Codeforces Global Round 4

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
1178 Codeforces Global Round 4 FINISHED False 9000 168186299 July 20, 2019, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2113 ) F1 Short Colorful Strip PROGRAMMING combinatorics dfs and similar dp 2200

B'This is the first subtask of problem F. The only differences between this and the second subtask are the constraints on the value of m and the time limit. You need to solve both subtasks in order to hack this one. There are n+1 distinct colours in the universe, numbered 0 through n . There is a strip of paper m centimetres long initially painted with colour 0 . Alice took a brush and painted the strip using the following process. For each i from 1 to n , in this order, she picks two integers 0 <= q a_i < b_i <= q m , such that the segment [a_i, b_i] is currently painted with a single colour, and repaints it with colour i . Alice chose the segments in such a way that each centimetre is now painted in some colour other than 0 . Formally, the segment [i-1, i] is painted with colour c_i ( c_i neq 0 ). Every colour other than 0 is visible on the strip. Count the number of different pairs of sequences {a_i }_{i=1}^n , {b_i }_{i=1}^n that result in this configuration. Since this number may be large, output it modulo 998244353 . The first line contains a two integers n , m ( 1 <= q n <= q 500 , n = m ) -- the number of colours excluding the colour 0 and the length of the paper, respectively. The second line contains m space separated integers c_1, c_2, ldots, c_m ( 1 <= q c_i <= q n ) -- the colour visible on the segment [i-1, i] after the process ends. It is guaranteed that for all j between 1 and n there is an index k such that c_k = j . Note that since in this subtask n = m , this means that c is a permutation of integers 1 through n . Output a single integer -- the number of ways Alice can perform the painting, modulo 998244353 . In the first example, there are 5 ways, all depicted in the figure below. Here, 0 is white, 1$'...

Tutorials

