Codeforces Round 558 (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
1163 Codeforces Round 558 (Div. 2) FINISHED False 7200 174408899 May 9, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13031 ) A Eating Soup PROGRAMMING greedy math 1000

B'The three friends, Kuro, Shiro, and Katie, met up again! It 's time for a party... What the cats do when they unite? Right, they have a party. Since they wanted to have as much fun as possible, they invited all their friends. Now n cats are at the party, sitting in a circle and eating soup. The rules are simple: anyone having finished their soup leaves the circle. Katie suddenly notices that whenever a cat leaves, the place where she was sitting becomes an empty space, which means the circle is divided into smaller continuous groups of cats sitting next to each other. At the moment Katie observes, there are m cats who left the circle. This raises a question for Katie: what is the maximum possible number of groups the circle is divided into at the moment? Could you help her with this curiosity? You can see the examples and their descriptions with pictures in the "Note" section. The only line contains two integers n and m ( 2 <= q n <= q 1000 , 0 <= q m <= q n ) -- the initial number of cats at the party and the number of cats who left the circle at the moment Katie observes, respectively. Print a single integer -- the maximum number of groups of cats at the moment Katie observes. In the first example, originally there are 7 cats sitting as shown below, creating a single group: At the observed moment, 4 cats have left the table. Suppose the cats 2 , 3 , 5 and 7 have left, then there are 3 groups remaining. It is possible to show that it is the maximum possible number of groups remaining. In the second example, there are 6 cats sitting as shown below: At the observed moment, 2 cats have left the table. Suppose the cats numbered 3 and 6 left, then there will be 2 groups remaining ( {1, 2 } and {4, 5 } ). It is impossible to have more than 2 groups of cats remaining. In the third example, no cats have left, so there is 1 group consis'...

Tutorials

