Codeforces Round 1084 (Div. 3)

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
2200 Codeforces Round 1084 (Div. 3) FINISHED False 8100 4202723 Feb. 27, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 970 ) G Operation Permutation PROGRAMMING combinatorics dp math probabilities

AksLolCoding has an integer (x) and a list of (n) operations. Each operation is a string starting with one of the symbols +,-,x, or / (representing addition, subtraction, multiplication, and real number division respectively), followed immediately by a positive integer (y) ((1 \leq y \leq 10^9)). For example, the operation x3 represents multiplying (x) by (3). AksLolCoding will randomly permute the operations and then apply all operations sequentially to (x) in the permuted order. Help AksLolCoding compute the expected(^{\text{∗}}) final value of (x) modulo (10^9+7). Formally, let (M = 10^9 + 7). 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} \pmod M). In other words, output such an integer (a) that (0 \le a \lt M) and (a \cdot q \equiv p \pmod M). (^{\text{∗}})The expected final value of (x) is the average of the final value of (x) over all (n!) permutations. The first line contains a single integer (t) ((1 \leq t \leq 1000)), the number of test cases. For each test case, the first line contains two integers (n) and (x) ((1 \leq n \leq 3000), (1 \leq x \leq 10^9)). The second line of each test case contains (n) strings, each representing an operation in the format described above. The sum of (n^2) over all test cases does not exceed (3000^2). Note: x is used to represent multiplication, not * For each test case, output a single integer: the expected final value of (x) modulo (10^9+7). In the first test case, (x) can either be ((10\cdot 2)-10=10) or ((10-10)\cdot 2=0), resulting in an expected value of (5). In the second test case, all possible permutations result in (x=2). In the third test case, the expected value of (x) is (\frac{55}{6}).

Tutorials

