Codeforces Round 594 (Div. 1)

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
1239 Codeforces Round 594 (Div. 1) FINISHED False 7200 160260899 Oct. 20, 2019, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1052 ) B The World Is Just a Programming Task (Hard Version) PROGRAMMING implementation 2500

B'This is a harder version of the problem. In this version, n <= 300 ,000 . Vasya is an experienced developer of programming competitions ' problems. As all great minds at some time, Vasya faced a creative crisis. To improve the situation, Petya gifted him a string consisting of opening and closing brackets only. Petya believes, that the beauty of the bracket string is a number of its cyclical shifts, which form a correct bracket sequence. To digress from his problems, Vasya decided to select two positions of the string (not necessarily distinct) and swap characters located at this positions with each other. Vasya will apply this operation exactly once. He is curious what is the maximum possible beauty he can achieve this way. Please help him. We remind that bracket sequence s is called correct if: For example, "(()())", "()" are correct, while ")(" and "())" are not. The cyclical shift of the string s of length n by k ( 0 <= q k < n ) is a string formed by a concatenation of the last k symbols of the string s with the first n - k symbols of string s . For example, the cyclical shift of string "(())()" by 2 equals "()(())". Cyclical shifts i and j are considered different, if i ne j . The first line contains an integer n ( 1 <= n <= 300 ,000 ), the length of the string. The second line contains a string, consisting of exactly n characters, where each of the characters is either "(" or ")". The first line should contain a single integer -- the largest beauty of the string, which can be achieved by swapping some two characters. The second line should contain integers l and r ( 1 <= q l, r <= q n ) -- the indices of two characters, which should be swapped in order to maximize the string 's beauty. In case there are several possible swaps, print any of them. In the first example, we can swap 7 -th and 8 -th character, obtaining a string'...

Tutorials