66943

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
64160356 maliao6 A Nov. 3, 2019, 2:17 p.m. OK Clang++17 Diagnostics TESTS 54 46 0 1000
54025090 Wqr_ A May 12, 2019, 12:06 p.m. OK Clang++17 Diagnostics TESTS 54 46 0 1000
61390412 vjudge3 A Sept. 27, 2019, 9:07 p.m. OK Clang++17 Diagnostics TESTS 54 46 0 1000
56308115 tm.gh803 A June 30, 2019, 1:07 p.m. OK Clang++17 Diagnostics TESTS 54 61 0 1000
53920610 iica A May 9, 2019, 4:02 p.m. OK D TESTS 54 31 102400 1000
53914335 Denor A May 9, 2019, 3:27 p.m. OK Delphi TESTS 54 31 0 1000
53917718 A_IGOR A May 9, 2019, 3:45 p.m. OK Delphi TESTS 54 31 0 1000
53960246 katyaabram A May 10, 2019, 1:46 p.m. OK FPC TESTS 54 31 0 1000
53973274 chinaxjh A May 11, 2019, 1:26 a.m. OK FPC TESTS 54 31 0 1000
60702272 minh04 A Sept. 17, 2019, 1:51 a.m. OK FPC TESTS 54 31 0 1000
53946629 bao-gpmn A May 10, 2019, 7:06 a.m. OK FPC TESTS 54 31 0 1000
53945902 ErwinRommel A May 10, 2019, 6:39 a.m. OK FPC TESTS 54 31 0 1000
53923636 StEpAn_123 A May 9, 2019, 4:21 p.m. OK FPC TESTS 54 31 0 1000
53959953 omlgg A May 10, 2019, 1:37 p.m. OK FPC TESTS 54 31 102400 1000
55302862 tuvidai2003 A June 8, 2019, 12:47 p.m. OK FPC TESTS 54 31 204800 1000
53966859 hoangphuc.qti A May 10, 2019, 5:40 p.m. OK FPC TESTS 54 31 204800 1000
53923910 giahung.nguyentrong A May 9, 2019, 4:23 p.m. OK FPC TESTS 54 31 307200 1000
53928723 Ky1 A May 9, 2019, 4:55 p.m. OK GNU C11 TESTS 54 30 0 1000
53931491 L_nai A May 9, 2019, 6:04 p.m. OK GNU C11 TESTS 54 30 0 1000
53935190 nightmare117 A May 9, 2019, 9:10 p.m. OK GNU C11 TESTS 54 30 0 1000
53949053 anjani_kumar_jangid A May 10, 2019, 8:29 a.m. OK GNU C11 TESTS 54 30 0 1000
53949949 anjani_kumar_jangid A May 10, 2019, 9 a.m. OK GNU C11 TESTS 54 30 0 1000
54372428 0x3A2B A May 19, 2019, 7:13 a.m. OK GNU C11 TESTS 54 30 0 1000
54457366 i_o__o_i A May 21, 2019, 4:36 p.m. OK GNU C11 TESTS 54 30 0 1000
54478212 rudro103863 A May 22, 2019, 9:37 a.m. OK GNU C11 TESTS 54 30 0 1000
54869022 0s_and_1s A May 31, 2019, 8:05 a.m. OK GNU C11 TESTS 54 30 0 1000
64078193 vjudge1 A Nov. 2, 2019, 9:22 a.m. OK GNU C11 TESTS 54 30 0 1000
53972811 xcxxcx A May 11, 2019, 12:49 a.m. OK GNU C++11 TESTS 54 30 0 1000
53976562 DepletedPrism A May 11, 2019, 4:33 a.m. OK GNU C++11 TESTS 54 30 0 1000
53994088 cavary_cl A May 11, 2019, 1:40 p.m. OK GNU C++11 TESTS 54 30 0 1000
54001509 MeeraJ A May 11, 2019, 4:38 p.m. OK GNU C++11 TESTS 54 30 0 1000
54007286 Doaaismael A May 11, 2019, 9:06 p.m. OK GNU C++11 TESTS 54 30 0 1000
54408346 andrix007 A May 20, 2019, 8:01 a.m. OK GNU C++11 TESTS 54 30 0 1000
54487164 bakpark A May 22, 2019, 1:40 p.m. OK GNU C++11 TESTS 54 30 0 1000
55478354 csj A June 12, 2019, 2:46 a.m. OK GNU C++11 TESTS 54 30 0 1000
57475343 Maruf_Hasan1789 A July 21, 2019, 9:03 p.m. OK GNU C++11 TESTS 54 30 0 1000
65659755 sd_pt A Nov. 24, 2019, 11:54 a.m. OK GNU C++11 TESTS 54 30 0 1000
54094066 coder7867 A May 14, 2019, 12:15 p.m. OK GNU C++14 TESTS 54 15 0 1000
67605062 pretending A Dec. 25, 2019, 1:17 p.m. OK GNU C++14 TESTS 54 15 0 1000
58254646 Atlas17 A Aug. 4, 2019, 9:25 a.m. OK GNU C++14 TESTS 54 15 0 1000
56234152 Huisung A June 28, 2019, 3:27 p.m. OK GNU C++14 TESTS 54 15 0 1000
55564966 vjudge5 A June 14, 2019, 2:52 p.m. OK GNU C++14 TESTS 54 15 0 1000
55320347 hiiamphi A June 9, 2019, 3:52 a.m. OK GNU C++14 TESTS 54 15 0 1000
54989312 aaj_ni_maanta_bhai A June 2, 2019, 5:39 p.m. OK GNU C++14 TESTS 54 15 0 1000
54597721 BlueHazard_rony A May 25, 2019, 9:09 a.m. OK GNU C++14 TESTS 54 15 0 1000
54082441 Rothi A May 14, 2019, 4:41 a.m. OK GNU C++14 TESTS 54 15 0 1000
54064839 singhkanishk7777 A May 13, 2019, 12:55 p.m. OK GNU C++14 TESTS 54 15 0 1000
55070063 tarachand A June 4, 2019, 5:52 a.m. OK GNU C++17 TESTS 54 15 0 1000
55309551 H0ssein A June 8, 2019, 4:41 p.m. OK GNU C++17 TESTS 54 15 0 1000
55677454 diananiki A June 17, 2019, 11:15 a.m. OK GNU C++17 TESTS 54 15 0 1000
56013566 shobhit907 A June 24, 2019, 7:31 p.m. OK GNU C++17 TESTS 54 15 0 1000
56256503 pdp0911 A June 29, 2019, 6:20 a.m. OK GNU C++17 TESTS 54 15 0 1000
56477046 PiyushGupta A July 3, 2019, 1:36 p.m. OK GNU C++17 TESTS 54 15 0 1000
59207228 npgnghi2003 A Aug. 21, 2019, 7:21 a.m. OK GNU C++17 TESTS 54 15 0 1000
59610490 yash_arora1313 A Aug. 28, 2019, 10:43 a.m. OK GNU C++17 TESTS 54 15 0 1000
62092385 elyutin159164 A Oct. 8, 2019, 6:20 a.m. OK GNU C++17 TESTS 54 15 0 1000
65292635 ioana678 A Nov. 18, 2019, 10:21 a.m. OK GNU C++17 TESTS 54 15 0 1000
62655217 120405217 A Oct. 16, 2019, 12:53 a.m. OK Go TESTS 54 31 0 1000
55981293 Andreeha A June 23, 2019, 9:21 p.m. OK Go TESTS 54 31 0 1000
54481439 tony_stark1 A May 22, 2019, 11:13 a.m. OK Go TESTS 54 31 0 1000
53996132 wilcot A May 11, 2019, 2:42 p.m. OK Go TESTS 54 31 0 1000
53946674 Lancern A May 10, 2019, 7:07 a.m. OK Go TESTS 54 31 0 1000
59594448 sighduck A Aug. 28, 2019, 12:01 a.m. OK Go TESTS 54 46 0 1000
54013578 shopnobaj_raju A May 12, 2019, 4:55 a.m. OK Go TESTS 54 46 0 1000
53947194 mayank1601 A May 10, 2019, 7:27 a.m. OK Go TESTS 54 46 0 1000
54371976 code_report A May 19, 2019, 6:59 a.m. OK Haskell TESTS 54 31 102400 1000
54913359 mihassan A June 1, 2019, 12:22 p.m. OK Haskell TESTS 54 46 102400 1000
54026711 aberent A May 12, 2019, 1:04 p.m. OK Haskell TESTS 54 46 102400 1000
53948232 Laurens A May 10, 2019, 8:03 a.m. OK Haskell TESTS 54 46 102400 1000
68153236 cribabby A Jan. 4, 2020, 7:49 a.m. OK Java 11 TESTS 54 171 0 1000
68888847 TruaTheOrca A Jan. 16, 2020, 12:41 a.m. OK Java 11 TESTS 54 202 0 1000
53961483 avenio99 A May 10, 2019, 2:29 p.m. OK Java 8 TESTS 54 108 0 1000
65056436 zekigurbuz A Nov. 15, 2019, 3:18 p.m. OK Java 8 TESTS 54 109 0 1000
61286403 formalist A Sept. 25, 2019, 6:38 p.m. OK Java 8 TESTS 54 109 0 1000
60295364 insane_28 A Sept. 9, 2019, 9:43 a.m. OK Java 8 TESTS 54 109 0 1000
58555677 vvenkai A Aug. 11, 2019, 1:34 a.m. OK Java 8 TESTS 54 109 0 1000
58226511 Bhavya_Arora A Aug. 3, 2019, 2:41 p.m. OK Java 8 TESTS 54 109 0 1000
57089175 Jarik A July 15, 2019, 10:04 a.m. OK Java 8 TESTS 54 109 0 1000
56995554 Shivam_72 A July 13, 2019, 9:48 p.m. OK Java 8 TESTS 54 109 0 1000
56995415 Shivam_72 A July 13, 2019, 9:39 p.m. OK Java 8 TESTS 54 109 0 1000
56739230 Garett A July 9, 2019, 6:54 a.m. OK Java 8 TESTS 54 109 0 1000
54003300 NguyenHungCuong A May 11, 2019, 5:52 p.m. OK JavaScript TESTS 54 31 0 1000
53956556 renton4code A May 10, 2019, 12:08 p.m. OK JavaScript TESTS 54 31 0 1000
53918292 smartful A May 9, 2019, 3:49 p.m. OK JavaScript TESTS 54 62 0 1000
56453251 I.A.K.O.V A July 3, 2019, 1:29 a.m. OK Kotlin TESTS 54 139 0 1000
54045428 -arg A May 12, 2019, 4:30 p.m. OK Kotlin TESTS 54 139 0 1000
56453124 I.A.K.O.V A July 3, 2019, 1:22 a.m. OK Kotlin TESTS 54 140 0 1000
53965211 CauchyRiemann A May 10, 2019, 4:32 p.m. OK Kotlin TESTS 54 140 0 1000
56185060 Spheniscine A June 28, 2019, 4 a.m. OK Kotlin TESTS 54 140 102400 1000
53997367 mtjones330 A May 11, 2019, 3:18 p.m. OK Kotlin TESTS 54 140 102400 1000
54633905 astro_lion A May 25, 2019, 3:54 p.m. OK Kotlin TESTS 54 155 102400 1000
53997431 mtjones330 A May 11, 2019, 3:20 p.m. OK Kotlin TESTS 54 155 102400 1000
53996560 mtjones330 A May 11, 2019, 2:55 p.m. OK Kotlin TESTS 54 155 102400 1000
56453172 I.A.K.O.V A July 3, 2019, 1:24 a.m. OK Kotlin TESTS 54 171 0 1000
60081700 ansergeyg A Sept. 5, 2019, 2:16 p.m. OK Mono C# TESTS 54 46 0 1000
54006425 Tatonka A May 11, 2019, 8:25 p.m. OK Mono C# TESTS 54 46 0 1000
54865473 og.kostya A May 31, 2019, 5:52 a.m. OK Mono C# TESTS 54 46 0 1000
53915615 gaozqxin A May 9, 2019, 3:34 p.m. OK Mono C# TESTS 54 46 0 1000
53915648 Ruban_Denic A May 9, 2019, 3:34 p.m. OK Mono C# TESTS 54 46 0 1000
53918122 east89 A May 9, 2019, 3:48 p.m. OK Mono C# TESTS 54 46 0 1000
54262645 bertalay A May 17, 2019, 3:20 a.m. OK Mono C# TESTS 54 61 0 1000
54210280 jayed.al.hasan A May 15, 2019, 5:08 p.m. OK Mono C# TESTS 54 61 0 1000
54057437 lewasupaman LapsleyJuno SaurumanS A May 13, 2019, 9:10 a.m. OK Mono C# TESTS 54 62 0 1000
54141063 m1_k3 A May 14, 2019, 5:43 p.m. OK Mono C# TESTS 54 62 0 1000
53941340 yznl A May 10, 2019, 3:16 a.m. OK MS C++ TESTS 54 30 0 1000
63982467 vjudge4 A Nov. 1, 2019, 10:45 a.m. OK MS C++ TESTS 54 31 0 1000
66252121 vjudge1 A Dec. 4, 2019, 2:54 a.m. OK MS C++ TESTS 54 31 0 1000
66209559 vjudge2 A Dec. 3, 2019, 5:54 a.m. OK MS C++ TESTS 54 31 0 1000
64795666 vjudge1 A Nov. 13, 2019, 12:48 p.m. OK MS C++ TESTS 54 31 0 1000
64794109 vjudge3 A Nov. 13, 2019, 12:17 p.m. OK MS C++ TESTS 54 31 0 1000
64793454 vjudge4 A Nov. 13, 2019, 12:03 p.m. OK MS C++ TESTS 54 31 0 1000
64553471 vjudge3 A Nov. 9, 2019, 1:47 a.m. OK MS C++ TESTS 54 31 0 1000
64515157 vjudge5 A Nov. 8, 2019, 10:26 a.m. OK MS C++ TESTS 54 31 0 1000
63998655 vjudge5 A Nov. 1, 2019, 2:44 p.m. OK MS C++ TESTS 54 31 0 1000
54983401 Atlasmoth A June 2, 2019, 2:22 p.m. OK MS C++ 2017 TESTS 54 30 0 1000
62313652 Ketovdk A Oct. 10, 2019, 2:37 p.m. OK MS C++ 2017 TESTS 54 31 0 1000
63936080 vjudge5 A Oct. 31, 2019, 3:53 p.m. OK MS C++ 2017 TESTS 54 31 0 1000
63940574 vjudge1 A Oct. 31, 2019, 5:20 p.m. OK MS C++ 2017 TESTS 54 31 0 1000
63942947 vjudge4 A Oct. 31, 2019, 6 p.m. OK MS C++ 2017 TESTS 54 31 0 1000
62159123 Moen1578 A Oct. 8, 2019, 5:40 p.m. OK MS C++ 2017 TESTS 54 31 0 1000
64554763 vjudge1 A Nov. 9, 2019, 2:48 a.m. OK MS C++ 2017 TESTS 54 31 0 1000
64791264 vjudge3 A Nov. 13, 2019, 11:17 a.m. OK MS C++ 2017 TESTS 54 31 0 1000
64795715 vjudge5 A Nov. 13, 2019, 12:49 p.m. OK MS C++ 2017 TESTS 54 31 0 1000
63955864 vjudge1 A Nov. 1, 2019, 1:27 a.m. OK MS C++ 2017 TESTS 54 31 0 1000
66557465 hirens A Dec. 9, 2019, 5:26 p.m. OK Node.js TESTS 54 171 409600 1000
53919220 Pasha2208 A May 9, 2019, 3:54 p.m. OK PascalABC.NET TESTS 54 202 0 1000
56529007 Gimber A July 4, 2019, 6:37 p.m. OK PascalABC.NET TESTS 54 202 0 1000
53949012 ProVolodya A May 10, 2019, 8:28 a.m. OK PascalABC.NET TESTS 54 311 102400 1000
53933858 Houy3 A May 9, 2019, 8:08 p.m. OK PascalABC.NET TESTS 54 311 102400 1000
54863172 Kennyvova A May 31, 2019, 4:11 a.m. OK PHP TESTS 54 46 0 1000
54051989 Eimaen A May 12, 2019, 9:19 p.m. OK PHP TESTS 54 46 0 1000
53945150 Priyank A May 10, 2019, 6:11 a.m. OK PHP TESTS 54 46 0 1000
55529821 mayakin A June 13, 2019, 1 p.m. OK PHP TESTS 54 46 409600 1000
54065780 lostamok A May 13, 2019, 1:22 p.m. OK PHP TESTS 54 46 512000 1000
54245982 nds92 A May 16, 2019, 2:55 p.m. OK PHP TESTS 54 46 512000 1000
54168046 smunjal96 A May 15, 2019, 9:35 a.m. OK PyPy 2 TESTS 54 124 0 1000
54573997 jolt.tks A May 24, 2019, 9:39 p.m. OK PyPy 2 TESTS 54 124 0 1000
54412515 kaif_7 A May 20, 2019, 10:43 a.m. OK PyPy 2 TESTS 54 124 0 1000
53936115 pedrosorio A May 9, 2019, 9:52 p.m. OK PyPy 2 TESTS 54 124 0 1000
53934049 masonsbro A May 9, 2019, 8:15 p.m. OK PyPy 2 TESTS 54 124 0 1000
53932098 kbagoli1999 A May 9, 2019, 6:37 p.m. OK PyPy 2 TESTS 54 124 0 1000
53913361 ilkerkosaroglu A May 9, 2019, 3:23 p.m. OK PyPy 2 TESTS 54 124 0 1000
53931542 kbagoli1999 A May 9, 2019, 6:06 p.m. OK PyPy 2 TESTS 54 139 0 1000
53913856 torabey A May 9, 2019, 3:25 p.m. OK PyPy 2 TESTS 54 139 0 1000
66249528 Darkjeton A Dec. 3, 2019, 11:54 p.m. OK PyPy 2 TESTS 54 140 0 1000
55239270 ragibshahriar2002 A June 7, 2019, 10:01 a.m. OK PyPy 3 TESTS 54 124 0 1000
54653645 Aidos A May 26, 2019, 7 a.m. OK PyPy 3 TESTS 54 124 0 1000
54375304 kdao A May 19, 2019, 8:30 a.m. OK PyPy 3 TESTS 54 124 0 1000
54168599 MEJlAHXOJluK A May 15, 2019, 9:51 a.m. OK PyPy 3 TESTS 54 124 0 1000
54027260 michael.dotsenko A May 12, 2019, 1:26 p.m. OK PyPy 3 TESTS 54 124 0 1000
53972929 nealzane A May 11, 2019, 1:01 a.m. OK PyPy 3 TESTS 54 124 0 1000
58457615 SarveshDubey A Aug. 7, 2019, 4:36 p.m. OK PyPy 3 TESTS 54 139 0 1000
56259443 camelliashelly A June 29, 2019, 7:29 a.m. OK PyPy 3 TESTS 54 139 0 1000
55542303 sonhuytranpython2 A June 13, 2019, 8:55 p.m. OK PyPy 3 TESTS 54 139 0 1000
54017257 SHOVON588 A May 12, 2019, 7:32 a.m. OK PyPy 3 TESTS 54 139 0 1000
53983863 abhishek.chomal A May 11, 2019, 8:35 a.m. OK Python 2 TESTS 54 156 0 1000
54912852 vrittikabagadia A June 1, 2019, 12:05 p.m. OK Python 2 TESTS 54 171 0 1000
54410717 pein_7 A May 20, 2019, 9:32 a.m. OK Python 2 TESTS 54 171 0 1000
54058219 29029 A May 13, 2019, 9:37 a.m. OK Python 2 TESTS 54 171 0 1000
53994784 ShashankGoel.IITD A May 11, 2019, 2 p.m. OK Python 2 TESTS 54 171 0 1000
53967432 cioba.catalin A May 10, 2019, 6:16 p.m. OK Python 2 TESTS 54 171 0 1000
53936370 amidenf A May 9, 2019, 10:05 p.m. OK Python 2 TESTS 54 171 0 1000
53945028 itsme297 A May 10, 2019, 6:06 a.m. OK Python 2 TESTS 54 186 0 1000
53941981 phoenix28 A May 10, 2019, 3:49 a.m. OK Python 2 TESTS 54 186 0 1000
53931544 bothering A May 9, 2019, 6:06 p.m. OK Python 2 TESTS 54 186 0 1000
68982995 cs1g A Jan. 17, 2020, 11:27 a.m. OK Python 3 TESTS 54 108 0 1000
54343994 vamshiyenreddy616 A May 18, 2019, 11:35 a.m. OK Python 3 TESTS 54 108 0 1000
54210203 meme_lord A May 15, 2019, 5:06 p.m. OK Python 3 TESTS 54 108 0 1000
53983075 noob_wins A May 11, 2019, 8:12 a.m. OK Python 3 TESTS 54 108 0 1000
53965991 dipterix A May 10, 2019, 5:02 p.m. OK Python 3 TESTS 54 108 0 1000
53959246 levan.bejanidze.1 A May 10, 2019, 1:17 p.m. OK Python 3 TESTS 54 108 0 1000
53940069 PrimeG A May 10, 2019, 2:08 a.m. OK Python 3 TESTS 54 108 0 1000
67664549 sureshsinghspd A Dec. 26, 2019, 5:15 p.m. OK Python 3 TESTS 54 109 0 1000
64891927 secretlearner.68 A Nov. 14, 2019, 3:01 p.m. OK Python 3 TESTS 54 109 0 1000
61842549 _lucifer_ A Oct. 4, 2019, 10:12 a.m. OK Python 3 TESTS 54 109 0 1000
53931867 andreig A May 9, 2019, 6:23 p.m. OK Ruby TESTS 54 77 204800 1000
53933518 Alsophila A May 9, 2019, 7:56 p.m. OK Ruby TESTS 54 77 409600 1000
59191156 sansen A Aug. 20, 2019, 9:15 p.m. OK Rust TESTS 54 31 0 1000
53913829 Budstalion A May 9, 2019, 3:25 p.m. OK Scala TESTS 54 451 0 1000
53914121 nafeezabrar A May 9, 2019, 3:26 p.m. OK Scala TESTS 54 452 0 1000
53916238 SID_ A May 9, 2019, 3:37 p.m. OK Scala TESTS 54 483 0 1000

remove filters

Back to search problems