Codeforces Round 1084 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
364723377 vinniee G Feb. 27, 2026, 4:26 p.m. OK C++17 (GCC 7-32) TESTS 6 46 102400
364722605 IsaacPang2526 G Feb. 27, 2026, 4:24 p.m. OK C++17 (GCC 7-32) TESTS 6 62 0
364723741 giabaovupham2007 G Feb. 27, 2026, 4:27 p.m. OK C++17 (GCC 7-32) TESTS 6 62 102400
364725165 darkmatter_druid G Feb. 27, 2026, 4:30 p.m. OK C++17 (GCC 7-32) TESTS 6 78 0
364734825 HanaYukii G Feb. 27, 2026, 4:55 p.m. OK C++17 (GCC 7-32) TESTS 6 78 102400
364733544 pocky9 G Feb. 27, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 6 78 102400
364730414 walizamanee G Feb. 27, 2026, 4:43 p.m. OK C++17 (GCC 7-32) TESTS 6 78 102400
364734530 fahimcp495 G Feb. 27, 2026, 4:54 p.m. OK C++17 (GCC 7-32) TESTS 6 78 72396800
364737378 Argentum47 G Feb. 27, 2026, 5:12 p.m. OK C++17 (GCC 7-32) TESTS 6 93 0
364736709 MCPlayer542 G Feb. 27, 2026, 5:07 p.m. OK C++17 (GCC 7-32) TESTS 6 93 36352000
364723842 TheFlying G Feb. 27, 2026, 4:27 p.m. OK C++20 (GCC 13-64) TESTS 6 31 0
364737754 CutSandstone G Feb. 27, 2026, 5:14 p.m. OK C++20 (GCC 13-64) TESTS 6 31 102400
364727027 sbsb114 G Feb. 27, 2026, 4:35 p.m. OK C++20 (GCC 13-64) TESTS 6 31 102400
364733006 wish_i_was_orphan G Feb. 27, 2026, 4:49 p.m. OK C++20 (GCC 13-64) TESTS 6 46 0
364732197 dimazhoskiy777 G Feb. 27, 2026, 4:47 p.m. OK C++20 (GCC 13-64) TESTS 6 46 0
364766254 wcnbxzx G Feb. 27, 2026, 10:07 p.m. OK C++20 (GCC 13-64) TESTS 7 46 102400
364749558 kcs0727 G Feb. 27, 2026, 7:01 p.m. OK C++20 (GCC 13-64) TESTS 6 46 102400
364738958 IustinFrateanu G Feb. 27, 2026, 5:23 p.m. OK C++20 (GCC 13-64) TESTS 6 46 102400
364733377 Gu1ityyyyyyy G Feb. 27, 2026, 4:49 p.m. OK C++20 (GCC 13-64) TESTS 6 46 102400
364733097 Lineares G Feb. 27, 2026, 4:49 p.m. OK C++20 (GCC 13-64) TESTS 6 46 102400
364788566 Kagarii22 G Feb. 28, 2026, 5:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 31 0
364774037 EMBailey G Feb. 28, 2026, 1:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 31 0
364731650 Ausp3x G Feb. 27, 2026, 4:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
364730907 xuyunao G Feb. 27, 2026, 4:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
364730222 YMWL G Feb. 27, 2026, 4:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
364723963 thisisaltofpupil G Feb. 27, 2026, 4:28 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 0
364734238 Mike_xi G Feb. 27, 2026, 4:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 102400
364733337 vedparth_7 G Feb. 27, 2026, 4:49 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 102400
364732021 antiaicoder G Feb. 27, 2026, 4:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 102400
364726215 Whales G Feb. 27, 2026, 4:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 31 102400
364726182 avishekjha23 G Feb. 27, 2026, 4:33 p.m. OK Java 21 TESTS 6 234 0
364725651 bluberry12 G Feb. 27, 2026, 4:32 p.m. OK Java 21 TESTS 6 406 819200
364723224 2310080064 G Feb. 27, 2026, 4:26 p.m. OK Java 8 TESTS 6 140 0
364723212 suhridpaulofficial G Feb. 27, 2026, 4:26 p.m. OK Java 8 TESTS 6 265 0
364786731 hitman_py G Feb. 28, 2026, 5:17 a.m. OK PyPy 3-64 TESTS 7 125 5222400
364732378 Shubhamrg25 G Feb. 27, 2026, 4:48 p.m. OK PyPy 3-64 TESTS 6 140 12492800
364729126 vignesh13022005 G Feb. 27, 2026, 4:40 p.m. OK PyPy 3-64 TESTS 6 156 11059200
364779209 smilences G Feb. 28, 2026, 3:08 a.m. OK PyPy 3-64 TESTS 7 218 9113600
364740252 krism G Feb. 27, 2026, 5:34 p.m. OK PyPy 3-64 TESTS 6 218 9318400
364733071 Lil_Flip38 G Feb. 27, 2026, 4:49 p.m. OK PyPy 3-64 TESTS 6 312 9830400
364737419 titia G Feb. 27, 2026, 5:12 p.m. OK PyPy 3-64 TESTS 6 359 8908800
364734208 CinaDor G Feb. 27, 2026, 4:52 p.m. OK PyPy 3-64 TESTS 6 406 37580800
364779959 eugenechka.boyko.2_0-0 G Feb. 28, 2026, 3:22 a.m. OK PyPy 3-64 TESTS 7 453 9523200
364726817 mikelou G Feb. 27, 2026, 4:35 p.m. OK PyPy 3-64 TESTS 6 484 10956800
364730048 Dattasai001 G Feb. 27, 2026, 4:42 p.m. OK Python 3 TESTS 6 328 8601600
364724056 veerabhadrayerram G Feb. 27, 2026, 4:28 p.m. OK Python 3 TESTS 6 406 409600
364768149 3zim G Feb. 27, 2026, 10:46 p.m. OK Python 3 TESTS 7 890 8704000
364729330 hachiko2026 G Feb. 27, 2026, 4:41 p.m. OK Ruby 3 TESTS 6 984 15974400

remove filters

Back to search problems