Editorial of Codeforces Round #594 (on the problems of Moscow Team Olympiad)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
63003237 Gassa B Oct. 20, 2019, 10:41 a.m. OK D TESTS 65 46 11571200 2500
63943426 jschr B Oct. 31, 2019, 6:08 p.m. OK GNU C11 TESTS 65 31 307200 2500
63001062 dqa2020 B Oct. 20, 2019, 10:30 a.m. OK GNU C++11 TESTS 65 31 409600 2500
64144661 Tiny B Nov. 3, 2019, 9:29 a.m. OK GNU C++11 TESTS 65 31 614400 2500
63408066 bruno.iljazovic B Oct. 25, 2019, 9:36 p.m. OK GNU C++11 TESTS 65 31 1536000 2500
64785299 _twilight B Nov. 13, 2019, 8:54 a.m. OK GNU C++11 TESTS 65 31 1536000 2500
63106012 Four-leafClover B Oct. 22, 2019, 4:47 a.m. OK GNU C++11 TESTS 65 31 1740800 2500
63156035 RBTsDefoliation B Oct. 22, 2019, 3:24 p.m. OK GNU C++11 TESTS 65 31 1843200 2500
63130056 lyuankai B Oct. 22, 2019, 1:55 p.m. OK GNU C++11 TESTS 65 31 1843200 2500
63110241 Fugtemypt B Oct. 22, 2019, 7:04 a.m. OK GNU C++11 TESTS 65 31 1843200 2500
66781434 luogu_bot1 B Dec. 13, 2019, 12:10 p.m. OK GNU C++11 TESTS 65 31 1843200 2500
63074967 triple__a B Oct. 21, 2019, 1:27 p.m. OK GNU C++11 TESTS 65 31 2252800 2500
63023824 liouzhou_101 B Oct. 20, 2019, 3:32 p.m. OK GNU C++14 TESTS 65 30 4505600 2500
63266094 sievra B Oct. 24, 2019, 12:15 a.m. OK GNU C++14 TESTS 65 31 1024000 2500
63699007 LJFan B Oct. 29, 2019, 6:38 a.m. OK GNU C++14 TESTS 65 31 1433600 2500
63005188 little_misfortune B Oct. 20, 2019, 10:50 a.m. OK GNU C++14 TESTS 65 31 1536000 2500
63004015 Quang B Oct. 20, 2019, 10:45 a.m. OK GNU C++14 TESTS 65 31 1536000 2500
64502132 bqq B Nov. 8, 2019, 4:54 a.m. OK GNU C++14 TESTS 65 31 1536000 2500
64072312 EulerLee B Nov. 2, 2019, 7:48 a.m. OK GNU C++14 TESTS 65 31 1843200 2500
63003084 Localization B Oct. 20, 2019, 10:40 a.m. OK GNU C++14 TESTS 65 31 2867200 2500
62997050 dario2994 B Oct. 20, 2019, 10:10 a.m. OK GNU C++14 TESTS 65 31 3481600 2500
62997772 dlalswp25 B Oct. 20, 2019, 10:14 a.m. OK GNU C++14 TESTS 65 31 3993600 2500
63029124 kalinov B Oct. 20, 2019, 5:37 p.m. OK GNU C++17 TESTS 65 31 307200 2500
63000895 Barbatos B Oct. 20, 2019, 10:30 a.m. OK GNU C++17 TESTS 65 31 614400 2500
66643873 K0u1e B Dec. 11, 2019, 3:52 p.m. OK GNU C++17 TESTS 65 31 614400 2500
64313701 ivan100sic B Nov. 5, 2019, 1:29 p.m. OK GNU C++17 TESTS 65 31 1024000 2500
63115764 HNO2 B Oct. 22, 2019, 9:15 a.m. OK GNU C++17 TESTS 65 31 1024000 2500
63006781 CMXRYNP B Oct. 20, 2019, 10:57 a.m. OK GNU C++17 TESTS 65 31 1536000 2500
64769995 krijgertje B Nov. 12, 2019, 10:29 p.m. OK GNU C++17 TESTS 65 31 1536000 2500
63065359 YunGoon B Oct. 21, 2019, 10:38 a.m. OK GNU C++17 TESTS 65 31 1536000 2500
62993848 Tropical_maid B Oct. 20, 2019, 9:54 a.m. OK GNU C++17 TESTS 65 31 1536000 2500
63064413 Arpa B Oct. 21, 2019, 10:13 a.m. OK GNU C++17 TESTS 65 31 1843200 2500
64680307 Nutella3000 B Nov. 11, 2019, 9:41 a.m. OK Java 8 TESTS 65 139 0 2500
63007405 DarLam B Oct. 20, 2019, 11 a.m. OK Java 8 TESTS 65 140 0 2500
63004292 mikit B Oct. 20, 2019, 10:46 a.m. OK Java 8 TESTS 65 171 3686400 2500
63001186 Eva B Oct. 20, 2019, 10:31 a.m. OK Kotlin TESTS 65 171 1433600 2500
63004061 knightL B Oct. 20, 2019, 10:45 a.m. OK Kotlin TESTS 65 233 1433600 2500
62997155 keymoon B Oct. 20, 2019, 10:11 a.m. OK Mono C# TESTS 65 77 5939200 2500
63002533 math957963 B Oct. 20, 2019, 10:38 a.m. OK MS C++ TESTS 65 31 819200 2500
65089693 vjudge2 B Nov. 15, 2019, 6:16 p.m. OK MS C++ TESTS 65 46 3174400 2500
63116586 Fortin B Oct. 22, 2019, 9:33 a.m. OK MS C++ 2017 TESTS 65 31 13721600 2500
63768302 dbelov B Oct. 30, 2019, 7:01 a.m. OK MS C++ 2017 TESTS 65 46 1228800 2500
63770658 dbelov B Oct. 30, 2019, 7:52 a.m. OK MS C++ 2017 TESTS 65 46 1331200 2500
63208932 Fakerone B Oct. 23, 2019, 2:24 a.m. OK MS C++ 2017 TESTS 65 46 3584000 2500
65509230 _kong_ B Nov. 22, 2019, 2:15 a.m. OK MS C++ 2017 TESTS 65 46 5324800 2500
63943981 dbelov B Oct. 31, 2019, 6:18 p.m. OK MS C++ 2017 TESTS 65 93 7372800 2500
63654641 yumtam B Oct. 28, 2019, 12:21 p.m. OK PyPy 2 TESTS 65 187 7680000 2500
66974881 sruthi_1729 B Dec. 15, 2019, 2:19 p.m. OK Python 3 TESTS 65 608 40857600 2500
63369857 Jutun B Oct. 25, 2019, 8:57 a.m. OK Python 3 TESTS 65 639 40652800 2500
63081588 yakamoto B Oct. 21, 2019, 3:16 p.m. OK Scala TESTS 65 499 7168000 2500

remove filters

Back to search problems