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 |
718
|
Codeforces Round 373 (Div. 1) |
FINISHED |
False |
7200 |
262976104 |
Sept. 23, 2016, 1:05 p.m. |
Problems
B"Today is Matvey's birthday. He never knows what to ask as a present so friends gave him a string s of length n. This string consists of only first eight English letters: 'a', 'b', ..., 'h'. First question that comes to mind is: who might ever need some string? Matvey is a special boy so he instantly found what to do with this string. He used it to build an undirected graph where vertices correspond to position in the string and there is an edge between distinct positions a and b (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89a, xe2 x80 x89b xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) if at least one of the following conditions hold: Then Matvey decided to find the diameter of this graph. Diameter is a maximum distance (length of the shortest path) among all pairs of vertices. Also, Matvey wants to find the number of pairs of vertices such that the distance between them is equal to the diameter of the graph. As he is very cool and experienced programmer he managed to solve this problem very fast. Will you do the same? 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 length of the string. The second line contains the string s itself. It's guaranteed that s consists of only first eight letters of English alphabet. Print two integers -- the diameter of the graph and the number of pairs of positions with the distance equal to the diameter. Consider the second sample. The maximum distance is 2. It's obtained for pairs (1, xe2 x80 x894), (2, xe2 x80 x894), (4, xe2 x80 x896) and (4, xe2 x80 x897)."... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
26330231 |
yyt16384 |
E |
April 13, 2017, 3:04 a.m. |
OK |
GNU C++ |
TESTS |
79 |
31 |
12800000 |
|
3400 |
35736188 |
Langlangago |
E |
Feb. 26, 2018, 3:05 p.m. |
OK |
GNU C++ |
TESTS |
79 |
31 |
23142400 |
|
3400 |
35733529 |
vjudge1 |
E |
Feb. 26, 2018, 1:36 p.m. |
OK |
GNU C++ |
TESTS |
79 |
31 |
23142400 |
|
3400 |
35664058 |
vjudge4 |
E |
Feb. 24, 2018, 11:30 p.m. |
OK |
GNU C++ |
TESTS |
79 |
46 |
7782400 |
|
3400 |
35733886 |
vjudge3 |
E |
Feb. 26, 2018, 1:48 p.m. |
OK |
GNU C++ |
TESTS |
79 |
46 |
23142400 |
|
3400 |
21278602 |
Los_Angelos_Laycurse |
E |
Oct. 8, 2016, 11:19 a.m. |
OK |
GNU C++ |
TESTS |
79 |
46 |
25190400 |
|
3400 |
22529380 |
Traumgeher |
E |
Nov. 27, 2016, 3:33 p.m. |
OK |
GNU C++ |
TESTS |
79 |
61 |
5529600 |
|
3400 |
31445555 |
aufeas |
E |
Oct. 17, 2017, 11:04 a.m. |
OK |
GNU C++ |
TESTS |
79 |
61 |
6451200 |
|
3400 |
35614541 |
vjudge3 |
E |
Feb. 24, 2018, 4:01 a.m. |
OK |
GNU C++ |
TESTS |
79 |
61 |
7782400 |
|
3400 |
21642052 |
aufeas |
E |
Oct. 21, 2016, 1:03 p.m. |
OK |
GNU C++ |
TESTS |
79 |
62 |
5529600 |
|
3400 |
47944017 |
skywalkert |
E |
Jan. 4, 2019, 6:23 p.m. |
OK |
GNU C++11 |
TESTS |
79 |
31 |
19251200 |
|
3400 |
34443657 |
ditoly |
E |
Jan. 22, 2018, 10:51 a.m. |
OK |
GNU C++11 |
TESTS |
79 |
31 |
22835200 |
|
3400 |
26828344 |
pacu |
E |
May 4, 2017, 4:54 a.m. |
OK |
GNU C++11 |
TESTS |
79 |
46 |
5734400 |
|
3400 |
32487140 |
kiiiiii |
E |
Nov. 20, 2017, 1:19 a.m. |
OK |
GNU C++11 |
TESTS |
79 |
46 |
7168000 |
|
3400 |
40983622 |
ReaLNero1 |
E |
July 30, 2018, 6:57 p.m. |
OK |
GNU C++11 |
TESTS |
79 |
46 |
20787200 |
|
3400 |
21278474 |
Los_Angelos_Laycurse |
E |
Oct. 8, 2016, 11:12 a.m. |
OK |
GNU C++11 |
TESTS |
79 |
46 |
26419200 |
|
3400 |
21273334 |
Los_Angelos_Laycurse |
E |
Oct. 8, 2016, 6:57 a.m. |
OK |
GNU C++11 |
TESTS |
79 |
46 |
26419200 |
|
3400 |
34251014 |
yyc_ |
E |
Jan. 17, 2018, 12:08 p.m. |
OK |
GNU C++11 |
TESTS |
79 |
46 |
110284800 |
|
3400 |
34251193 |
yyc_ |
E |
Jan. 17, 2018, 12:15 p.m. |
OK |
GNU C++11 |
TESTS |
79 |
61 |
110387200 |
|
3400 |
32418085 |
lych_cys |
E |
Nov. 18, 2017, 2:02 a.m. |
OK |
GNU C++11 |
TESTS |
79 |
62 |
5017600 |
|
3400 |
34472775 |
CommonAnts |
E |
Jan. 23, 2018, 7:44 a.m. |
OK |
GNU C++14 |
TESTS |
79 |
31 |
22835200 |
|
3400 |
51745097 |
_23333 |
E |
March 23, 2019, 7:20 a.m. |
OK |
GNU C++14 |
TESTS |
79 |
46 |
17408000 |
|
3400 |
34196598 |
leoly |
E |
Jan. 15, 2018, 12:32 p.m. |
OK |
GNU C++14 |
TESTS |
79 |
62 |
7065600 |
|
3400 |
21273189 |
Los_Angelos_Laycurse |
E |
Oct. 8, 2016, 6:49 a.m. |
OK |
GNU C++14 |
TESTS |
79 |
62 |
26521600 |
|
3400 |
34428602 |
FallDream |
E |
Jan. 22, 2018, 1:32 a.m. |
OK |
GNU C++14 |
TESTS |
79 |
78 |
11673600 |
|
3400 |
51737620 |
Created_equal |
E |
March 23, 2019, 3:48 a.m. |
OK |
GNU C++14 |
TESTS |
79 |
78 |
70144000 |
|
3400 |
51737643 |
Created_equal |
E |
March 23, 2019, 3:49 a.m. |
OK |
GNU C++14 |
TESTS |
79 |
92 |
70144000 |
|
3400 |
45158535 |
The_Unbeatable |
E |
Nov. 1, 2018, 6:39 a.m. |
OK |
GNU C++14 |
TESTS |
79 |
93 |
8089600 |
|
3400 |
51737745 |
Created_equal |
E |
March 23, 2019, 3:53 a.m. |
OK |
GNU C++14 |
TESTS |
79 |
93 |
70144000 |
|
3400 |
51737527 |
Created_equal |
E |
March 23, 2019, 3:42 a.m. |
OK |
GNU C++14 |
TESTS |
79 |
93 |
70144000 |
|
3400 |
51278880 |
kczno1 |
E |
March 14, 2019, 1:27 a.m. |
OK |
GNU C++17 |
TESTS |
79 |
31 |
83251200 |
|
3400 |
50213393 |
kczno1 |
E |
Feb. 20, 2019, 2:20 a.m. |
OK |
GNU C++17 |
TESTS |
79 |
46 |
22323200 |
|
3400 |
50214467 |
kczno1 |
E |
Feb. 20, 2019, 3:17 a.m. |
OK |
GNU C++17 |
TESTS |
79 |
62 |
5529600 |
|
3400 |
50213226 |
kczno1 |
E |
Feb. 20, 2019, 2:11 a.m. |
OK |
GNU C++17 |
TESTS |
79 |
217 |
22323200 |
|
3400 |
63169509 |
gongsuidashen |
E |
Oct. 22, 2019, 4:01 p.m. |
OK |
GNU C++17 |
TESTS |
79 |
264 |
24268800 |
|
3400 |
57069426 |
Benq |
E |
July 15, 2019, 1:36 a.m. |
OK |
GNU C++17 |
TESTS |
79 |
374 |
5017600 |
|
3400 |
57147393 |
hjk1030 |
E |
July 16, 2019, 1:27 p.m. |
OK |
GNU C++17 |
TESTS |
79 |
390 |
9420800 |
|
3400 |
56526553 |
maras |
E |
July 4, 2019, 5:24 p.m. |
OK |
GNU C++17 |
TESTS |
79 |
436 |
6348800 |
|
3400 |
64685684 |
vjudge3 |
E |
Nov. 11, 2019, 11:40 a.m. |
OK |
GNU C++17 |
TESTS |
79 |
468 |
5017600 |
|
3400 |
64678181 |
Wiz_HUA |
E |
Nov. 11, 2019, 8:55 a.m. |
OK |
GNU C++17 |
TESTS |
79 |
468 |
108441600 |
|
3400 |
58469003 |
life_errror_executed |
E |
Aug. 8, 2019, 9:47 p.m. |
OK |
Java 8 |
TESTS |
79 |
1528 |
0 |
|
3400 |
22497653 |
emo |
E |
Nov. 25, 2016, 8:52 p.m. |
OK |
Java 8 |
TESTS |
79 |
1778 |
0 |
|
3400 |
64678319 |
vjudge1 |
E |
Nov. 11, 2019, 8:58 a.m. |
OK |
MS C++ |
TESTS |
79 |
748 |
108339200 |
|
3400 |
21241085 |
Los_Angelos_Laycurse |
E |
Oct. 6, 2016, 4:46 p.m. |
OK |
MS C++ |
TESTS |
79 |
1154 |
40857600 |
|
3400 |
remove filters
Back to search problems