Codeforces Round 174 (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
283 Codeforces Round 174 (Div. 1) FINISHED False 7500 373904987 March 17, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3681 ) B Cow Program PROGRAMMING dfs and similar dp graphs 1900

B'Farmer John has just given the cows a program to play with! The program contains two integer variables, x and y, and performs the following operations on a sequence a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an of positive integers: The cows are not very good at arithmetic though, and they want to see how the program works. Please help them! You are given the sequence a2, xe2 x80 x89a3, xe2 x80 x89..., xe2 x80 x89an. Suppose for each i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89- xe2 x80 x891) we run the program on the sequence i, xe2 x80 x89a2, xe2 x80 x89a3, xe2 x80 x89..., xe2 x80 x89an. For each such run output the final value of y if the program terminates or -1 if it does not terminate. The first line contains a single integer, n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892 xc2 xb7105). The next line contains n xe2 x80 x89- xe2 x80 x891 space separated integers, a2, xe2 x80 x89a3, xe2 x80 x89..., xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). Output n xe2 x80 x89- xe2 x80 x891 lines. On the i-th line, print the requested value when the program is run on the sequence i, xe2 x80 x89a2, xe2 x80 x89a3, xe2 x80 x89...an. Please do not use the %lld specifier to read or write 64-bit integers in xd0 xa1++. It is preferred to use the cin, cout streams or the %I64d specifier. In the first sample '...

Tutorials

