VK Cup 2022 - Финальный раунд (Engine)

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
1784 VK Cup 2022 - Финальный раунд (Engine) FINISHED False 10800 56224499 Feb. 5, 2023, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 346 ) E Infinite Game PROGRAMMING combinatorics dp games probabilities

B"Alice and Bob are playing an infinite game consisting of sets. Each set consists of rounds. In each round, one of the players wins. The first player to win two rounds in a set wins this set. Thus, a set always ends with the score of 2:0 or 2:1 in favor of one of the players. Let's call a game scenario a finite string s consisting of characters 'a' and 'b'. Consider an infinite string formed with repetitions of string s : sss ldots Suppose that Alice and Bob play rounds according to this infinite string, left to right. If a character of the string sss ldots is 'a', then Alice wins the round; if it's 'b', Bob wins the round. As soon as one of the players wins two rounds, the set ends in their favor, and a new set starts from the next round. Let's define a_i as the number of sets won by Alice among the first i sets while playing according to the given scenario. Let's also define r as the limit of ratio frac{a_i}{i} as i rightarrow infty . If r > frac{1}{2} , we'll say that scenario s is winning for Alice. If r = frac{1}{2} , we'll say that scenario s is tied. If r < frac{1}{2} , we'll say that scenario s is winning for Bob. You are given a string s consisting of characters 'a', 'b', and '?'. Consider all possible ways of replacing every '?' with 'a' or 'b' to obtain a string consisting only of characters 'a' and 'b'. Count how many of them result in a scenario winning for Alice, how many result in a tied scenario, and how many result in a scenario winning for Bob. Print these three numbers modulo 998 ,244 ,353 . The only line contains a single string s ( 1 <= |s| <= 200 ), consisting of characters 'a', 'b', and '?'. Print three integers: how many ways result in a scenario winning for Alice, how many result in a tied scenario, and how many result in a scenario winning for Bob, modulo 998 ,244 ,353 . In the first example, there a"...

Tutorials

Codeforces Round #850 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
192408398 william556 E Feb. 6, 2023, 12:48 a.m. OK GNU C++14 TESTS 101 1622 164249600
192415794 intmain111 E Feb. 6, 2023, 3:20 a.m. OK GNU C++14 TESTS 101 1808 101171200
192377778 Azimjonm0012 E Feb. 5, 2023, 5:59 p.m. OK GNU C++17 TESTS 101 1855 168448000
192421548 luogu_bot4 E Feb. 6, 2023, 4:58 a.m. OK GNU C++17 (64) TESTS 101 156 307200
192341573 353cerega E Feb. 5, 2023, 2:27 p.m. OK GNU C++17 (64) TESTS 101 1263 3481600
192348783 Mangooste E Feb. 5, 2023, 2:55 p.m. OK GNU C++20 (64) TESTS 101 592 11980800
192325824 Maksim1744 E Feb. 5, 2023, 1:38 p.m. OK GNU C++20 (64) TESTS 101 1123 73318400
192329463 never_giveup E Feb. 5, 2023, 1:48 p.m. OK GNU C++20 (64) TESTS 101 1201 179814400
192340873 turmax E Feb. 5, 2023, 2:24 p.m. OK GNU C++20 (64) TESTS 101 1825 6758400
192351180 Ormlis E Feb. 5, 2023, 3:03 p.m. OK GNU C++20 (64) TESTS 101 2698 92876800
192407350 AndreySergunin E Feb. 6, 2023, 12:23 a.m. OK GNU C++20 (64) TESTS 101 4617 49254400

remove filters

Back to search problems