Codeforces Round 114 (Div. 1)

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
167 Codeforces Round 114 (Div. 1) FINISHED False 7200 404319563 March 27, 2012, 3 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 682 ) C Wizards and Numbers PROGRAMMING games math 2400

B'In some country live wizards. They love playing with numbers. The blackboard has two numbers written on it -- a and b. The order of the numbers is not important. Let 's consider a xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89b for the sake of definiteness. The players can cast one of the two spells in turns: If a xe2 x80 x89> xe2 x80 x89b, similar moves are possible. If at least one of the numbers equals zero, a player can 't make a move, because taking a remainder modulo zero is considered somewhat uncivilized, and it is far too boring to subtract a zero. The player who cannot make a move, loses. To perform well in the magic totalizator, you need to learn to quickly determine which player wins, if both wizards play optimally: the one that moves first or the one that moves second. The first line contains a single integer t -- the number of input data sets (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89t xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89104). Each of the next t lines contains two integers a, b (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89a, xe2 x80 x89b xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891018). The numbers are separated by a space. Please do not use the %lld specificator to read or write 64-bit integers in xd0 xa1++. It is preferred to use the cin, cout streams or the %I64d specificator. For any of the t input sets print "First" (without the quotes) if the player who moves first wins. Print "Second" (without the quotes) if the player who moves second wins. Print the answers to different data sets on different lines in the order in which they are given in the input. In the first sample, the first player should go to (11,10). Then, after a single move of the second player to (1,10), he will take 10 modulo 1 and win. In the second sample the first player has two moves to (1,10) and (21,10). After both moves the second player can win. In the third sample, the first player has no moves. In the fourth sample, the first player wins in one move, taking 30 modulo 10.'...

Tutorials

