Codeforces Round 353 (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
675 Codeforces Round 353 (Div. 2) FINISHED False 7200 268406699 May 16, 2016, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2788 ) E Trains and Statistic PROGRAMMING data structures dp greedy 2500

B"Vasya commutes by train every day. There are n train stations in the city, and at the i-th station it's possible to buy only tickets to stations from i xe2 x80 x89+ xe2 x80 x891 to ai inclusive. No tickets are sold at the last station. Let xcf x81i, xe2 x80 x89j be the minimum number of tickets one needs to buy in order to get from stations i to station j. As Vasya is fond of different useless statistic he asks you to compute the sum of all values xcf x81i, xe2 x80 x89j among all pairs 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89< xe2 x80 x89j xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n. The first line of the input contains a single integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000) -- the number of stations. The second line contains n xe2 x80 x89- xe2 x80 x891 integer ai (i xe2 x80 x89+ xe2 x80 x891 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n), the i-th of them means that at the i-th station one may buy tickets to each station from i xe2 x80 x89+ xe2 x80 x891 to ai inclusive. Print the sum of xcf x81i, xe2 x80 x89j among all pairs of 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89< xe2 x80 x89j xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n. In the first sample it's possible to get from any station to any other (with greater index) using only one ticket. The total number of pairs is 6, so the answer is also 6. Consider the second sample: Thus the answer equals 1 xe2 x80 x89+ xe2 x80 x892 xe2 x80 x89+ xe2 x80 x893 xe2 x80 x89+ xe2 x80 x893 xe2 x80 x89+ xe2 x80 x891 xe2 x80 x89+ xe2 x80 x892 xe2 x80 x89+ xe2 x80 x892 xe2 x80 x89+ xe2 x80 x891 xe2 x80 x89+ xe2 x80 x891 xe2 x80 x89+ xe2 x80 x891 xe2 x80 x89= xe2 x80 x8917. "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
18004554 dmlocdmloc E May 20, 2016, 12:24 p.m. OK FPC TESTS 45 62 13004800 2500
64868250 dblark E Nov. 14, 2019, 7:12 a.m. OK FPC TESTS 45 93 4403200 2500
22074850 myx12345 E Nov. 6, 2016, 12:28 p.m. OK FPC TESTS 45 140 7577600 2500
26041212 tiboy E April 1, 2017, 3:06 a.m. OK GNU C TESTS 45 46 9113600 2500
25888942 Finnn E March 29, 2017, 6:40 a.m. OK GNU C TESTS 45 46 9113600 2500
25837941 jannellyjelly E March 27, 2017, 12:21 p.m. OK GNU C TESTS 45 46 9113600 2500
26031888 palacioje E March 31, 2017, 5:43 p.m. OK GNU C TESTS 45 61 9113600 2500
25890658 JoshuaIsanan E March 29, 2017, 8:17 a.m. OK GNU C TESTS 45 62 6758400 2500
25940152 arranbaleva E March 30, 2017, 4:07 a.m. OK GNU C TESTS 45 77 6758400 2500
26038817 amolo.riz E April 1, 2017, 12:09 a.m. OK GNU C TESTS 45 77 6758400 2500
26036274 vinceftw E March 31, 2017, 9:06 p.m. OK GNU C TESTS 45 77 6758400 2500
26031158 thessaquijote E March 31, 2017, 5:09 p.m. OK GNU C TESTS 45 77 6758400 2500
25969600 londun E March 31, 2017, 6:47 a.m. OK GNU C TESTS 45 77 6758400 2500
22207591 Ajatar E Nov. 14, 2016, 12:56 p.m. OK GNU C++ TESTS 45 31 1433600 2500
18167229 caoyu01 E May 31, 2016, 10:56 a.m. OK GNU C++ TESTS 45 31 3686400 2500
18137829 rmtgh E May 28, 2016, 6:29 p.m. OK GNU C++ TESTS 45 31 3891200 2500
18005572 vjudge4 E May 20, 2016, 1:42 p.m. OK GNU C++ TESTS 45 31 3891200 2500
18178629 Hikari9 E June 1, 2016, 7:35 a.m. OK GNU C++ TESTS 45 31 11878400 2500
18114451 chentong E May 27, 2016, 7:43 a.m. OK GNU C++ TESTS 45 31 23142400 2500
18020587 Owaski E May 21, 2016, 3:13 p.m. OK GNU C++ TESTS 45 31 39936000 2500
19445039 130705009 E July 27, 2016, 3:58 p.m. OK GNU C++ TESTS 45 46 1843200 2500
19074485 vjudge1 E July 13, 2016, 2 p.m. OK GNU C++ TESTS 45 46 2764800 2500
29643943 lllllllllllllllllllllll E Aug. 21, 2017, 12:55 p.m. OK GNU C++ TESTS 45 46 3584000 2500
18062542 bertho_coder E May 24, 2016, 6:04 p.m. OK GNU C11 TESTS 45 62 4812800 2500
20360711 yukihana0416 E Sept. 3, 2016, 12:11 p.m. OK GNU C++11 TESTS 45 31 1638400 2500
31132000 Amayoneko E Oct. 8, 2017, 4:02 a.m. OK GNU C++11 TESTS 45 31 1638400 2500
23464059 vjudge4 E Dec. 31, 2016, 6:20 a.m. OK GNU C++11 TESTS 45 31 3686400 2500
18123151 akapros E May 27, 2016, 7:56 p.m. OK GNU C++11 TESTS 45 31 3891200 2500
17989163 zhangcy269_1 E May 19, 2016, 10:20 a.m. OK GNU C++11 TESTS 45 31 4198400 2500
18285818 krijgertje E June 7, 2016, 2:35 p.m. OK GNU C++11 TESTS 45 31 4198400 2500
18702176 xy961218 E June 24, 2016, 2 p.m. OK GNU C++11 TESTS 45 31 7987200 2500
18169213 WFang E May 31, 2016, 1:25 p.m. OK GNU C++11 TESTS 45 31 10240000 2500
18491615 thanhtien92to123 E June 15, 2016, 8:28 a.m. OK GNU C++11 TESTS 45 31 11468800 2500
64870243 zhouhongkai E Nov. 14, 2019, 7:53 a.m. OK GNU C++11 TESTS 45 31 13004800 2500
66980013 twangal E Dec. 15, 2019, 4:02 p.m. OK GNU C++14 TESTS 45 46 1740800 2500
68847541 BamiTorabi E Jan. 15, 2020, 7:54 a.m. OK GNU C++14 TESTS 45 46 2252800 2500
20390991 King E Sept. 4, 2016, 11:27 p.m. OK GNU C++14 TESTS 45 46 3174400 2500
23382720 Ali.Pi E Dec. 28, 2016, 5:10 p.m. OK GNU C++14 TESTS 45 46 3686400 2500
26244044 abdullah009 E April 9, 2017, 8:58 p.m. OK GNU C++14 TESTS 45 46 4710400 2500
24630904 szawinis E Feb. 13, 2017, 3:29 p.m. OK GNU C++14 TESTS 45 46 4710400 2500
34971012 KyntsevichVova E Feb. 6, 2018, 12:57 p.m. OK GNU C++14 TESTS 45 46 4710400 2500
30464667 AryanSM E Sept. 18, 2017, 1:03 p.m. OK GNU C++14 TESTS 45 46 5427200 2500
39357445 realcomplex E June 18, 2018, 1:30 p.m. OK GNU C++14 TESTS 45 46 8806400 2500
22118838 Woreviam E Nov. 8, 2016, 6:34 p.m. OK GNU C++14 TESTS 45 46 9216000 2500
56859884 0442A403 E July 11, 2019, 9:08 p.m. OK GNU C++17 TESTS 45 46 2048000 2500
64873592 luogu_bot4 E Nov. 14, 2019, 9:02 a.m. OK GNU C++17 TESTS 45 46 2252800 2500
67694602 SuiT_Up E Dec. 27, 2019, 12:31 p.m. OK GNU C++17 TESTS 45 61 5427200 2500
42733064 vjudge2 E Sept. 10, 2018, 12:34 p.m. OK GNU C++17 TESTS 45 62 4608000 2500
69520930 Bars E Jan. 25, 2020, 1:25 p.m. OK GNU C++17 TESTS 45 62 4710400 2500
69931944 vjudge1 E Feb. 1, 2020, 12:38 a.m. OK GNU C++17 TESTS 45 62 5017600 2500
39657441 demol E June 25, 2018, 6:13 p.m. OK GNU C++17 TESTS 45 62 5427200 2500
64860552 little_gift E Nov. 14, 2019, 2:50 a.m. OK GNU C++17 TESTS 45 62 10444800 2500
44920411 arshiya_ E Oct. 26, 2018, 5:37 p.m. OK GNU C++17 TESTS 45 62 19456000 2500
69888007 rama_pang E Jan. 31, 2020, 8:57 a.m. OK GNU C++17 TESTS 45 62 48128000 2500
47890391 qb2008 E Jan. 4, 2019, 5:55 a.m. OK Go TESTS 45 109 17203200 2500
17998962 CyberZHG E May 20, 2016, 3:09 a.m. OK Haskell TESTS 45 889 134348800 2500
69273471 Hemose E Jan. 21, 2020, 11:28 p.m. OK Java 11 TESTS 45 265 11468800 2500
17979890 codder90 E May 18, 2016, 12:52 p.m. OK Java 7 TESTS 45 233 54272000 2500
18773836 mkirsche E June 28, 2016, 9:24 p.m. OK Java 7 TESTS 45 280 0 2500
19958524 kafy83 E Aug. 19, 2016, 6:29 a.m. OK Java 8 TESTS 45 155 20582400 2500
27093604 U_Square E May 13, 2017, 4:22 p.m. OK Java 8 TESTS 45 156 0 2500
26062244 hannahlasola E April 1, 2017, 6:34 p.m. OK Java 8 TESTS 45 156 27443200 2500
45342832 flyman3046 E Nov. 5, 2018, 10:51 p.m. OK Java 8 TESTS 45 171 0 2500
32329808 Ahmad_Elsagheer E Nov. 15, 2017, 11:21 a.m. OK Java 8 TESTS 45 171 0 2500
18047814 alibaba E May 23, 2016, 7:48 p.m. OK Java 8 TESTS 45 171 21094400 2500
32803528 Jeel_Vaishnav E Nov. 30, 2017, 11:29 a.m. OK Java 8 TESTS 45 186 20889600 2500
18056826 cchli E May 24, 2016, 2:22 p.m. OK Java 8 TESTS 45 186 22118400 2500
17998070 GoodDok E May 19, 2016, 11:19 p.m. OK Java 8 TESTS 45 187 20787200 2500
26346189 RP_9 E April 13, 2017, 7:17 p.m. OK Java 8 TESTS 45 187 28876800 2500
18156101 JS_Lighter E May 30, 2016, 11:27 a.m. OK JavaScript TESTS 45 124 22118400 2500
18014456 og.kostya E May 21, 2016, 6:46 a.m. OK MS C# TESTS 45 93 17817600 2500
18644894 AnatolyTolstobrov E June 22, 2016, 10:40 a.m. OK MS C# TESTS 45 109 5324800 2500
18185074 kuzAnatoliy E June 1, 2016, 4:09 p.m. OK MS C# TESTS 45 124 17817600 2500
18363349 DigitalArtistKz E June 10, 2016, 6:09 p.m. OK MS C# TESTS 45 187 31948800 2500
18152268 rkm0959 E May 30, 2016, 1:50 a.m. OK MS C++ TESTS 45 46 9523200 2500
21637640 AWCXV E Oct. 21, 2016, 9:31 a.m. OK MS C++ TESTS 45 46 19251200 2500
19074525 pseudo E July 13, 2016, 2:03 p.m. OK MS C++ TESTS 45 62 2764800 2500
28644435 wuliuyi E July 17, 2017, 4:44 p.m. OK MS C++ TESTS 45 62 4915200 2500
25461083 godusheep E March 13, 2017, 7:39 p.m. OK MS C++ TESTS 45 62 4915200 2500
18115396 abc651279230 E May 27, 2016, 9:08 a.m. OK MS C++ TESTS 45 62 9830400 2500
18115176 abc651279230 E May 27, 2016, 8:51 a.m. OK MS C++ TESTS 45 62 9830400 2500
18115619 abc651279230 E May 27, 2016, 9:28 a.m. OK MS C++ TESTS 45 62 11468800 2500
18178826 vanvector E June 1, 2016, 7:54 a.m. OK MS C++ TESTS 45 77 5017600 2500
18115512 abc651279230 E May 27, 2016, 9:18 a.m. OK MS C++ TESTS 45 77 11468800 2500
68951030 hakobdilif E Jan. 16, 2020, 5:58 p.m. OK MS C++ 2017 TESTS 45 467 177152000 2500
20875683 rex321 E Sept. 23, 2016, 9:21 p.m. OK Ocaml TESTS 45 93 3788800 2500
18011979 jhilary E May 21, 2016, 12:43 a.m. OK PyPy 2 TESTS 45 468 31846400 2500
18281514 vjudge2 E June 7, 2016, 9:17 a.m. OK PyPy 2 TESTS 45 514 37888000 2500
18279564 ccdd4211 E June 7, 2016, 6:29 a.m. OK Python 2 TESTS 45 1216 21811200 2500
18177652 vjudge3 E June 1, 2016, 6:01 a.m. OK Python 2 TESTS 45 1840 20582400 2500
18177839 vjudge4 E June 1, 2016, 6:18 a.m. OK Python 2 TESTS 45 1918 12800000 2500
18177622 mylibero E June 1, 2016, 5:57 a.m. OK Python 2 TESTS 45 1965 20480000 2500
18049807 orailly E May 24, 2016, 2:50 a.m. OK Python 3 TESTS 45 997 16588800 2500
25707601 mazicwong E March 22, 2017, 9:42 a.m. OK Python 3 TESTS 45 1294 28364800 2500
18438363 zhangyu19900418 E June 13, 2016, 10:09 p.m. OK Python 3 TESTS 45 1809 18534400 2500
18064442 dr.ikros E May 24, 2016, 9:59 p.m. OK Scala TESTS 45 670 55603200 2500

remove filters

Back to search problems