E

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
57501832 4c5948 F1 July 22, 2019, 10:30 a.m. OK Clang++17 Diagnostics TESTS 43 1216 0 2200
57501692 4c5948 F1 July 22, 2019, 10:26 a.m. OK Clang++17 Diagnostics TESTS 43 1232 0 2200
57501580 4c5948 F1 July 22, 2019, 10:23 a.m. OK Clang++17 Diagnostics TESTS 43 1247 0 2200
57501506 4c5948 F1 July 22, 2019, 10:21 a.m. OK Clang++17 Diagnostics TESTS 43 1247 0 2200
57501645 4c5948 F1 July 22, 2019, 10:25 a.m. OK Clang++17 Diagnostics TESTS 43 1263 0 2200
57501383 4c5948 F1 July 22, 2019, 10:18 a.m. OK Clang++17 Diagnostics TESTS 43 1278 0 2200
57407843 hos.lyric F1 July 20, 2019, 4:50 p.m. OK D TESTS 43 639 4198400 2200
57415260 sansen F1 July 20, 2019, 5:33 p.m. OK GNU C11 TESTS 43 46 2048000 2200
57423755 sansen F1 July 20, 2019, 7:23 p.m. OK GNU C11 TESTS 43 187 1024000 2200
57451687 4c5948 F1 July 21, 2019, 9:57 a.m. OK GNU C11 TESTS 43 265 1228800 2200
57499355 MRoy F1 July 22, 2019, 9:36 a.m. OK GNU C11 TESTS 43 280 2048000 2200
57500624 MRoy F1 July 22, 2019, 10:01 a.m. OK GNU C11 TESTS 43 499 2048000 2200
57422074 Malomalomalomalo F1 July 20, 2019, 6:55 p.m. OK GNU C++11 TESTS 43 31 4096000 2200
58920277 gote F1 Aug. 16, 2019, 4:48 p.m. OK GNU C++11 TESTS 43 61 4403200 2200
57408883 ekrem F1 July 20, 2019, 4:55 p.m. OK GNU C++11 TESTS 43 62 4096000 2200
57481453 CaptainSlow F1 July 22, 2019, 2:36 a.m. OK GNU C++11 TESTS 43 156 921600 2200
57490750 z1321317 F1 July 22, 2019, 7 a.m. OK GNU C++11 TESTS 43 156 1024000 2200
57405191 SaSa F1 July 20, 2019, 4:38 p.m. OK GNU C++11 TESTS 43 171 2048000 2200
57449687 chenxiaoyan F1 July 21, 2019, 9:19 a.m. OK GNU C++11 TESTS 43 171 2048000 2200
57418022 Mikaeel F1 July 20, 2019, 5:51 p.m. OK GNU C++11 TESTS 43 171 2048000 2200
57698828 Tiberiu F1 July 24, 2019, 5:15 p.m. OK GNU C++11 TESTS 43 171 2969600 2200
60216508 ezhjw F1 Sept. 7, 2019, 12:02 p.m. OK GNU C++11 TESTS 43 171 3174400 2200
57616967 iqqsoszs F1 July 24, 2019, 2:09 a.m. OK GNU C++14 TESTS 43 30 3686400 2200
57422139 pperm F1 July 20, 2019, 6:56 p.m. OK GNU C++14 TESTS 43 31 204800 2200
57413667 hitonanode F1 July 20, 2019, 5:23 p.m. OK GNU C++14 TESTS 43 31 204800 2200
57408237 betrue12 F1 July 20, 2019, 4:52 p.m. OK GNU C++14 TESTS 43 31 2048000 2200
57417402 jtnydv25 F1 July 20, 2019, 5:47 p.m. OK GNU C++14 TESTS 43 31 5120000 2200
57409069 nhho F1 July 20, 2019, 4:56 p.m. OK GNU C++14 TESTS 43 31 8294400 2200
57413754 Hamzqq9 F1 July 20, 2019, 5:23 p.m. OK GNU C++14 TESTS 43 46 2048000 2200
57423214 a_aron F1 July 20, 2019, 7:13 p.m. OK GNU C++14 TESTS 43 46 2048000 2200
57414835 icecuber F1 July 20, 2019, 5:30 p.m. OK GNU C++14 TESTS 43 46 2150400 2200
57455696 jakedavis F1 July 21, 2019, 11:32 a.m. OK GNU C++14 TESTS 43 46 4198400 2200
62771138 2bcn F1 Oct. 17, 2019, 10:19 a.m. OK GNU C++17 TESTS 43 31 2048000 2200
57415098 Kallaseldor F1 July 20, 2019, 5:32 p.m. OK GNU C++17 TESTS 43 31 3174400 2200
57415297 alimagde F1 July 20, 2019, 5:33 p.m. OK GNU C++17 TESTS 43 31 4096000 2200
57736523 IF_IR_A_1_IR F1 July 25, 2019, 10:06 a.m. OK GNU C++17 TESTS 43 31 19456000 2200
57405222 krijgertje F1 July 20, 2019, 4:38 p.m. OK GNU C++17 TESTS 43 31 96358400 2200
57408098 kotamanegi F1 July 20, 2019, 4:51 p.m. OK GNU C++17 TESTS 43 46 2048000 2200
57417163 subinium F1 July 20, 2019, 5:45 p.m. OK GNU C++17 TESTS 43 46 2048000 2200
57404216 Vedensky F1 July 20, 2019, 4:33 p.m. OK GNU C++17 TESTS 43 46 3993600 2200
57413630 Petro1488 F1 July 20, 2019, 5:23 p.m. OK GNU C++17 TESTS 43 46 4096000 2200
57413932 skylinebaby F1 July 20, 2019, 5:24 p.m. OK GNU C++17 TESTS 43 46 5222400 2200
57598086 kirigiri F1 July 23, 2019, 2:41 p.m. OK Haskell TESTS 43 1435 9625600 2200
57560266 kirigiri F1 July 22, 2019, 11:47 p.m. OK Haskell TESTS 43 1466 9625600 2200
57403435 Egor F1 July 20, 2019, 4:30 p.m. OK Java 8 TESTS 43 124 0 2200
59492020 icpc_loser F1 Aug. 25, 2019, 7:44 p.m. OK Java 8 TESTS 43 436 0 2200
59366485 beginner1010 F1 Aug. 23, 2019, 5:23 p.m. OK Java 8 TESTS 43 436 0 2200
57405488 uwi F1 July 20, 2019, 4:39 p.m. OK Java 8 TESTS 43 436 0 2200
57480171 albertfanboy F1 July 22, 2019, 1:54 a.m. OK Java 8 TESTS 43 467 0 2200
57424546 Intrincantation F1 July 20, 2019, 7:42 p.m. OK Java 8 TESTS 43 467 0 2200
59529309 KazusaMegumi F1 Aug. 26, 2019, 2:27 p.m. OK Java 8 TESTS 43 483 0 2200
58238261 fetetriste F1 Aug. 3, 2019, 9:15 p.m. OK Java 8 TESTS 43 499 0 2200
58237845 fetetriste F1 Aug. 3, 2019, 8:54 p.m. OK Java 8 TESTS 43 499 0 2200
57494033 lekhang123lc F1 July 22, 2019, 7:59 a.m. OK Java 8 TESTS 43 514 0 2200
57488328 Spheniscine F1 July 22, 2019, 6:12 a.m. OK Kotlin TESTS 43 655 204800 2200
57458177 Spheniscine F1 July 21, 2019, 12:27 p.m. OK Kotlin TESTS 43 685 204800 2200
57423439 Tlatoani F1 July 20, 2019, 7:17 p.m. OK Kotlin TESTS 43 702 0 2200
57456197 Spheniscine F1 July 21, 2019, 11:44 a.m. OK Kotlin TESTS 43 1029 409600 2200
57455374 Spheniscine F1 July 21, 2019, 11:25 a.m. OK Kotlin TESTS 43 1044 409600 2200
57455027 Spheniscine F1 July 21, 2019, 11:16 a.m. OK Kotlin TESTS 43 1076 409600 2200
57569749 vjudge4 F1 July 23, 2019, 4:43 a.m. OK MS C++ TESTS 43 374 2048000 2200
58117682 juruoHBr F1 Aug. 1, 2019, 9:27 a.m. OK MS C++ TESTS 43 390 2048000 2200
69944749 zengxy F1 Feb. 1, 2020, 7:15 a.m. OK MS C++ TESTS 43 498 2150400 2200
69947914 vjudge5 F1 Feb. 1, 2020, 8:07 a.m. OK MS C++ TESTS 43 514 7987200 2200
69944716 vjudge2 F1 Feb. 1, 2020, 7:14 a.m. OK MS C++ TESTS 43 530 2150400 2200
57412430 math957963 F1 July 20, 2019, 5:15 p.m. OK MS C++ TESTS 43 764 2867200 2200
57428428 youx F1 July 20, 2019, 10:17 p.m. OK MS C++ 2017 TESTS 43 421 3993600 2200
57582137 pmitkov F1 July 23, 2019, 9:13 a.m. OK MS C++ 2017 TESTS 43 655 4096000 2200
60312429 pajenegod F1 Sept. 9, 2019, 4:25 p.m. OK PyPy 2 TESTS 43 1996 4608000 2200
57502727 Helli.code F1 July 22, 2019, 10:54 a.m. OK PyPy 2 TESTS 43 2900 13004800 2200
57475464 titia F1 July 21, 2019, 9:09 p.m. OK PyPy 3 TESTS 43 1840 17715200 2200
65575069 vjudge3 F1 Nov. 23, 2019, 9:07 a.m. OK PyPy 3 TESTS 43 2386 14131200 2200
57432306 malylesio F1 July 21, 2019, 2:22 a.m. OK PyPy 3 TESTS 43 2558 14540800 2200
57509005 albeXL F1 July 22, 2019, 1:02 p.m. OK PyPy 3 TESTS 43 2917 12492800 2200
65726967 sansen F1 Nov. 26, 2019, 12:40 a.m. OK Rust TESTS 43 233 1126400 2200
57411105 tuna_salad F1 July 20, 2019, 5:07 p.m. OK Rust TESTS 43 311 2150400 2200
57429790 EbTech F1 July 20, 2019, 11:51 p.m. OK Rust TESTS 43 327 2150400 2200

remove filters

Back to search problems