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 |
919
|
Codeforces Round 460 (Div. 2) |
FINISHED |
False |
7200 |
220035286 |
Jan. 31, 2018, 1:05 p.m. |
Problems
B'You are given a graph with n nodes and m directed edges. One lowercase letter is assigned to each node. We define a path 's value as the number of the most frequently occurring letter. For example, if letters on a path are "abaca", then the value of that path is 3 . Your task is find a path whose value is the largest. The first line contains two positive integers n, m ( 1 <= q n, m <= q 300 ,000 ), denoting that the graph has n nodes and m directed edges. The second line contains a string s with only lowercase English letters. The i -th character is the letter assigned to the i -th node. Then m lines follow. Each line contains two integers x, y ( 1 <= q x, y <= q n ), describing a directed edge from x to y . Note that x can be equal to y and there can be multiple edges between x and y . Also the graph can be not connected. Output a single line with a single integer denoting the largest value. If the value can be arbitrarily large, output -1 instead. In the first sample, the path with largest value is 1 to 3 to 4 to 5 . The value is 3 because the letter 'a ' appears 3 times. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
34789663 |
rabbitcxk |
D |
Feb. 1, 2018, 5:06 a.m. |
OK |
FPC |
TESTS |
53 |
234 |
60211200 |
|
1700 |
34787565 |
AsahiKasugano |
D |
Feb. 1, 2018, 3:34 a.m. |
OK |
FPC |
TESTS |
53 |
546 |
64409600 |
|
1700 |
35433635 |
weskerhluffy |
D |
Feb. 17, 2018, 11:58 p.m. |
OK |
GNU C |
TESTS |
53 |
1404 |
95027200 |
|
1700 |
34996865 |
streek36 |
D |
Feb. 7, 2018, 11:47 a.m. |
OK |
GNU C++ |
TESTS |
53 |
124 |
39731200 |
|
1700 |
34786885 |
vjudge3 |
D |
Feb. 1, 2018, 2:58 a.m. |
OK |
GNU C++ |
TESTS |
53 |
140 |
39628800 |
|
1700 |
34785728 |
zhenGG |
D |
Feb. 1, 2018, 1:58 a.m. |
OK |
GNU C++ |
TESTS |
53 |
140 |
39628800 |
|
1700 |
34823033 |
peng_ym |
D |
Feb. 2, 2018, 1:06 a.m. |
OK |
GNU C++ |
TESTS |
53 |
140 |
57856000 |
|
1700 |
34802994 |
pengym |
D |
Feb. 1, 2018, 12:54 p.m. |
OK |
GNU C++ |
TESTS |
53 |
140 |
57856000 |
|
1700 |
34801250 |
functionendless |
D |
Feb. 1, 2018, noon |
OK |
GNU C++ |
TESTS |
53 |
140 |
102400000 |
|
1700 |
37650712 |
LJZ_C |
D |
April 27, 2018, 3:58 a.m. |
OK |
GNU C++ |
TESTS |
53 |
155 |
41062400 |
|
1700 |
34785239 |
_AxclbkJ_ |
D |
Feb. 1, 2018, 1:33 a.m. |
OK |
GNU C++ |
TESTS |
53 |
155 |
48332800 |
|
1700 |
34802381 |
lin714093880 |
D |
Feb. 1, 2018, 12:36 p.m. |
OK |
GNU C++ |
TESTS |
53 |
155 |
57856000 |
|
1700 |
34801879 |
pengym |
D |
Feb. 1, 2018, 12:20 p.m. |
OK |
GNU C++ |
TESTS |
53 |
155 |
57856000 |
|
1700 |
57262433 |
zekrom_dream |
D |
July 18, 2019, 5:51 a.m. |
OK |
GNU C++11 |
TESTS |
53 |
109 |
46182400 |
|
1700 |
58851199 |
Adelard |
D |
Aug. 15, 2019, 7:34 a.m. |
OK |
GNU C++11 |
TESTS |
53 |
124 |
38092800 |
|
1700 |
49987464 |
vjudge4 |
D |
Feb. 16, 2019, 11:12 a.m. |
OK |
GNU C++11 |
TESTS |
53 |
124 |
42496000 |
|
1700 |
49978768 |
vjudge1 |
D |
Feb. 16, 2019, 7:17 a.m. |
OK |
GNU C++11 |
TESTS |
53 |
124 |
42496000 |
|
1700 |
52522868 |
luogu_bot1 |
D |
April 9, 2019, 9:49 a.m. |
OK |
GNU C++11 |
TESTS |
53 |
124 |
44953600 |
|
1700 |
48708684 |
KING_LRL |
D |
Jan. 22, 2019, 7:18 a.m. |
OK |
GNU C++11 |
TESTS |
53 |
124 |
48537600 |
|
1700 |
54325960 |
Silvio_Manuel |
D |
May 18, 2019, 2:42 a.m. |
OK |
GNU C++11 |
TESTS |
53 |
124 |
57344000 |
|
1700 |
35001393 |
shuitiacji |
D |
Feb. 7, 2018, 2:21 p.m. |
OK |
GNU C++11 |
TESTS |
53 |
124 |
92672000 |
|
1700 |
59137574 |
emptyboxs |
D |
Aug. 20, 2019, 1:13 p.m. |
OK |
GNU C++11 |
TESTS |
53 |
139 |
40140800 |
|
1700 |
43114136 |
fks20011206 |
D |
Sept. 20, 2018, 12:57 p.m. |
OK |
GNU C++11 |
TESTS |
53 |
140 |
43724800 |
|
1700 |
34829331 |
Tivility |
D |
Feb. 2, 2018, 6:54 a.m. |
OK |
GNU C++14 |
TESTS |
53 |
187 |
39424000 |
|
1700 |
34828915 |
Tivility |
D |
Feb. 2, 2018, 6:35 a.m. |
OK |
GNU C++14 |
TESTS |
53 |
187 |
39424000 |
|
1700 |
34786119 |
xiaolongbao |
D |
Feb. 1, 2018, 2:17 a.m. |
OK |
GNU C++14 |
TESTS |
53 |
187 |
61337600 |
|
1700 |
34785587 |
xiaolongbao |
D |
Feb. 1, 2018, 1:51 a.m. |
OK |
GNU C++14 |
TESTS |
53 |
187 |
61337600 |
|
1700 |
34829021 |
Tivility |
D |
Feb. 2, 2018, 6:40 a.m. |
OK |
GNU C++14 |
TESTS |
53 |
202 |
39424000 |
|
1700 |
34785164 |
xiaolongbao |
D |
Feb. 1, 2018, 1:29 a.m. |
OK |
GNU C++14 |
TESTS |
53 |
202 |
64921600 |
|
1700 |
34785686 |
5120160705 |
D |
Feb. 1, 2018, 1:56 a.m. |
OK |
GNU C++14 |
TESTS |
53 |
202 |
69017600 |
|
1700 |
34785665 |
5120160705 |
D |
Feb. 1, 2018, 1:55 a.m. |
OK |
GNU C++14 |
TESTS |
53 |
202 |
69017600 |
|
1700 |
64794129 |
welkinstream |
D |
Nov. 13, 2019, 12:17 p.m. |
OK |
GNU C++14 |
TESTS |
53 |
218 |
39116800 |
|
1700 |
34909007 |
NoNameError |
D |
Feb. 3, 2018, 9:12 p.m. |
OK |
GNU C++14 |
TESTS |
53 |
218 |
40960000 |
|
1700 |
53459687 |
chenhongta0 |
D |
April 28, 2019, 6:23 a.m. |
OK |
GNU C++17 |
TESTS |
53 |
202 |
45056000 |
|
1700 |
57349482 |
lienquanpc |
D |
July 20, 2019, 2:29 a.m. |
OK |
GNU C++17 |
TESTS |
53 |
218 |
39116800 |
|
1700 |
54822597 |
1640616850 |
D |
May 30, 2019, 4:18 a.m. |
OK |
GNU C++17 |
TESTS |
53 |
218 |
42700800 |
|
1700 |
50520115 |
riguangx |
D |
Feb. 26, 2019, 8:56 a.m. |
OK |
GNU C++17 |
TESTS |
53 |
218 |
45056000 |
|
1700 |
52290799 |
vjudge1 |
D |
April 4, 2019, 1:23 a.m. |
OK |
GNU C++17 |
TESTS |
53 |
218 |
46284800 |
|
1700 |
49517199 |
bhargav_0085 |
D |
Feb. 6, 2019, 4:30 a.m. |
OK |
GNU C++17 |
TESTS |
53 |
233 |
39116800 |
|
1700 |
58230347 |
KellyLu |
D |
Aug. 3, 2019, 4:30 p.m. |
OK |
GNU C++17 |
TESTS |
53 |
233 |
41369600 |
|
1700 |
58623743 |
vjudge1 |
D |
Aug. 11, 2019, 4:40 p.m. |
OK |
GNU C++17 |
TESTS |
53 |
233 |
46387200 |
|
1700 |
58619268 |
yeyyx |
D |
Aug. 11, 2019, 3:13 p.m. |
OK |
GNU C++17 |
TESTS |
53 |
233 |
46387200 |
|
1700 |
58619030 |
vjudge2 |
D |
Aug. 11, 2019, 2:57 p.m. |
OK |
GNU C++17 |
TESTS |
53 |
233 |
46387200 |
|
1700 |
43972883 |
Marii |
D |
Oct. 7, 2018, 8 p.m. |
OK |
Go |
TESTS |
53 |
717 |
63385600 |
|
1700 |
57604952 |
JCKG |
D |
July 23, 2019, 5:28 p.m. |
OK |
Java 8 |
TESTS |
53 |
420 |
65638400 |
|
1700 |
49183303 |
aman28rwt |
D |
Jan. 30, 2019, 3:51 a.m. |
OK |
Java 8 |
TESTS |
53 |
436 |
77721600 |
|
1700 |
49183286 |
aman28rwt |
D |
Jan. 30, 2019, 3:50 a.m. |
OK |
Java 8 |
TESTS |
53 |
436 |
77824000 |
|
1700 |
48885517 |
kusomushi |
D |
Jan. 24, 2019, 12:10 p.m. |
OK |
Java 8 |
TESTS |
53 |
436 |
81612800 |
|
1700 |
34815992 |
prashanth_rebala |
D |
Feb. 1, 2018, 6:35 p.m. |
OK |
Java 8 |
TESTS |
53 |
436 |
119193600 |
|
1700 |
45536543 |
Jarik |
D |
Nov. 10, 2018, 4:58 p.m. |
OK |
Java 8 |
TESTS |
53 |
499 |
83148800 |
|
1700 |
48884169 |
kusomushi |
D |
Jan. 24, 2019, 11:39 a.m. |
OK |
Java 8 |
TESTS |
53 |
514 |
74752000 |
|
1700 |
45537767 |
Jarik |
D |
Nov. 10, 2018, 5:05 p.m. |
OK |
Java 8 |
TESTS |
53 |
561 |
83148800 |
|
1700 |
36090797 |
donli |
D |
March 9, 2018, 7:57 a.m. |
OK |
Java 8 |
TESTS |
53 |
561 |
107622400 |
|
1700 |
66737516 |
bluesky111 |
D |
Dec. 12, 2019, 7:35 p.m. |
OK |
Java 8 |
TESTS |
53 |
577 |
143052800 |
|
1700 |
58232721 |
og.kostya |
D |
Aug. 3, 2019, 5:43 p.m. |
OK |
Mono C# |
TESTS |
53 |
623 |
125440000 |
|
1700 |
34802838 |
tattosha_aptan |
D |
Feb. 1, 2018, 12:49 p.m. |
OK |
MS C# |
TESTS |
53 |
1154 |
121139200 |
|
1700 |
34879162 |
Nightmare_n |
D |
Feb. 3, 2018, 12:57 a.m. |
OK |
MS C++ |
TESTS |
53 |
202 |
41881600 |
|
1700 |
58847039 |
vjudge5 |
D |
Aug. 15, 2019, 5:53 a.m. |
OK |
MS C++ |
TESTS |
53 |
217 |
50688000 |
|
1700 |
37035811 |
vjudge3 |
D |
April 7, 2018, 3:19 a.m. |
OK |
MS C++ |
TESTS |
53 |
218 |
42086400 |
|
1700 |
60027394 |
echr |
D |
Sept. 4, 2019, 2:30 p.m. |
OK |
MS C++ |
TESTS |
53 |
218 |
58777600 |
|
1700 |
48972338 |
vjudge4 |
D |
Jan. 26, 2019, 8:38 a.m. |
OK |
MS C++ |
TESTS |
53 |
233 |
47206400 |
|
1700 |
37505543 |
vjudge5 |
D |
April 21, 2018, 6:47 a.m. |
OK |
MS C++ |
TESTS |
53 |
233 |
60313600 |
|
1700 |
48771370 |
vjudge4 |
D |
Jan. 23, 2019, 12:28 a.m. |
OK |
MS C++ |
TESTS |
53 |
233 |
84377600 |
|
1700 |
34792468 |
1627405131_ws |
D |
Feb. 1, 2018, 6:52 a.m. |
OK |
MS C++ |
TESTS |
53 |
234 |
55296000 |
|
1700 |
34798656 |
SleepZzz |
D |
Feb. 1, 2018, 10:33 a.m. |
OK |
MS C++ |
TESTS |
53 |
234 |
56422400 |
|
1700 |
65132970 |
vjudge1 |
D |
Nov. 16, 2019, 4:39 a.m. |
OK |
MS C++ |
TESTS |
53 |
249 |
47308800 |
|
1700 |
52225977 |
work_hard. |
D |
April 2, 2019, 9:29 a.m. |
OK |
MS C++ 2017 |
TESTS |
53 |
343 |
46284800 |
|
1700 |
58845902 |
vjudge1 |
D |
Aug. 15, 2019, 5:18 a.m. |
OK |
MS C++ 2017 |
TESTS |
53 |
467 |
8704000 |
|
1700 |
55825826 |
index_ |
D |
June 20, 2019, 10:48 a.m. |
OK |
MS C++ 2017 |
TESTS |
53 |
623 |
86937600 |
|
1700 |
69933692 |
OneBit74 |
D |
Feb. 1, 2020, 2:14 a.m. |
OK |
MS C++ 2017 |
TESTS |
53 |
1434 |
53248000 |
|
1700 |
36536038 |
Kengreville |
D |
March 23, 2018, 4:07 p.m. |
OK |
Ocaml |
TESTS |
53 |
592 |
71372800 |
|
1700 |
36536010 |
Kengreville |
D |
March 23, 2018, 4:06 p.m. |
OK |
Ocaml |
TESTS |
53 |
623 |
71372800 |
|
1700 |
38981576 |
Ali_Pi |
D |
June 6, 2018, 1:51 a.m. |
OK |
PyPy 2 |
TESTS |
53 |
2495 |
102502400 |
|
1700 |
54967913 |
anshuman16423 |
D |
June 2, 2019, 7:16 a.m. |
OK |
PyPy 2 |
TESTS |
53 |
2839 |
102297600 |
|
1700 |
34802854 |
cojna |
D |
Feb. 1, 2018, 12:50 p.m. |
OK |
Rust |
TESTS |
53 |
1060 |
84480000 |
|
1700 |
34798724 |
cojna |
D |
Feb. 1, 2018, 10:35 a.m. |
OK |
Rust |
TESTS |
53 |
1107 |
84480000 |
|
1700 |
remove filters
Back to search problems