Codeforces Round 304 (Div. 2)

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
546 Codeforces Round 304 (Div. 2) FINISHED False 7200 305213424 May 22, 2015, 4:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 17869 ) C Soldier and Cards PROGRAMMING brute force dfs and similar games 1400

B'Two bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, all values are different. They divide cards between them in some manner, it 's possible that they have different number of cards. Then they play a "war"-like card game. The rules are following. On each turn a fight happens. Each of them picks card from the top of his stack and puts on the table. The one whose card value is bigger wins this fight and takes both cards from the table to the bottom of his stack. More precisely, he first takes his opponent 's card and puts to the bottom of his stack, and then he puts his card to the bottom of his stack. If after some turn one of the player 's stack becomes empty, he loses and the other one wins. You have to calculate how many fights will happen and who will win the game, or state that game won 't end. First line contains a single integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8910), the number of cards. Second line contains integer k1 (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89- xe2 x80 x891), the number of the first soldier 's cards. Then follow k1 integers that are the values on the first soldier 's cards, from top to bottom of his stack. Third line contains integer k2 (k1 xe2 x80 x89+ xe2 x80 x89k2 xe2 x80 x89= xe2 x80 x89n), the number of the second soldier 's cards. Then follow k2 integers that are the values on the second soldier 's cards, from top to bottom of his stack. All card values are different. If somebody wins in this game, print 2 integers where the first one stands for the number of fights before end of game and the second one is 1 or 2 showing which player has won. If the game won 't end and will continue forever output xe2 x80 x89- xe2 x80 x891. First sample: Second sample: '...

Tutorials

