Codeforces Round 681 (Div. 1, based on VK Cup 2019-2020 - Final)

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
1442 Codeforces Round 681 (Div. 1, based on VK Cup 2019-2020 - Final) FINISHED False 7200 127495499 Nov. 2, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4505 ) B Identify the Operations PROGRAMMING brute force combinatorics data structures ds greedy implementation

B"We start with a permutation a_1, a_2, ldots, a_n and with an empty array b . We apply the following operation k times. On the i -th iteration, we select an index t_i ( 1 <= t_i <= n-i+1 ), remove a_{t_i} from the array, and append one of the numbers a_{t_i-1} or a_{t_i+1} (if t_i-1 or t_i+1 are within the array bounds) to the right end of the array b . Then we move elements a_{t_i+1}, ldots, a_n to the left in order to fill in the empty space. You are given the initial permutation a_1, a_2, ldots, a_n and the resulting array b_1, b_2, ldots, b_k . All elements of an array b are distinct. Calculate the number of possible sequences of indices t_1, t_2, ldots, t_k modulo 998 ,244 ,353 . Each test contains multiple test cases. The first line contains an integer t ( 1 <= t <= 100 ,000 ), denoting the number of test cases, followed by a description of the test cases. The first line of each test case contains two integers n, k ( 1 <= k < n <= 200 ,000 ): sizes of arrays a and b . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ): elements of a . All elements of a are distinct. The third line of each test case contains k integers b_1, b_2, ldots, b_k ( 1 <= b_i <= n ): elements of b . All elements of b are distinct. The sum of all n among all test cases is guaranteed to not exceed 200 ,000 . For each test case print one integer: the number of possible sequences modulo 998 ,244 ,353 . require{cancel} Let's denote as a_1 a_2 ldots cancel{a_i} underline{a_{i+1}} ldots a_n rightarrow a_1 a_2 ldots a_{i-1} a_{i+1} ldots a_{n-1} an operation over an element with index i : removal of element a_i from array a and appending element a_{i+1} to array b . In the first exa"...

Tutorials

