Codeforces Round 747 (Div. 2)

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
1594 Codeforces Round 747 (Div. 2) FINISHED False 8100 103474463 Oct. 8, 2021, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1505 ) E2 Rubik's Cube Coloring (hard version) PROGRAMMING brute force dp implementation math trees 2300

B"It is the hard version of the problem. The difference is that in this version, there are nodes with already chosen colors. Theofanis is starving, and he wants to eat his favorite food, sheftalia. However, he should first finish his homework. Can you help him with this problem? You have a perfect binary tree of 2^k - 1 nodes -- a binary tree where all vertices i from 1 to 2^{k - 1} - 1 have exactly two children: vertices 2i and 2i + 1 . Vertices from 2^{k - 1} to 2^k - 1 don't have any children. You want to color its vertices with the 6 Rubik's cube colors (White, Green, Red, Blue, Orange and Yellow). Let's call a coloring good when all edges connect nodes with colors that are neighboring sides in the Rubik's cube. More formally: However, there are n special nodes in the tree, colors of which are already chosen. You want to calculate the number of the good colorings of the binary tree. Two colorings are considered different if at least one node is colored with a different color. The answer may be too large, so output the answer modulo 10^9+7 . The first line contains the integers k ( 1 <= k <= 60 ) -- the number of levels in the perfect binary tree you need to color. The second line contains the integer n ( 1 <= n <= min(2^k - 1, 2000) ) -- the number of nodes, colors of which are already chosen. The next n lines contains integer v ( 1 <= v <= 2^k - 1 ) and string s -- the index of the node and the color of the node ( s is one of the white, yellow, green, blue, red and orange). It is guaranteed that each node v appears in the input at most once. Print one integer -- the number of the different colorings modulo 10^9+7 . In the picture below, you can see one of the correct colorings of the first test example. "...

Tutorials

