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
( 901 ) F2 Long Colorful Strip PROGRAMMING dp 2600

B'This is the second subtask of problem F. The only differences between this and the first subtask are the constraints on the value of m and the time limit. It is sufficient to solve this subtask in order to hack it, but you need to solve both subtasks in order to hack the first 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 <= q m <= q 10^6 ) -- 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 . 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 is red, 2 is green and 3 i'...

Tutorials

E

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
57422184 hos.lyric F2 July 20, 2019, 6:57 p.m. OK D TESTS 95 2464 75161600 2600
57431804 iSooke F2 July 21, 2019, 2:03 a.m. OK GNU C++11 TESTS 95 217 28160000 2600
57631550 idxcalcal F2 July 24, 2019, 8:55 a.m. OK GNU C++11 TESTS 95 218 4403200 2600
59944640 ohweonfire F2 Sept. 3, 2019, 12:36 p.m. OK GNU C++11 TESTS 95 264 18022400 2600
57417076 cuizhuyefei F2 July 20, 2019, 5:44 p.m. OK GNU C++11 TESTS 95 280 35840000 2600
57619572 vjudge1 F2 July 24, 2019, 3:45 a.m. OK GNU C++11 TESTS 95 295 13312000 2600
59654409 LJZ_C F2 Aug. 29, 2019, 9:41 a.m. OK GNU C++11 TESTS 95 312 25292800 2600
57581663 dqa2020 F2 July 23, 2019, 9:04 a.m. OK GNU C++11 TESTS 95 343 13209600 2600
64163504 2016wudi F2 Nov. 3, 2019, 3:23 p.m. OK GNU C++11 TESTS 95 358 7884800 2600
60753213 HyscereXD F2 Sept. 18, 2019, 7:30 a.m. OK GNU C++11 TESTS 95 358 8089600 2600
57419442 lzr_010506 F2 July 20, 2019, 6 p.m. OK GNU C++11 TESTS 95 358 12185600 2600
57422159 pperm F2 July 20, 2019, 6:56 p.m. OK GNU C++14 TESTS 95 218 4198400 2600
57409005 nhho F2 July 20, 2019, 4:56 p.m. OK GNU C++14 TESTS 95 233 16691200 2600
57416931 hitonanode F2 July 20, 2019, 5:44 p.m. OK GNU C++14 TESTS 95 280 19865600 2600
57422221 BSBandme F2 July 20, 2019, 6:57 p.m. OK GNU C++14 TESTS 95 326 86220800 2600
57416177 natsugiri F2 July 20, 2019, 5:39 p.m. OK GNU C++14 TESTS 95 327 8294400 2600
57423267 betrue12 F2 July 20, 2019, 7:14 p.m. OK GNU C++14 TESTS 95 373 20684800 2600
57466917 Tutituti F2 July 21, 2019, 3:58 p.m. OK GNU C++14 TESTS 95 373 23552000 2600
57422137 Alex_2oo8 F2 July 20, 2019, 6:56 p.m. OK GNU C++14 TESTS 95 374 12083200 2600
57430654 shdut F2 July 21, 2019, 12:58 a.m. OK GNU C++14 TESTS 95 374 12185600 2600
57434333 Quang F2 July 21, 2019, 3:46 a.m. OK GNU C++14 TESTS 95 374 13619200 2600
57445374 neal F2 July 21, 2019, 8:04 a.m. OK GNU C++17 TESTS 95 187 8089600 2600
57555023 neal F2 July 22, 2019, 7:14 p.m. OK GNU C++17 TESTS 95 187 8192000 2600
57426880 kefaa2 F2 July 20, 2019, 8:58 p.m. OK GNU C++17 TESTS 95 342 103014400 2600
57406581 E869120 F2 July 20, 2019, 4:44 p.m. OK GNU C++17 TESTS 95 343 33280000 2600
57434308 neal F2 July 21, 2019, 3:44 a.m. OK GNU C++17 TESTS 95 358 8089600 2600
57441859 interestingLSY F2 July 21, 2019, 7 a.m. OK GNU C++17 TESTS 95 358 13824000 2600
57415018 DPR-pavlin F2 July 20, 2019, 5:31 p.m. OK GNU C++17 TESTS 95 358 21094400 2600
65554579 2bcn F2 Nov. 22, 2019, 8:44 p.m. OK GNU C++17 TESTS 95 373 12800000 2600
57455240 SoulTch F2 July 21, 2019, 11:22 a.m. OK GNU C++17 TESTS 95 373 26931200 2600
57418315 includehdhd F2 July 20, 2019, 5:53 p.m. OK GNU C++17 TESTS 95 373 28467200 2600
57597141 kirigiri F2 July 23, 2019, 2:22 p.m. OK Haskell TESTS 95 1637 64204800 2600
57598071 kirigiri F2 July 23, 2019, 2:41 p.m. OK Haskell TESTS 95 1637 65331200 2600
57596575 kirigiri F2 July 23, 2019, 2:09 p.m. OK Haskell TESTS 95 1949 109363200 2600
57560291 kirigiri F2 July 22, 2019, 11:50 p.m. OK Haskell TESTS 95 2090 109363200 2600
57504737 kirigiri F2 July 22, 2019, 11:36 a.m. OK Haskell TESTS 95 5880 109363200 2600
57407425 Egor F2 July 20, 2019, 4:48 p.m. OK Java 8 TESTS 95 592 3891200 2600
57408850 ilyakor F2 July 20, 2019, 4:55 p.m. OK Java 8 TESTS 95 654 126771200 2600
57423776 AkshajK F2 July 20, 2019, 7:24 p.m. OK Java 8 TESTS 95 764 17715200 2600
57778730 bwang1008 F2 July 26, 2019, 5:01 a.m. OK Java 8 TESTS 95 888 13824000 2600
57419004 AnandOza F2 July 20, 2019, 5:57 p.m. OK Java 8 TESTS 95 1138 17510400 2600
57949567 Nutella3000 F2 July 29, 2019, 3:50 p.m. OK Java 8 TESTS 95 1153 17408000 2600
57715112 dalt F2 July 25, 2019, 2:20 a.m. OK Java 8 TESTS 95 1325 65945600 2600
58238257 fetetriste F2 Aug. 3, 2019, 9:14 p.m. OK Java 8 TESTS 95 3400 39936000 2600
57489552 Spheniscine F2 July 22, 2019, 6:37 a.m. OK Kotlin TESTS 95 2542 83558400 2600
57491596 Spheniscine F2 July 22, 2019, 7:16 a.m. OK Kotlin TESTS 95 2588 83558400 2600
57480104 Spheniscine F2 July 22, 2019, 1:51 a.m. OK Kotlin TESTS 95 2589 83456000 2600
57467448 Spheniscine F2 July 21, 2019, 4:13 p.m. OK Kotlin TESTS 95 2589 83456000 2600
57478643 Spheniscine F2 July 22, 2019, 12:59 a.m. OK Kotlin TESTS 95 2620 83456000 2600
57466971 Spheniscine F2 July 21, 2019, 4 p.m. OK Kotlin TESTS 95 2651 83456000 2600
57467124 Spheniscine F2 July 21, 2019, 4:04 p.m. OK Kotlin TESTS 95 2683 83456000 2600
57601339 vjudge4 F2 July 23, 2019, 3:56 p.m. OK MS C++ TESTS 95 1294 4096000 2600
57430200 pseuda F2 July 21, 2019, 12:23 a.m. OK MS C++ 2017 TESTS 95 1076 33177600 2600
57429338 Fdg F2 July 20, 2019, 11:18 p.m. OK MS C++ 2017 TESTS 95 1544 17100800 2600
60313895 pajenegod F2 Sept. 9, 2019, 5 p.m. OK PyPy 2 TESTS 95 2121 48230400 2600
57435208 EbTech F2 July 21, 2019, 4:19 a.m. OK Rust TESTS 95 951 15257600 2600
57429808 EbTech F2 July 20, 2019, 11:52 p.m. OK Rust TESTS 95 967 15257600 2600

remove filters

Back to search problems