Codeforces Round 501 (Div. 3)

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
1015 Codeforces Round 501 (Div. 3) FINISHED False 7200 198775499 July 31, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8247 ) D Walking Between Houses PROGRAMMING constructive algorithms greedy 1600

B'There are n houses in a row. They are numbered from 1 to n in order from left to right. Initially you are in the house 1 . You have to perform k moves to other house. In one move you go from your current house to some other house. You can 't stay where you are (i.e., in each move the new house differs from the current house). If you go from the house x to the house y , the total distance you walked increases by |x-y| units of distance, where |a| is the absolute value of a . It is possible to visit the same house multiple times (but you can 't visit the same house in sequence). Your goal is to walk exactly s units of distance in total. If it is impossible, print "NO". Otherwise print "YES" and any of the ways to do that. Remember that you should do exactly k moves. The first line of the input contains three integers n , k , s ( 2 <= n <= 10^9 , 1 <= k <= 2 cdot 10^5 , 1 <= s <= 10^{18} ) -- the number of houses, the number of moves and the total distance you want to walk. If you cannot perform k moves with total walking distance equal to s , print "NO". Otherwise print "YES" on the first line and then print exactly k integers h_i ( 1 <= h_i <= n ) on the second line, where h_i is the house you visit on the i -th move. For each j from 1 to k-1 the following condition should be satisfied: h_j ne h_{j + 1} . Also h_1 ne 1 should be satisfied. '...

Tutorials

60949

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
41173654 rr_ D Aug. 3, 2018, 3:38 p.m. OK D TESTS 69 62 4198400 1600
41195676 TSFH D Aug. 4, 2018, 12:44 a.m. OK FPC TESTS 69 373 0 1600
41140511 chinahhy D Aug. 3, 2018, 2:28 a.m. OK FPC TESTS 69 405 0 1600
41199436 BattleCry D Aug. 4, 2018, 4:08 a.m. OK FPC TESTS 69 405 0 1600
41138626 Asurudo D Aug. 3, 2018, 12:29 a.m. OK GNU C TESTS 69 46 0 1600
41156274 RenKai_Z D Aug. 3, 2018, 12:26 p.m. OK GNU C TESTS 69 61 0 1600
41132333 linesekarenge D Aug. 2, 2018, 6:11 p.m. OK GNU C TESTS 69 61 0 1600
41513293 supremeyu D Aug. 12, 2018, 3:59 a.m. OK GNU C TESTS 69 61 0 1600
41217001 d.j6082013 D Aug. 4, 2018, 1:29 p.m. OK GNU C TESTS 69 62 0 1600
41133774 linesekarenge D Aug. 2, 2018, 7:08 p.m. OK GNU C TESTS 69 62 0 1600
41133074 linesekarenge D Aug. 2, 2018, 6:42 p.m. OK GNU C TESTS 69 62 0 1600
41240545 Scut82 D Aug. 5, 2018, 10 a.m. OK GNU C++ TESTS 69 31 3584000 1600
41197648 sdibt3 D Aug. 4, 2018, 2:37 a.m. OK GNU C++ TESTS 69 46 0 1600
41124718 luogu_bot1 D Aug. 2, 2018, 1:43 p.m. OK GNU C++ TESTS 69 46 0 1600
41329449 sjc_fan D Aug. 8, 2018, 7:51 a.m. OK GNU C++ TESTS 69 46 307200 1600
41116510 ynyuje D Aug. 2, 2018, 9:15 a.m. OK GNU C++ TESTS 69 46 307200 1600
41113874 swunHJ D Aug. 2, 2018, 8:03 a.m. OK GNU C++ TESTS 69 46 307200 1600
41240101 Scut82 D Aug. 5, 2018, 9:40 a.m. OK GNU C++ TESTS 69 46 1740800 1600
41616780 jk17211754 D Aug. 15, 2018, 9:42 a.m. OK GNU C++ TESTS 69 61 0 1600
41284495 iris001999 D Aug. 6, 2018, 6:45 p.m. OK GNU C++ TESTS 69 61 0 1600
41282937 NadimM D Aug. 6, 2018, 5:40 p.m. OK GNU C++ TESTS 69 61 0 1600
41103739 Na.viD D Aug. 2, 2018, 2:39 a.m. OK GNU C11 TESTS 69 1668 4812800 1600
55235849 Umi D June 7, 2019, 8:24 a.m. OK GNU C++11 TESTS 69 31 3174400 1600
61260122 vincentviktor D Sept. 25, 2019, 11:22 a.m. OK GNU C++11 TESTS 69 46 0 1600
59905080 nwpu2018302329 D Sept. 2, 2019, 3:02 p.m. OK GNU C++11 TESTS 69 46 0 1600
58183865 BDFCL D Aug. 2, 2019, 4:18 p.m. OK GNU C++11 TESTS 69 46 0 1600
55994101 julianfernando D June 24, 2019, 9:19 a.m. OK GNU C++11 TESTS 69 46 0 1600
55088034 vjudge1 D June 4, 2019, 1:21 p.m. OK GNU C++11 TESTS 69 46 0 1600
67586856 trueBatty D Dec. 25, 2019, 8:37 a.m. OK GNU C++11 TESTS 69 46 0 1600
53725586 guaguastandup D May 4, 2019, 4 a.m. OK GNU C++11 TESTS 69 46 0 1600
53295241 WinstonWolf D April 25, 2019, 5:19 p.m. OK GNU C++11 TESTS 69 46 0 1600
55087078 vjudge2 D June 4, 2019, 12:58 p.m. OK GNU C++11 TESTS 69 46 0 1600
41152481 mohammad_heydari D Aug. 3, 2018, 9:42 a.m. OK GNU C++14 TESTS 69 31 307200 1600
41995248 Devani_OO7 D Aug. 23, 2018, 11:43 a.m. OK GNU C++14 TESTS 69 31 819200 1600
69296914 Dustin_78989 D Jan. 22, 2020, 12:33 p.m. OK GNU C++14 TESTS 69 46 0 1600
69198175 udit19 D Jan. 20, 2020, 3:35 p.m. OK GNU C++14 TESTS 69 46 0 1600
68462368 Messiah_10 D Jan. 9, 2020, 6:34 p.m. OK GNU C++14 TESTS 69 46 0 1600
67071290 vjudge4 D Dec. 17, 2019, 12:52 p.m. OK GNU C++14 TESTS 69 46 0 1600
66592437 Hyado D Dec. 10, 2019, 1:27 p.m. OK GNU C++14 TESTS 69 46 0 1600
66581306 bayashiko D Dec. 10, 2019, 9:30 a.m. OK GNU C++14 TESTS 69 46 0 1600
66484149 _HonEy D Dec. 8, 2019, 5:18 a.m. OK GNU C++14 TESTS 69 46 0 1600
66381929 _-_11 D Dec. 6, 2019, 5:58 a.m. OK GNU C++14 TESTS 69 46 0 1600
62686591 Soapen D Oct. 16, 2019, 2:14 p.m. OK GNU C++17 TESTS 69 31 0 1600
69473107 rajan_keshari D Jan. 24, 2020, 3:13 p.m. OK GNU C++17 TESTS 69 46 0 1600
69065210 animesh.ab99 D Jan. 18, 2020, 6:18 p.m. OK GNU C++17 TESTS 69 46 0 1600
68657783 manovik18 D Jan. 12, 2020, 12:44 p.m. OK GNU C++17 TESTS 69 46 0 1600
67498748 hdsingh D Dec. 24, 2019, 2:26 a.m. OK GNU C++17 TESTS 69 46 0 1600
67429495 KingInTheNorth_ D Dec. 22, 2019, 2:43 p.m. OK GNU C++17 TESTS 69 46 0 1600
67048461 vjudge5 D Dec. 17, 2019, 1:43 a.m. OK GNU C++17 TESTS 69 46 0 1600
67019307 vjudge2 D Dec. 16, 2019, 12:28 p.m. OK GNU C++17 TESTS 69 46 0 1600
66189768 alif_cse_ju D Dec. 2, 2019, 3:57 p.m. OK GNU C++17 TESTS 69 46 0 1600
69667547 nihal_47 D Jan. 28, 2020, 11:54 a.m. OK GNU C++17 TESTS 69 46 0 1600
41629983 synapse D Aug. 15, 2018, 5:20 p.m. OK Go TESTS 69 62 1331200 1600
41527744 tusupov D Aug. 12, 2018, 12:53 p.m. OK Go TESTS 69 62 1331200 1600
69670997 GiantTornado D Jan. 28, 2020, 12:59 p.m. OK Java 11 TESTS 69 202 0 1600
66203675 Agnimandur D Dec. 2, 2019, 11:51 p.m. OK Java 8 TESTS 69 109 0 1600
49313484 Mackenzie D Feb. 1, 2019, 9:10 a.m. OK Java 8 TESTS 69 124 0 1600
67991437 AnandOza D Dec. 31, 2019, 5:11 a.m. OK Java 8 TESTS 69 124 2662400 1600
55948413 the41 D June 22, 2019, 9:58 p.m. OK Java 8 TESTS 69 124 2764800 1600
66256378 bluesky111 D Dec. 4, 2019, 6:10 a.m. OK Java 8 TESTS 69 124 3174400 1600
67042967 Ziklon D Dec. 16, 2019, 8:14 p.m. OK Java 8 TESTS 69 139 0 1600
55533956 Hemose D June 13, 2019, 3:14 p.m. OK Java 8 TESTS 69 139 0 1600
55533034 TheSawan D June 13, 2019, 2:41 p.m. OK Java 8 TESTS 69 139 0 1600
46426427 YahiaBadr D Dec. 1, 2018, 12:46 a.m. OK Java 8 TESTS 69 139 0 1600
53855549 TWO_POINTER D May 7, 2019, 3:57 p.m. OK Java 8 TESTS 69 139 614400 1600
41632948 Mosyagin D Aug. 15, 2018, 7:48 p.m. OK Mono C# TESTS 69 77 12185600 1600
56506553 og.kostya D July 4, 2019, 8:41 a.m. OK Mono C# TESTS 69 93 3072000 1600
41569563 AlexBlade D Aug. 13, 2018, 8:08 p.m. OK Mono C# TESTS 69 452 3072000 1600
41569611 AlexBlade D Aug. 13, 2018, 8:10 p.m. OK Mono C# TESTS 69 452 7065600 1600
41569591 AlexBlade D Aug. 13, 2018, 8:10 p.m. OK Mono C# TESTS 69 483 7270400 1600
41138643 jainchethan87 D Aug. 3, 2018, 12:31 a.m. OK Mono C# TESTS 69 514 3072000 1600
41683060 n.a.borisov D Aug. 17, 2018, 12:17 p.m. OK Mono C# TESTS 69 514 3072000 1600
44739150 NEvOl D Oct. 23, 2018, 1:57 p.m. OK Mono C# TESTS 69 686 10854400 1600
42121403 TrinidadTobago D Aug. 26, 2018, 12:41 p.m. OK Mono C# TESTS 69 872 3072000 1600
44939127 XRDS-BJFU101 D Oct. 27, 2018, 6:57 a.m. OK MS C++ TESTS 69 46 0 1600
49528722 vjudge2 D Feb. 6, 2019, 12:49 p.m. OK MS C++ TESTS 69 46 0 1600
54784787 vjudge2 D May 29, 2019, 2:48 a.m. OK MS C++ TESTS 69 46 0 1600
44531025 vjudge1 D Oct. 19, 2018, 6:31 a.m. OK MS C++ TESTS 69 61 0 1600
49527825 vjudge1 D Feb. 6, 2019, 12:22 p.m. OK MS C++ TESTS 69 61 0 1600
47298043 vjudge1 D Dec. 20, 2018, 12:56 p.m. OK MS C++ TESTS 69 61 0 1600
45864013 vjudge5 D Nov. 17, 2018, 7:18 a.m. OK MS C++ TESTS 69 62 0 1600
49530176 vjudge5 D Feb. 6, 2019, 1:28 p.m. OK MS C++ TESTS 69 62 0 1600
49528895 vjudge1 D Feb. 6, 2019, 12:54 p.m. OK MS C++ TESTS 69 62 0 1600
48959836 vjudge4 D Jan. 26, 2019, 6:07 a.m. OK MS C++ TESTS 69 62 0 1600
54785356 lantianbaiyun D May 29, 2019, 3:20 a.m. OK MS C++ 2017 TESTS 69 62 0 1600
55522434 hwangganzi D June 13, 2019, 9:16 a.m. OK MS C++ 2017 TESTS 69 62 0 1600
54785569 sikly D May 29, 2019, 3:33 a.m. OK MS C++ 2017 TESTS 69 62 1638400 1600
54980109 Skeef79 D June 2, 2019, 12:44 p.m. OK MS C++ 2017 TESTS 69 124 0 1600
57888991 Still_Theory D July 28, 2019, 11:07 a.m. OK MS C++ 2017 TESTS 69 140 0 1600
63080216 onkrot D Oct. 21, 2019, 2:53 p.m. OK MS C++ 2017 TESTS 69 140 0 1600
68484741 bread333 D Jan. 10, 2020, 9:13 a.m. OK MS C++ 2017 TESTS 69 140 307200 1600
63219631 tanimania D Oct. 23, 2019, 7:30 a.m. OK MS C++ 2017 TESTS 69 140 3788800 1600
61410011 NAD777 D Sept. 28, 2019, 8:22 a.m. OK MS C++ 2017 TESTS 69 140 4915200 1600
58403485 yorky D Aug. 6, 2019, 7:04 p.m. OK MS C++ 2017 TESTS 69 155 2764800 1600
45624724 KGYYT D Nov. 12, 2018, 4:10 p.m. OK PascalABC.NET TESTS 69 1201 2969600 1600
45286262 GrimGutz D Nov. 4, 2018, 4:52 p.m. OK PascalABC.NET TESTS 69 1248 2969600 1600
50995223 pajenegod D March 8, 2019, 3:05 a.m. OK PyPy 2 TESTS 69 140 3584000 1600
54823486 Mukundan314 D May 30, 2019, 4:59 a.m. OK PyPy 2 TESTS 69 140 7065600 1600
45435804 c1729 D Nov. 8, 2018, 7:51 a.m. OK PyPy 2 TESTS 69 170 13721600 1600
45436187 c1729 D Nov. 8, 2018, 8:06 a.m. OK PyPy 2 TESTS 69 186 10137600 1600
45435421 c1729 D Nov. 8, 2018, 7:37 a.m. OK PyPy 2 TESTS 69 202 10137600 1600
41284274 kd710306 D Aug. 6, 2018, 6:35 p.m. OK PyPy 2 TESTS 69 1481 2150400 1600
42452614 morejarphone D Sept. 4, 2018, 9:09 a.m. OK PyPy 2 TESTS 69 1497 12288000 1600
41145198 arikpamnani D Aug. 3, 2018, 6:12 a.m. OK PyPy 2 TESTS 69 1512 14233600 1600
56400391 soumyasarkar1998 D July 1, 2019, 4:34 p.m. OK PyPy 2 TESTS 69 1996 2150400 1600
45436419 c1729 D Nov. 8, 2018, 8:14 a.m. OK PyPy 3 TESTS 69 217 13619200 1600
42493810 wadissimo D Sept. 5, 2018, 1:23 p.m. OK PyPy 3 TESTS 69 249 19558400 1600
45460521 omarnvidia D Nov. 9, 2018, 12:29 a.m. OK PyPy 3 TESTS 69 264 10956800 1600
69877699 Katushechka D Jan. 31, 2020, 4:57 a.m. OK PyPy 3 TESTS 69 280 13312000 1600
62065774 deadguy D Oct. 7, 2019, 3:10 p.m. OK PyPy 3 TESTS 69 296 13209600 1600
46128546 cgfs10000 D Nov. 23, 2018, 9:05 p.m. OK PyPy 3 TESTS 69 311 17715200 1600
56558473 koptev D July 5, 2019, 1:35 p.m. OK PyPy 3 TESTS 69 326 9420800 1600
66673895 vdv09 D Dec. 12, 2019, 10:30 a.m. OK PyPy 3 TESTS 69 327 9113600 1600
47506927 TurningTables D Dec. 26, 2018, 1:52 a.m. OK PyPy 3 TESTS 69 342 7884800 1600
44722943 D_J_Z D Oct. 23, 2018, 6:26 a.m. OK PyPy 3 TESTS 69 342 8294400 1600
41102846 wangkan2001 D Aug. 2, 2018, 2:07 a.m. OK Python 2 TESTS 69 187 7065600 1600
41099097 lisztfan D Aug. 1, 2018, 10:53 p.m. OK Python 2 TESTS 69 327 5836800 1600
41146210 rakshak197 D Aug. 3, 2018, 6:41 a.m. OK Python 2 TESTS 69 342 0 1600
41115883 franckmy D Aug. 2, 2018, 8:58 a.m. OK Python 2 TESTS 69 343 0 1600
41136178 nealzane D Aug. 2, 2018, 9:05 p.m. OK Python 2 TESTS 69 358 8089600 1600
41140974 sainitejeshwar D Aug. 3, 2018, 2:51 a.m. OK Python 2 TESTS 69 405 0 1600
41155453 SoSooding D Aug. 3, 2018, 11:52 a.m. OK Python 2 TESTS 69 436 3481600 1600
41126544 morassly D Aug. 2, 2018, 2:31 p.m. OK Python 2 TESTS 69 483 0 1600
41400628 tnowakow D Aug. 9, 2018, 1:26 p.m. OK Python 2 TESTS 69 483 2560000 1600
41137246 orailly D Aug. 2, 2018, 10:15 p.m. OK Python 3 TESTS 69 109 4403200 1600
41152620 serge854 D Aug. 3, 2018, 9:48 a.m. OK Python 3 TESTS 69 124 3788800 1600
41096482 sergovoy D Aug. 1, 2018, 7:58 p.m. OK Python 3 TESTS 69 171 11161600 1600
41382772 19194 D Aug. 9, 2018, 3:25 a.m. OK Python 3 TESTS 69 311 11468800 1600
41106454 EatYourBones D Aug. 2, 2018, 4:27 a.m. OK Python 3 TESTS 69 326 12390400 1600
45436342 c1729 D Nov. 8, 2018, 8:12 a.m. OK Python 3 TESTS 69 342 139980800 1600
67670000 vjudge2 D Dec. 26, 2019, 7:48 p.m. OK Python 3 TESTS 69 405 4505600 1600
67669906 CarlosBC14 D Dec. 26, 2019, 7:44 p.m. OK Python 3 TESTS 69 420 4198400 1600
41264861 kp1999 D Aug. 6, 2018, 6:26 a.m. OK Python 3 TESTS 69 420 20480000 1600
41283007 index_ D Aug. 6, 2018, 5:42 p.m. OK Python 3 TESTS 69 421 15769600 1600
41503026 clupasq D Aug. 11, 2018, 6:24 p.m. OK Ruby TESTS 69 218 3379200 1600
41149892 betrue12 D Aug. 3, 2018, 8:20 a.m. OK Ruby TESTS 69 280 3379200 1600
41657587 leoniduvk D Aug. 16, 2018, 3:45 p.m. OK Rust TESTS 69 93 0 1600
46396276 yakamoto D Nov. 30, 2018, 9:29 a.m. OK Scala TESTS 69 467 8908800 1600
46399567 yakamoto D Nov. 30, 2018, 11:37 a.m. OK Scala TESTS 69 483 9011200 1600

remove filters

Back to search problems