Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
---|---|---|---|---|---|---|
213 | Codeforces Round 131 (Div. 1) | FINISHED | False | 7200 | 393517763 | July 30, 2012, 3:30 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 842 ) | E | Two Permutations | PROGRAMMING | data structures hashing strings | 2600 |
B'Rubik is very keen on number permutations. A permutation a with length n is a sequence, consisting of n different numbers from 1 to n. Element number i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) of this permutation will be denoted as ai. Furik decided to make a present to Rubik and came up with a new problem on permutations. Furik tells Rubik two number permutations: permutation a with length n and permutation b with length m. Rubik must give an answer to the problem: how many distinct integers d exist, such that sequence c (c1 xe2 x80 x89= xe2 x80 x89a1 xe2 x80 x89+ xe2 x80 x89d, xe2 x80 x89c2 xe2 x80 x89= xe2 x80 x89a2 xe2 x80 x89+ xe2 x80 x89d, xe2 x80 x89..., xe2 x80 x89cn xe2 x80 x89= xe2 x80 x89an xe2 x80 x89+ xe2 x80 x89d) of length n is a subsequence of b. Sequence a is a subsequence of sequence b, if there are such indices i1, xe2 x80 x89i2, xe2 x80 x89..., xe2 x80 x89in (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i1 xe2 x80 x89< xe2 x80 x89i2 xe2 x80 x89< xe2 x80 x89... xe2 x80 x89< xe2 x80 x89in xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m), that a1 xe2 x80 x89= xe2 x80 x89bi1, a2 xe2 x80 x89= xe2 x80 x89bi2, ..., an xe2 x80 x89= xe2 x80 x89bin, where n is the length of sequence a, and m is the length of sequence b. You are given permutations a and b, help Rubik solve the given problem. The first line contains two integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200000) -- the sizes of the given permutations. The second line contains n distinct integers -- permutation a, the third line contains m distinct integers -- permutation b. Numbers on the lines are separated by spaces. On a single line print the answer to the problem. '... |
Codeforces Round #131 Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
2666889 | luogan | E | Nov. 27, 2012, 8:12 a.m. | OK | FPC | TESTS | 48 | 125 | 7168000 | 2600 | |
2065954 | pigpigzhu | E | Aug. 29, 2012, 7:56 a.m. | OK | FPC | TESTS | 48 | 840 | 24985600 | 2600 | |
1967591 | con_nha_ngheo | E | Aug. 1, 2012, 8:52 a.m. | OK | FPC | TESTS | 48 | 1200 | 26214400 | 2600 | |
2041040 | Petya1995 | E | Aug. 21, 2012, 7:08 p.m. | OK | FPC | TESTS | 48 | 1220 | 26214400 | 2600 | |
2004497 | giongto35 | E | Aug. 13, 2012, 2:47 p.m. | OK | FPC | TESTS | 48 | 1480 | 13209600 | 2600 | |
2875528 | shyoshyohw1 | E | Jan. 5, 2013, 3:28 p.m. | OK | GNU C++ | TESTS | 48 | 15 | 6348800 | 2600 | |
5146470 | 200lbs | E | Nov. 19, 2013, 3:11 a.m. | OK | GNU C++ | TESTS | 48 | 30 | 7168000 | 2600 | |
5146455 | 200lbs | E | Nov. 19, 2013, 3:08 a.m. | OK | GNU C++ | TESTS | 48 | 30 | 7168000 | 2600 | |
2832020 | Seasons | E | Dec. 27, 2012, 7:13 a.m. | OK | GNU C++ | TESTS | 48 | 31 | 6348800 | 2600 | |
3165471 | xy666 | E | Feb. 21, 2013, 6:26 a.m. | OK | GNU C++ | TESTS | 48 | 31 | 6451200 | 2600 | |
2859879 | qiandichen | E | Dec. 31, 2012, 4:30 a.m. | OK | GNU C++ | TESTS | 48 | 31 | 8294400 | 2600 | |
2635491 | ACMonster | E | Nov. 24, 2012, 4:07 a.m. | OK | GNU C++ | TESTS | 48 | 46 | 6451200 | 2600 | |
2756277 | Leo_Yu | E | Dec. 13, 2012, 2:23 a.m. | OK | GNU C++ | TESTS | 48 | 46 | 28057600 | 2600 | |
2236713 | sunweijun | E | Sept. 24, 2012, 12:12 p.m. | OK | GNU C++ | TESTS | 48 | 46 | 64409600 | 2600 | |
2861413 | YuukaKazami | E | Dec. 31, 2012, 2:36 p.m. | OK | GNU C++ | TESTS | 48 | 62 | 4812800 | 2600 | |
2865705 | bakabakashyoshyo | E | Jan. 2, 2013, 8:15 a.m. | OK | GNU C++0x | TESTS | 48 | 31 | 6348800 | 2600 | |
3564347 | Robert | E | April 19, 2013, 1:32 p.m. | OK | GNU C++0x | TESTS | 48 | 140 | 5632000 | 2600 | |
4929437 | harhrayr | E | Oct. 29, 2013, 2:31 p.m. | OK | GNU C++0x | TESTS | 48 | 140 | 16076800 | 2600 | |
2969407 | bonism | E | Jan. 20, 2013, 2:04 p.m. | OK | GNU C++0x | TESTS | 48 | 156 | 3993600 | 2600 | |
9922465 | xwind | E | Feb. 19, 2015, 6:21 a.m. | OK | GNU C++0x | TESTS | 48 | 156 | 7270400 | 2600 | |
1970749 | Archon.JK | E | Aug. 2, 2012, 11:44 a.m. | OK | GNU C++0x | TESTS | 48 | 310 | 10137600 | 2600 | |
2769265 | roosephu | E | Dec. 15, 2012, 8:19 a.m. | OK | GNU C++0x | TESTS | 48 | 328 | 11571200 | 2600 | |
7688431 | Mr.ink | E | Sept. 5, 2014, 1:54 p.m. | OK | GNU C++0x | TESTS | 48 | 374 | 16076800 | 2600 | |
8612254 | Plumrain | E | Nov. 8, 2014, 7:34 a.m. | OK | GNU C++0x | TESTS | 48 | 434 | 10444800 | 2600 | |
8612317 | vjudge2 | E | Nov. 8, 2014, 7:50 a.m. | OK | GNU C++0x | TESTS | 48 | 468 | 10444800 | 2600 | |
20167042 | GLK | E | Aug. 26, 2016, 3:15 a.m. | OK | GNU C++11 | TESTS | 48 | 92 | 9420800 | 2600 | |
57822177 | py_ultron | E | July 27, 2019, 12:21 a.m. | OK | GNU C++11 | TESTS | 48 | 154 | 7065600 | 2600 | |
17121911 | freebsdx | E | April 2, 2016, 3:08 a.m. | OK | GNU C++11 | TESTS | 48 | 154 | 8396800 | 2600 | |
48044683 | xielinhan | E | Jan. 7, 2019, 12:30 a.m. | OK | GNU C++11 | TESTS | 48 | 156 | 6246400 | 2600 | |
16544320 | McGinn | E | March 6, 2016, 3:51 a.m. | OK | GNU C++11 | TESTS | 48 | 156 | 6246400 | 2600 | |
16384217 | MaxKU | E | Feb. 27, 2016, 1:56 p.m. | OK | GNU C++11 | TESTS | 48 | 156 | 6451200 | 2600 | |
57899796 | lopare | E | July 28, 2019, 3:11 p.m. | OK | GNU C++11 | TESTS | 48 | 156 | 7065600 | 2600 | |
20166367 | GLK | E | Aug. 26, 2016, 2:05 a.m. | OK | GNU C++11 | TESTS | 48 | 186 | 9318400 | 2600 | |
42972977 | cor001 | E | Sept. 17, 2018, 7:48 a.m. | OK | GNU C++11 | TESTS | 48 | 216 | 6451200 | 2600 | |
62085267 | Genius_Z | E | Oct. 8, 2019, 1:06 a.m. | OK | GNU C++11 | TESTS | 48 | 216 | 16793600 | 2600 | |
58858652 | hongye123456 | E | Aug. 15, 2019, 10:36 a.m. | OK | GNU C++14 | TESTS | 48 | 186 | 7168000 | 2600 | |
23667720 | Ali.Pi | E | Jan. 9, 2017, 5:13 p.m. | OK | GNU C++14 | TESTS | 48 | 218 | 8294400 | 2600 | |
28199478 | Yousef_Salama | E | July 1, 2017, 10:50 p.m. | OK | GNU C++14 | TESTS | 48 | 248 | 7577600 | 2600 | |
25453924 | abeker | E | March 13, 2017, 12:46 p.m. | OK | GNU C++14 | TESTS | 48 | 278 | 5939200 | 2600 | |
48078497 | RUSH_D_CAT | E | Jan. 8, 2019, 6:01 a.m. | OK | GNU C++14 | TESTS | 48 | 280 | 9625600 | 2600 | |
54405735 | NotNight | E | May 20, 2019, 6:05 a.m. | OK | GNU C++14 | TESTS | 48 | 280 | 16793600 | 2600 | |
25118779 | TianyiChen | E | March 1, 2017, 8:49 a.m. | OK | GNU C++14 | TESTS | 48 | 342 | 14745600 | 2600 | |
69545416 | RobeZH | E | Jan. 26, 2020, 2:04 a.m. | OK | GNU C++14 | TESTS | 48 | 342 | 18329600 | 2600 | |
37396928 | cclx | E | April 17, 2018, 1:37 p.m. | OK | GNU C++14 | TESTS | 48 | 372 | 15360000 | 2600 | |
35156704 | I_love_Y_UME | E | Feb. 11, 2018, 3:11 p.m. | OK | GNU C++14 | TESTS | 48 | 374 | 16486400 | 2600 | |
48131964 | ruo | E | Jan. 9, 2019, 3:13 p.m. | OK | GNU C++17 | TESTS | 48 | 280 | 6656000 | 2600 | |
67294035 | user202729_ | E | Dec. 20, 2019, 4:23 p.m. | OK | GNU C++17 | TESTS | 48 | 310 | 10649600 | 2600 | |
67294739 | user202729_ | E | Dec. 20, 2019, 4:35 p.m. | OK | GNU C++17 | TESTS | 48 | 312 | 10649600 | 2600 | |
60397086 | hjk1030 | E | Sept. 11, 2019, 3:20 p.m. | OK | GNU C++17 | TESTS | 48 | 342 | 13619200 | 2600 | |
42893149 | Hermera | E | Sept. 15, 2018, 2 p.m. | OK | GNU C++17 | TESTS | 48 | 436 | 23449600 | 2600 | |
65320455 | irri | E | Nov. 18, 2019, 7:26 p.m. | OK | GNU C++17 | TESTS | 48 | 592 | 15257600 | 2600 | |
67945575 | xiaowuc1 | E | Dec. 30, 2019, 5:04 a.m. | OK | GNU C++17 | TESTS | 48 | 686 | 8704000 | 2600 | |
52646542 | almogwald | E | April 12, 2019, 2:46 p.m. | OK | GNU C++17 | TESTS | 48 | 778 | 69836800 | 2600 | |
40056366 | AliTavassoly | E | July 7, 2018, 9:10 a.m. | OK | GNU C++17 | TESTS | 48 | 1058 | 72192000 | 2600 | |
42435996 | 771491749 | E | Sept. 3, 2018, 5:25 p.m. | OK | GNU C++17 | TESTS | 48 | 1090 | 206028800 | 2600 | |
1959492 | Petr | E | July 30, 2012, 5:14 p.m. | OK | Java 6 | TESTS | 48 | 420 | 46080000 | 2600 | |
1960470 | Egor | E | July 30, 2012, 5:47 p.m. | OK | Java 6 | TESTS | 48 | 2470 | 59596800 | 2600 | |
1960235 | Egor | E | July 30, 2012, 5:28 p.m. | OK | Java 6 | TESTS | 48 | 2520 | 59392000 | 2600 | |
7052389 | ainta | E | July 9, 2014, 10:23 a.m. | OK | MS C++ | TESTS | 48 | 154 | 4812800 | 2600 | |
5819551 | vjudge4 | E | Jan. 27, 2014, 1:21 p.m. | OK | MS C++ | TESTS | 48 | 156 | 5529600 | 2600 | |
1993438 | Myungwoo | E | Aug. 8, 2012, 3:58 p.m. | OK | MS C++ | TESTS | 48 | 470 | 18329600 | 2600 | |
9814427 | democracy343 | E | Feb. 13, 2015, 8:39 a.m. | OK | MS C++ | TESTS | 48 | 530 | 31232000 | 2600 | |
2355326 | vjudge4 | E | Oct. 13, 2012, 1:08 p.m. | OK | MS C++ | TESTS | 48 | 578 | 22016000 | 2600 | |
2093786 | NALP | E | Sept. 3, 2012, 8:02 p.m. | OK | MS C++ | TESTS | 48 | 970 | 16076800 | 2600 | |
3382204 | repeatuntil0 | E | March 22, 2013, 6:25 p.m. | OK | MS C++ | TESTS | 48 | 1076 | 24166400 | 2600 | |
4616161 | map | E | Sept. 30, 2013, 10:46 p.m. | OK | MS C++ | TESTS | 48 | 1340 | 23347200 | 2600 | |
2805107 | Endagorion | E | Dec. 22, 2012, 1:59 a.m. | OK | MS C++ | TESTS | 48 | 1435 | 23449600 | 2600 |
Back to search problems