Codeforces Round 166 (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
271 Codeforces Round 166 (Div. 2) FINISHED False 7200 377101797 Feb. 11, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3010 ) C Secret PROGRAMMING constructive algorithms implementation 1500

B'The Greatest Secret Ever consists of n words, indexed by positive integers from 1 to n. The secret needs dividing between k Keepers (let 's index them by positive integers from 1 to k), the i-th Keeper gets a non-empty set of words with numbers from the set Ui xe2 x80 x89= xe2 x80 x89(ui, xe2 x80 x891, xe2 x80 x89ui, xe2 x80 x892, xe2 x80 x89..., xe2 x80 x89ui, xe2 x80 x89|Ui|). Here and below we 'll presuppose that the set elements are written in the increasing order. We 'll say that the secret is safe if the following conditions are hold: Let us remind you that the elements of set (u1, xe2 x80 x89u2, xe2 x80 x89..., xe2 x80 x89us) form an arithmetic progression if there is such number d, that for all i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89< xe2 x80 x89s) fulfills ui xe2 x80 x89+ xe2 x80 x89d xe2 x80 x89= xe2 x80 x89ui xe2 x80 x89+ xe2 x80 x891. For example, the elements of sets (5), (1, xe2 x80 x8910) and (1, xe2 x80 x895, xe2 x80 x899) form arithmetic progressions and the elements of sets (1, xe2 x80 x892, xe2 x80 x894) and (3, xe2 x80 x896, xe2 x80 x898) don 't. Your task is to find any partition of the set of words into subsets U1, xe2 x80 x89U2, xe2 x80 x89..., xe2 x80 x89Uk so that the secret is safe. Otherwise indicate that there 's no such partition. The input consists of a single line which contains two integers n and k (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- the number of words in the secret and the number of the Keepers. The numbers are separated by a single space. If there is no way to keep the secret safe, print a single integer "-1" (without the quotes). Otherwise, print n integers, the i-th of them representing the number of the Keeper who 's got the i-th word of the secret. If there are multiple solutions, print any of them.'...

Tutorials

editroal

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
57291200 LaSWeeG C July 18, 2019, 4:49 p.m. OK Delphi TESTS 23 468 3993600 1500
35980708 AynaP C March 6, 2018, 3:50 a.m. OK GNU C TESTS 23 434 1945600 1500
39070479 sanchit17 C June 9, 2018, 1:34 p.m. OK GNU C TESTS 23 466 3993600 1500
38306297 Scut82 C May 16, 2018, 2:24 a.m. OK GNU C++ TESTS 23 124 7577600 1500
35221623 vjudge4 C Feb. 14, 2018, 1:46 a.m. OK GNU C++ TESTS 23 374 2048000 1500
35222080 vjudge2 C Feb. 14, 2018, 2:56 a.m. OK GNU C++ TESTS 23 404 2048000 1500
35385181 vjudge2 C Feb. 17, 2018, 7:54 a.m. OK GNU C++ TESTS 23 404 6041600 1500
38307187 Scut82 C May 16, 2018, 3:18 a.m. OK GNU C++ TESTS 23 404 8908800 1500
35279225 vjudge3 C Feb. 15, 2018, 1 a.m. OK GNU C++ TESTS 23 434 1843200 1500
38306016 Scut82 C May 16, 2018, 2:02 a.m. OK GNU C++ TESTS 23 434 3481600 1500
35221829 vjudge1 C Feb. 14, 2018, 2:13 a.m. OK GNU C++ TESTS 23 434 6041600 1500
31823249 vjudge1 C Oct. 28, 2017, 3:09 a.m. OK GNU C++ TESTS 23 434 7782400 1500
35239279 vjudge4 C Feb. 14, 2018, 12:29 p.m. OK GNU C++ TESTS 23 436 6041600 1500
54815233 _Kanf C May 29, 2019, 7:24 p.m. OK GNU C++11 TESTS 23 312 0 1500
54500065 WOSHIGEPACHONG2 C May 22, 2019, 8:10 p.m. OK GNU C++11 TESTS 23 312 0 1500
53836963 gmhg C May 7, 2019, 4:03 a.m. OK GNU C++11 TESTS 23 312 0 1500
68423681 cor001 C Jan. 9, 2020, 1:16 a.m. OK GNU C++11 TESTS 23 340 0 1500
58533591 Ufowoqqqo C Aug. 10, 2019, 10:47 a.m. OK GNU C++11 TESTS 23 342 0 1500
54511265 MohamedSameh C May 23, 2019, 7:15 a.m. OK GNU C++11 TESTS 23 342 0 1500
52723723 Gankutsuou C April 13, 2019, 9:44 p.m. OK GNU C++11 TESTS 23 342 0 1500
52678993 Gankutsuou C April 13, 2019, 11:16 a.m. OK GNU C++11 TESTS 23 342 0 1500
54511220 MohamedSameh C May 23, 2019, 7:13 a.m. OK GNU C++11 TESTS 23 342 3993600 1500
66435972 vjudge4 C Dec. 7, 2019, 6:11 a.m. OK GNU C++11 TESTS 23 374 0 1500
30837029 conquistador3 C Sept. 29, 2017, 5:31 p.m. OK GNU C++14 TESTS 23 280 0 1500
30091637 pirate_47 C Sept. 5, 2017, 5:54 a.m. OK GNU C++14 TESTS 23 280 0 1500
34609966 _him_ C Jan. 27, 2018, 3:26 p.m. OK GNU C++14 TESTS 23 280 1843200 1500
34268412 ytz123 C Jan. 18, 2018, 6:33 a.m. OK GNU C++14 TESTS 23 280 1945600 1500
34001108 Verstand C Jan. 8, 2018, 10:18 a.m. OK GNU C++14 TESTS 23 280 1945600 1500
27710600 vinayjaisinghani C June 10, 2017, 7:56 p.m. OK GNU C++14 TESTS 23 280 3993600 1500
34617166 baghead C Jan. 27, 2018, 8:22 p.m. OK GNU C++14 TESTS 23 280 5939200 1500
34262116 danya.smelskiy C Jan. 17, 2018, 9:47 p.m. OK GNU C++14 TESTS 23 280 5939200 1500
53076901 Mahmoud-warrak C April 20, 2019, 10:17 p.m. OK GNU C++14 TESTS 23 310 0 1500
53056733 Ahmad_Mohammad_Kouja C April 20, 2019, 5:58 p.m. OK GNU C++14 TESTS 23 310 0 1500
59272725 vjudge5 C Aug. 22, 2019, 1:20 p.m. OK GNU C++17 TESTS 23 310 0 1500
56423075 parammodi2281 C July 2, 2019, 8:18 a.m. OK GNU C++17 TESTS 23 310 0 1500
53373499 Nihad_Nabelsi C April 26, 2019, 6:44 p.m. OK GNU C++17 TESTS 23 310 0 1500
47830607 Dalgerok C Jan. 2, 2019, 6:21 a.m. OK GNU C++17 TESTS 23 310 0 1500
53590549 Quinas C April 30, 2019, 10:47 p.m. OK GNU C++17 TESTS 23 310 3993600 1500
40475398 arbitrary_A C July 17, 2018, 11:37 a.m. OK GNU C++17 TESTS 23 310 3993600 1500
39141271 Photon_ C June 11, 2018, 8:48 a.m. OK GNU C++17 TESTS 23 310 3993600 1500
44475860 CodeBreaker_6 C Oct. 18, 2018, 8:54 a.m. OK GNU C++17 TESTS 23 310 4198400 1500
42219190 samraat1 C Aug. 28, 2018, 7:10 p.m. OK GNU C++17 TESTS 23 310 7987200 1500
60341743 vjudge1 C Sept. 10, 2019, 11:08 a.m. OK GNU C++17 TESTS 23 312 0 1500
54634797 lebaur C May 25, 2019, 4:22 p.m. OK Java 8 TESTS 23 342 0 1500
30742138 vaibhav28 C Sept. 26, 2017, 6:31 a.m. OK Java 8 TESTS 23 372 37888000 1500
29801172 ashcodish C Aug. 26, 2017, 8:30 a.m. OK Java 8 TESTS 23 434 38195200 1500
53585938 GiantTornado C April 30, 2019, 6:31 p.m. OK Java 8 TESTS 23 436 37683200 1500
58675534 Dukkha C Aug. 12, 2019, 4:21 p.m. OK Java 8 TESTS 23 498 0 1500
39181537 vatsal.malaviya C June 12, 2018, 5:52 a.m. OK Java 8 TESTS 23 498 0 1500
45069992 Artem533 C Oct. 29, 2018, 7:09 p.m. OK Java 8 TESTS 23 498 38195200 1500
66782931 mennafadali C Dec. 13, 2019, 12:39 p.m. OK Java 8 TESTS 23 528 0 1500
27954430 kaseik C June 22, 2017, 12:24 a.m. OK Java 8 TESTS 23 592 20684800 1500
41666805 StayAwayFromBitches C Aug. 17, 2018, 12:36 a.m. OK Java 8 TESTS 23 652 0 1500
67952829 teru C Dec. 30, 2019, 8:24 a.m. OK Mono C# TESTS 23 436 51814400 1500
57972527 vjudge5 C July 30, 2019, 6:32 a.m. OK MS C++ TESTS 23 404 0 1500
30354740 Volpe C Sept. 15, 2017, 12:15 a.m. OK MS C++ TESTS 23 466 5324800 1500
30354718 Volpe C Sept. 15, 2017, 12:11 a.m. OK MS C++ TESTS 23 466 5324800 1500
57974895 vjudge4 C July 30, 2019, 7:21 a.m. OK MS C++ TESTS 23 966 3993600 1500
36135026 vjudge3 C March 10, 2018, 3:13 a.m. OK MS C++ TESTS 23 1152 2048000 1500
58492702 YaMi506 C Aug. 9, 2019, 10:40 a.m. OK MS C++ 2017 TESTS 23 1092 0 1500
69544958 beethoven97 C Jan. 26, 2020, 1:31 a.m. OK PyPy 3 TESTS 23 1560 45875200 1500
67441058 ishmumkhan1234 C Dec. 22, 2019, 7:20 p.m. OK PyPy 3 TESTS 23 1590 45977600 1500
36465015 Schullz C March 21, 2018, 9:27 p.m. OK PyPy 3 TESTS 23 1902 34508800 1500
42135003 Mk_Python_v1 C Aug. 26, 2018, 10:32 p.m. OK Python 3 TESTS 23 686 34816000 1500
55991444 Mohamed_Ayman C June 24, 2019, 7:53 a.m. OK Python 3 TESTS 23 1092 72089600 1500
48908300 mohamedramadan2515 C Jan. 24, 2019, 10:46 p.m. OK Python 3 TESTS 23 1590 51097600 1500

remove filters

Back to search problems