Codeforces Global Round 18

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
1615 Codeforces Global Round 18 FINISHED False 9000 96909863 Dec. 24, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 910 ) F LEGOndary Grandmaster PROGRAMMING combinatorics dp math

B"After getting bored by playing with crayons, you decided to switch to Legos! Today, you're working with a long strip, with height 1 and length n , some positions of which are occupied by 1 by 1 Lego pieces. In one second, you can either remove two adjacent Lego pieces from the strip (if both are present), or add two Lego pieces to adjacent positions (if both are absent). You can only add or remove Lego's at two adjacent positions at the same time, as otherwise your chubby fingers run into precision issues. You want to know exactly how much time you'll spend playing with Legos. You value efficiency, so given some starting state and some ending state, you'll always spend the least number of seconds to transform the starting state into the ending state. If it's impossible to transform the starting state into the ending state, you just skip it (so you spend 0 seconds). The issue is that, for some positions, you don't remember whether there were Legos there or not (in either the starting state, the ending state, or both). Over all pairs of (starting state, ending state) that are consistent with your memory, find the total amount of time it will take to transform the starting state to the ending state. Print this value modulo 1 ,000 ,000 ,007 ( 10^9 + 7 ). The first line contains one integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. Then t cases follow. The first line of each test case contains one integer n ( 2 <= q n <= q 2000 ) -- the size of the Lego strip. The second line of each test case contains a string s of length n , consisting of the characters 0, 1, and ? -- your memory of the starting state: The third line of each test case contains a string t of length n , consisting of the characters 0, 1, and ? -- your memory of the ending state. It follows a similar format to the starting state. It's guaranteed that the sum of n over all test cases"...

Tutorials

Global Round 18 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
140495257 Suiseiseki F Dec. 24, 2021, 4:25 p.m. OK GNU C++14 TESTS 16 46 102400
140503101 MofK F Dec. 24, 2021, 4:53 p.m. OK GNU C++14 TESTS 16 77 64307200
140533841 wyzwyz F Dec. 25, 2021, 2:41 a.m. OK GNU C++14 TESTS 16 109 103219200
140533745 wyzwyz F Dec. 25, 2021, 2:38 a.m. OK GNU C++14 TESTS 16 109 103219200
140511104 yao11617 F Dec. 24, 2021, 5:52 p.m. OK GNU C++14 TESTS 16 124 0
140508271 yao11617 F Dec. 24, 2021, 5:28 p.m. OK GNU C++14 TESTS 16 140 0
140494262 lzoi.win F Dec. 24, 2021, 4:22 p.m. OK GNU C++14 TESTS 16 140 48332800
140513872 RobeZH F Dec. 24, 2021, 6:21 p.m. OK GNU C++14 TESTS 16 187 64614400
140505346 _Guoyh_ F Dec. 24, 2021, 5:01 p.m. OK GNU C++14 TESTS 16 218 134860800
140505148 Karry5307_AK_NOI2021 F Dec. 24, 2021, 5:01 p.m. OK GNU C++14 TESTS 16 249 193024000
140534455 ympc2005 F Dec. 25, 2021, 2:59 a.m. OK GNU C++17 TESTS 16 93 102400
140531413 tokusakurai F Dec. 25, 2021, 1:30 a.m. OK GNU C++17 TESTS 16 93 102400
140514870 skywalkert F Dec. 24, 2021, 6:31 p.m. OK GNU C++17 TESTS 16 93 102400
140517830 AliShahali1382 F Dec. 24, 2021, 7:06 p.m. OK GNU C++17 TESTS 16 93 409600
140532613 DerekFeng F Dec. 25, 2021, 2:06 a.m. OK GNU C++17 TESTS 16 93 64307200
140504193 MonkeyKing F Dec. 24, 2021, 4:57 p.m. OK GNU C++17 TESTS 16 109 32358400
140497288 atomicenergy F Dec. 24, 2021, 4:32 p.m. OK GNU C++17 TESTS 16 124 32153600
140503531 Argentina F Dec. 24, 2021, 4:55 p.m. OK GNU C++17 TESTS 16 124 64409600
140498222 Wailydest F Dec. 24, 2021, 4:35 p.m. OK GNU C++17 TESTS 16 124 64409600
140503227 inaFSTream F Dec. 24, 2021, 4:54 p.m. OK GNU C++17 TESTS 16 139 102400
140516618 PinkieRabbit F Dec. 24, 2021, 6:52 p.m. OK GNU C++17 (64) TESTS 16 15 0
140516202 PinkieRabbit F Dec. 24, 2021, 6:47 p.m. OK GNU C++17 (64) TESTS 16 31 0
140508402 natsugiri F Dec. 24, 2021, 5:28 p.m. OK GNU C++17 (64) TESTS 16 31 102400
140496374 RimuruTempest F Dec. 24, 2021, 4:29 p.m. OK GNU C++17 (64) TESTS 16 31 102400
140492296 tourist F Dec. 24, 2021, 4:15 p.m. OK GNU C++17 (64) TESTS 16 46 102400
140532503 BurnoutAg7 F Dec. 25, 2021, 2:02 a.m. OK GNU C++17 (64) TESTS 16 46 32256000
140509118 QAQAutoMaton F Dec. 24, 2021, 5:33 p.m. OK GNU C++17 (64) TESTS 16 46 68608000
140513816 tabr F Dec. 24, 2021, 6:21 p.m. OK GNU C++17 (64) TESTS 16 62 102400
140498518 balbit F Dec. 24, 2021, 4:36 p.m. OK GNU C++17 (64) TESTS 16 62 102400
140500367 aid F Dec. 24, 2021, 4:44 p.m. OK GNU C++17 (64) TESTS 16 62 64512000
140508240 Rubikun F Dec. 24, 2021, 5:27 p.m. OK GNU C++20 (64) TESTS 16 46 204800
140543834 SSerxhs F Dec. 25, 2021, 5:56 a.m. OK GNU C++20 (64) TESTS 16 46 65433600
140506002 physics0523 F Dec. 24, 2021, 5:03 p.m. OK GNU C++20 (64) TESTS 16 62 102400
140510096 Krolo7 F Dec. 24, 2021, 5:42 p.m. OK GNU C++20 (64) TESTS 16 62 64204800
140494009 heno239 F Dec. 24, 2021, 4:21 p.m. OK GNU C++20 (64) TESTS 16 77 72806400
140510807 jiangly F Dec. 24, 2021, 5:49 p.m. OK GNU C++20 (64) TESTS 16 78 102400
140505176 AnandOza F Dec. 24, 2021, 5:01 p.m. OK GNU C++20 (64) TESTS 16 78 102400
140492440 rama_pang F Dec. 24, 2021, 4:15 p.m. OK GNU C++20 (64) TESTS 16 93 102400
140499632 never_giveup F Dec. 24, 2021, 4:41 p.m. OK GNU C++20 (64) TESTS 16 93 8192000
140494154 risujiroh F Dec. 24, 2021, 4:21 p.m. OK GNU C++20 (64) TESTS 16 93 64307200
140492134 eatmore F Dec. 24, 2021, 4:14 p.m. OK Java 11 TESTS 16 233 0

remove filters

Back to search problems