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.
Problems
B"You are given n sequences. Each sequence consists of positive integers, not exceeding m. All integers in one sequence are distinct, but the same integer may appear in multiple sequences. The length of the i-th sequence is ki. Each second integers in each of the sequences are shifted by one to the left, i.e. integers at positions i xe2 x80 x89> xe2 x80 x891 go to positions i xe2 x80 x89- xe2 x80 x891, while the first integers becomes the last. Each second we take the first integer of each sequence and write it down to a new array. Then, for each value x from 1 to m we compute the longest segment of the array consisting of element x only. The above operation is performed for 10100 seconds. For each integer from 1 to m find out the longest segment found at this time. The first line of the input contains two integers n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000) -- the number of sequences and the maximum integer that can appear in the sequences. Then follow n lines providing the sequences. Each of them starts with an integer ki (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ki xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8940) -- the number of integers in the sequence, proceeded by ki positive integers -- elements of the sequence. It's guaranteed that all integers in each sequence are pairwise distinct and do not exceed m. The total length of all sequences doesn't exceed 200 xe2 x80 x89000. Print m integers, the i-th of them should be equal to the length of the longest segment of the array with all its values equal to i during the first 10100 seconds. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
33982378 |
E.Space |
F |
Jan. 7, 2018, 12:10 p.m. |
OK |
GNU C++ |
TESTS |
73 |
46 |
15667200 |
|
2800 |
33982358 |
E.Space |
F |
Jan. 7, 2018, 12:09 p.m. |
OK |
GNU C++ |
TESTS |
73 |
46 |
15974400 |
|
2800 |
40983516 |
ReaLNero1 |
F |
July 30, 2018, 6:54 p.m. |
OK |
GNU C++ |
TESTS |
73 |
61 |
13619200 |
|
2800 |
21562841 |
Hillan |
F |
Oct. 18, 2016, 9:47 a.m. |
OK |
GNU C++ |
TESTS |
73 |
62 |
22016000 |
|
2800 |
21226039 |
zhanglexing |
F |
Oct. 6, 2016, 4:51 a.m. |
OK |
GNU C++ |
TESTS |
73 |
77 |
33894400 |
|
2800 |
21380711 |
Talon_F |
F |
Oct. 12, 2016, 12:03 p.m. |
OK |
GNU C++ |
TESTS |
73 |
77 |
70041600 |
|
2800 |
21128754 |
UsedToBe |
F |
Oct. 3, 2016, 5 a.m. |
OK |
GNU C++ |
TESTS |
73 |
78 |
6758400 |
|
2800 |
24955975 |
Dylans |
F |
Feb. 24, 2017, 6:14 a.m. |
OK |
GNU C++ |
TESTS |
73 |
78 |
9216000 |
|
2800 |
21110565 |
Owaski |
F |
Oct. 2, 2016, 9:27 a.m. |
OK |
GNU C++ |
TESTS |
73 |
93 |
5734400 |
|
2800 |
27575879 |
vjudge5 |
F |
June 5, 2017, 5:08 a.m. |
OK |
GNU C++ |
TESTS |
73 |
93 |
24371200 |
|
2800 |
44825470 |
luogu_bot3 |
F |
Oct. 25, 2018, 5:40 a.m. |
OK |
GNU C++11 |
TESTS |
73 |
46 |
22016000 |
|
2800 |
52307449 |
CYJian |
F |
April 4, 2019, 12:58 p.m. |
OK |
GNU C++11 |
TESTS |
73 |
61 |
7065600 |
|
2800 |
52307486 |
CYJJJian |
F |
April 4, 2019, 12:59 p.m. |
OK |
GNU C++11 |
TESTS |
73 |
62 |
7065600 |
|
2800 |
52305190 |
hjsjhn |
F |
April 4, 2019, 11:42 a.m. |
OK |
GNU C++11 |
TESTS |
73 |
62 |
39731200 |
|
2800 |
51845123 |
EthanZyh |
F |
March 26, 2019, 3:50 a.m. |
OK |
GNU C++11 |
TESTS |
73 |
62 |
40345600 |
|
2800 |
51457670 |
khaled.farouk_2 |
F |
March 18, 2019, 5:52 p.m. |
OK |
GNU C++11 |
TESTS |
73 |
62 |
68096000 |
|
2800 |
33401899 |
xc01 |
F |
Dec. 19, 2017, 8:41 a.m. |
OK |
GNU C++11 |
TESTS |
73 |
62 |
70348800 |
|
2800 |
52303485 |
Daniel_yuan |
F |
April 4, 2019, 10:46 a.m. |
OK |
GNU C++11 |
TESTS |
73 |
62 |
212480000 |
|
2800 |
21180461 |
NiroBC |
F |
Oct. 4, 2016, 6:50 a.m. |
OK |
GNU C++11 |
TESTS |
73 |
77 |
5529600 |
|
2800 |
52299714 |
luogu_bot3 |
F |
April 4, 2019, 8:21 a.m. |
OK |
GNU C++11 |
TESTS |
73 |
77 |
10649600 |
|
2800 |
50062685 |
FlyWhite |
F |
Feb. 17, 2019, 1:23 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
93 |
3584000 |
|
2800 |
51282567 |
vjudge4 |
F |
March 14, 2019, 5:14 a.m. |
OK |
GNU C++14 |
TESTS |
73 |
109 |
3584000 |
|
2800 |
21089803 |
bmerry |
F |
Oct. 1, 2016, 3:46 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
109 |
4608000 |
|
2800 |
62400421 |
melancholic_fat_otaku |
F |
Oct. 12, 2019, 7:10 a.m. |
OK |
GNU C++14 |
TESTS |
73 |
109 |
7168000 |
|
2800 |
21090638 |
AmberFrame |
F |
Oct. 1, 2016, 3:54 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
109 |
7270400 |
|
2800 |
21088540 |
Nezzar |
F |
Oct. 1, 2016, 3:36 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
124 |
8806400 |
|
2800 |
37979170 |
4l5n3 |
F |
May 6, 2018, 7:42 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
124 |
9420800 |
|
2800 |
21093765 |
Deemo |
F |
Oct. 1, 2016, 5:06 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
124 |
11468800 |
|
2800 |
21338608 |
jasonvictoryan |
F |
Oct. 10, 2016, 1:24 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
124 |
39219200 |
|
2800 |
21124084 |
kraskevich |
F |
Oct. 2, 2016, 7:56 p.m. |
OK |
GNU C++14 |
TESTS |
73 |
139 |
7168000 |
|
2800 |
51438031 |
Shayan.P |
F |
March 18, 2019, 8 a.m. |
OK |
GNU C++17 |
TESTS |
73 |
93 |
7168000 |
|
2800 |
56984682 |
Benq |
F |
July 13, 2019, 3:22 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
109 |
7270400 |
|
2800 |
68398244 |
Arianfk |
F |
Jan. 8, 2020, 12:03 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
109 |
17203200 |
|
2800 |
59484730 |
t_swizzle141 |
F |
Aug. 25, 2019, 4:44 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
124 |
4505600 |
|
2800 |
67176751 |
fsociety00 |
F |
Dec. 18, 2019, 7:41 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
124 |
5324800 |
|
2800 |
53282008 |
gubeiqg |
F |
April 25, 2019, 12:22 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
156 |
45158400 |
|
2800 |
68101137 |
milisav |
F |
Jan. 3, 2020, 3:08 a.m. |
OK |
GNU C++17 |
TESTS |
73 |
171 |
75776000 |
|
2800 |
67606987 |
hjk1030 |
F |
Dec. 25, 2019, 1:58 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
202 |
18944000 |
|
2800 |
44413128 |
Dmitriy.Belichenko |
F |
Oct. 16, 2018, 5:43 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
265 |
165273600 |
|
2800 |
67204978 |
HIR180 |
F |
Dec. 19, 2019, 12:08 p.m. |
OK |
GNU C++17 |
TESTS |
73 |
717 |
60518400 |
|
2800 |
29967501 |
mualanhlung017 |
F |
Sept. 1, 2017, 9:03 a.m. |
OK |
Java 8 |
TESTS |
73 |
280 |
17510400 |
|
2800 |
32882609 |
AdityaP |
F |
Dec. 2, 2017, 6:49 p.m. |
OK |
Java 8 |
TESTS |
73 |
311 |
40243200 |
|
2800 |
21093851 |
uwi |
F |
Oct. 1, 2016, 5:09 p.m. |
OK |
Java 8 |
TESTS |
73 |
374 |
6041600 |
|
2800 |
21093408 |
uwi |
F |
Oct. 1, 2016, 4:57 p.m. |
OK |
Java 8 |
TESTS |
73 |
483 |
6041600 |
|
2800 |
21266968 |
Michael |
F |
Oct. 7, 2016, 8:57 p.m. |
OK |
MS C++ |
TESTS |
73 |
1138 |
108339200 |
|
2800 |
21092946 |
Michael |
F |
Oct. 1, 2016, 4:47 p.m. |
OK |
MS C++ |
TESTS |
73 |
1200 |
106700800 |
|
2800 |
remove filters
Back to search problems