Codeforces Round #304 (Div.2) editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
46750105 vjudge4 C Dec. 8, 2018, 8:47 a.m. OK Clang++17 Diagnostics TESTS 81 171 0 1400
69152938 vjudge1 C Jan. 19, 2020, 6:15 p.m. OK Clang++17 Diagnostics TESTS 81 1419 0 1400
69327612 vjudge5 C Jan. 22, 2020, 3:07 p.m. OK Clang++17 Diagnostics TESTS 81 1450 0 1400
56543096 jiang5ye C July 5, 2019, 6:20 a.m. OK FPC TESTS 81 31 0 1400
56544365 jiang5ye C July 5, 2019, 6:58 a.m. OK FPC TESTS 81 31 0 1400
56546484 jiang5ye C July 5, 2019, 7:52 a.m. OK FPC TESTS 81 31 0 1400
56543299 jiang5ye C July 5, 2019, 6:27 a.m. OK FPC TESTS 81 31 819200 1400
49761650 chaorenhaha C Feb. 11, 2019, 9:18 a.m. OK FPC TESTS 81 31 5017600 1400
41135554 Ashish C Aug. 2, 2018, 8:31 p.m. OK GNU C++ TESTS 81 31 0 1400
42456318 vjudge1 C Sept. 4, 2018, 11:40 a.m. OK GNU C++ TESTS 81 31 0 1400
42451026 vjudge4 C Sept. 4, 2018, 8:06 a.m. OK GNU C++ TESTS 81 31 0 1400
42451014 zichen0535 C Sept. 4, 2018, 8:06 a.m. OK GNU C++ TESTS 81 31 0 1400
41666404 lanti C Aug. 17, 2018, 12:08 a.m. OK GNU C++ TESTS 81 31 0 1400
41536095 samer_orfali C Aug. 12, 2018, 5:53 p.m. OK GNU C++ TESTS 81 31 0 1400
41526963 vjudge3 C Aug. 12, 2018, 12:28 p.m. OK GNU C++ TESTS 81 31 0 1400
41281963 Deepesh__ C Aug. 6, 2018, 5:03 p.m. OK GNU C++ TESTS 81 31 102400 1400
42237149 manjhiboy C Aug. 29, 2018, 10:25 a.m. OK GNU C++ TESTS 81 31 204800 1400
41117465 vjudge3 C Aug. 2, 2018, 9:53 a.m. OK GNU C++ TESTS 81 31 307200 1400
43073363 vjudge1 C Sept. 19, 2018, 10:31 a.m. OK GNU C11 TESTS 81 31 0 1400
43081962 vjudge4 C Sept. 19, 2018, 2:16 p.m. OK GNU C11 TESTS 81 31 0 1400
47337241 vjudge2 C Dec. 21, 2018, 3:40 p.m. OK GNU C11 TESTS 81 31 0 1400
47382475 vjudge2 C Dec. 22, 2018, 11:19 p.m. OK GNU C11 TESTS 81 31 0 1400
48720914 kmoussai C Jan. 22, 2019, 1:30 p.m. OK GNU C11 TESTS 81 31 0 1400
48765614 vjudge1 C Jan. 22, 2019, 7:11 p.m. OK GNU C11 TESTS 81 31 0 1400
48771514 vjudge4 C Jan. 23, 2019, 12:40 a.m. OK GNU C11 TESTS 81 31 0 1400
48987229 vjudge1 C Jan. 26, 2019, 12:51 p.m. OK GNU C11 TESTS 81 31 0 1400
61451714 FEILI C Sept. 29, 2019, 3:28 a.m. OK GNU C11 TESTS 81 31 0 1400
68025627 utsab560 C Jan. 1, 2020, 5:27 a.m. OK GNU C11 TESTS 81 31 0 1400
51962698 tsingcbx C March 29, 2019, 7:59 a.m. OK GNU C++11 TESTS 81 30 0 1400
69083222 luogu_bot5 C Jan. 19, 2020, 7:16 a.m. OK GNU C++11 TESTS 81 31 0 1400
69152914 luogu_bot5 C Jan. 19, 2020, 6:14 p.m. OK GNU C++11 TESTS 81 31 0 1400
69326643 luogu_bot3 C Jan. 22, 2020, 3:06 p.m. OK GNU C++11 TESTS 81 31 0 1400
69425259 OishikBiswas C Jan. 23, 2020, 3:36 p.m. OK GNU C++11 TESTS 81 31 0 1400
68866853 MaxC9 C Jan. 15, 2020, 1:52 p.m. OK GNU C++11 TESTS 81 31 0 1400
69569110 Eid_Ham00 C Jan. 26, 2020, 1:30 p.m. OK GNU C++11 TESTS 81 31 0 1400
69724699 vjudge4 C Jan. 29, 2020, 11:53 a.m. OK GNU C++11 TESTS 81 31 0 1400
69845962 mijanur_rmn C Jan. 30, 2020, 2:21 p.m. OK GNU C++11 TESTS 81 31 0 1400
69537662 Rush C Jan. 25, 2020, 7:36 p.m. OK GNU C++11 TESTS 81 31 0 1400
48447159 vjudge4 C Jan. 16, 2019, 8:07 a.m. OK GNU C++14 TESTS 81 30 0 1400
69066450 mohitm12 C Jan. 18, 2020, 6:51 p.m. OK GNU C++14 TESTS 81 30 0 1400
68149632 vjudge3 C Jan. 4, 2020, 6:20 a.m. OK GNU C++14 TESTS 81 30 0 1400
64327890 Heartless. C Nov. 5, 2019, 6:03 p.m. OK GNU C++14 TESTS 81 30 0 1400
57314281 gaurav_kr123 C July 19, 2019, 7:40 a.m. OK GNU C++14 TESTS 81 30 0 1400
56070771 himanshu802 C June 26, 2019, 10:19 a.m. OK GNU C++14 TESTS 81 30 0 1400
54879206 Anmol321 C May 31, 2019, 1:23 p.m. OK GNU C++14 TESTS 81 30 0 1400
54810905 Emadhashem12 C May 29, 2019, 4:47 p.m. OK GNU C++14 TESTS 81 30 0 1400
48764099 dwai009 C Jan. 22, 2019, 6:35 p.m. OK GNU C++14 TESTS 81 30 0 1400
48559047 vaibhav_1999 C Jan. 19, 2019, 6:37 a.m. OK GNU C++14 TESTS 81 30 0 1400
51759065 Abdulrahman_MJ C March 23, 2019, 12:55 p.m. OK GNU C++17 TESTS 81 15 0 1400
56553489 HanaYukii C July 5, 2019, 11:09 a.m. OK GNU C++17 TESTS 81 30 0 1400
56876612 anjgodara C July 12, 2019, 8:33 a.m. OK GNU C++17 TESTS 81 30 0 1400
62844288 Cloud_ C Oct. 18, 2019, 4:44 a.m. OK GNU C++17 TESTS 81 30 0 1400
63347179 sharif_khan_cse C Oct. 24, 2019, 7:46 p.m. OK GNU C++17 TESTS 81 30 0 1400
63921055 vjudge2 C Oct. 31, 2019, 11:44 a.m. OK GNU C++17 TESTS 81 30 0 1400
66285047 ImnAmn C Dec. 4, 2019, 6:51 p.m. OK GNU C++17 TESTS 81 30 0 1400
66464911 _fl0P_ C Dec. 7, 2019, 4:10 p.m. OK GNU C++17 TESTS 81 30 0 1400
69397926 Hasti_K C Jan. 23, 2020, 7:11 a.m. OK GNU C++17 TESTS 81 30 0 1400
56259553 991rajat C June 29, 2019, 7:32 a.m. OK GNU C++17 TESTS 81 30 0 1400
69928161 MHemati C Jan. 31, 2020, 9:36 p.m. OK Java 11 TESTS 81 187 0 1400
67983006 Alirezahodaee C Dec. 30, 2019, 8:24 p.m. OK Java 11 TESTS 81 202 0 1400
68316656 Kimia_mrv C Jan. 6, 2020, 1:27 p.m. OK Java 11 TESTS 81 1076 0 1400
59112334 BitShot C Aug. 19, 2019, 9:49 p.m. OK Java 8 TESTS 81 109 0 1400
67103729 Buu-Zaid C Dec. 17, 2019, 4:13 p.m. OK Java 8 TESTS 81 109 0 1400
59094896 vjudge2 C Aug. 19, 2019, 1:53 p.m. OK Java 8 TESTS 81 109 0 1400
59072407 Sleep C Aug. 19, 2019, 5:31 a.m. OK Java 8 TESTS 81 109 0 1400
58249400 _mcubed123 C Aug. 4, 2019, 7:07 a.m. OK Java 8 TESTS 81 109 0 1400
57869928 Maikol1804 C July 28, 2019, 12:48 a.m. OK Java 8 TESTS 81 109 0 1400
55302612 chojh1222 C June 8, 2019, 12:40 p.m. OK Java 8 TESTS 81 109 0 1400
54531239 still_the_big_bang C May 23, 2019, 5:10 p.m. OK Java 8 TESTS 81 109 0 1400
52953978 aspatelakbar C April 18, 2019, 1:02 p.m. OK Java 8 TESTS 81 109 0 1400
52641109 Radwan_ C April 12, 2019, 12:30 p.m. OK Java 8 TESTS 81 109 0 1400
61311253 david_varela C Sept. 26, 2019, 9:20 a.m. OK Kotlin TESTS 81 155 102400 1400
43072971 DENDUKA C Sept. 19, 2018, 10:18 a.m. OK Mono C# TESTS 81 62 1638400 1400
59114024 vjudge4 C Aug. 19, 2019, 11:57 p.m. OK Mono C# TESTS 81 62 1638400 1400
59114087 vjudge3 C Aug. 20, 2019, 12:02 a.m. OK Mono C# TESTS 81 62 1638400 1400
43072694 DENDUKA C Sept. 19, 2018, 10:09 a.m. OK Mono C# TESTS 81 77 1536000 1400
43810026 nemars C Oct. 4, 2018, 11:14 p.m. OK Mono C# TESTS 81 156 6656000 1400
63544503 vjudge3 C Oct. 27, 2019, 10:12 a.m. OK MS C++ TESTS 81 31 0 1400
69809739 vjudge3 C Jan. 30, 2020, 3:48 a.m. OK MS C++ TESTS 81 31 0 1400
69779071 vjudge5 C Jan. 29, 2020, 4:28 p.m. OK MS C++ TESTS 81 31 0 1400
69400925 vjudge4 C Jan. 23, 2020, 8:46 a.m. OK MS C++ TESTS 81 31 0 1400
69400899 vjudge1 C Jan. 23, 2020, 8:44 a.m. OK MS C++ TESTS 81 31 0 1400
69302234 vjudge5 C Jan. 22, 2020, 2:10 p.m. OK MS C++ TESTS 81 31 0 1400
63546808 vjudge4 C Oct. 27, 2019, 10:43 a.m. OK MS C++ TESTS 81 31 0 1400
63545404 vjudge2 C Oct. 27, 2019, 10:23 a.m. OK MS C++ TESTS 81 31 0 1400
63545308 vjudge2 C Oct. 27, 2019, 10:22 a.m. OK MS C++ TESTS 81 31 0 1400
63544761 vjudge3 C Oct. 27, 2019, 10:15 a.m. OK MS C++ TESTS 81 31 0 1400
65713553 CtrlAlt C Nov. 25, 2019, 3:27 p.m. OK MS C++ 2017 TESTS 81 31 0 1400
69098049 YaMi506 C Jan. 19, 2020, 12:51 p.m. OK MS C++ 2017 TESTS 81 31 0 1400
69083262 vjudge5 C Jan. 19, 2020, 7:17 a.m. OK MS C++ 2017 TESTS 81 31 0 1400
62449743 YHHxBULIATANIA C Oct. 13, 2019, 3:08 a.m. OK MS C++ 2017 TESTS 81 31 0 1400
59766941 bahaaEldeen C Aug. 30, 2019, 6:26 p.m. OK MS C++ 2017 TESTS 81 31 0 1400
66192928 foxinoxi C Dec. 2, 2019, 5:13 p.m. OK MS C++ 2017 TESTS 81 31 307200 1400
66588489 jhoon6699 C Dec. 10, 2019, 12:07 p.m. OK MS C++ 2017 TESTS 81 31 307200 1400
66857552 kdje0506 C Dec. 14, 2019, 12:20 p.m. OK MS C++ 2017 TESTS 81 31 307200 1400
69098223 YaMi506 C Jan. 19, 2020, 12:55 p.m. OK MS C++ 2017 TESTS 81 31 307200 1400
69283430 Yomapeed C Jan. 22, 2020, 7:03 a.m. OK MS C++ 2017 TESTS 81 31 307200 1400
47336533 vjudge1 C Dec. 21, 2018, 3:22 p.m. OK PHP TESTS 81 46 512000 1400
53697163 raj1307 C May 3, 2019, 8:24 a.m. OK PyPy 2 TESTS 81 155 0 1400
53285465 iamprayush C April 25, 2019, 1:43 p.m. OK PyPy 3 TESTS 81 139 0 1400
45884432 kaname_madoka123 C Nov. 17, 2018, 3:18 p.m. OK PyPy 3 TESTS 81 139 0 1400
69955665 WeirdBugsButOkay C Feb. 1, 2020, 10:04 a.m. OK PyPy 3 TESTS 81 140 0 1400
55237988 guardian.of.gods99 C June 7, 2019, 9:23 a.m. OK PyPy 3 TESTS 81 140 204800 1400
61110737 Leendertz C Sept. 23, 2019, 11:09 a.m. OK PyPy 3 TESTS 81 140 1228800 1400
59081352 ankit_31122019 C Aug. 19, 2019, 9:17 a.m. OK PyPy 3 TESTS 81 155 0 1400
57843945 rambo_1 C July 27, 2019, 10:20 a.m. OK PyPy 3 TESTS 81 155 1228800 1400
59217534 shivam_hbtu C Aug. 21, 2019, 10:57 a.m. OK PyPy 3 TESTS 81 156 0 1400
67187546 McStick C Dec. 19, 2019, 5:36 a.m. OK PyPy 3 TESTS 81 171 512000 1400
69492555 beethoven97 C Jan. 25, 2020, 12:05 a.m. OK PyPy 3 TESTS 81 171 1638400 1400
54586174 soumyasarkar1998 C May 25, 2019, 6:58 a.m. OK Python 2 TESTS 81 171 0 1400
47520401 jaaguptamme C Dec. 26, 2018, 12:44 p.m. OK Python 2 TESTS 81 171 0 1400
54609301 Claustrophobic_Penguin C May 25, 2019, 10:38 a.m. OK Python 2 TESTS 81 187 0 1400
50627584 gaidash C March 1, 2019, 7:03 a.m. OK Python 2 TESTS 81 202 0 1400
55481216 enchantedpudding C June 12, 2019, 5:18 a.m. OK Python 2 TESTS 81 233 102400 1400
67064844 Abdelatty C Dec. 17, 2019, 10:41 a.m. OK Python 3 TESTS 81 109 0 1400
62372753 Ajay_Modi C Oct. 11, 2019, 4:16 p.m. OK Python 3 TESTS 81 109 0 1400
55616157 petushny C June 16, 2019, 9:03 a.m. OK Python 3 TESTS 81 109 0 1400
55614769 co_devil C June 16, 2019, 8:13 a.m. OK Python 3 TESTS 81 109 0 1400
55492953 Mohamed_Ayman C June 12, 2019, 11:03 a.m. OK Python 3 TESTS 81 109 0 1400
51672879 k0walski C March 22, 2019, 9:03 a.m. OK Python 3 TESTS 81 109 0 1400
50629883 Jsxft C March 1, 2019, 8:30 a.m. OK Python 3 TESTS 81 109 0 1400
46356476 TangentDay C Nov. 29, 2018, 8:36 a.m. OK Python 3 TESTS 81 109 0 1400
54421118 Messiah_10 C May 20, 2019, 3:30 p.m. OK Python 3 TESTS 81 109 307200 1400
67066752 zyattong C Dec. 17, 2019, 11:23 a.m. OK Python 3 TESTS 81 124 0 1400
56421862 tuna_salad C July 2, 2019, 7:44 a.m. OK Rust TESTS 81 31 0 1400

remove filters

Back to search problems