Codeforces Round 519 by Botan Investments

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
1043 Codeforces Round 519 by Botan Investments FINISHED False 7200 196439063 Oct. 28, 2018, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 246 ) G Speckled Band PROGRAMMING data structures divide and conquer hashing string suffix structures strings 3500

B"Ildar took a band (a thin strip of cloth) and colored it. Formally, the band has n cells, each of them is colored into one of 26 colors, so we can denote each color with one of the lowercase letters of English alphabet. Ildar decided to take some segment of the band [l, r] ( 1 <= l <= r <= n ) he likes and cut it from the band. So he will create a new band that can be represented as a string t = s_l s_{l+1} ldots s_r . After that Ildar will play the following game: he cuts the band t into some new bands and counts the number of different bands among them. Formally, Ildar chooses 1 <= k <= |t| indexes 1 <= i_1 < i_2 < ldots < i_k = |t| and cuts t to k bands-strings t_1 t_2 ldots t_{i_1}, t_{i_1 + 1} ldots t_{i_2}, ldots, {t_{i_{k-1} + 1}} ldots t_{i_k} and counts the number of different bands among them. He wants to know the minimal possible number of different bands he can get under the constraint that at least one band repeats at least two times. The result of the game is this number. If it is impossible to cut t in such a way, the result of the game is -1. Unfortunately Ildar hasn't yet decided which segment he likes, but he has q segments-candidates [l_1, r_1] , [l_2, r_2] , ..., [l_q, r_q] . Your task is to calculate the result of the game for each of them. The first line contains one integer n ( 1 <= n <= 200 ,000 ) -- the length of the band Ildar has. The second line contains a string s consisting of n lowercase English letters -- the band Ildar has. The third line contains a single integer q ( 1 <= q <= 200 ,000 ) -- the number of segments Ildar has chosen as candidates. Each of the next q lines contains two integer integers l_i and r_i ( 1 <= l_i <= r_i <= n ) denoting the ends of the i -th segment. Output q lines, where the i -th of them should contain the result o"...

Tutorials

Codeforces Round #519 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
46274862 ohweonfire G Nov. 27, 2018, 10:52 a.m. OK GNU C++11 TESTS 130 1122 190054400 3500
46274477 ohweonfire G Nov. 27, 2018, 10:39 a.m. OK GNU C++11 TESTS 130 1279 190054400 3500
46275200 ohweonfire G Nov. 27, 2018, 11:06 a.m. OK GNU C++11 TESTS 130 1341 190054400 3500
45990035 tritanngo99 G Nov. 20, 2018, 9:10 a.m. OK GNU C++11 TESTS 130 1887 124211200 3500
57736824 py_ultron G July 25, 2019, 10:12 a.m. OK GNU C++11 TESTS 130 1902 124211200 3500
60702264 zx2003 G Sept. 17, 2019, 1:51 a.m. OK GNU C++11 TESTS 130 1996 89497600 3500
57868549 lopare G July 27, 2019, 11:23 p.m. OK GNU C++11 TESTS 130 2074 124211200 3500
45422400 krijgertje G Nov. 7, 2018, 6:12 p.m. OK GNU C++11 TESTS 130 2245 212480000 3500
47853505 skywalkert G Jan. 2, 2019, 7:27 p.m. OK GNU C++11 TESTS 130 3291 78131200 3500
47797442 Tangjz G Dec. 31, 2018, 6:23 p.m. OK GNU C++11 TESTS 130 3291 78131200 3500
45035058 apiadu G Oct. 29, 2018, 7:09 a.m. OK GNU C++14 TESTS 130 1669 175001600 3500
49895865 ochilov-2004 G Feb. 14, 2019, 6:53 a.m. OK GNU C++14 TESTS 130 1965 124416000 3500
54452731 Ma_Ster1 G May 21, 2019, 2:20 p.m. OK GNU C++14 TESTS 130 1980 124416000 3500
45753637 consecutivelimit G Nov. 15, 2018, 3:52 a.m. OK GNU C++14 TESTS 130 2074 68710400 3500
45753613 consecutivelimit G Nov. 15, 2018, 3:50 a.m. OK GNU C++14 TESTS 130 2090 124416000 3500
45055264 MiFaFaOvO G Oct. 29, 2018, 12:27 p.m. OK GNU C++14 TESTS 130 2339 119193600 3500
61450902 cz_xuyixuan G Sept. 29, 2019, 2:38 a.m. OK GNU C++14 TESTS 130 2339 273817600 3500
58477068 yybyyb G Aug. 9, 2019, 3:37 a.m. OK GNU C++14 TESTS 130 2854 80384000 3500
47603202 emoairx G Dec. 28, 2018, 2:02 a.m. OK GNU C++14 TESTS 130 3478 92774400 3500
45221349 aid G Nov. 2, 2018, 9:27 p.m. OK GNU C++14 TESTS 130 3697 149504000 3500
56145066 maroonrk G June 27, 2019, 5:50 a.m. OK GNU C++17 TESTS 130 1496 162201600 3500
45282322 FizzyDavid G Nov. 4, 2018, 2:28 p.m. OK GNU C++17 TESTS 130 1513 202854400 3500
45343676 _Happy_New_Year_ G Nov. 6, 2018, 12:09 a.m. OK GNU C++17 TESTS 130 1809 307916800 3500
62574853 ak_taniya G Oct. 14, 2019, 3:35 p.m. OK GNU C++17 TESTS 130 1965 124416000 3500
49684704 pandora_lee G Feb. 10, 2019, 6:16 a.m. OK GNU C++17 TESTS 130 1965 124620800 3500
53803395 A01703424 G May 5, 2019, 8:59 p.m. OK GNU C++17 TESTS 130 2136 124416000 3500
64165817 Mai-sanBestWaifu G Nov. 3, 2019, 4:13 p.m. OK GNU C++17 TESTS 130 2152 225177600 3500
45147938 kismetovic G Oct. 31, 2018, 5:57 p.m. OK GNU C++17 TESTS 130 2355 225177600 3500
45025123 185217 G Oct. 28, 2018, 9:09 p.m. OK GNU C++17 TESTS 130 2496 225177600 3500
54608977 Xellos G May 25, 2019, 10:28 a.m. OK GNU C++17 TESTS 130 2823 255488000 3500
68422290 Ahmad G Jan. 8, 2020, 11:35 p.m. OK Java 8 TESTS 130 6145 362496000 3500

remove filters

Back to search problems