Codeforces Round 491 (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
991 Codeforces Round 491 (Div. 2) FINISHED False 7200 202055099 June 23, 2018, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10642 ) A If at first you don't succeed... PROGRAMMING implementation 1100

B"Each student eagerly awaits the day he would pass the exams successfully. Thus, Vasya was ready to celebrate, but, alas, he didn't pass it. However, many of Vasya's fellow students from the same group were more successful and celebrated after the exam. Some of them celebrated in the BugDonalds restaurant, some of them -- in the BeaverKing restaurant, the most successful ones were fast enough to celebrate in both of restaurants. Students which didn't pass the exam didn't celebrate in any of those restaurants and elected to stay home to prepare for their reexamination. However, this quickly bored Vasya and he started checking celebration photos on the Kilogramm. He found out that, in total, BugDonalds was visited by A students, BeaverKing -- by B students and C students visited both restaurants. Vasya also knows that there are N students in his group. Based on this info, Vasya wants to determine either if his data contradicts itself or, if it doesn't, how many students in his group didn't pass the exam. Can you help him so he won't waste his valuable preparation time? The first line contains four integers -- A , B , C and N ( 0 <= q A, B, C, N <= q 100 ). If a distribution of N students exists in which A students visited BugDonalds, B -- BeaverKing, C -- both of the restaurants and at least one student is left home (it is known that Vasya didn't pass the exam and stayed at home), output one integer -- amount of students (including Vasya) who did not pass the exam. If such a distribution does not exist and Vasya made a mistake while determining the numbers A , B , C or N (as in samples 2 and 3), output -1 . The first sample describes following situation: 5 only visited BugDonalds, 5 students only visited BeaverKing, 5 visited both of them and 5 students (including Vasya) didn't pass the exam. In the second sample 2 stud"...

Tutorials