95525

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
131257381 Chameleon216 E2 Oct. 9, 2021, 2:11 a.m. OK GNU C++14 TESTS 23 61 21811200 2300
131240891 SuperJ6 E2 Oct. 8, 2021, 7:15 p.m. OK GNU C++14 TESTS 23 62 4096000 2300
131228237 kristevalex E2 Oct. 8, 2021, 5:13 p.m. OK GNU C++14 TESTS 23 77 3993600 2300
131248475 VLapytskyi E2 Oct. 8, 2021, 9:44 p.m. OK GNU C++14 TESTS 23 93 7884800 2300
131225352 fr200110217102 E2 Oct. 8, 2021, 5:05 p.m. OK GNU C++14 TESTS 23 93 12800000 2300
131254808 graphcity E2 Oct. 9, 2021, 1:30 a.m. OK GNU C++14 TESTS 23 93 86118400 2300
131272800 SrO E2 Oct. 9, 2021, 5:29 a.m. OK GNU C++14 TESTS 23 109 7270400 2300
131257159 zrr12138 E2 Oct. 9, 2021, 2:05 a.m. OK GNU C++14 TESTS 23 124 7168000 2300
131262990 L7-56 E2 Oct. 9, 2021, 2:51 a.m. OK GNU C++14 TESTS 23 124 22630400 2300
131226112 K0u1es E2 Oct. 8, 2021, 5:07 p.m. OK GNU C++14 TESTS 23 124 31846400 2300
131248162 AlexanderL E2 Oct. 8, 2021, 9:34 p.m. OK GNU C++17 TESTS 23 31 3788800 2300
131238957 fishcathu. E2 Oct. 8, 2021, 6:48 p.m. OK GNU C++17 TESTS 23 31 3891200 2300
131238554 ModestMouse E2 Oct. 8, 2021, 6:43 p.m. OK GNU C++17 TESTS 23 46 14233600 2300
131244442 fishcathu. E2 Oct. 8, 2021, 8:12 p.m. OK GNU C++17 TESTS 23 61 3993600 2300
131245979 Bohun E2 Oct. 8, 2021, 8:42 p.m. OK GNU C++17 TESTS 23 62 7782400 2300
131229036 Miaoao E2 Oct. 8, 2021, 5:15 p.m. OK GNU C++17 TESTS 23 62 96972800 2300
131270339 742949301 E2 Oct. 9, 2021, 4:56 a.m. OK GNU C++17 TESTS 23 77 7987200 2300
131253029 kdh E2 Oct. 9, 2021, 12:40 a.m. OK GNU C++17 TESTS 23 78 7782400 2300
131264393 Igorjan94 E2 Oct. 9, 2021, 3:16 a.m. OK GNU C++17 TESTS 23 78 7987200 2300
131270374 742949301 E2 Oct. 9, 2021, 4:56 a.m. OK GNU C++17 TESTS 23 78 8192000 2300
131251192 oskarfiuk1 E2 Oct. 8, 2021, 11:30 p.m. OK GNU C++17 (64) TESTS 23 31 4300800 2300
131248767 Kude E2 Oct. 8, 2021, 9:53 p.m. OK GNU C++17 (64) TESTS 23 31 4608000 2300
131240005 NRolly E2 Oct. 8, 2021, 7:02 p.m. OK GNU C++17 (64) TESTS 23 46 5222400 2300
131267838 bkifhr8 E2 Oct. 9, 2021, 4:20 a.m. OK GNU C++17 (64) TESTS 23 46 5324800 2300
131254996 He_Ren E2 Oct. 9, 2021, 1:35 a.m. OK GNU C++17 (64) TESTS 23 46 9625600 2300
131234820 Alice_Synthesis_Thirty E2 Oct. 8, 2021, 6:10 p.m. OK GNU C++17 (64) TESTS 23 46 15155200 2300
131255630 Qingyu E2 Oct. 9, 2021, 1:51 a.m. OK GNU C++17 (64) TESTS 23 46 36454400 2300
131267871 EmZie E2 Oct. 9, 2021, 4:20 a.m. OK GNU C++17 (64) TESTS 23 61 5222400 2300
131228745 F_know E2 Oct. 8, 2021, 5:14 p.m. OK GNU C++17 (64) TESTS 23 62 8192000 2300
131259584 Thallium54 E2 Oct. 9, 2021, 2:15 a.m. OK GNU C++17 (64) TESTS 23 62 8806400 2300
131239369 bobbilyking E2 Oct. 8, 2021, 6:54 p.m. OK Java 11 TESTS 23 1637 88985600 2300
131239910 armoking E2 Oct. 8, 2021, 7:01 p.m. OK Java 8 TESTS 23 873 41267200 2300
131246658 armoking E2 Oct. 8, 2021, 8:57 p.m. OK Java 8 TESTS 23 873 43622400 2300
131247117 armoking E2 Oct. 8, 2021, 9:08 p.m. OK Java 8 TESTS 23 888 44646400 2300
131238551 Katushechka E2 Oct. 8, 2021, 6:43 p.m. OK Java 8 TESTS 23 1653 34713600 2300
131250774 madun1999 E2 Oct. 8, 2021, 11:10 p.m. OK PyPy 3 TESTS 23 873 59187200 2300
131239676 huikang E2 Oct. 8, 2021, 6:58 p.m. OK PyPy 3 TESTS 23 1107 62771200 2300
131241235 tcltk E2 Oct. 8, 2021, 7:20 p.m. OK PyPy 3 TESTS 23 1543 65228800 2300
131241415 tcltk E2 Oct. 8, 2021, 7:23 p.m. OK PyPy 3 TESTS 23 1543 65638400 2300
131244470 SPD_9X2 E2 Oct. 8, 2021, 8:12 p.m. OK PyPy 3 TESTS 23 2542 52633600 2300
131226142 r57shell E2 Oct. 8, 2021, 5:07 p.m. OK Python 3 TESTS 23 919 13926400 2300

remove filters

Back to search problems