Codeforces Round #114 — Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
1448165 jtc172 C April 1, 2012, 3:30 a.m. OK Delphi TESTS 95 110 819200 2400
1449629 levi C April 1, 2012, 2:51 p.m. OK Delphi TESTS 95 110 35532800 2400
1425129 tourist C March 27, 2012, 3:17 p.m. OK Delphi TESTS 95 110 35532800 2400
3361265 ig_dug C March 20, 2013, 2:59 p.m. OK FPC TESTS 95 46 0 2400
1430716 zanoes C March 27, 2012, 4:40 p.m. OK FPC TESTS 95 50 1024000 2400
1448109 LbyG C April 1, 2012, 2:29 a.m. OK FPC TESTS 95 60 1024000 2400
1446020 giongto35 C March 31, 2012, 9:29 a.m. OK FPC TESTS 95 60 1024000 2400
1441962 lydrainbowcat C March 30, 2012, 12:11 a.m. OK FPC TESTS 95 60 1024000 2400
1435681 coolinging C March 28, 2012, 8:12 a.m. OK FPC TESTS 95 60 1024000 2400
1432687 tjg C March 27, 2012, 6:33 p.m. OK FPC TESTS 95 60 1024000 2400
1429520 object022 C March 27, 2012, 4:18 p.m. OK FPC TESTS 95 60 1024000 2400
1434405 sillycross C March 28, 2012, 12:14 a.m. OK FPC TESTS 95 80 1024000 2400
64682332 luogu_bot5 C Nov. 11, 2019, 10:33 a.m. OK FPC TESTS 95 124 307200 2400
3965856 jhcmonroy C June 27, 2013, 3:44 a.m. OK GNU C++ TESTS 95 31 0 2400
3353932 H3X C March 18, 2013, 8:33 p.m. OK GNU C++ TESTS 95 31 0 2400
3149459 ddyyxx C Feb. 20, 2013, 7:19 a.m. OK GNU C++ TESTS 95 46 0 2400
3008389 noh4h_ss C Jan. 25, 2013, 3:19 p.m. OK GNU C++ TESTS 95 46 0 2400
1436529 pty C March 28, 2012, 12:45 p.m. OK GNU C++ TESTS 95 50 1433600 2400
2042704 KrK C Aug. 22, 2012, 1:14 p.m. OK GNU C++ TESTS 95 60 1433600 2400
1772681 davidmg C June 9, 2012, 5:29 a.m. OK GNU C++ TESTS 95 60 1433600 2400
1706978 punish C May 21, 2012, 2:01 a.m. OK GNU C++ TESTS 95 60 1433600 2400
1650560 liuq901 C May 3, 2012, 9:57 a.m. OK GNU C++ TESTS 95 60 1433600 2400
1650404 vjudge2 C May 3, 2012, 7:58 a.m. OK GNU C++ TESTS 95 60 1433600 2400
1585634 Archon.JK C April 20, 2012, 8:25 a.m. OK GNU C++0x TESTS 95 50 1433600 2400
1435704 doraemon C March 28, 2012, 8:17 a.m. OK GNU C++0x TESTS 95 60 1433600 2400
6641104 FancyCoder C May 17, 2014, 8:29 a.m. OK GNU C++0x TESTS 95 62 0 2400
3936618 alculquicondor C June 22, 2013, 6:31 p.m. OK GNU C++0x TESTS 95 62 0 2400
1434706 cylixstar C March 28, 2012, 2:21 a.m. OK GNU C++0x TESTS 95 90 1433600 2400
6979036 hidenn C June 29, 2014, 8:07 a.m. OK GNU C++0x TESTS 95 92 0 2400
1496292 evima C April 7, 2012, 3:22 p.m. OK GNU C++0x TESTS 95 110 1433600 2400
4535456 harhrayr C Sept. 22, 2013, 8:47 a.m. OK GNU C++0x TESTS 95 124 0 2400
4535337 harhrayr C Sept. 22, 2013, 8:30 a.m. OK GNU C++0x TESTS 95 124 0 2400
9720814 sdya C Feb. 4, 2015, 7:17 p.m. OK GNU C++0x TESTS 95 342 0 2400
57796642 luogu_bot3 C July 26, 2019, 11:40 a.m. OK GNU C++11 TESTS 95 62 0 2400
57795118 luogu_bot2 C July 26, 2019, 11:07 a.m. OK GNU C++11 TESTS 95 62 0 2400
57794033 luogu_bot5 C July 26, 2019, 10:44 a.m. OK GNU C++11 TESTS 95 62 0 2400
22025601 King_George C Nov. 4, 2016, 2:28 a.m. OK GNU C++11 TESTS 95 62 0 2400
20416540 joisino C Sept. 6, 2016, 10:11 a.m. OK GNU C++11 TESTS 95 62 0 2400
18875791 RNS_CUS C July 4, 2016, 3:16 a.m. OK GNU C++11 TESTS 95 62 0 2400
16052921 vjudge3 C Feb. 16, 2016, 8:47 a.m. OK GNU C++11 TESTS 95 62 0 2400
14143498 vjudge5 C Nov. 8, 2015, 3:40 p.m. OK GNU C++11 TESTS 95 62 0 2400
14008159 junkbot C Nov. 1, 2015, 1:01 p.m. OK GNU C++11 TESTS 95 62 0 2400
12721856 johnathan79717 C Aug. 27, 2015, 4:21 p.m. OK GNU C++11 TESTS 95 62 0 2400
29505715 fengsuiyan C Aug. 16, 2017, 12:55 p.m. OK GNU C++14 TESTS 95 62 0 2400
35788924 iqqsoszs C Feb. 28, 2018, 3:05 p.m. OK GNU C++14 TESTS 95 62 1945600 2400
35788840 iqqsoszs C Feb. 28, 2018, 3:01 p.m. OK GNU C++14 TESTS 95 62 1945600 2400
56830724 vjudge5 C July 11, 2019, 6:54 a.m. OK GNU C++14 TESTS 95 92 0 2400
56784893 Hacheylight C July 10, 2019, 7:56 a.m. OK GNU C++14 TESTS 95 92 0 2400
56783689 djq_fpc C July 10, 2019, 7:25 a.m. OK GNU C++14 TESTS 95 92 0 2400
56781835 luogu_bot3 C July 10, 2019, 6:36 a.m. OK GNU C++14 TESTS 95 92 0 2400
54028260 kefaa2 C May 12, 2019, 2:10 p.m. OK GNU C++14 TESTS 95 92 0 2400
47892197 beet C Jan. 4, 2019, 7:36 a.m. OK GNU C++14 TESTS 95 92 0 2400
39853877 orbitingflea C July 2, 2018, 12:58 a.m. OK GNU C++14 TESTS 95 92 0 2400
66392919 AryssonFigueiredo C Dec. 6, 2019, 9:43 a.m. OK GNU C++17 TESTS 95 92 0 2400
61395141 MinecraftFuns C Sept. 28, 2019, 1:34 a.m. OK GNU C++17 TESTS 95 92 0 2400
56828653 KillerX C July 11, 2019, 5:56 a.m. OK GNU C++17 TESTS 95 92 0 2400
56797610 llbra9z C July 10, 2019, 1:07 p.m. OK GNU C++17 TESTS 95 92 0 2400
56786007 qinding C July 10, 2019, 8:29 a.m. OK GNU C++17 TESTS 95 92 0 2400
56785036 charlieyan C July 10, 2019, 8 a.m. OK GNU C++17 TESTS 95 92 0 2400
50767049 chinmay0906 C March 3, 2019, 11:31 p.m. OK GNU C++17 TESTS 95 92 0 2400
43513970 ruo C Sept. 28, 2018, 2:53 a.m. OK GNU C++17 TESTS 95 92 0 2400
42862028 I_love_Y_UME C Sept. 14, 2018, 1:26 p.m. OK GNU C++17 TESTS 95 92 0 2400
36658836 LiChenKoh C March 27, 2018, 5:40 a.m. OK GNU C++17 TESTS 95 92 3686400 2400
1446983 sayuan C March 31, 2012, 2:31 p.m. OK Java 6 TESTS 95 140 43417600 2400
1435677 dalex C March 28, 2012, 8:11 a.m. OK Java 6 TESTS 95 140 44032000 2400
1431701 OgieKako C March 27, 2012, 4:56 p.m. OK Java 6 TESTS 95 160 43417600 2400
1428104 Egor C March 27, 2012, 3:55 p.m. OK Java 6 TESTS 95 160 43417600 2400
1427928 cerealguy C March 27, 2012, 3:52 p.m. OK Java 6 TESTS 95 160 43417600 2400
1442823 S.Yesipenko C March 30, 2012, 8:36 a.m. OK Java 6 TESTS 95 160 43520000 2400
1428572 eatmore C March 27, 2012, 4:02 p.m. OK Java 6 TESTS 95 160 43520000 2400
1435660 dalex C March 28, 2012, 8:06 a.m. OK Java 6 TESTS 95 160 44032000 2400
1431237 niyaznigmatul C March 27, 2012, 4:49 p.m. OK Java 6 TESTS 95 170 43417600 2400
1428724 chavit C March 27, 2012, 4:05 p.m. OK Java 6 TESTS 95 170 43417600 2400
3957953 Azat_Yusupov C June 25, 2013, 5:32 a.m. OK Java 7 TESTS 95 140 102400 2400
1496527 Madiyar C April 7, 2012, 5:31 p.m. OK Java 7 TESTS 95 160 45056000 2400
1432505 uwi C March 27, 2012, 6:26 p.m. OK Java 7 TESTS 95 170 44953600 2400
1431917 alexey.enkov C March 27, 2012, 4:58 p.m. OK Java 7 TESTS 95 170 44953600 2400
1429005 Di735 C March 27, 2012, 4:10 p.m. OK Java 7 TESTS 95 170 45056000 2400
15457254 mkirsche C Jan. 20, 2016, 5:38 p.m. OK Java 7 TESTS 95 342 0 2400
5738540 hama-du C Jan. 19, 2014, 7:46 a.m. OK Java 7 TESTS 95 342 102400 2400
5738503 hama-du C Jan. 19, 2014, 7:41 a.m. OK Java 7 TESTS 95 342 102400 2400
9633510 AlexFetisov C Jan. 30, 2015, 8:36 p.m. OK Java 8 TESTS 95 280 0 2400
19473110 mist23 C July 29, 2016, 5:51 a.m. OK Java 8 TESTS 95 310 0 2400
19363310 Sumeet.Varma yashkumar18 C July 23, 2016, 11:02 a.m. OK Java 8 TESTS 95 310 0 2400
11061007 A.Elahi C May 10, 2015, 8:12 a.m. OK Java 8 TESTS 95 342 0 2400
55978858 Xylenox C June 23, 2019, 7:22 p.m. OK Java 8 TESTS 95 560 0 2400
1505567 emppu C April 8, 2012, 11:52 p.m. OK MS C++ TESTS 95 50 1433600 2400
1434595 Timur_Sitdikov C March 28, 2012, 1:32 a.m. OK MS C++ TESTS 95 60 1433600 2400
1431622 Milanin C March 27, 2012, 4:55 p.m. OK MS C++ TESTS 95 60 1433600 2400
1429827 ItsNear C March 27, 2012, 4:24 p.m. OK MS C++ TESTS 95 60 1536000 2400
12426790 luckyone2014 C Aug. 9, 2015, 2:05 p.m. OK MS C++ TESTS 95 62 0 2400
12425840 vjudge4 C Aug. 9, 2015, 12:31 p.m. OK MS C++ TESTS 95 62 0 2400
1444801 Parhomets C March 30, 2012, 9:56 p.m. OK MS C++ TESTS 95 80 1433600 2400
1444799 Parhomets C March 30, 2012, 9:53 p.m. OK MS C++ TESTS 95 80 1433600 2400
1435580 AleX C March 28, 2012, 7:39 a.m. OK MS C++ TESTS 95 80 1433600 2400
1433880 NALP C March 27, 2012, 8:31 p.m. OK MS C++ TESTS 95 80 1433600 2400
57184348 sorry_im_smurfing C July 17, 2019, 8:14 a.m. OK MS C++ 2017 TESTS 95 156 0 2400
1432770 alexey.shchepin C March 27, 2012, 6:37 p.m. OK Ocaml TESTS 95 110 2662400 2400
1442818 Riatre C March 30, 2012, 8:35 a.m. OK Python 2 TESTS 95 420 2867200 2400
1434231 izban C March 27, 2012, 10:50 p.m. OK Python 2 TESTS 95 530 3072000 2400

remove filters

Back to search problems