84298

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
97455061 Gassa B Nov. 2, 2020, 3:10 p.m. OK D TESTS 27 202 13516800
97494714 hos.lyric B Nov. 2, 2020, 5:15 p.m. OK D TESTS 27 233 24064000
97510560 rainboy B Nov. 2, 2020, 8:55 p.m. OK GNU C11 TESTS 27 373 1638400
97461028 fr200110217102 B Nov. 2, 2020, 3:22 p.m. OK GNU C++11 TESTS 27 31 2662400
97466245 dqa2020 B Nov. 2, 2020, 3:33 p.m. OK GNU C++11 TESTS 27 31 2969600
97503145 huangxiaohua B Nov. 2, 2020, 6:40 p.m. OK GNU C++11 TESTS 27 31 3686400
97516820 Mr_Eight B Nov. 3, 2020, 1 a.m. OK GNU C++11 TESTS 27 31 4198400
97460593 Mr_Eight B Nov. 2, 2020, 3:21 p.m. OK GNU C++11 TESTS 27 31 4198400
97503006 huangxiaohua B Nov. 2, 2020, 6:38 p.m. OK GNU C++11 TESTS 27 31 4300800
97466480 zhylj B Nov. 2, 2020, 3:33 p.m. OK GNU C++11 TESTS 27 31 4812800
97525636 Watson_2020 B Nov. 3, 2020, 4:50 a.m. OK GNU C++11 TESTS 27 31 4812800
97463917 allfadeaway B Nov. 2, 2020, 3:28 p.m. OK GNU C++11 TESTS 27 31 7270400
97515006 computerkiller B Nov. 2, 2020, 11:39 p.m. OK GNU C++11 TESTS 27 31 12800000
97480192 luisBah B Nov. 2, 2020, 4:06 p.m. OK GNU C++14 TESTS 27 78 3174400
97452364 SidneyMars B Nov. 2, 2020, 3:05 p.m. OK GNU C++14 TESTS 27 93 3174400
97478982 shanin B Nov. 2, 2020, 4:03 p.m. OK GNU C++14 TESTS 27 93 3174400
97458422 pyqjw B Nov. 2, 2020, 3:16 p.m. OK GNU C++14 TESTS 27 93 4812800
97457199 ugly2333 B Nov. 2, 2020, 3:14 p.m. OK GNU C++14 TESTS 27 93 5324800
97462294 qxforever B Nov. 2, 2020, 3:25 p.m. OK GNU C++14 TESTS 27 93 16076800
97515387 Sofapuden B Nov. 2, 2020, 11:57 p.m. OK GNU C++14 TESTS 27 108 2457600
97452077 ..vince B Nov. 2, 2020, 3:04 p.m. OK GNU C++14 TESTS 27 108 2457600
97463228 JustInCase B Nov. 2, 2020, 3:26 p.m. OK GNU C++14 TESTS 27 108 2457600
97448998 Potassium B Nov. 2, 2020, 2:58 p.m. OK GNU C++14 TESTS 27 108 3174400
97444728 LayCurse B Nov. 2, 2020, 2:51 p.m. OK GNU C++17 TESTS 27 46 6963200
97460572 radical108 B Nov. 2, 2020, 3:21 p.m. OK GNU C++17 TESTS 27 93 2457600
97463172 F0_0H B Nov. 2, 2020, 3:26 p.m. OK GNU C++17 TESTS 27 93 2560000
97458499 dcsp B Nov. 2, 2020, 3:17 p.m. OK GNU C++17 TESTS 27 93 4812800
97454560 alechin28 B Nov. 2, 2020, 3:09 p.m. OK GNU C++17 TESTS 27 108 2457600
97471520 ZieiN B Nov. 2, 2020, 3:45 p.m. OK GNU C++17 TESTS 27 108 3174400
97454956 pikel_rik B Nov. 2, 2020, 3:10 p.m. OK GNU C++17 TESTS 27 108 3174400
97467128 hoke_t B Nov. 2, 2020, 3:35 p.m. OK GNU C++17 TESTS 27 108 3174400
97480247 skorobog B Nov. 2, 2020, 4:07 p.m. OK GNU C++17 TESTS 27 108 3379200
97467704 plourde27 B Nov. 2, 2020, 3:36 p.m. OK GNU C++17 TESTS 27 108 4198400
97525706 vjudge4 B Nov. 3, 2020, 4:52 a.m. OK GNU C++17 (64) TESTS 27 31 5324800
97514148 LayCurse B Nov. 2, 2020, 11:01 p.m. OK GNU C++17 (64) TESTS 27 31 6963200
97458834 Linkus B Nov. 2, 2020, 3:17 p.m. OK GNU C++17 (64) TESTS 27 46 3174400
97471344 june_waves B Nov. 2, 2020, 3:45 p.m. OK GNU C++17 (64) TESTS 27 62 2457600
97454616 Anila9007 B Nov. 2, 2020, 3:09 p.m. OK GNU C++17 (64) TESTS 27 62 2662400
97477192 Golden B Nov. 2, 2020, 3:59 p.m. OK GNU C++17 (64) TESTS 27 62 3174400
97510280 Geothermal B Nov. 2, 2020, 8:47 p.m. OK GNU C++17 (64) TESTS 27 62 3174400
97519006 june_waves B Nov. 3, 2020, 2:15 a.m. OK GNU C++17 (64) TESTS 27 62 3276800
97500735 Prateek B Nov. 2, 2020, 6:10 p.m. OK GNU C++17 (64) TESTS 27 62 6451200
97496137 june_waves B Nov. 2, 2020, 5:25 p.m. OK GNU C++17 (64) TESTS 27 77 2457600
97444497 uwi B Nov. 2, 2020, 2:51 p.m. OK Java 11 TESTS 27 202 0
97452194 mphillotry B Nov. 2, 2020, 3:04 p.m. OK Java 11 TESTS 27 249 1126400
97468815 ProgrammingCanBeHard B Nov. 2, 2020, 3:39 p.m. OK Java 11 TESTS 27 311 17408000
97502274 bobib B Nov. 2, 2020, 6:28 p.m. OK Java 11 TESTS 27 358 21196800
97477630 skittles1412 B Nov. 2, 2020, 4 p.m. OK Java 11 TESTS 27 404 28979200
97480555 DanielW48 B Nov. 2, 2020, 4:07 p.m. OK Java 11 TESTS 27 499 18329600
97474923 Agnimandur B Nov. 2, 2020, 3:54 p.m. OK Java 11 TESTS 27 560 37273600
97476853 Apfeloxid B Nov. 2, 2020, 3:58 p.m. OK Java 11 TESTS 27 857 22630400
97499175 fetetriste B Nov. 2, 2020, 5:53 p.m. OK Java 8 TESTS 27 170 6860800
97468371 Katushechka B Nov. 2, 2020, 3:38 p.m. OK Java 8 TESTS 27 171 7065600
97445781 cwise B Nov. 2, 2020, 2:53 p.m. OK Java 8 TESTS 27 218 14745600
97473137 StayAwayFromBitches B Nov. 2, 2020, 3:49 p.m. OK Java 8 TESTS 27 233 27750400
97468858 O_E B Nov. 2, 2020, 3:39 p.m. OK Java 8 TESTS 27 264 21913600
97462009 ElragolEl3enab B Nov. 2, 2020, 3:24 p.m. OK Java 8 TESTS 27 296 21708800
97454004 golions B Nov. 2, 2020, 3:08 p.m. OK Java 8 TESTS 27 311 18534400
97464537 Taran_1407 B Nov. 2, 2020, 3:29 p.m. OK Java 8 TESTS 27 436 15769600
97462255 martins B Nov. 2, 2020, 3:24 p.m. OK Java 8 TESTS 27 467 28774400
97460277 ijxjdjd B Nov. 2, 2020, 3:20 p.m. OK Java 8 TESTS 27 498 27238400
97445035 Tlatoani B Nov. 2, 2020, 2:51 p.m. OK Kotlin TESTS 27 280 16896000
97462275 pichulia B Nov. 2, 2020, 3:24 p.m. OK MS C++ 2017 TESTS 27 124 6041600
97477327 P___ B Nov. 2, 2020, 3:59 p.m. OK MS C++ 2017 TESTS 27 545 14438400
97473474 mban259 B Nov. 2, 2020, 3:50 p.m. OK .NET Core C# TESTS 27 140 33075200
97453952 Yupiteru B Nov. 2, 2020, 3:08 p.m. OK .NET Core C# TESTS 27 187 34099200
97452189 keymoon B Nov. 2, 2020, 3:04 p.m. OK .NET Core C# TESTS 27 701 30208000
97527522 Soul_Full_Of_Thunder B Nov. 3, 2020, 5:27 a.m. OK PHP TESTS 27 498 47820800
97454080 alexwice B Nov. 2, 2020, 3:08 p.m. OK PyPy 2 TESTS 27 311 36352000
97458729 conqueror_of_tourist B Nov. 2, 2020, 3:17 p.m. OK PyPy 3 TESTS 27 265 25497600
97452617 kclee2172 B Nov. 2, 2020, 3:05 p.m. OK PyPy 3 TESTS 27 296 23347200
97454526 pineriver B Nov. 2, 2020, 3:09 p.m. OK PyPy 3 TESTS 27 390 20275200
97457695 hir35 B Nov. 2, 2020, 3:15 p.m. OK PyPy 3 TESTS 27 405 20480000
97455352 titia B Nov. 2, 2020, 3:10 p.m. OK PyPy 3 TESTS 27 405 20889600
97447356 nehan_der_thal B Nov. 2, 2020, 2:55 p.m. OK PyPy 3 TESTS 27 405 20992000
97460792 nagiss B Nov. 2, 2020, 3:21 p.m. OK PyPy 3 TESTS 27 405 24780800
97456266 FlakeLCR B Nov. 2, 2020, 3:12 p.m. OK PyPy 3 TESTS 27 405 28160000
97471471 macaroni B Nov. 2, 2020, 3:45 p.m. OK PyPy 3 TESTS 27 421 23347200
97466244 asdsasd B Nov. 2, 2020, 3:33 p.m. OK PyPy 3 TESTS 27 436 24883200
97448263 nwi B Nov. 2, 2020, 2:57 p.m. OK Python 2 TESTS 27 764 14540800
97464428 mkawa2 B Nov. 2, 2020, 3:29 p.m. OK Python 3 TESTS 27 763 17408000
97487456 naagi B Nov. 2, 2020, 4:24 p.m. OK Python 3 TESTS 27 1699 17920000
97458857 sansen B Nov. 2, 2020, 3:17 p.m. OK Rust TESTS 27 139 10547200
97465172 GeoffreyY B Nov. 2, 2020, 3:31 p.m. OK Rust TESTS 27 1013 4505600
97449258 ngtkana B Nov. 2, 2020, 2:59 p.m. OK Rust TESTS 27 1169 14131200

remove filters

Back to search problems