Editorial for Codeforces #174

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3343469 MrJigan1488 B March 17, 2013, 5:31 p.m. OK Delphi TESTS 50 156 36659200 1900
3364939 Timur_Keks B March 21, 2013, 12:09 p.m. OK Delphi TESTS 50 187 9523200 1900
3342739 IgorL B March 17, 2013, 5:25 p.m. OK Delphi TESTS 50 187 25804800 1900
3345041 Misha100896 B March 17, 2013, 7:24 p.m. OK Delphi TESTS 50 203 7782400 1900
4213969 AHTuTTuTyX B Aug. 1, 2013, 12:43 p.m. OK Delphi TESTS 50 248 17408000 1900
3344248 AleksanderBalobanov B March 17, 2013, 6:59 p.m. OK Delphi TESTS 50 250 19865600 1900
3620090 i14 B April 25, 2013, 11:24 a.m. OK FPC TESTS 50 93 15564800 1900
3493770 vlad107 B April 8, 2013, 3:15 p.m. OK FPC TESTS 50 125 9113600 1900
3336092 tsunayoshi B March 17, 2013, 4:11 p.m. OK FPC TESTS 50 125 9625600 1900
3409548 Furko B March 26, 2013, 7:19 p.m. OK FPC TESTS 50 125 18432000 1900
3349875 Petrushenko B March 18, 2013, 9:22 a.m. OK FPC TESTS 50 125 29798400 1900
3335093 con_nha_ngheo B March 17, 2013, 4:03 p.m. OK FPC TESTS 50 140 11059200 1900
3352020 nhandi B March 18, 2013, 2:11 p.m. OK FPC TESTS 50 140 11161600 1900
3339531 JustN B March 17, 2013, 4:45 p.m. OK FPC TESTS 50 140 11161600 1900
3337880 Berzhik B March 17, 2013, 4:28 p.m. OK FPC TESTS 50 140 11264000 1900
3340158 laoriu B March 17, 2013, 4:51 p.m. OK FPC TESTS 50 140 11366400 1900
3348859 cpy B March 18, 2013, 6:37 a.m. OK GNU C TESTS 50 171 7987200 1900
3348815 cpy B March 18, 2013, 6:31 a.m. OK GNU C TESTS 50 171 7987200 1900
3336893 Electronic B March 17, 2013, 4:18 p.m. OK GNU C TESTS 50 171 10342400 1900
3420175 atpec B March 29, 2013, 5:16 p.m. OK GNU C TESTS 50 171 10444800 1900
3344395 pedja B March 17, 2013, 7:02 p.m. OK GNU C TESTS 50 203 11980800 1900
18004167 TsReaper B May 20, 2016, 11:57 a.m. OK GNU C TESTS 50 218 10035200 1900
7449308 vjudge5 B Aug. 15, 2014, 3:14 a.m. OK GNU C TESTS 50 218 14438400 1900
7448844 vjudge1 B Aug. 15, 2014, 1:41 a.m. OK GNU C TESTS 50 248 13619200 1900
40305250 paulzrm B July 14, 2018, 5:21 a.m. OK GNU C++ TESTS 50 122 10752000 1900
4720090 abbyy B Oct. 9, 2013, 6:28 p.m. OK GNU C++ TESTS 50 124 7475200 1900
40305800 paulzrm B July 14, 2018, 5:40 a.m. OK GNU C++ TESTS 50 124 9216000 1900
40305212 paulzrm B July 14, 2018, 5:19 a.m. OK GNU C++ TESTS 50 124 10752000 1900
40990107 ReaLNero1 B July 30, 2018, 11:36 p.m. OK GNU C++ TESTS 50 124 10854400 1900
40305338 paulzrm B July 14, 2018, 5:24 a.m. OK GNU C++ TESTS 50 124 10854400 1900
3360765 Krig B March 20, 2013, 12:42 p.m. OK GNU C++ TESTS 50 140 8806400 1900
4158947 Simplex B July 24, 2013, 8:12 p.m. OK GNU C++ TESTS 50 140 10444800 1900
3344168 H3X B March 17, 2013, 6:57 p.m. OK GNU C++ TESTS 50 140 10752000 1900
3345079 cjoa B March 17, 2013, 7:25 p.m. OK GNU C++ TESTS 50 140 13619200 1900
8709928 user32 B Nov. 16, 2014, 9:41 a.m. OK GNU C++0x TESTS 50 154 13619200 1900
3337453 boleyn.su B March 17, 2013, 4:24 p.m. OK GNU C++0x TESTS 50 156 11776000 1900
6129481 FancyCoder B March 24, 2014, 8:24 a.m. OK GNU C++0x TESTS 50 156 14028800 1900
8641224 Duxar B Nov. 10, 2014, 9:38 p.m. OK GNU C++0x TESTS 50 156 20070400 1900
3333127 -DMYTRO- B March 17, 2013, 3:49 p.m. OK GNU C++0x TESTS 50 171 8806400 1900
3337496 riadwaw B March 17, 2013, 4:25 p.m. OK GNU C++0x TESTS 50 171 17612800 1900
4851334 Orfest B Oct. 23, 2013, 11:30 a.m. OK GNU C++0x TESTS 50 186 8192000 1900
3339422 Xellos B March 17, 2013, 4:43 p.m. OK GNU C++0x TESTS 50 187 9625600 1900
3342402 cgangee B March 17, 2013, 5:23 p.m. OK GNU C++0x TESTS 50 187 10649600 1900
3335676 lcch B March 17, 2013, 4:08 p.m. OK GNU C++0x TESTS 50 187 12800000 1900
48064690 ediiknorand B Jan. 7, 2019, 5:24 p.m. OK GNU C11 TESTS 50 1496 17612800 1900
48063960 ediiknorand B Jan. 7, 2019, 4:59 p.m. OK GNU C11 TESTS 50 1526 21196800 1900
56865279 lukelin B July 12, 2019, 2:38 a.m. OK GNU C++11 TESTS 50 154 31846400 1900
48515171 LuciferX07 B Jan. 18, 2019, 3:08 a.m. OK GNU C++11 TESTS 50 156 14233600 1900
48475745 KING_LRL B Jan. 17, 2019, 2:21 a.m. OK GNU C++11 TESTS 50 156 14438400 1900
56865639 chhokmah B July 12, 2019, 2:52 a.m. OK GNU C++11 TESTS 50 156 16793600 1900
16138093 huanghongxun B Feb. 18, 2016, 8:06 a.m. OK GNU C++11 TESTS 50 156 17817600 1900
48483204 luogu_bot3 B Jan. 17, 2019, 7:06 a.m. OK GNU C++11 TESTS 50 156 20787200 1900
19776396 Bassel B Aug. 11, 2016, 3:51 a.m. OK GNU C++11 TESTS 50 156 22835200 1900
22203873 yhf_2015 B Nov. 14, 2016, 7:41 a.m. OK GNU C++11 TESTS 50 184 18022400 1900
16024897 aka.Sohieb B Feb. 14, 2016, 10:26 p.m. OK GNU C++11 TESTS 50 186 5632000 1900
16024862 aka.Sohieb B Feb. 14, 2016, 10:21 p.m. OK GNU C++11 TESTS 50 186 5632000 1900
34081498 John_Titor B Jan. 11, 2018, 5:24 a.m. OK GNU C++14 TESTS 50 216 13926400 1900
25488599 KhaleD_ B March 15, 2017, 2:43 a.m. OK GNU C++14 TESTS 50 216 15462400 1900
67563419 wleung_bvg B Dec. 24, 2019, 6:19 p.m. OK GNU C++14 TESTS 50 216 25292800 1900
47867322 Zenkai B Jan. 3, 2019, 10:38 a.m. OK GNU C++14 TESTS 50 218 9318400 1900
29682386 danya.smelskiy B Aug. 22, 2017, 12:23 p.m. OK GNU C++14 TESTS 50 218 10035200 1900
40218904 HanZhongBalls B July 12, 2018, 5:07 a.m. OK GNU C++14 TESTS 50 218 10444800 1900
64495878 zxyl B Nov. 7, 2019, 11:44 p.m. OK GNU C++14 TESTS 50 218 10547200 1900
49650734 rdd6584 B Feb. 9, 2019, 7:30 a.m. OK GNU C++14 TESTS 50 218 10547200 1900
46115697 anjn98 B Nov. 23, 2018, 1:51 p.m. OK GNU C++14 TESTS 50 218 10752000 1900
34273107 orbitingflea B Jan. 18, 2018, 10:30 a.m. OK GNU C++14 TESTS 50 218 10854400 1900
41280361 BloodMaster06 B Aug. 6, 2018, 3:53 p.m. OK GNU C++17 TESTS 50 216 14745600 1900
45910298 vjudge4 B Nov. 18, 2018, 10:54 a.m. OK GNU C++17 TESTS 50 218 10342400 1900
52721911 abhishektiwari B April 13, 2019, 8:23 p.m. OK GNU C++17 TESTS 50 218 10752000 1900
48476370 vjudge4 B Jan. 17, 2019, 2:54 a.m. OK GNU C++17 TESTS 50 218 11161600 1900
37880306 fsociety00 B May 4, 2018, 10:36 a.m. OK GNU C++17 TESTS 50 218 11673600 1900
40223311 tzxydby B July 12, 2018, 7:37 a.m. OK GNU C++17 TESTS 50 218 11980800 1900
40315952 vjudge4 B July 14, 2018, 10:42 a.m. OK GNU C++17 TESTS 50 218 11980800 1900
45792428 noelcowm B Nov. 16, 2018, 8:10 a.m. OK GNU C++17 TESTS 50 218 14643200 1900
47228793 Maycon_708 B Dec. 18, 2018, 5:14 p.m. OK GNU C++17 TESTS 50 218 17612800 1900
54698861 vjudge5 B May 26, 2019, 8:57 p.m. OK GNU C++17 TESTS 50 218 18022400 1900
69195336 kashishsingh8700 B Jan. 20, 2020, 2:45 p.m. OK Java 11 TESTS 50 748 65638400 1900
3344023 emo B March 17, 2013, 6:52 p.m. OK Java 6 TESTS 50 234 9625600 1900
3562915 su_58 B April 19, 2013, 7:37 a.m. OK Java 6 TESTS 50 250 12902400 1900
3338182 sayuan B March 17, 2013, 4:31 p.m. OK Java 6 TESTS 50 250 16076800 1900
3338105 bsrkaditya B March 17, 2013, 4:30 p.m. OK Java 6 TESTS 50 281 13107200 1900
3602041 su_58 B April 22, 2013, 3:43 p.m. OK Java 6 TESTS 50 296 13107200 1900
3337268 Dumpty B March 17, 2013, 4:22 p.m. OK Java 6 TESTS 50 296 17510400 1900
3337550 uwi B March 17, 2013, 4:25 p.m. OK Java 6 TESTS 50 312 12288000 1900
3340109 AlexanderBolshakov B March 17, 2013, 4:50 p.m. OK Java 6 TESTS 50 312 13312000 1900
3338503 hs484 B March 17, 2013, 4:34 p.m. OK Java 6 TESTS 50 328 19251200 1900
3636245 Ahmed.Ibrahem B April 26, 2013, 2:04 p.m. OK Java 6 TESTS 50 343 30310400 1900
4027575 MOSJAVA B July 5, 2013, 3:15 p.m. OK Java 7 TESTS 50 187 12800000 1900
3338284 TheRaven B March 17, 2013, 4:32 p.m. OK Java 7 TESTS 50 202 102400 1900
3331894 Egor B March 17, 2013, 3:42 p.m. OK Java 7 TESTS 50 218 12595200 1900
3336387 OgieKako B March 17, 2013, 4:14 p.m. OK Java 7 TESTS 50 234 12595200 1900
3963909 API B June 26, 2013, 1:33 p.m. OK Java 7 TESTS 50 250 25600000 1900
3341043 dalex B March 17, 2013, 5 p.m. OK Java 7 TESTS 50 281 13107200 1900
3334095 mmaxio B March 17, 2013, 3:55 p.m. OK Java 7 TESTS 50 296 12697600 1900
3342518 ivanovak B March 17, 2013, 5:24 p.m. OK Java 7 TESTS 50 296 15052800 1900
3789983 kjay B May 29, 2013, 7:01 a.m. OK Java 7 TESTS 50 296 23859200 1900
3343288 Slamur B March 17, 2013, 5:29 p.m. OK Java 7 TESTS 50 312 15462400 1900
65316748 NMouad21 B Nov. 18, 2019, 5:40 p.m. OK Java 8 TESTS 50 340 5836800 1900
64894624 pehchan_kaun B Nov. 14, 2019, 4:04 p.m. OK Java 8 TESTS 50 342 10649600 1900
35144214 vjudge3 B Feb. 11, 2018, 6:38 a.m. OK Java 8 TESTS 50 342 46387200 1900
35144173 megaspazz B Feb. 11, 2018, 6:36 a.m. OK Java 8 TESTS 50 372 46387200 1900
12767043 sweiss B Aug. 29, 2015, 8:47 p.m. OK Java 8 TESTS 50 374 17100800 1900
57816976 Ahmed_Diab B July 26, 2019, 8:16 p.m. OK Java 8 TESTS 50 404 9216000 1900
39226190 megh422 B June 13, 2018, 8:20 p.m. OK Java 8 TESTS 50 404 10547200 1900
39818785 spar5h B July 1, 2018, 10:40 a.m. OK Java 8 TESTS 50 404 10854400 1900
68155520 prem_cse B Jan. 4, 2020, 8:48 a.m. OK Java 8 TESTS 50 404 20889600 1900
48389519 AJ47 B Jan. 14, 2019, 2:37 p.m. OK Java 8 TESTS 50 404 26112000 1900
16018920 og.kostya B Feb. 14, 2016, 2:05 p.m. OK MS C# TESTS 50 186 11059200 1900
3719236 Lepetrandr B May 14, 2013, 7:13 a.m. OK MS C++ TESTS 50 156 5017600 1900
3360854 Vino B March 20, 2013, 1:01 p.m. OK MS C++ TESTS 50 156 5222400 1900
3344804 Monyura B March 17, 2013, 7:14 p.m. OK MS C++ TESTS 50 156 6451200 1900
3345269 romanova B March 17, 2013, 7:37 p.m. OK MS C++ TESTS 50 156 10035200 1900
3403515 RiKang B March 25, 2013, 11:11 a.m. OK MS C++ TESTS 50 156 12083200 1900
3337720 Erop B March 17, 2013, 4:26 p.m. OK MS C++ TESTS 50 171 5017600 1900
3337819 ZJUT_BrokenHeart B March 17, 2013, 4:27 p.m. OK MS C++ TESTS 50 171 5427200 1900
3339415 AndreySiunov B March 17, 2013, 4:43 p.m. OK MS C++ TESTS 50 171 5632000 1900
3340031 Sklyack B March 17, 2013, 4:49 p.m. OK MS C++ TESTS 50 171 6451200 1900
3340899 lost3030 B March 17, 2013, 4:58 p.m. OK MS C++ TESTS 50 171 6656000 1900
58512645 CtrlAlt B Aug. 9, 2019, 8:02 p.m. OK MS C++ 2017 TESTS 50 280 11161600 1900
3348143 Darooha B March 18, 2013, 4:50 a.m. OK Ocaml TESTS 50 453 17715200 1900
3346914 Quimbee B March 18, 2013, 12:27 a.m. OK Ocaml TESTS 50 453 17715200 1900
5341072 yugle7 B Dec. 3, 2013, 8:49 a.m. OK Python 2 TESTS 50 1466 28467200 1900
43349582 Yazan_Eagle B Sept. 24, 2018, 12:43 a.m. OK Python 2 TESTS 50 1684 28569600 1900
5340828 yugle7 B Dec. 3, 2013, 7:52 a.m. OK Python 3 TESTS 50 1872 29593600 1900

remove filters

Back to search problems