Codeforces Round 397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined)

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
765 Codeforces Round 397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) FINISHED False 10800 250466123 Feb. 14, 2017, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7023 ) C Table Tennis Game 2 PROGRAMMING math 1300

B'Misha and Vanya have played several table tennis sets. Each set consists of several serves, each serve is won by one of the players, he receives one point and the loser receives nothing. Once one of the players scores exactly k points, the score is reset and a new set begins. Across all the sets Misha scored a points in total, and Vanya scored b points. Given this information, determine the maximum number of sets they could have played, or that the situation is impossible. Note that the game consisted of several complete sets. The first line contains three space-separated integers k, a and b (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109, 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89a, xe2 x80 x89b xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109, a xe2 x80 x89+ xe2 x80 x89b xe2 x80 x89> xe2 x80 x890). If the situation is impossible, print a single number -1. Otherwise, print the maximum possible number of sets. Note that the rules of the game in this problem differ from the real table tennis game, for example, the rule of "balance" (the winning player has to be at least two points ahead to win a set) has no power within the present problem. '...

Tutorials

Codeforces Round #397 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
42225188 vjudge5 C Aug. 29, 2018, 1:46 a.m. OK Clang++17 Diagnostics TESTS 279 46 0 1300
24652155 ruban C Feb. 14, 2017, 8:34 a.m. OK Delphi TESTS 59 15 2560000 1300
24661182 Alidrod C Feb. 14, 2017, 9:42 a.m. OK Delphi TESTS 59 15 2662400 1300
24656511 Cabpacob C Feb. 14, 2017, 8:59 a.m. OK Delphi TESTS 59 31 2662400 1300
27674378 KagamiharaNadeshiko C June 8, 2017, 3:21 p.m. OK FPC TESTS 279 15 0 1300
26082311 Fred_Flintstone C April 2, 2017, 4:47 p.m. OK FPC TESTS 279 15 1638400 1300
28810941 vjudge2 C July 24, 2017, 1:43 a.m. OK FPC TESTS 279 15 1638400 1300
25430555 vjudge5 C March 12, 2017, 10:06 a.m. OK FPC TESTS 59 15 1638400 1300
25430540 vjudge5 C March 12, 2017, 10:05 a.m. OK FPC TESTS 59 15 1638400 1300
25406314 vjudge3 C March 11, 2017, 1:21 p.m. OK FPC TESTS 59 15 1638400 1300
25405820 vjudge4 C March 11, 2017, 1:07 p.m. OK FPC TESTS 59 15 1638400 1300
25360590 vjudge3 C March 9, 2017, 1:14 p.m. OK FPC TESTS 59 15 1638400 1300
25359270 vjudge3 C March 9, 2017, 12:11 p.m. OK FPC TESTS 59 15 1638400 1300
25794173 ice_tea C March 25, 2017, 9:42 a.m. OK FPC TESTS 279 15 1638400 1300
27396798 MarcosK C May 27, 2017, 8:25 p.m. OK GNU C TESTS 279 15 0 1300
27269625 asiar C May 21, 2017, 3:10 p.m. OK GNU C TESTS 279 15 0 1300
26999134 code-knight C May 10, 2017, 3:35 p.m. OK GNU C TESTS 279 15 0 1300
33972515 MrCoderBoy C Jan. 6, 2018, 8:50 p.m. OK GNU C TESTS 279 15 1843200 1300
25955699 Willoward C March 30, 2017, 2:33 p.m. OK GNU C TESTS 279 15 1843200 1300
25629795 gkisaoglu C March 18, 2017, 9:06 p.m. OK GNU C TESTS 279 15 1843200 1300
24721339 the_smartest C Feb. 16, 2017, 3:43 p.m. OK GNU C TESTS 59 15 1843200 1300
24680451 Thenerdone C Feb. 14, 2017, 8:05 p.m. OK GNU C TESTS 59 15 1843200 1300
24670552 shuafen C Feb. 14, 2017, 12:58 p.m. OK GNU C TESTS 59 15 1843200 1300
24669777 mukeshchugani10 C Feb. 14, 2017, 12:34 p.m. OK GNU C TESTS 59 15 1843200 1300
31737959 vjudge1 C Oct. 26, 2017, 12:27 p.m. OK GNU C++ TESTS 279 15 0 1300
31735433 vjudge1 C Oct. 26, 2017, 10:45 a.m. OK GNU C++ TESTS 279 15 0 1300
32091060 resendiz C Nov. 6, 2017, 10:03 a.m. OK GNU C++ TESTS 279 15 0 1300
31734682 vjudge5 C Oct. 26, 2017, 10:16 a.m. OK GNU C++ TESTS 279 15 0 1300
31050133 actionboyvn C Oct. 6, 2017, 1:26 a.m. OK GNU C++ TESTS 279 15 0 1300
30798189 WSPZZ5 C Sept. 28, 2017, 7:59 a.m. OK GNU C++ TESTS 279 15 0 1300
29836955 vjudge3 C Aug. 28, 2017, 1:29 a.m. OK GNU C++ TESTS 279 15 0 1300
29828246 vjudge5 C Aug. 27, 2017, 2:11 p.m. OK GNU C++ TESTS 279 15 0 1300
29826697 vjudge1 C Aug. 27, 2017, 12:43 p.m. OK GNU C++ TESTS 279 15 0 1300
29824249 vjudge4 C Aug. 27, 2017, 10:39 a.m. OK GNU C++ TESTS 279 15 0 1300
25360722 xiao-xiao C March 9, 2017, 1:19 p.m. OK GNU C11 TESTS 59 15 1843200 1300
24692792 dreamaniac C Feb. 15, 2017, 10:57 a.m. OK GNU C11 TESTS 59 15 1843200 1300
24657245 nancylol C Feb. 14, 2017, 9:04 a.m. OK GNU C11 TESTS 59 15 1945600 1300
26143158 Yash_Agarwal C April 5, 2017, 12:36 p.m. OK GNU C11 TESTS 279 15 1945600 1300
24672551 f2lk6wf90d C Feb. 14, 2017, 2:23 p.m. OK GNU C11 TESTS 59 15 1945600 1300
24670710 newbass C Feb. 14, 2017, 1:05 p.m. OK GNU C11 TESTS 59 15 1945600 1300
25821933 I_frankenstein C March 26, 2017, 2:52 p.m. OK GNU C11 TESTS 279 30 1945600 1300
65523601 Razvan2000f C Nov. 22, 2019, 9:23 a.m. OK GNU C11 TESTS 279 31 0 1300
62593749 razi2001 C Oct. 14, 2019, 11:37 p.m. OK GNU C11 TESTS 279 31 0 1300
67467031 Piccacu C Dec. 23, 2019, 11:26 a.m. OK GNU C11 TESTS 279 31 0 1300
27662634 FieryPhoenix C June 8, 2017, 4:02 a.m. OK GNU C++11 TESTS 279 15 0 1300
31182115 Feeey C Oct. 10, 2017, 6:14 a.m. OK GNU C++11 TESTS 279 15 0 1300
30997290 The_Wolfpack C Oct. 4, 2017, 4:16 p.m. OK GNU C++11 TESTS 279 15 0 1300
30913031 rafsan35 C Oct. 1, 2017, 3:42 p.m. OK GNU C++11 TESTS 279 15 0 1300
30861230 VinayakaB C Sept. 30, 2017, 9:45 a.m. OK GNU C++11 TESTS 279 15 0 1300
29850501 bonna46 C Aug. 28, 2017, 4:58 p.m. OK GNU C++11 TESTS 279 15 0 1300
29690784 heck C Aug. 22, 2017, 6:17 p.m. OK GNU C++11 TESTS 279 15 0 1300
29600295 vjudge2 C Aug. 19, 2017, 2:02 p.m. OK GNU C++11 TESTS 279 15 0 1300
27831130 Dronzer1997 C June 16, 2017, 6:13 p.m. OK GNU C++11 TESTS 279 15 0 1300
27677922 hho C June 8, 2017, 7:29 p.m. OK GNU C++11 TESTS 279 15 0 1300
31233660 _DSy C Oct. 12, 2017, 6:38 a.m. OK GNU C++14 TESTS 279 15 0 1300
31316700 mohammadmgh77 C Oct. 14, 2017, 3:47 p.m. OK GNU C++14 TESTS 279 15 0 1300
32490649 gaporf C Nov. 20, 2017, 6:17 a.m. OK GNU C++14 TESTS 279 15 0 1300
32380418 jianba C Nov. 17, 2017, 1:57 p.m. OK GNU C++14 TESTS 279 15 0 1300
32360684 helio C Nov. 16, 2017, 4:40 p.m. OK GNU C++14 TESTS 279 15 0 1300
31988177 chamow C Nov. 2, 2017, 5:43 p.m. OK GNU C++14 TESTS 279 15 0 1300
31987362 sakib19 C Nov. 2, 2017, 5:12 p.m. OK GNU C++14 TESTS 279 15 0 1300
31916195 gio_bakradze C Oct. 31, 2017, 9:43 a.m. OK GNU C++14 TESTS 279 15 0 1300
31810433 pushpendra1997 C Oct. 27, 2017, 3:56 p.m. OK GNU C++14 TESTS 279 15 0 1300
31719720 kian2000 C Oct. 25, 2017, 5:48 p.m. OK GNU C++14 TESTS 279 15 0 1300
36225589 lstdiraf C March 12, 2018, 1:37 p.m. OK GNU C++17 TESTS 279 15 2048000 1300
35328572 fractal C Feb. 16, 2018, 6:35 a.m. OK GNU C++17 TESTS 279 15 2048000 1300
67031111 mridhapower C Dec. 16, 2019, 3:52 p.m. OK GNU C++17 TESTS 279 31 0 1300
67999294 JustDoIt28 C Dec. 31, 2019, 9:55 a.m. OK GNU C++17 TESTS 279 31 0 1300
68053827 leo16614 C Jan. 1, 2020, 8:36 p.m. OK GNU C++17 TESTS 279 31 0 1300
68112725 YouKnowWho_IAm C Jan. 3, 2020, 10:13 a.m. OK GNU C++17 TESTS 279 31 0 1300
68126029 HiruMollah C Jan. 3, 2020, 3:14 p.m. OK GNU C++17 TESTS 279 31 0 1300
68986376 Aman_j1 C Jan. 17, 2020, 12:39 p.m. OK GNU C++17 TESTS 279 31 0 1300
69703641 is_mail C Jan. 29, 2020, 2:57 a.m. OK GNU C++17 TESTS 279 31 0 1300
69913911 hongochoangm C Jan. 31, 2020, 4:13 p.m. OK GNU C++17 TESTS 279 31 0 1300
24825619 gchebanov C Feb. 20, 2017, 3:57 p.m. OK Go TESTS 59 15 23040000 1300
24825507 gchebanov C Feb. 20, 2017, 3:51 p.m. OK Go TESTS 59 15 23040000 1300
24655178 mipt.vi002 C Feb. 14, 2017, 8:50 a.m. OK Haskell TESTS 59 30 44953600 1300
58506354 formalist C Aug. 9, 2019, 4:37 p.m. OK Java 8 TESTS 279 109 0 1300
46899676 nkhattab C Dec. 11, 2018, 11:18 a.m. OK Java 8 TESTS 279 109 0 1300
26511253 OmarRadwan C April 20, 2017, 8:45 a.m. OK Java 8 TESTS 279 109 20684800 1300
24657400 Carson C Feb. 14, 2017, 9:05 a.m. OK Java 8 TESTS 59 109 20684800 1300
24674496 huapito C Feb. 14, 2017, 3:35 p.m. OK Java 8 TESTS 59 109 20787200 1300
24672414 harsh11298 C Feb. 14, 2017, 2:18 p.m. OK Java 8 TESTS 59 109 20787200 1300
28904875 Hossam C July 26, 2017, 12:29 p.m. OK Java 8 TESTS 279 109 21094400 1300
25430865 ekaanshkhosla C March 12, 2017, 10:15 a.m. OK Java 8 TESTS 59 109 21094400 1300
25362996 Mahakarma C March 9, 2017, 3:08 p.m. OK Java 8 TESTS 59 109 21094400 1300
25188629 xdimension C March 3, 2017, 8:50 p.m. OK Java 8 TESTS 59 109 21094400 1300
24665758 Grizix C Feb. 14, 2017, 10:43 a.m. OK JavaScript TESTS 59 31 5939200 1300
25487009 webneat C March 14, 2017, 10:39 p.m. OK JavaScript TESTS 279 31 6963200 1300
59625084 david_varela C Aug. 28, 2019, 3:37 p.m. OK Kotlin TESTS 279 155 614400 1300
24658906 htkb C Feb. 14, 2017, 9:18 a.m. OK Kotlin TESTS 59 186 21708800 1300
24676834 Nuts C Feb. 14, 2017, 5:13 p.m. OK Kotlin TESTS 59 202 21606400 1300
36403162 kasabulatov C March 19, 2018, 5:32 a.m. OK Mono C# TESTS 279 46 7884800 1300
51168502 nemars C March 11, 2019, 3:19 p.m. OK Mono C# TESTS 279 62 0 1300
24748451 brosly C Feb. 18, 2017, 1:40 a.m. OK Mono C# TESTS 59 62 9011200 1300
24994853 maxspT C Feb. 24, 2017, 8:12 p.m. OK MS C# TESTS 59 46 8908800 1300
25083439 ArLion C Feb. 27, 2017, 4:52 p.m. OK MS C# TESTS 59 46 9011200 1300
25318887 tellmewhy SkeW Gardiys C March 7, 2017, 10:59 a.m. OK MS C# TESTS 59 46 9011200 1300
24661231 mircea85 C Feb. 14, 2017, 9:43 a.m. OK MS C# TESTS 59 46 9113600 1300
24659040 elmahalawym C Feb. 14, 2017, 9:19 a.m. OK MS C# TESTS 59 61 9011200 1300
24654670 zelyanin C Feb. 14, 2017, 8:47 a.m. OK MS C# TESTS 59 61 9011200 1300
24902710 dgravett C Feb. 22, 2017, 9:49 p.m. OK MS C# TESTS 59 62 8908800 1300
24661030 lecho C Feb. 14, 2017, 9:40 a.m. OK MS C# TESTS 59 62 9011200 1300
24671223 artsin666 C Feb. 14, 2017, 1:28 p.m. OK MS C# TESTS 59 62 9011200 1300
24660740 Neverauskas C Feb. 14, 2017, 9:37 a.m. OK MS C# TESTS 59 62 11366400 1300
27614251 ze177482 C June 6, 2017, 12:59 p.m. OK MS C++ TESTS 279 15 204800 1300
27511367 DaniaSewwi C June 1, 2017, 10:03 p.m. OK MS C++ TESTS 279 15 204800 1300
24665065 Lobanov_VAVKO C Feb. 14, 2017, 10:33 a.m. OK MS C++ TESTS 59 15 1945600 1300
25211164 vjudge4 C March 4, 2017, 12:17 p.m. OK MS C++ TESTS 59 15 2048000 1300
34476740 vjudge4 C Jan. 23, 2018, 9:44 a.m. OK MS C++ TESTS 279 15 2048000 1300
25679532 Ally0729 C March 21, 2017, 3:23 a.m. OK MS C++ TESTS 279 15 2048000 1300
25679521 Ally0729 C March 21, 2017, 3:20 a.m. OK MS C++ TESTS 279 15 2048000 1300
25358114 songchoong C March 9, 2017, 11:17 a.m. OK MS C++ TESTS 59 15 2048000 1300
25209662 vjudge5 C March 4, 2017, 11:36 a.m. OK MS C++ TESTS 59 15 2048000 1300
25177660 vjudge1 C March 3, 2017, 2:53 p.m. OK MS C++ TESTS 59 15 2048000 1300
55010493 Still_Theory C June 3, 2019, 9:48 a.m. OK MS C++ 2017 TESTS 279 31 0 1300
60482769 vjudge4 C Sept. 13, 2019, 11:17 a.m. OK MS C++ 2017 TESTS 279 31 0 1300
64066789 Mad112233 C Nov. 2, 2019, 6:04 a.m. OK MS C++ 2017 TESTS 279 31 307200 1300
59134819 Vovkaez C Aug. 20, 2019, 12:17 p.m. OK MS C++ 2017 TESTS 279 46 0 1300
52747426 felix412441 C April 14, 2019, 12:23 p.m. OK MS C++ 2017 TESTS 279 46 0 1300
58208081 vjudge3 C Aug. 3, 2019, 7:51 a.m. OK MS C++ 2017 TESTS 279 46 0 1300
58071614 116c C July 31, 2019, 10:53 a.m. OK MS C++ 2017 TESTS 279 46 0 1300
24853306 agibson C Feb. 20, 2017, 7:55 p.m. OK Ocaml TESTS 59 30 3891200 1300
24670217 rsFalse C Feb. 14, 2017, 12:47 p.m. OK Perl TESTS 59 31 2150400 1300
24670045 rsFalse C Feb. 14, 2017, 12:42 p.m. OK Perl TESTS 59 31 2150400 1300
24663934 rsFalse C Feb. 14, 2017, 10:16 a.m. OK Perl TESTS 59 31 2355200 1300
24656713 lovelymoon C Feb. 14, 2017, 9 a.m. OK PHP TESTS 59 31 6144000 1300
24671837 vbazuke C Feb. 14, 2017, 1:53 p.m. OK PHP TESTS 59 31 6758400 1300
24678322 mayakin C Feb. 14, 2017, 6:16 p.m. OK PHP TESTS 59 46 6041600 1300
25025431 ryanr1230 C Feb. 25, 2017, 11:18 p.m. OK PyPy 2 TESTS 59 62 22016000 1300
24673386 scorpion C Feb. 14, 2017, 2:53 p.m. OK PyPy 2 TESTS 59 77 22016000 1300
24674049 pirat3 C Feb. 14, 2017, 3:18 p.m. OK PyPy 2 TESTS 59 77 22016000 1300
24655731 osev C Feb. 14, 2017, 8:54 a.m. OK PyPy 2 TESTS 59 77 22016000 1300
24652948 aShadow C Feb. 14, 2017, 8:38 a.m. OK PyPy 2 TESTS 59 77 22016000 1300
30234149 iit2014101 C Sept. 9, 2017, 9:02 p.m. OK PyPy 2 TESTS 279 78 921600 1300
24672135 Trunks C Feb. 14, 2017, 2:07 p.m. OK PyPy 2 TESTS 59 78 22016000 1300
24656330 loalkota C Feb. 14, 2017, 8:58 a.m. OK PyPy 2 TESTS 59 78 22016000 1300
24653455 masonsbro C Feb. 14, 2017, 8:40 a.m. OK PyPy 2 TESTS 59 78 22016000 1300
24685263 ahxgw C Feb. 15, 2017, 3:50 a.m. OK PyPy 2 TESTS 59 93 22016000 1300
27359352 Yash_ C May 26, 2017, 3:49 p.m. OK PyPy 3 TESTS 279 108 307200 1300
29443537 Abdelrahman_Radwan C Aug. 13, 2017, 8:52 p.m. OK PyPy 3 TESTS 279 109 23142400 1300
24665472 JustAni C Feb. 14, 2017, 10:39 a.m. OK PyPy 3 TESTS 59 109 23142400 1300
54728847 Aidos C May 27, 2019, 9:19 p.m. OK PyPy 3 TESTS 279 140 0 1300
69687710 RazvanPanaite C Jan. 28, 2020, 5:34 p.m. OK PyPy 3 TESTS 279 155 0 1300
62739948 _rdv_ gaurav17050 C Oct. 16, 2019, 7:25 p.m. OK PyPy 3 TESTS 279 155 0 1300
60697874 kchau C Sept. 16, 2019, 8:46 p.m. OK PyPy 3 TESTS 279 155 102400 1300
24699526 Arch0n C Feb. 15, 2017, 3:29 p.m. OK PyPy 3 TESTS 59 218 23142400 1300
24661694 14110581002 C Feb. 14, 2017, 9:48 a.m. OK Python 2 TESTS 59 46 4710400 1300
24653922 shreypandey C Feb. 14, 2017, 8:43 a.m. OK Python 2 TESTS 59 46 4710400 1300
31111449 biltharesatyendra C Oct. 7, 2017, 11:03 a.m. OK Python 2 TESTS 279 61 0 1300
24662673 abhinashjain C Feb. 14, 2017, 9:59 a.m. OK Python 2 TESTS 59 61 4608000 1300
26251543 TokuchiToa C April 10, 2017, 11:32 a.m. OK Python 2 TESTS 279 61 4710400 1300
24670937 rewan C Feb. 14, 2017, 1:15 p.m. OK Python 2 TESTS 59 61 4710400 1300
24668758 Lewin C Feb. 14, 2017, 12:07 p.m. OK Python 2 TESTS 59 61 4710400 1300
24663637 EvgeniSergeev C Feb. 14, 2017, 10:12 a.m. OK Python 2 TESTS 59 61 4710400 1300
24661681 adi28galaxyak C Feb. 14, 2017, 9:48 a.m. OK Python 2 TESTS 59 61 4710400 1300
24660551 nezahualcoyotl C Feb. 14, 2017, 9:35 a.m. OK Python 2 TESTS 59 61 4710400 1300
25437790 lelius C March 12, 2017, 3:12 p.m. OK Python 3 TESTS 59 61 4608000 1300
25240744 manish3749 C March 5, 2017, 10:25 a.m. OK Python 3 TESTS 59 61 4608000 1300
29524268 zalioos C Aug. 17, 2017, 10:45 a.m. OK Python 3 TESTS 279 62 0 1300
26954398 madn C May 8, 2017, 10:26 a.m. OK Python 3 TESTS 279 62 0 1300
31837384 Rustt C Oct. 28, 2017, 12:40 p.m. OK Python 3 TESTS 279 62 102400 1300
29369641 DanielAnderson C Aug. 12, 2017, 6:01 a.m. OK Python 3 TESTS 279 62 4608000 1300
29140556 kantuni C Aug. 2, 2017, 9:51 p.m. OK Python 3 TESTS 279 62 4608000 1300
29127657 Vasiliy_48 C Aug. 2, 2017, 11:04 a.m. OK Python 3 TESTS 279 62 4608000 1300
24992362 Dusaev.2000 C Feb. 24, 2017, 6:51 p.m. OK Python 3 TESTS 59 62 4608000 1300
24876080 MirelaBocsa C Feb. 21, 2017, 4:37 p.m. OK Python 3 TESTS 59 62 4608000 1300
24672717 wasiq.bhamla C Feb. 14, 2017, 2:29 p.m. OK Ruby TESTS 59 62 6451200 1300
26534360 yigezhe C April 21, 2017, 9:23 a.m. OK Ruby TESTS 279 77 6656000 1300
24654874 cielavenir C Feb. 14, 2017, 8:48 a.m. OK Ruby TESTS 59 93 6553600 1300
24807244 cielavenir C Feb. 19, 2017, 5:22 p.m. OK Ruby TESTS 59 108 6656000 1300
24656245 kobae964 C Feb. 14, 2017, 8:57 a.m. OK Rust TESTS 59 15 1536000 1300
24651183 mio_h C Feb. 14, 2017, 8:30 a.m. OK Rust TESTS 59 15 18432000 1300
24659301 traff C Feb. 14, 2017, 9:22 a.m. OK Scala TESTS 59 296 24166400 1300

remove filters

Back to search problems