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 |
659
|
Codeforces Round 346 (Div. 2) |
FINISHED |
False |
9000 |
278258104 |
March 30, 2016, 4:05 p.m. |
Problems
B"Long ago, Vasily built a good fence at his country house. Vasily calls a fence good, if it is a series of n consecutively fastened vertical boards of centimeter width, the height of each in centimeters is a positive integer. The house owner remembers that the height of the i-th board to the left is hi. Today Vasily decided to change the design of the fence he had built, by cutting his top connected part so that the fence remained good. The cut part should consist of only the upper parts of the boards, while the adjacent parts must be interconnected (share a non-zero length before cutting out of the fence). You, as Vasily's curious neighbor, will count the number of possible ways to cut exactly one part as is described above. Two ways to cut a part are called distinct, if for the remaining fences there is such i, that the height of the i-th boards vary. As Vasily's fence can be very high and long, get the remainder after dividing the required number of ways by 1 xe2 x80 x89000 xe2 x80 x89000 xe2 x80 x89007 (109 xe2 x80 x89+ xe2 x80 x897). The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891 xe2 x80 x89000 xe2 x80 x89000) -- the number of boards in Vasily's fence. The second line contains n space-separated numbers h1, xe2 x80 x89h2, xe2 x80 x89..., xe2 x80 x89hn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89hi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109), where hi equals the height of the i-th board to the left. Print the remainder after dividing r by 1 xe2 x80 x89000 xe2 x80 x89000 xe2 x80 x89007, where r is the number of ways to cut exactly one connected part so that the part consisted of the upper parts of the boards and the remaining fence was good. From the fence from the first example it is impossible to cut exactly one piece so as the remaining fence was good. All the possible variants of the resulting fence from the second sample look as follows (the grey shows the cut out part): "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
41261490 |
vjudge5 |
G |
Aug. 6, 2018, 3:05 a.m. |
OK |
GNU C++ |
TESTS |
50 |
77 |
12185600 |
|
2500 |
41261457 |
CalvinJin |
G |
Aug. 6, 2018, 3:04 a.m. |
OK |
GNU C++ |
TESTS |
50 |
77 |
12185600 |
|
2500 |
17321121 |
Arturia |
G |
April 15, 2016, 12:13 a.m. |
OK |
GNU C++ |
TESTS |
50 |
93 |
0 |
|
2500 |
40984625 |
ReaLNero1 |
G |
July 30, 2018, 7:29 p.m. |
OK |
GNU C++ |
TESTS |
50 |
93 |
12083200 |
|
2500 |
18911326 |
AkaneSasu |
G |
July 6, 2016, 4:17 a.m. |
OK |
GNU C++ |
TESTS |
50 |
108 |
0 |
|
2500 |
21258095 |
zhan8855 |
G |
Oct. 7, 2016, 12:56 p.m. |
OK |
GNU C++ |
TESTS |
50 |
108 |
21094400 |
|
2500 |
41381171 |
luogu_bot3 |
G |
Aug. 9, 2018, 2:22 a.m. |
OK |
GNU C++ |
TESTS |
50 |
109 |
3993600 |
|
2500 |
41308150 |
vjudge4 |
G |
Aug. 7, 2018, 2:14 p.m. |
OK |
GNU C++ |
TESTS |
50 |
109 |
16076800 |
|
2500 |
41381175 |
vjudge5 |
G |
Aug. 9, 2018, 2:22 a.m. |
OK |
GNU C++ |
TESTS |
50 |
124 |
3993600 |
|
2500 |
41381108 |
luogu_bot3 |
G |
Aug. 9, 2018, 2:19 a.m. |
OK |
GNU C++ |
TESTS |
50 |
124 |
3993600 |
|
2500 |
57270303 |
luogu_bot1 |
G |
July 18, 2019, 8:40 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
78 |
12083200 |
|
2500 |
17299029 |
Theodor1000 |
G |
April 13, 2016, 7:59 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
93 |
3891200 |
|
2500 |
18045087 |
arasmus |
G |
May 23, 2016, 2:49 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
109 |
26316800 |
|
2500 |
18129373 |
khatribiru |
G |
May 28, 2016, 9:25 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
124 |
26316800 |
|
2500 |
57284116 |
luogu_bot5 |
G |
July 18, 2019, 1:53 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
124 |
32051200 |
|
2500 |
57284937 |
Md_Drew |
G |
July 18, 2019, 2:13 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
140 |
23859200 |
|
2500 |
57303698 |
luogu_bot5 |
G |
July 19, 2019, 2:10 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
140 |
32051200 |
|
2500 |
56624895 |
KMAASZRAA |
G |
July 6, 2019, 1:23 p.m. |
OK |
GNU C++11 |
TESTS |
50 |
202 |
3993600 |
|
2500 |
57272136 |
Silver_Star |
G |
July 18, 2019, 9:16 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
202 |
7987200 |
|
2500 |
57272034 |
Silver_Star |
G |
July 18, 2019, 9:14 a.m. |
OK |
GNU C++11 |
TESTS |
50 |
202 |
7987200 |
|
2500 |
45109499 |
KATATONIA |
G |
Oct. 30, 2018, 5:46 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
280 |
3993600 |
|
2500 |
57832460 |
dbdbab |
G |
July 27, 2019, 6:29 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
280 |
7987200 |
|
2500 |
54725561 |
vjudge3 |
G |
May 27, 2019, 8:12 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
280 |
7987200 |
|
2500 |
49122667 |
LODB---D |
G |
Jan. 28, 2019, 8:11 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
280 |
7987200 |
|
2500 |
54725466 |
vjudge5 |
G |
May 27, 2019, 8:08 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
280 |
8294400 |
|
2500 |
54790030 |
arshia_119 |
G |
May 29, 2019, 6:38 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
280 |
24064000 |
|
2500 |
44895417 |
_no0B |
G |
Oct. 26, 2018, 6:22 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
295 |
16076800 |
|
2500 |
54824871 |
vjudge3 |
G |
May 30, 2019, 5:51 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
295 |
24064000 |
|
2500 |
27306453 |
MaxxaM |
G |
May 23, 2017, 5:52 p.m. |
OK |
GNU C++14 |
TESTS |
50 |
296 |
3993600 |
|
2500 |
54731486 |
vjudge5 |
G |
May 28, 2019, 12:40 a.m. |
OK |
GNU C++14 |
TESTS |
50 |
296 |
8294400 |
|
2500 |
47368056 |
how_to_become_purple |
G |
Dec. 22, 2018, 12:37 p.m. |
OK |
GNU C++17 |
TESTS |
50 |
280 |
3993600 |
|
2500 |
53975846 |
mohammadrobot |
G |
May 11, 2019, 3:56 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
296 |
3993600 |
|
2500 |
54976047 |
Balerion |
G |
June 2, 2019, 10:52 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
296 |
7987200 |
|
2500 |
63940764 |
animeFORever |
G |
Oct. 31, 2019, 5:24 p.m. |
OK |
GNU C++17 |
TESTS |
50 |
296 |
12083200 |
|
2500 |
54976191 |
vjudge5 |
G |
June 2, 2019, 10:56 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
311 |
7987200 |
|
2500 |
47190628 |
_Ore_ |
G |
Dec. 18, 2018, 12:05 p.m. |
OK |
GNU C++17 |
TESTS |
50 |
311 |
7987200 |
|
2500 |
41322797 |
vjudge3 |
G |
Aug. 8, 2018, 2:39 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
327 |
3993600 |
|
2500 |
41322786 |
Zerokei |
G |
Aug. 8, 2018, 2:38 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
327 |
3993600 |
|
2500 |
65681858 |
meeeeeeeeendko |
G |
Nov. 24, 2019, 8:32 p.m. |
OK |
GNU C++17 |
TESTS |
50 |
327 |
7987200 |
|
2500 |
67632778 |
SuiT_Up |
G |
Dec. 26, 2019, 5:08 a.m. |
OK |
GNU C++17 |
TESTS |
50 |
327 |
16076800 |
|
2500 |
17508891 |
LocknKey |
G |
April 25, 2016, 12:42 p.m. |
OK |
Java 7 |
TESTS |
50 |
483 |
118784000 |
|
2500 |
17381241 |
YakutovDmitriy |
G |
April 18, 2016, 8:46 p.m. |
OK |
Java 8 |
TESTS |
50 |
420 |
100659200 |
|
2500 |
36059912 |
BiIIy |
G |
March 8, 2018, 2:54 a.m. |
OK |
Java 8 |
TESTS |
50 |
436 |
100864000 |
|
2500 |
19218083 |
alibaba |
G |
July 18, 2016, 6:19 p.m. |
OK |
Java 8 |
TESTS |
50 |
467 |
83865600 |
|
2500 |
17272730 |
sandun |
G |
April 11, 2016, 1:18 a.m. |
OK |
Java 8 |
TESTS |
50 |
670 |
170086400 |
|
2500 |
17462408 |
jagauthier |
G |
April 22, 2016, 7:59 p.m. |
OK |
Java 8 |
TESTS |
50 |
1949 |
29184000 |
|
2500 |
17477829 |
duckladydinh |
G |
April 24, 2016, 9 a.m. |
OK |
Java 8 |
TESTS |
50 |
1949 |
100556800 |
|
2500 |
19830615 |
rkm0959 |
G |
Aug. 12, 2016, 2:20 p.m. |
OK |
MS C++ |
TESTS |
50 |
295 |
28467200 |
|
2500 |
19174914 |
pseudo |
G |
July 16, 2016, 2:19 p.m. |
OK |
MS C++ |
TESTS |
50 |
373 |
7987200 |
|
2500 |
17311880 |
Ywind |
G |
April 14, 2016, 8:53 a.m. |
OK |
MS C++ |
TESTS |
50 |
982 |
3993600 |
|
2500 |
23656804 |
MZuev |
G |
Jan. 8, 2017, 9:07 p.m. |
OK |
MS C++ |
TESTS |
50 |
1107 |
10137600 |
|
2500 |
17274247 |
ksikka |
G |
April 11, 2016, 6:42 a.m. |
OK |
PyPy 2 |
TESTS |
50 |
608 |
92876800 |
|
2500 |
35887939 |
______M______ |
G |
March 3, 2018, 2:13 p.m. |
OK |
PyPy 3 |
TESTS |
50 |
1263 |
114585600 |
|
2500 |
21130571 |
Vosatorp |
G |
Oct. 3, 2016, 7:34 a.m. |
OK |
PyPy 3 |
TESTS |
50 |
1466 |
101068800 |
|
2500 |
remove filters
Back to search problems