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 |
|---|---|---|---|---|---|---|
| 901 | Codeforces Round 453 (Div. 1) | FINISHED | False | 7200 | 262707923 | Dec. 19, 2017, 3:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 98 ) | E | Cyclic Cipher | PROGRAMMING | fft math | 3300 |
Senor Vorpal Kickass'o invented an innovative method to encrypt integer sequences of length n . To encrypt a sequence, one has to choose a secret sequence , that acts as a key. Vorpal is very selective, so the key should be such a sequence b i , that its cyclic shifts are linearly independent, that is, there is no non-zero set of coefficients x 0 , x 1 , ..., x n - 1 , such that for all k at the same time. After that for a sequence you should build the following cipher: In other words, you are to compute the quadratic deviation between each cyclic shift of b i and the sequence a i . The resulting sequence is the Kickass's cipher. The cipher is in development right now and Vorpal wants to decipher a sequence after it has been encrypted. You are to solve this problem for him. You are given sequences c i and b i . You are to find all suitable sequences a i . The first line contains a single integer n ( ). The second line contains n integers b 0 , b 1 , ..., b n - 1 ( ). The third line contains n integers c 0 , c 1 , ..., c n - 1 ( ). It is guaranteed that all cyclic shifts of sequence b i are linearly independent. In the first line print a single integer k — the number of sequences a i , such that after encrypting them with key b i you get the sequence c i . After that in each of k next lines print n integers a 0 , a 1 , ..., a n - 1 . Print the sequences in lexicographical order. Note that k could be equal to 0 . |
| Codeforces Round #453 (Div. 1 & Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 53304958 | alonefight | E | April 26, 2019, 1:51 a.m. | OK | GNU C++11 | TESTS | 70 | 1216 | 60108800 | 3300 | |
| 36988410 | FizzyDavid | E | April 5, 2018, 5:21 a.m. | OK | GNU C++11 | TESTS | 70 | 1216 | 83456000 | 3300 | |
| 33759468 | krijgertje | E | Dec. 29, 2017, 12:26 p.m. | OK | GNU C++11 | TESTS | 70 | 1263 | 17920000 | 3300 | |
| 34065981 | matthew99 | E | Jan. 10, 2018, 9:45 a.m. | OK | GNU C++11 | TESTS | 70 | 1482 | 24166400 | 3300 | |
| 34838028 | Georgia_001 | E | Feb. 2, 2018, 12:37 p.m. | OK | GNU C++11 | TESTS | 70 | 1637 | 112640000 | 3300 | |
| 33467823 | rxdoi | E | Dec. 20, 2017, 11:47 p.m. | OK | GNU C++11 | TESTS | 70 | 1637 | 112640000 | 3300 | |
| 33822588 | Hank2006 | E | Dec. 30, 2017, 11:40 p.m. | OK | GNU C++11 | TESTS | 70 | 1653 | 112640000 | 3300 | |
| 57872184 | lopare | E | July 28, 2019, 2:39 a.m. | OK | GNU C++11 | TESTS | 70 | 2152 | 23552000 | 3300 | |
| 57768432 | py_ultron | E | July 25, 2019, 10:21 p.m. | OK | GNU C++11 | TESTS | 70 | 2261 | 23552000 | 3300 | |
| 33458270 | rxdoi | E | Dec. 20, 2017, 2:31 p.m. | OK | GNU C++11 | TESTS | 70 | 2838 | 112640000 | 3300 | |
| 59832611 | Scut82 | E | Sept. 1, 2019, 12:57 a.m. | OK | GNU C++14 | TESTS | 70 | 639 | 38912000 | 3300 | |
| 37594618 | Troywar | E | April 25, 2018, 11:14 a.m. | OK | GNU C++14 | TESTS | 70 | 1466 | 56524800 | 3300 | |
| 37594682 | Troywar | E | April 25, 2018, 11:17 a.m. | OK | GNU C++14 | TESTS | 70 | 1575 | 56524800 | 3300 | |
| 33828322 | nicecoder37 | E | Dec. 31, 2017, 9:16 a.m. | OK | GNU C++14 | TESTS | 70 | 1668 | 112537600 | 3300 | |
| 33657000 | Ali_P | E | Dec. 26, 2017, 8:21 p.m. | OK | GNU C++14 | TESTS | 70 | 1668 | 112537600 | 3300 | |
| 34734988 | andronos | E | Jan. 31, 2018, 11:17 a.m. | OK | GNU C++14 | TESTS | 70 | 1669 | 112537600 | 3300 | |
| 34177964 | ABDbek | E | Jan. 14, 2018, 2:48 p.m. | OK | GNU C++14 | TESTS | 70 | 1669 | 112537600 | 3300 | |
| 34295279 | jslijin | E | Jan. 19, 2018, 7:32 a.m. | OK | GNU C++14 | TESTS | 70 | 1700 | 152166400 | 3300 | |
| 34295707 | jslijin | E | Jan. 19, 2018, 7:50 a.m. | OK | GNU C++14 | TESTS | 70 | 1793 | 152166400 | 3300 | |
| 37598689 | handsomeIvan | E | April 25, 2018, 1:32 p.m. | OK | GNU C++14 | TESTS | 70 | 2589 | 26931200 | 3300 | |
| 63687024 | xgcxgc | E | Oct. 28, 2019, 11:25 p.m. | OK | GNU C++17 | TESTS | 70 | 935 | 17920000 | 3300 | |
| 69652089 | gongsuidashen | E | Jan. 28, 2020, 5:47 a.m. | OK | GNU C++17 | TESTS | 70 | 1528 | 110592000 | 3300 | |
| 63780866 | AryssonFigueiredo | E | Oct. 30, 2019, 10:59 a.m. | OK | GNU C++17 | TESTS | 70 | 1575 | 42598400 | 3300 | |
| 63756899 | AryssonFigueiredo | E | Oct. 30, 2019, 12:16 a.m. | OK | GNU C++17 | TESTS | 70 | 1606 | 42598400 | 3300 | |
| 57465257 | Benq | E | July 21, 2019, 3:19 p.m. | OK | GNU C++17 | TESTS | 70 | 1902 | 54067200 | 3300 | |
| 62612027 | I_love_motos | E | Oct. 15, 2019, 10:09 a.m. | OK | GNU C++17 | TESTS | 70 | 1964 | 54067200 | 3300 | |
| 63874928 | AryssonFigueiredo | E | Oct. 30, 2019, 6:40 p.m. | OK | GNU C++17 | TESTS | 70 | 2011 | 52838400 | 3300 | |
| 63875831 | AryssonFigueiredo | E | Oct. 30, 2019, 6:58 p.m. | OK | GNU C++17 | TESTS | 70 | 2027 | 52531200 | 3300 | |
| 63875341 | AryssonFigueiredo | E | Oct. 30, 2019, 6:49 p.m. | OK | GNU C++17 | TESTS | 70 | 2043 | 52838400 | 3300 | |
| 63874844 | AryssonFigueiredo | E | Oct. 30, 2019, 6:39 p.m. | OK | GNU C++17 | TESTS | 70 | 2043 | 52838400 | 3300 | |
| 62595138 | I_love_motos | E | Oct. 15, 2019, 1:04 a.m. | OK | Java 8 | TESTS | 70 | 794 | 82227200 | 3300 | |
| 40978873 | ReaLNero1 | E | July 30, 2018, 4:50 p.m. | OK | Java 8 | TESTS | 70 | 920 | 96972800 | 3300 | |
| 36732651 | mmaxio | E | March 29, 2018, 8:20 p.m. | OK | Java 8 | TESTS | 70 | 951 | 119705600 | 3300 | |
| 33467694 | mmaxio | E | Dec. 20, 2017, 11:27 p.m. | OK | Java 8 | TESTS | 70 | 1029 | 148480000 | 3300 |
Back to search problems