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
1781 VK Cup 2022 - Отборочный раунд (Engine) FINISHED False 10800 63395662 Jan. 15, 2023, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 976 ) F Bracket Insertion PROGRAMMING brute force combinatorics constructive algorithms dp math trees

B'Vika likes playing with bracket sequences. Today she wants to create a new bracket sequence using the following algorithm. Initially, Vika 's sequence is an empty string, and then she will repeat the following actions n times: A bracket sequence is called regular if it is possible to obtain a correct arithmetic expression by inserting characters '+ ' and '1 ' into it. For example, sequences "(())()", "()", and "(()(()))" are regular, while ")(", "(()", and "(()))(" are not. Vika wants to know the probability that her bracket sequence will be a regular one at the end. Help her and find this probability modulo 998 ,244 ,353 (see Output section). The only line contains two integers n and q ( 1 <= n <= 500 ; 0 <= q <= 10^4 ). Here n is equal to the number of bracket insertion operations, and the probability that Vika chooses string "()" on every step of the algorithm is equal to p = q cdot 10^{-4} . Print the probability that Vika 's final bracket sequence will be regular, modulo 998 ,244 ,353 . Formally, let M = 998 ,244 ,353 . It can be shown that the answer can be expressed as an irreducible fraction frac{p}{q} , where p and q are integers and q not equiv 0 pmod{M} . Output the integer equal to p cdot q^{-1} bmod M . In other words, output such an integer x that 0 <= x < M and x cdot q equiv p pmod{M} . In the first example, Vika will get a regular bracket sequence () with probability p = frac{3}{4} , and she will get an irregular bracket sequence )( with probability 1 - p = frac{1}{4} . The sought probability is frac{3}{4} , and 249 ,561 ,089 cdot 4 equiv 3 pmod{998 ,244 ,353} . In the second example, the sought probability is frac{11}{25} . '...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
189393414 YeahPotato F Jan. 16, 2023, 3:45 a.m. OK GNU C++14 TESTS 28 530 1024000
189374376 bashkort F Jan. 15, 2023, 6:47 p.m. OK GNU C++17 (64) TESTS 28 202 2252800
189374076 bashkort F Jan. 15, 2023, 6:42 p.m. OK GNU C++17 (64) TESTS 28 218 2252800
189373591 bashkort F Jan. 15, 2023, 6:34 p.m. OK GNU C++17 (64) TESTS 28 280 1126400
189336163 353cerega F Jan. 15, 2023, 1:34 p.m. OK GNU C++17 (64) TESTS 28 312 6553600
189371892 bashkort F Jan. 15, 2023, 6:11 p.m. OK GNU C++17 (64) TESTS 28 561 2252800
189373917 bashkort F Jan. 15, 2023, 6:39 p.m. OK GNU C++17 (64) TESTS 28 592 1126400
189342043 244mhq F Jan. 15, 2023, 1:59 p.m. OK GNU C++17 (64) TESTS 28 639 2048000
189369161 bashkort F Jan. 15, 2023, 5:36 p.m. OK GNU C++17 (64) TESTS 28 1232 2252800
189369014 bashkort F Jan. 15, 2023, 5:34 p.m. OK GNU C++17 (64) TESTS 28 1248 2252800
189353225 receed F Jan. 15, 2023, 2:49 p.m. OK GNU C++17 (64) TESTS 28 2184 6144000
189383389 SirShokoladina F Jan. 15, 2023, 10:10 p.m. OK GNU C++20 (64) TESTS 28 109 1024000
189339396 Golovanov399 F Jan. 15, 2023, 1:48 p.m. OK GNU C++20 (64) TESTS 28 109 2048000
189352966 amethyst0 F Jan. 15, 2023, 2:48 p.m. OK GNU C++20 (64) TESTS 28 234 4198400
189366083 Error_Yuan F Jan. 15, 2023, 4:59 p.m. OK GNU C++20 (64) TESTS 28 390 32460800
189346928 Arterm F Jan. 15, 2023, 2:20 p.m. OK GNU C++20 (64) TESTS 28 420 5120000
189333931 never_giveup F Jan. 15, 2023, 1:25 p.m. OK GNU C++20 (64) TESTS 28 483 2150400
189337120 isaf27 F Jan. 15, 2023, 1:38 p.m. OK GNU C++20 (64) TESTS 28 639 2662400
189324802 Petr F Jan. 15, 2023, 12:53 p.m. OK GNU C++20 (64) TESTS 28 733 2252800
189355054 budalnik F Jan. 15, 2023, 2:57 p.m. OK GNU C++20 (64) TESTS 28 764 2252800
189352080 vepifanov F Jan. 15, 2023, 2:44 p.m. OK GNU C++20 (64) TESTS 28 1029 3072000
189346456 iakovlev.zakhar F Jan. 15, 2023, 2:18 p.m. OK Java 8 TESTS 28 1731 0
189341823 darnley F Jan. 15, 2023, 1:58 p.m. OK Kotlin 1.7 TESTS 28 3572 286924800
189340503 Egor F Jan. 15, 2023, 1:52 p.m. OK Rust 2021 TESTS 28 1092 3072000

remove filters

Back to search problems