Codeforces Round 176 (Div. 1)

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
286 Codeforces Round 176 (Div. 1) FINISHED False 7200 367797599 March 23, 2013, 8 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3183 ) A Lucky Permutation PROGRAMMING constructive algorithms math 1600

B'A permutation p of size n is the sequence p1, xe2 x80 x89p2, xe2 x80 x89..., xe2 x80 x89pn, consisting of n distinct integers, each of them is from 1 to n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). A lucky permutation is such permutation p, that any integer i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) meets this condition ppi xe2 x80 x89= xe2 x80 x89n xe2 x80 x89- xe2 x80 x89i xe2 x80 x89+ xe2 x80 x891. You have integer n. Find some lucky permutation p of size n. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the required permutation size. Print "-1" (without the quotes) if the lucky permutation p of size n doesn 't exist. Otherwise, print n distinct integers p1, xe2 x80 x89p2, xe2 x80 x89..., xe2 x80 x89pn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) after a space -- the required permutation. If there are multiple answers, you can print any of them.'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3397011 Gassa A March 23, 2013, 8:10 p.m. OK D TESTS 30 125 512000 1600
3385155 Gassa A March 23, 2013, 8:09 a.m. OK D TESTS 30 125 512000 1600
3397027 Gassa A March 23, 2013, 8:13 p.m. OK D TESTS 30 125 512000 1600
4369776 IgorL A Aug. 30, 2013, 9:38 a.m. OK Delphi TESTS 30 30 102400 1600
4201093 KTS A July 29, 2013, 7:30 p.m. OK Delphi TESTS 30 30 3993600 1600
4201087 KTS A July 29, 2013, 7:29 p.m. OK Delphi TESTS 30 30 3993600 1600
4201062 KTS A July 29, 2013, 7:20 p.m. OK Delphi TESTS 30 30 3993600 1600
3384810 Golovanov399 A March 23, 2013, 8:07 a.m. OK Delphi TESTS 30 31 307200 1600
3426872 Misha100896 A March 31, 2013, 10:51 a.m. OK Delphi TESTS 30 31 409600 1600
3428004 kirill135 A March 31, 2013, 3:27 p.m. OK Delphi TESTS 30 31 512000 1600
3401426 AHTuTTuTyX A March 24, 2013, 6:32 p.m. OK Delphi TESTS 30 31 512000 1600
3391579 Shaykhutdinov-T-I A March 23, 2013, 9:49 a.m. OK Delphi TESTS 30 31 512000 1600
3386404 amirrr A March 23, 2013, 8:23 a.m. OK Delphi TESTS 30 31 512000 1600
3689599 ghost_dog A May 7, 2013, 8:34 a.m. OK FPC TESTS 30 15 409600 1600
3479766 anri-1151 A April 6, 2013, 11:56 a.m. OK FPC TESTS 30 15 409600 1600
3417586 SpoonsAN A March 29, 2013, 2:34 a.m. OK FPC TESTS 30 15 409600 1600
3400526 zscc A March 24, 2013, 2:06 p.m. OK FPC TESTS 30 15 409600 1600
3399528 Nik_Storm_2010 A March 24, 2013, 10:29 a.m. OK FPC TESTS 30 15 409600 1600
3397728 thaison1496 A March 24, 2013, 2:57 a.m. OK FPC TESTS 30 15 409600 1600
3394710 metalopocalipsis A March 23, 2013, 1:17 p.m. OK FPC TESTS 30 15 409600 1600
3394651 Omelianenko A March 23, 2013, 1:08 p.m. OK FPC TESTS 30 15 409600 1600
3388072 ig_dug A March 23, 2013, 8:46 a.m. OK FPC TESTS 30 15 409600 1600
3387464 hgminh A March 23, 2013, 8:37 a.m. OK FPC TESTS 30 15 409600 1600
3398626 cpy A March 24, 2013, 7:13 a.m. OK GNU C TESTS 30 31 409600 1600
3496924 aman2604 A April 9, 2013, 2:48 p.m. OK GNU C TESTS 30 46 409600 1600
3409857 neelshahr92 A March 26, 2013, 10:26 p.m. OK GNU C TESTS 30 46 409600 1600
3399060 NoSoul A March 24, 2013, 8:33 a.m. OK GNU C TESTS 30 46 409600 1600
3397770 wmwick A March 24, 2013, 3:20 a.m. OK GNU C TESTS 30 46 409600 1600
3397718 abhinav92003 A March 24, 2013, 2:55 a.m. OK GNU C TESTS 30 46 409600 1600
3386320 kawatea A March 23, 2013, 8:22 a.m. OK GNU C TESTS 30 46 409600 1600
3386000 mikeCAT A March 23, 2013, 8:17 a.m. OK GNU C TESTS 30 46 409600 1600
3397833 xzxiong A March 24, 2013, 3:57 a.m. OK GNU C TESTS 30 46 819200 1600
3396707 picaso A March 23, 2013, 6:49 p.m. OK GNU C TESTS 30 46 819200 1600
3519499 Empty A April 12, 2013, 7:57 p.m. OK GNU C++ TESTS 30 15 409600 1600
3476400 uc-nuts A April 5, 2013, 11:52 a.m. OK GNU C++ TESTS 30 15 409600 1600
3405012 arturas A March 25, 2013, 3:43 p.m. OK GNU C++ TESTS 30 15 409600 1600
3393859 Horea A March 23, 2013, 11:29 a.m. OK GNU C++ TESTS 30 15 409600 1600
3386427 xukaiwen A March 23, 2013, 8:23 a.m. OK GNU C++ TESTS 30 15 409600 1600
3405008 arturas A March 25, 2013, 3:41 p.m. OK GNU C++ TESTS 30 15 819200 1600
3397817 agarwaen A March 24, 2013, 3:45 a.m. OK GNU C++ TESTS 30 15 819200 1600
3387492 emonzhong A March 23, 2013, 8:37 a.m. OK GNU C++ TESTS 30 15 1228800 1600
3399189 LashaBukhnikashvili A March 24, 2013, 8:59 a.m. OK GNU C++ TESTS 30 15 7987200 1600
8022363 aid A Sept. 29, 2014, 8:25 a.m. OK GNU C++ TESTS 30 30 0 1600
3423919 hex539 A March 30, 2013, 5:23 p.m. OK GNU C++0x TESTS 30 15 409600 1600
4499014 Orfest A Sept. 18, 2013, 7:36 p.m. OK GNU C++0x TESTS 30 30 409600 1600
9007953 sinesight A Dec. 7, 2014, 9:32 a.m. OK GNU C++0x TESTS 30 30 819200 1600
6301614 moh.amr A April 8, 2014, 4:51 p.m. OK GNU C++0x TESTS 30 30 1126400 1600
3408779 my2011 A March 26, 2013, 3:14 p.m. OK GNU C++0x TESTS 30 31 409600 1600
3396926 Xellos A March 23, 2013, 7:46 p.m. OK GNU C++0x TESTS 30 31 409600 1600
3386541 boleyn.su A March 23, 2013, 8:24 a.m. OK GNU C++0x TESTS 30 31 409600 1600
3386269 htc550605125 A March 23, 2013, 8:21 a.m. OK GNU C++0x TESTS 30 31 409600 1600
3385636 Ilya_MSU A March 23, 2013, 8:13 a.m. OK GNU C++0x TESTS 30 31 409600 1600
3385164 GuyUpLion A March 23, 2013, 8:09 a.m. OK GNU C++0x TESTS 30 31 409600 1600
18825630 white_sage A June 30, 2016, 2:27 p.m. OK GNU C++11 TESTS 30 30 204800 1600
18167452 Deathlyhallows A May 31, 2016, 11:14 a.m. OK GNU C++11 TESTS 30 30 2252800 1600
12291276 OmarHashim A July 31, 2015, 12:16 p.m. OK GNU C++11 TESTS 30 60 0 1600
22720946 spetsnaz A Dec. 6, 2016, midnight OK GNU C++11 TESTS 30 60 204800 1600
23010672 NourElRashidy A Dec. 15, 2016, 3:28 p.m. OK GNU C++11 TESTS 30 60 409600 1600
22312942 geniucos A Nov. 18, 2016, 6:42 p.m. OK GNU C++11 TESTS 30 60 409600 1600
21957237 Diego1149 A Nov. 1, 2016, 5:15 a.m. OK GNU C++11 TESTS 30 60 409600 1600
12111094 a1s3a A July 18, 2015, 10:34 p.m. OK GNU C++11 TESTS 30 60 409600 1600
68471561 cor001 A Jan. 10, 2020, 2:10 a.m. OK GNU C++11 TESTS 30 62 0 1600
61847821 xzmxzm A Oct. 4, 2019, 11:50 a.m. OK GNU C++11 TESTS 30 62 0 1600
29694930 AMnu A Aug. 22, 2017, 11:31 p.m. OK GNU C++14 TESTS 30 30 0 1600
30126565 fsshakkhor A Sept. 6, 2017, 8:51 a.m. OK GNU C++14 TESTS 30 30 409600 1600
27095197 demonsbane A May 13, 2017, 6:11 p.m. OK GNU C++14 TESTS 30 30 409600 1600
33104714 whybee A Dec. 11, 2017, 2:54 p.m. OK GNU C++14 TESTS 30 30 2252800 1600
29497580 after A Aug. 16, 2017, 6:15 a.m. OK GNU C++14 TESTS 30 30 2355200 1600
29216239 chien.than A Aug. 5, 2017, 10:35 a.m. OK GNU C++14 TESTS 30 30 2355200 1600
28249060 gaporf A July 3, 2017, 8:25 a.m. OK GNU C++14 TESTS 30 30 2355200 1600
25709364 allenwhale A March 22, 2017, 11:22 a.m. OK GNU C++14 TESTS 30 30 2355200 1600
23563201 pparwal12 A Jan. 5, 2017, 9:24 p.m. OK GNU C++14 TESTS 30 30 2355200 1600
23552653 garuna A Jan. 5, 2017, 10:32 a.m. OK GNU C++14 TESTS 30 30 2355200 1600
59270869 vjudge5 A Aug. 22, 2019, 12:40 p.m. OK GNU C++17 TESTS 30 60 409600 1600
48211121 VishwasLathi A Jan. 11, 2019, 12:06 p.m. OK GNU C++17 TESTS 30 60 614400 1600
56839627 vjudge1 A July 11, 2019, 10:52 a.m. OK GNU C++17 TESTS 30 62 0 1600
60324044 prishan76 A Sept. 9, 2019, 10:58 p.m. OK GNU C++17 TESTS 30 62 409600 1600
62240134 XZJ A Oct. 10, 2019, 1:07 a.m. OK GNU C++17 TESTS 30 62 409600 1600
62239625 vjudge1 A Oct. 10, 2019, 12:48 a.m. OK GNU C++17 TESTS 30 62 409600 1600
56867098 Double_w A July 12, 2019, 3:53 a.m. OK GNU C++17 TESTS 30 62 409600 1600
56840041 vjudge1 A July 11, 2019, 11:04 a.m. OK GNU C++17 TESTS 30 62 409600 1600
56837992 vjudge3 A July 11, 2019, 10:04 a.m. OK GNU C++17 TESTS 30 62 409600 1600
56837852 vjudge1 A July 11, 2019, 9:59 a.m. OK GNU C++17 TESTS 30 62 409600 1600
8167472 arnoldjulians A Oct. 10, 2014, 4:03 p.m. OK Go TESTS 30 280 0 1600
8295573 teamsande A Oct. 18, 2014, 3:50 p.m. OK Go TESTS 30 340 102400 1600
8173532 devroid A Oct. 11, 2014, 10:27 a.m. OK Go TESTS 30 560 0 1600
6713841 erikr A May 26, 2014, 7:27 a.m. OK Haskell TESTS 30 30 102400 1600
3388224 bsrkaditya A March 23, 2013, 8:48 a.m. OK Java 6 TESTS 30 109 204800 1600
3387702 piotr.kukla A March 23, 2013, 8:40 a.m. OK Java 6 TESTS 30 109 204800 1600
3386896 hama-du A March 23, 2013, 8:29 a.m. OK Java 6 TESTS 30 109 2560000 1600
3384594 uwi A March 23, 2013, 8:05 a.m. OK Java 6 TESTS 30 109 2560000 1600
3386723 hiukim A March 23, 2013, 8:26 a.m. OK Java 6 TESTS 30 124 2457600 1600
3969054 Sammarize A June 27, 2013, 9:57 p.m. OK Java 6 TESTS 30 125 204800 1600
3389218 calculus.saransh A March 23, 2013, 9:06 a.m. OK Java 6 TESTS 30 125 204800 1600
3413737 xiaowuc1 A March 28, 2013, 12:02 a.m. OK Java 6 TESTS 30 125 2150400 1600
3386016 AlexanderBolshakov A March 23, 2013, 8:18 a.m. OK Java 6 TESTS 30 125 2457600 1600
4008146 mkirsche A July 3, 2013, 8:04 p.m. OK Java 6 TESTS 30 125 2560000 1600
3394706 Aksenov239 A March 23, 2013, 1:17 p.m. OK Java 7 TESTS 30 93 0 1600
3388481 ocelopilli A March 23, 2013, 8:53 a.m. OK Java 7 TESTS 30 93 0 1600
3385663 ysyshtc A March 23, 2013, 8:14 a.m. OK Java 7 TESTS 30 93 0 1600
3426781 1Shreesh A March 31, 2013, 10:30 a.m. OK Java 7 TESTS 30 109 0 1600
3420048 KOHCTAHTIH A March 29, 2013, 4:35 p.m. OK Java 7 TESTS 30 109 0 1600
3395748 dusty.and.rusty A March 23, 2013, 3:47 p.m. OK Java 7 TESTS 30 109 0 1600
3393373 dusty.and.rusty A March 23, 2013, 10:45 a.m. OK Java 7 TESTS 30 109 0 1600
3388746 tanzaku A March 23, 2013, 8:57 a.m. OK Java 7 TESTS 30 109 0 1600
3386455 SergeyLazarev A March 23, 2013, 8:23 a.m. OK Java 7 TESTS 30 109 0 1600
3386370 yarrr A March 23, 2013, 8:22 a.m. OK Java 7 TESTS 30 109 0 1600
27113141 pitfall A May 14, 2017, 9:55 p.m. OK Java 8 TESTS 30 248 0 1600
20629483 motivation_error A Sept. 15, 2016, 12:52 a.m. OK Java 8 TESTS 30 248 0 1600
12253430 Sumeet.Varma A July 28, 2015, 2:45 p.m. OK Java 8 TESTS 30 248 0 1600
11724523 sweiss A June 23, 2015, 2:23 p.m. OK Java 8 TESTS 30 248 0 1600
11259248 AlexFetisov A May 25, 2015, midnight OK Java 8 TESTS 30 248 0 1600
28746942 tomdmitriev A July 21, 2017, 9:59 a.m. OK Java 8 TESTS 30 248 20582400 1600
10936771 pmarecki A April 30, 2015, 9:31 a.m. OK Java 8 TESTS 30 248 28569600 1600
33904919 kocko A Jan. 4, 2018, 2:27 p.m. OK Java 8 TESTS 30 278 20684800 1600
40449733 KulikAlex A July 16, 2018, 5:56 p.m. OK Java 8 TESTS 30 280 0 1600
21735562 gahou A Oct. 24, 2016, 7:51 a.m. OK Java 8 TESTS 30 280 0 1600
3395414 dwoolley3 A March 23, 2013, 2:54 p.m. OK Mono C# TESTS 30 62 6553600 1600
3385888 fiver A March 23, 2013, 8:16 a.m. OK Mono C# TESTS 30 109 214323200 1600
3599948 XilinX A April 22, 2013, 7:50 a.m. OK Mono C# TESTS 30 140 2457600 1600
14638637 og.kostya A Dec. 3, 2015, 6:51 p.m. OK MS C# TESTS 30 154 3276800 1600
16804508 vjudge2 A March 19, 2016, 7:42 a.m. OK MS C++ TESTS 30 30 2969600 1600
3396493 azim__ A March 23, 2013, 6:04 p.m. OK MS C++ TESTS 30 31 409600 1600
3387925 Muali A March 23, 2013, 8:44 a.m. OK MS C++ TESTS 30 31 409600 1600
3386384 Schullz A March 23, 2013, 8:22 a.m. OK MS C++ TESTS 30 31 409600 1600
3387239 caustique A March 23, 2013, 8:34 a.m. OK MS C++ TESTS 30 31 512000 1600
3387252 AnnKats93 A March 23, 2013, 8:34 a.m. OK MS C++ TESTS 30 31 512000 1600
3388334 LovelyPenguin A March 23, 2013, 8:50 a.m. OK MS C++ TESTS 30 31 921600 1600
3452950 yougatup A April 2, 2013, 1:16 p.m. OK MS C++ TESTS 30 31 1740800 1600
3386115 RiKang A March 23, 2013, 8:19 a.m. OK MS C++ TESTS 30 31 3993600 1600
3386794 harhrayr A March 23, 2013, 8:27 a.m. OK MS C++ TESTS 30 31 4403200 1600
21199389 2rquNsP A Oct. 5, 2016, 2:14 a.m. OK PyPy 3 TESTS 30 342 7270400 1600
3480254 Newer123 A April 6, 2013, 2:37 p.m. OK Python 2 TESTS 30 78 6041600 1600
3406497 jeswang A March 26, 2013, 4:30 a.m. OK Python 2 TESTS 30 78 6451200 1600
3399203 nealzane A March 24, 2013, 9:03 a.m. OK Python 2 TESTS 30 78 6451200 1600
3395753 daidailanlan A March 23, 2013, 3:48 p.m. OK Python 2 TESTS 30 78 6451200 1600
4909398 Unlenin A Oct. 27, 2013, 4:39 a.m. OK Python 2 TESTS 30 78 6553600 1600
3685073 tryPython A May 6, 2013, 7:38 a.m. OK Python 2 TESTS 30 93 6246400 1600
3386483 treshaque A March 23, 2013, 8:24 a.m. OK Python 2 TESTS 30 93 7475200 1600
3387445 nwi A March 23, 2013, 8:37 a.m. OK Python 2 TESTS 30 109 2048000 1600
3385956 zibada A March 23, 2013, 8:17 a.m. OK Python 2 TESTS 30 109 7680000 1600
3394990 erikgrabljevec5 A March 23, 2013, 1:56 p.m. OK Python 2 TESTS 30 124 6963200 1600
3672043 neko13 A May 5, 2013, 9:30 a.m. OK Python 3 TESTS 30 140 7475200 1600
5184290 yugle7 A Nov. 21, 2013, 11:17 a.m. OK Python 3 TESTS 30 186 4710400 1600
9876423 dingdinglhz A Feb. 16, 2015, 9:42 p.m. OK Python 3 TESTS 30 280 5120000 1600
41983844 Mk_Python_v1 A Aug. 23, 2018, 4:25 a.m. OK Python 3 TESTS 30 716 3686400 1600
4454183 TsunamiNoLetGo A Sept. 13, 2013, 6:46 p.m. OK Python 3 TESTS 30 780 3276800 1600
3409925 Lebesgue A March 26, 2013, 11:43 p.m. OK Ruby TESTS 30 109 1536000 1600
3388751 sweetsc A March 23, 2013, 8:57 a.m. OK Ruby TESTS 30 109 1740800 1600
3397029 whhone A March 23, 2013, 8:14 p.m. OK Ruby TESTS 30 109 1843200 1600
9552524 instantkill A Jan. 25, 2015, 6:13 p.m. OK Ruby TESTS 30 156 1433600 1600
35857499 ______u______ A March 2, 2018, 8:40 p.m. OK Ruby TESTS 30 156 7884800 1600
35857438 ______n______ A March 2, 2018, 8:40 p.m. OK Ruby TESTS 30 156 7884800 1600
35856989 _____i_____ A March 2, 2018, 8:32 p.m. OK Ruby TESTS 30 156 7884800 1600
35856861 _____k_____ A March 2, 2018, 8:28 p.m. OK Ruby TESTS 30 156 7884800 1600
35848262 ______h______ A March 2, 2018, 4:56 p.m. OK Ruby TESTS 30 156 7884800 1600
35848256 ______k______ A March 2, 2018, 4:56 p.m. OK Ruby TESTS 30 156 7884800 1600

remove filters

Back to search problems