60181

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
49220751 Siddhaarth.S A Jan. 30, 2019, 7:02 p.m. OK Clang++17 Diagnostics TESTS 76 46 0 1100
49223031 U4ECE18050 A Jan. 30, 2019, 8:17 p.m. OK Clang++17 Diagnostics TESTS 76 46 0 1100
50300382 K.CHAKRI A Feb. 22, 2019, 1:42 a.m. OK Clang++17 Diagnostics TESTS 76 46 0 1100
52614003 AM.EN.U4ME18130 A April 11, 2019, 5:24 p.m. OK Clang++17 Diagnostics TESTS 76 46 0 1100
64720555 abuhuraira071 A Nov. 12, 2019, 3:09 a.m. OK Clang++17 Diagnostics TESTS 76 46 0 1100
49220059 U4ME18055 A Jan. 30, 2019, 6:42 p.m. OK Clang++17 Diagnostics TESTS 76 46 0 1100
49217344 AM.EN.U4ECE18011 A Jan. 30, 2019, 5:39 p.m. OK Clang++17 Diagnostics TESTS 76 46 0 1100
48918449 u_turn_ A Jan. 25, 2019, 6:35 a.m. OK Clang++17 Diagnostics TESTS 76 46 0 1100
48918233 AM.EN.U4ECE18153 A Jan. 25, 2019, 6:29 a.m. OK Clang++17 Diagnostics TESTS 76 46 0 1100
40054566 vjudge3 A July 7, 2018, 7:53 a.m. OK Clang++17 Diagnostics TESTS 76 46 0 1100
39580870 ruban A June 23, 2018, 8:03 p.m. OK Delphi TESTS 76 30 0 1100
39581347 pchvirov A June 23, 2018, 8:18 p.m. OK Delphi TESTS 76 31 102400 1100
39594755 PiMat A June 24, 2018, 8:07 a.m. OK FPC TESTS 76 30 0 1100
57617707 luogu_bot5 A July 24, 2019, 2:34 a.m. OK FPC TESTS 76 31 0 1100
47781976 luogu_bot1 A Dec. 31, 2018, 8:40 a.m. OK FPC TESTS 76 31 0 1100
47780793 luogu_bot5 A Dec. 31, 2018, 8 a.m. OK FPC TESTS 76 31 0 1100
40410243 luogu_bot2 A July 16, 2018, 12:06 p.m. OK FPC TESTS 76 31 0 1100
40410218 luogu_bot3 A July 16, 2018, 12:05 p.m. OK FPC TESTS 76 31 0 1100
40165171 Pashechka A July 10, 2018, 9:20 a.m. OK FPC TESTS 76 31 0 1100
40039556 dodongchien123 A July 6, 2018, 5:50 p.m. OK FPC TESTS 76 31 0 1100
40039515 dodongchien234 A July 6, 2018, 5:49 p.m. OK FPC TESTS 76 31 0 1100
40039479 dodongchien234 A July 6, 2018, 5:48 p.m. OK FPC TESTS 76 31 0 1100
39633826 m3h3d1 A June 24, 2018, 10:58 p.m. OK GNU C TESTS 76 15 0 1100
39586907 singhal_123 A June 24, 2018, 2:30 a.m. OK GNU C TESTS 76 30 0 1100
39608057 chetna_v A June 24, 2018, 4:25 p.m. OK GNU C TESTS 76 30 0 1100
39607138 naruto248 A June 24, 2018, 3:41 p.m. OK GNU C TESTS 76 30 0 1100
39591536 rishiraje A June 24, 2018, 6:14 a.m. OK GNU C TESTS 76 30 0 1100
39566914 mehedihassanrupok A June 23, 2018, 4:36 p.m. OK GNU C TESTS 76 30 0 1100
41609376 vjudge5 A Aug. 15, 2018, 5:32 a.m. OK GNU C TESTS 76 31 0 1100
41799121 sayan1706 A Aug. 18, 2018, 5:51 p.m. OK GNU C TESTS 76 31 0 1100
42427573 Tusher_1703111 A Sept. 3, 2018, 1:23 p.m. OK GNU C TESTS 76 31 0 1100
41686602 AsadulHasan_Rasel A Aug. 17, 2018, 2:36 p.m. OK GNU C TESTS 76 31 0 1100
39693674 ligang123 A June 27, 2018, 7:09 a.m. OK GNU C++ TESTS 76 15 0 1100
39641901 shethparita98 A June 25, 2018, 7:36 a.m. OK GNU C++ TESTS 76 15 0 1100
39671882 luogu_bot1 A June 26, 2018, 9:49 a.m. OK GNU C++ TESTS 76 30 0 1100
39646752 AmazingWang A June 25, 2018, 10:44 a.m. OK GNU C++ TESTS 76 30 0 1100
39664588 rocket A June 26, 2018, 3:46 a.m. OK GNU C++ TESTS 76 30 0 1100
40595120 vjudge3 A July 21, 2018, 4:51 a.m. OK GNU C++ TESTS 76 30 0 1100
39735685 Naim_Hasan A June 28, 2018, 7:36 a.m. OK GNU C++ TESTS 76 30 0 1100
39699615 aditya787244poddar A June 27, 2018, 11:20 a.m. OK GNU C++ TESTS 76 30 0 1100
39697670 shccho A June 27, 2018, 9:53 a.m. OK GNU C++ TESTS 76 30 0 1100
39694294 Serious-Man A June 27, 2018, 7:33 a.m. OK GNU C++ TESTS 76 30 0 1100
39592578 Tanvir_Rasel A June 24, 2018, 6:51 a.m. OK GNU C11 TESTS 76 30 0 1100
67193333 the-code-innovator A Dec. 19, 2019, 8:01 a.m. OK GNU C11 TESTS 76 31 0 1100
66223933 tearing A Dec. 3, 2019, 11:50 a.m. OK GNU C11 TESTS 76 31 0 1100
54407120 ksaswin A May 20, 2019, 7:06 a.m. OK GNU C11 TESTS 76 31 0 1100
54876400 vjudge2 A May 31, 2019, 12:01 p.m. OK GNU C11 TESTS 76 31 0 1100
55587131 abir_hasan_1703100 A June 15, 2019, 10:12 a.m. OK GNU C11 TESTS 76 31 0 1100
56517509 Watch_Dog_Vintorez A July 4, 2019, 1:25 p.m. OK GNU C11 TESTS 76 31 0 1100
57153806 aliftheruslan A July 16, 2019, 3:53 p.m. OK GNU C11 TESTS 76 31 0 1100
65526864 DevJewel A Nov. 22, 2019, 10:46 a.m. OK GNU C11 TESTS 76 31 0 1100
57297103 Judas_Tadeo A July 18, 2019, 7:58 p.m. OK GNU C11 TESTS 76 31 0 1100
39666433 BluEarth A June 26, 2018, 5:42 a.m. OK GNU C++11 TESTS 76 15 0 1100
39663558 makorro A June 26, 2018, 2:42 a.m. OK GNU C++11 TESTS 76 15 0 1100
39636826 shiautsung A June 25, 2018, 3:15 a.m. OK GNU C++11 TESTS 76 15 0 1100
39586314 Zerpro A June 24, 2018, 1:53 a.m. OK GNU C++11 TESTS 76 15 0 1100
39737637 rytwww A June 28, 2018, 9:03 a.m. OK GNU C++11 TESTS 76 30 0 1100
39649720 _ifg A June 25, 2018, 12:43 p.m. OK GNU C++11 TESTS 76 30 0 1100
39662467 GYC A June 26, 2018, 1:18 a.m. OK GNU C++11 TESTS 76 30 0 1100
39664817 rv15hwakarthik A June 26, 2018, 4:04 a.m. OK GNU C++11 TESTS 76 30 0 1100
39689328 Hi_archer A June 27, 2018, 2:39 a.m. OK GNU C++11 TESTS 76 30 0 1100
39706158 Nihad_Nabelsi A June 27, 2018, 2:47 p.m. OK GNU C++11 TESTS 76 30 0 1100
39651727 Evro A June 25, 2018, 2:03 p.m. OK GNU C++14 TESTS 76 15 0 1100
39645227 Quick1337 A June 25, 2018, 9:44 a.m. OK GNU C++14 TESTS 76 15 0 1100
39692329 Slow_But_Determined A June 27, 2018, 6:02 a.m. OK GNU C++14 TESTS 76 15 0 1100
39640662 likhith18_nitd A June 25, 2018, 6:47 a.m. OK GNU C++14 TESTS 76 15 0 1100
39632682 ma1n_event A June 24, 2018, 9:33 p.m. OK GNU C++14 TESTS 76 15 0 1100
39692427 rm_iiest A June 27, 2018, 6:06 a.m. OK GNU C++14 TESTS 76 15 0 1100
39697150 racecar_nascar A June 27, 2018, 9:31 a.m. OK GNU C++14 TESTS 76 15 0 1100
41604302 Chem_Than A Aug. 15, 2018, 12:25 a.m. OK GNU C++14 TESTS 76 15 0 1100
42221751 ACRS A Aug. 28, 2018, 9:20 p.m. OK GNU C++14 TESTS 76 15 0 1100
39653794 3.1415926535897932384626 A June 25, 2018, 3:34 p.m. OK GNU C++14 TESTS 76 15 0 1100
39590008 idsigma A June 24, 2018, 5:09 a.m. OK GNU C++17 TESTS 76 15 0 1100
54874864 vjudge5 A May 31, 2019, 11:18 a.m. OK GNU C++17 TESTS 76 15 0 1100
53309544 Shadmim03 A April 26, 2019, 5:36 a.m. OK GNU C++17 TESTS 76 15 0 1100
39691684 Certified_Intellectual A June 27, 2018, 5:26 a.m. OK GNU C++17 TESTS 76 15 0 1100
39653993 Amurenok A June 25, 2018, 3:44 p.m. OK GNU C++17 TESTS 76 15 0 1100
39651908 deeptiagg16 A June 25, 2018, 2:10 p.m. OK GNU C++17 TESTS 76 15 0 1100
39605521 cujo A June 24, 2018, 2:33 p.m. OK GNU C++17 TESTS 76 15 0 1100
39601629 artsin666 A June 24, 2018, 12:16 p.m. OK GNU C++17 TESTS 76 15 0 1100
39595819 Saiham A June 24, 2018, 8:46 a.m. OK GNU C++17 TESTS 76 15 0 1100
39586293 aloo123 A June 24, 2018, 1:51 a.m. OK GNU C++17 TESTS 76 15 0 1100
40604234 zhangyin_ A July 21, 2018, 10:22 a.m. OK GNU C++17 Diagnostics TESTS 76 998 1228800 1100
42962556 Gansito144 A Sept. 16, 2018, 8:19 p.m. OK Go TESTS 76 31 0 1100
43001323 __D__ A Sept. 17, 2018, 1:58 p.m. OK Go TESTS 76 46 0 1100
54543223 Vatsal53 A May 24, 2019, 4:09 a.m. OK Java 8 TESTS 76 109 0 1100
66614346 ijxjdjd A Dec. 11, 2019, 2:10 a.m. OK Java 8 TESTS 76 109 0 1100
58555769 vvenkai A Aug. 11, 2019, 1:39 a.m. OK Java 8 TESTS 76 109 0 1100
56238371 foreverlearner A June 28, 2019, 5:15 p.m. OK Java 8 TESTS 76 109 0 1100
55588377 adeepgarg13 A June 15, 2019, 10:55 a.m. OK Java 8 TESTS 76 109 0 1100
48580830 Naman_123 A Jan. 19, 2019, 4:35 p.m. OK Java 8 TESTS 76 109 0 1100
69078499 StEpAn_123 A Jan. 19, 2020, 5:06 a.m. OK Java 8 TESTS 76 124 0 1100
68489469 insane_28 A Jan. 10, 2020, 11:09 a.m. OK Java 8 TESTS 76 124 0 1100
67260374 fundamentals A Dec. 20, 2019, 2:58 a.m. OK Java 8 TESTS 76 124 0 1100
61396818 growcallisaya A Sept. 28, 2019, 2:47 a.m. OK Java 8 TESTS 76 124 0 1100
50900691 vucket A March 6, 2019, 5:17 p.m. OK JavaScript TESTS 76 31 0 1100
62840935 Bakuryu A Oct. 18, 2019, 2:38 a.m. OK JavaScript TESTS 76 46 0 1100
50900327 vucket A March 6, 2019, 5:06 p.m. OK JavaScript TESTS 76 46 0 1100
39878825 benjani A July 2, 2018, 9:17 p.m. OK JavaScript TESTS 76 46 0 1100
39572926 islamdidarmd A June 23, 2018, 5:08 p.m. OK Kotlin TESTS 76 171 102400 1100
39570466 SerVB A June 23, 2018, 4:53 p.m. OK Kotlin TESTS 76 186 102400 1100
39590376 thirtiseven A June 24, 2018, 5:24 a.m. OK Mono C# TESTS 76 46 0 1100
39752041 -PhoeniX- A June 28, 2018, 7:28 p.m. OK Mono C# TESTS 76 46 0 1100
39783661 ibastarreche A June 29, 2018, 10:43 p.m. OK Mono C# TESTS 76 46 0 1100
40649820 Ruban_Denic A July 22, 2018, 7:51 p.m. OK Mono C# TESTS 76 46 0 1100
44056848 nemars A Oct. 10, 2018, 1:36 a.m. OK Mono C# TESTS 76 46 0 1100
39582653 vetedde A June 23, 2018, 9:10 p.m. OK Mono C# TESTS 76 46 0 1100
39693616 n.a.borisov A June 27, 2018, 7:06 a.m. OK Mono C# TESTS 76 46 0 1100
54653044 og.kostya A May 26, 2019, 6:39 a.m. OK Mono C# TESTS 76 62 0 1100
39581189 still_the_big_bang A June 23, 2018, 8:13 p.m. OK Mono C# TESTS 76 62 3481600 1100
39605004 psy7726 A June 24, 2018, 2:12 p.m. OK MS C++ TESTS 76 30 0 1100
39604966 WooDeND A June 24, 2018, 2:10 p.m. OK MS C++ TESTS 76 30 0 1100
39590801 MenOfPassion A June 24, 2018, 5:43 a.m. OK MS C++ TESTS 76 30 0 1100
39586627 ladjasd A June 24, 2018, 2:13 a.m. OK MS C++ TESTS 76 30 0 1100
39580648 Vovka A June 23, 2018, 7:57 p.m. OK MS C++ TESTS 76 30 0 1100
67919633 vjudge4 A Dec. 29, 2019, 4:09 p.m. OK MS C++ TESTS 76 31 0 1100
67795039 vjudge1 A Dec. 28, 2019, 4:15 p.m. OK MS C++ TESTS 76 31 0 1100
64307558 vjudge5 A Nov. 5, 2019, 11:50 a.m. OK MS C++ TESTS 76 31 0 1100
64452723 vjudge5 A Nov. 7, 2019, 7:41 a.m. OK MS C++ TESTS 76 31 0 1100
65531878 vjudge3 A Nov. 22, 2019, 12:45 p.m. OK MS C++ TESTS 76 31 0 1100
58905452 FumeiYaziwa A Aug. 16, 2019, 10:55 a.m. OK MS C++ 2017 TESTS 76 31 0 1100
60943577 ahmedo42 A Sept. 20, 2019, 6 p.m. OK MS C++ 2017 TESTS 76 31 0 1100
62600323 parisa.mqdm A Oct. 15, 2019, 5:10 a.m. OK MS C++ 2017 TESTS 76 31 0 1100
57747758 vjudge3 A July 25, 2019, 1:40 p.m. OK MS C++ 2017 TESTS 76 31 0 1100
57743836 vjudge2 A July 25, 2019, 12:20 p.m. OK MS C++ 2017 TESTS 76 31 0 1100
57742010 vjudge4 A July 25, 2019, 11:44 a.m. OK MS C++ 2017 TESTS 76 31 0 1100
54239820 JuicyCloud12609 A May 16, 2019, 12:28 p.m. OK MS C++ 2017 TESTS 76 31 0 1100
58161569 IbraheemJanajreh A Aug. 2, 2019, 7:36 a.m. OK MS C++ 2017 TESTS 76 31 0 1100
65665250 MRamanauskas A Nov. 24, 2019, 1:40 p.m. OK MS C++ 2017 TESTS 76 31 307200 1100
69382928 takam529 A Jan. 22, 2020, 8:30 p.m. OK MS C++ 2017 TESTS 76 31 307200 1100
39941589 secondwtq A July 4, 2018, 3:48 a.m. OK Ocaml TESTS 76 31 0 1100
46661539 sasakargin A Dec. 5, 2018, 7:44 p.m. OK PascalABC.NET TESTS 76 46 102400 1100
42205623 despairrr A Aug. 28, 2018, 11:26 a.m. OK PascalABC.NET TESTS 76 62 102400 1100
47363554 Emris666 A Dec. 22, 2018, 10:10 a.m. OK PascalABC.NET TESTS 76 62 102400 1100
50291614 bochkov A Feb. 21, 2019, 5:46 p.m. OK PascalABC.NET TESTS 76 187 0 1100
39820529 Hitrec A July 1, 2018, 11:59 a.m. OK PascalABC.NET TESTS 76 187 102400 1100
56464342 28Nik A July 3, 2019, 8:14 a.m. OK PascalABC.NET TESTS 76 264 0 1100
39590750 mayakin A June 24, 2018, 5:41 a.m. OK PHP TESTS 76 62 512000 1100
39653169 SerChirag A June 25, 2018, 3:05 p.m. OK PyPy 2 TESTS 76 93 0 1100
39585823 nealzane A June 24, 2018, 1:21 a.m. OK PyPy 2 TESTS 76 109 0 1100
40518863 akshay125 A July 18, 2018, 2:49 p.m. OK PyPy 2 TESTS 76 124 0 1100
39780831 BurntArgonPancakes A June 29, 2018, 7:57 p.m. OK PyPy 2 TESTS 76 171 0 1100
40545292 EON_KID A July 19, 2018, 11:19 a.m. OK PyPy 2 TESTS 76 217 1228800 1100
39596392 bortoz A June 24, 2018, 9:07 a.m. OK PyPy 3 TESTS 76 109 0 1100
39665128 atharva456 A June 26, 2018, 4:24 a.m. OK PyPy 3 TESTS 76 109 0 1100
39592012 shubply A June 24, 2018, 6:32 a.m. OK PyPy 3 TESTS 76 124 0 1100
39568618 shmabulock A June 23, 2018, 4:44 p.m. OK PyPy 3 TESTS 76 124 0 1100
61326377 FCUKmodiBhakts I_Am_Justice RedRanger A Sept. 26, 2019, 1:50 p.m. OK PyPy 3 TESTS 76 140 0 1100
55104867 meme_lord A June 5, 2019, 1:05 a.m. OK PyPy 3 TESTS 76 140 0 1100
51231676 morriship A March 12, 2019, 4:34 p.m. OK PyPy 3 TESTS 76 140 0 1100
47804509 Guendabiaani A Jan. 1, 2019, 5:42 a.m. OK PyPy 3 TESTS 76 140 0 1100
39786203 mcpower A June 30, 2018, 2:42 a.m. OK PyPy 3 TESTS 76 140 0 1100
39567197 fakepool A June 23, 2018, 4:37 p.m. OK PyPy 3 TESTS 76 140 0 1100
39643544 Ali_Pi A June 25, 2018, 8:40 a.m. OK Python 2 TESTS 76 93 0 1100
39603133 bary A June 24, 2018, 12:57 p.m. OK Python 2 TESTS 76 93 0 1100
39584051 Carlson.Bimbuh A June 23, 2018, 10:40 p.m. OK Python 2 TESTS 76 109 0 1100
39680422 homie A June 26, 2018, 4:06 p.m. OK Python 2 TESTS 76 109 0 1100
39629407 SoSooding A June 24, 2018, 6:38 p.m. OK Python 2 TESTS 76 109 0 1100
39599476 Sabareeshk A June 24, 2018, 10:54 a.m. OK Python 2 TESTS 76 109 0 1100
39594608 tnowakow A June 24, 2018, 8:03 a.m. OK Python 2 TESTS 76 109 0 1100
39587513 biltharesatyendra A June 24, 2018, 3:03 a.m. OK Python 2 TESTS 76 109 0 1100
39584985 Coutzzz A June 23, 2018, 11:59 p.m. OK Python 2 TESTS 76 109 0 1100
39582894 Carlson.Bimbuh A June 23, 2018, 9:23 p.m. OK Python 2 TESTS 76 109 0 1100
39636983 itsron143 A June 25, 2018, 3:26 a.m. OK Python 3 TESTS 76 77 0 1100
39607727 Alternation A June 24, 2018, 4:10 p.m. OK Python 3 TESTS 76 77 0 1100
39683301 neeleshsinha A June 26, 2018, 6:09 p.m. OK Python 3 TESTS 76 78 0 1100
39655449 malikpk02 A June 25, 2018, 4:48 p.m. OK Python 3 TESTS 76 78 0 1100
39648429 Saimon_ A June 25, 2018, 11:53 a.m. OK Python 3 TESTS 76 78 0 1100
39637754 Vasiliy_48 A June 25, 2018, 4:21 a.m. OK Python 3 TESTS 76 78 0 1100
39636557 AmanGupta_ A June 25, 2018, 2:57 a.m. OK Python 3 TESTS 76 78 0 1100
39599445 Rahul A June 24, 2018, 10:53 a.m. OK Python 3 TESTS 76 78 0 1100
39594801 umangnangal A June 24, 2018, 8:09 a.m. OK Python 3 TESTS 76 78 0 1100
39592610 Fan_Of_The_Secret_Annex A June 24, 2018, 6:52 a.m. OK Python 3 TESTS 76 78 0 1100
46025536 xw19 A Nov. 21, 2018, 11 a.m. OK Ruby TESTS 76 62 0 1100
41669058 betrue12 A Aug. 17, 2018, 3:04 a.m. OK Ruby TESTS 76 62 102400 1100
39702386 cielavenir A June 27, 2018, 1:11 p.m. OK Ruby TESTS 76 77 0 1100
39568511 pifagor97 A June 23, 2018, 4:43 p.m. OK Scala TESTS 76 545 0 1100
39565219 math_botan A June 23, 2018, 4:28 p.m. OK Scala TESTS 76 561 0 1100

remove filters

Back to search problems