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 |
---|---|---|---|---|---|---|
1060 | Codeforces Round 513 by Barcelona Bootcamp (rated, Div. 1 + Div. 2) | FINISHED | False | 9000 | 193186499 | Oct. 4, 2018, 7:05 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 213 ) | H | Sophisticated Device | PROGRAMMING | constructive algorithms | 2900 |
B'You are given integers d and p , p is prime. Also you have a mysterious device. It has memory cells, each contains an integer between 0 and p-1 . Also two instructions are supported, addition and raising to the d -th power. textbf{Both are modulo} p . The memory cells are numbered 1, 2, ... , 5000 . Initially cells 1 and 2 contain integers x and y , respectively ( 0 <= qslant x, y <= q p - 1 ). All other cells contain textbf{1} s. You can not directly access values in cells, and you textbf{don 't know} values of x and y (but you know they are written in first two cells). You mission, should you choose to accept it, is to write a program using the available instructions to obtain the product xy modulo p in one of the cells. You program should work for all possible x and y . Addition instruction evaluates sum of values in two cells and writes it to third cell. This instruction is encoded by a string "+ e1 e2 to", which writes sum of values in cells e1 and e2 into cell to. Any values of e1, e2, to can coincide. Second instruction writes the d -th power of a value in some cell to the target cell. This instruction is encoded by a string "^ e to". Values e and to can coincide, in this case value in the cell will be overwritten. Last instruction is special, this is the return instruction, and it is encoded by a string "f target". This means you obtained values xy bmod p in the cell target. No instructions should be called after this instruction. Provide a program that obtains xy bmod p and uses no more than 5000 instructions (including the return instruction). It is guaranteed that, under given constrains, a solution exists. The first line contains space-separated integers d and p ( 2 <= qslant d <= qslant 10 , d < p , 3 <= qslant p <= qslant 10^9 + 9 , p is prime). Output instru'... |
User editorial for Codeforces Round 513 by Barcelona Bootcamp (rated, Div. 1 + Div. 2) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
57868264 | lopare | H | July 27, 2019, 11:04 p.m. | OK | GNU C++11 | TESTS | 49 | 31 | 0 | 2900 | |
46962567 | Itst | H | Dec. 13, 2018, 9:12 a.m. | OK | GNU C++11 | TESTS | 49 | 31 | 0 | 2900 | |
45649315 | dragonslayerintraining | H | Nov. 12, 2018, 10:38 p.m. | OK | GNU C++11 | TESTS | 49 | 31 | 0 | 2900 | |
45206717 | Wallbreaker5th | H | Nov. 2, 2018, 1:07 p.m. | OK | GNU C++11 | TESTS | 49 | 31 | 0 | 2900 | |
44481957 | FlappyFish | H | Oct. 18, 2018, 10:47 a.m. | OK | GNU C++11 | TESTS | 49 | 31 | 0 | 2900 | |
44176842 | dy0607 | H | Oct. 12, 2018, 9:17 a.m. | OK | GNU C++11 | TESTS | 49 | 31 | 0 | 2900 | |
44032470 | FlappyFish | H | Oct. 9, 2018, 11:30 a.m. | OK | GNU C++11 | TESTS | 49 | 31 | 0 | 2900 | |
43982888 | frodakcin | H | Oct. 8, 2018, 4:39 a.m. | OK | GNU C++11 | TESTS | 49 | 31 | 0 | 2900 | |
43923617 | tqyaaaaaaaang | H | Oct. 7, 2018, 3 a.m. | OK | GNU C++11 | TESTS | 49 | 31 | 0 | 2900 | |
43922393 | ohweonfire | H | Oct. 7, 2018, 1:41 a.m. | OK | GNU C++11 | TESTS | 49 | 31 | 0 | 2900 | |
48039612 | Toxel | H | Jan. 6, 2019, 6:06 p.m. | OK | GNU C++14 | TESTS | 49 | 31 | 0 | 2900 | |
46971215 | newbiegcz | H | Dec. 13, 2018, 1:57 p.m. | OK | GNU C++14 | TESTS | 49 | 31 | 0 | 2900 | |
45030552 | 012-28876-Margulan-7 | H | Oct. 29, 2018, 3:29 a.m. | OK | GNU C++14 | TESTS | 49 | 31 | 0 | 2900 | |
44116240 | ugly2333 | H | Oct. 11, 2018, 2:20 p.m. | OK | GNU C++14 | TESTS | 49 | 31 | 0 | 2900 | |
43941845 | FAAAAAAAAAAAAAAAAK | H | Oct. 7, 2018, 11:49 a.m. | OK | GNU C++14 | TESTS | 49 | 31 | 0 | 2900 | |
43863056 | sparsh_garg | H | Oct. 5, 2018, 4:59 p.m. | OK | GNU C++14 | TESTS | 49 | 31 | 0 | 2900 | |
43816906 | rqgao2014 | H | Oct. 5, 2018, 5:58 a.m. | OK | GNU C++14 | TESTS | 49 | 31 | 0 | 2900 | |
43812851 | imeimi | H | Oct. 5, 2018, 2:38 a.m. | OK | GNU C++14 | TESTS | 49 | 31 | 0 | 2900 | |
43778906 | yhx-12243 | H | Oct. 4, 2018, 9:21 a.m. | OK | GNU C++14 | TESTS | 49 | 31 | 0 | 2900 | |
47704061 | shadowatyy | H | Dec. 29, 2018, 6:50 p.m. | OK | GNU C++14 | TESTS | 49 | 31 | 102400 | 2900 | |
52332034 | Elegia | H | April 5, 2019, 5:58 a.m. | OK | GNU C++17 | TESTS | 49 | 31 | 0 | 2900 | |
46298219 | vjudge5 | H | Nov. 28, 2018, 5:27 a.m. | OK | GNU C++17 | TESTS | 49 | 31 | 0 | 2900 | |
44336167 | LHiC | H | Oct. 14, 2018, 9:44 p.m. | OK | GNU C++17 | TESTS | 49 | 31 | 0 | 2900 | |
43777602 | xumingkuan | H | Oct. 4, 2018, 9:06 a.m. | OK | GNU C++17 | TESTS | 49 | 31 | 0 | 2900 | |
56857207 | cristian1997 | H | July 11, 2019, 7:10 p.m. | OK | GNU C++17 | TESTS | 49 | 31 | 204800 | 2900 | |
56857167 | vjudge3 | H | July 11, 2019, 7:09 p.m. | OK | GNU C++17 | TESTS | 49 | 31 | 204800 | 2900 | |
54450613 | dtcxzyw | H | May 21, 2019, 1:22 p.m. | OK | GNU C++17 | TESTS | 49 | 31 | 307200 | 2900 | |
44659229 | TohnoYouki | H | Oct. 21, 2018, 2:23 p.m. | OK | GNU C++17 | TESTS | 49 | 31 | 307200 | 2900 | |
43808199 | Benq | H | Oct. 4, 2018, 9:07 p.m. | OK | GNU C++17 | TESTS | 49 | 31 | 307200 | 2900 | |
48284752 | FlappyFish | H | Jan. 12, 2019, 9:47 a.m. | OK | GNU C++17 | TESTS | 49 | 31 | 409600 | 2900 | |
44378469 | stewbasic | H | Oct. 16, 2018, 12:30 a.m. | OK | Python 2 | TESTS | 49 | 171 | 409600 | 2900 |
Back to search problems