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 |
|---|---|---|---|---|---|---|
| 819 | Codeforces Round 421 (Div. 1) | FINISHED | False | 7200 | 277831523 | June 27, 2017, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 308 ) | D | Mister B and Astronomers | PROGRAMMING | number theory | 2900 |
After studying the beacons Mister B decided to visit alien's planet, because he learned that they live in a system of flickering star Moon. Moreover, Mister B learned that the star shines once in exactly T seconds. The problem is that the star is yet to be discovered by scientists. There are n astronomers numerated from 1 to n trying to detect the star. They try to detect the star by sending requests to record the sky for 1 second. The astronomers send requests in cycle : the i -th astronomer sends a request exactly a i second after the ( i - 1) -th (i.e. if the previous request was sent at moment t , then the next request is sent at moment t + a i ); the 1 -st astronomer sends requests a 1 seconds later than the n -th. The first astronomer sends his first request at moment 0 . Mister B doesn't know the first moment the star is going to shine, but it's obvious that all moments at which the star will shine are determined by the time of its shine moment in the interval [0, T ) . Moreover, this interval can be split into T parts of 1 second length each of form [ t , t + 1) , where t = 0, 1, 2, ..., ( T - 1) . Mister B wants to know how lucky each astronomer can be in discovering the star first. For each astronomer compute how many segments of form [ t , t + 1) ( t = 0, 1, 2, ..., ( T - 1) ) there are in the interval [0, T ) so that this astronomer is the first to discover the star if the first shine of the star happens in this time interval. The first line contains two integers T and n ( 1 ≤ T ≤ 10 9 , 2 ≤ n ≤ 2·10 5 ). The second line contains n integers a 1 , a 2 , ..., a n ( 1 ≤ a i ≤ 10 9 ). Print n integers: for each astronomer print the number of time segments describer earlier. In the first sample test the first astronomer will send requests at moments t 1 = 0, 5, 10, ... , the second — at moments t 2 = 3, 8, 13, ... . That's why interval [0, 1) the first astronomer will discover first at moment t 1 = 0 , [1, 2) — the first astronomer at moment t 1 = 5 |
| Codeforces Round #421 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 28121777 | jiyutian | D | June 28, 2017, 1:55 p.m. | OK | GNU C++ | TESTS | 110 | 171 | 7475200 | 2900 | |
| 28122376 | wanna_yellow | D | June 28, 2017, 2:34 p.m. | OK | GNU C++ | TESTS | 110 | 171 | 19148800 | 2900 | |
| 28792511 | permui | D | July 23, 2017, 5:48 a.m. | OK | GNU C++ | TESTS | 110 | 218 | 23859200 | 2900 | |
| 28093948 | 1919810 | D | June 27, 2017, 4:05 p.m. | OK | GNU C++ | TESTS | 110 | 218 | 26112000 | 2900 | |
| 28282623 | XuYipei | D | July 4, 2017, 2:14 p.m. | OK | GNU C++ | TESTS | 110 | 234 | 23142400 | 2900 | |
| 30028681 | wmdcstdio | D | Sept. 3, 2017, 9:58 a.m. | OK | GNU C++ | TESTS | 110 | 249 | 16588800 | 2900 | |
| 29911395 | vjudge4 | D | Aug. 30, 2017, 8:06 a.m. | OK | GNU C++ | TESTS | 110 | 265 | 16281600 | 2900 | |
| 29911322 | gjghfd | D | Aug. 30, 2017, 8:04 a.m. | OK | GNU C++ | TESTS | 110 | 280 | 16281600 | 2900 | |
| 30028697 | wmdcstdio | D | Sept. 3, 2017, 9:59 a.m. | OK | GNU C++ | TESTS | 110 | 280 | 16588800 | 2900 | |
| 28262104 | Parachutes | D | July 3, 2017, 6:01 p.m. | OK | GNU C++ | TESTS | 110 | 280 | 24064000 | 2900 | |
| 28102896 | skywalkert | D | June 27, 2017, 7:37 p.m. | OK | GNU C++11 | TESTS | 110 | 109 | 5120000 | 2900 | |
| 28102911 | skywalkert | D | June 27, 2017, 7:38 p.m. | OK | GNU C++11 | TESTS | 110 | 124 | 4300800 | 2900 | |
| 40980661 | ReaLNero1 | D | July 30, 2018, 5:38 p.m. | OK | GNU C++11 | TESTS | 110 | 139 | 3072000 | 2900 | |
| 28123648 | krijgertje | D | June 28, 2017, 4:16 p.m. | OK | GNU C++11 | TESTS | 110 | 140 | 8499200 | 2900 | |
| 49210996 | ZqlwMatt | D | Jan. 30, 2019, 3:34 p.m. | OK | GNU C++11 | TESTS | 110 | 171 | 11264000 | 2900 | |
| 44772740 | yasugongshang | D | Oct. 24, 2018, 1:02 p.m. | OK | GNU C++11 | TESTS | 110 | 202 | 12697600 | 2900 | |
| 29722019 | choice | D | Aug. 24, 2017, 4:38 a.m. | OK | GNU C++11 | TESTS | 110 | 202 | 16179200 | 2900 | |
| 29721994 | choice | D | Aug. 24, 2017, 4:36 a.m. | OK | GNU C++11 | TESTS | 110 | 202 | 16179200 | 2900 | |
| 28202259 | Twishkle.Aevdark | D | July 2, 2017, 3:06 a.m. | OK | GNU C++11 | TESTS | 110 | 202 | 16384000 | 2900 | |
| 28109590 | AkaneSasu | D | June 28, 2017, 6:48 a.m. | OK | GNU C++11 | TESTS | 110 | 218 | 12492800 | 2900 | |
| 31892342 | King_George | D | Oct. 30, 2017, 11:52 a.m. | OK | GNU C++14 | TESTS | 110 | 109 | 83148800 | 2900 | |
| 59506780 | Scut82 | D | Aug. 26, 2019, 6:28 a.m. | OK | GNU C++14 | TESTS | 110 | 140 | 10854400 | 2900 | |
| 28276423 | NiroBC | D | July 4, 2017, 9:13 a.m. | OK | GNU C++14 | TESTS | 110 | 155 | 8294400 | 2900 | |
| 28141869 | AmberFrame | D | June 29, 2017, 2:34 p.m. | OK | GNU C++14 | TESTS | 110 | 156 | 9932800 | 2900 | |
| 28096368 | dotorya | D | June 27, 2017, 4:23 p.m. | OK | GNU C++14 | TESTS | 110 | 202 | 14950400 | 2900 | |
| 36876816 | PinkEx | D | April 2, 2018, 11:48 a.m. | OK | GNU C++14 | TESTS | 110 | 218 | 14745600 | 2900 | |
| 36876615 | PinkEx | D | April 2, 2018, 11:39 a.m. | OK | GNU C++14 | TESTS | 110 | 218 | 14745600 | 2900 | |
| 28087916 | yutaka1999 | D | June 27, 2017, 3:23 p.m. | OK | GNU C++14 | TESTS | 110 | 218 | 23142400 | 2900 | |
| 45853053 | RNS_KSB | D | Nov. 17, 2018, 1:50 a.m. | OK | GNU C++14 | TESTS | 110 | 234 | 14643200 | 2900 | |
| 28099805 | anta | D | June 27, 2017, 5:25 p.m. | OK | GNU C++14 | TESTS | 110 | 249 | 13926400 | 2900 | |
| 50427505 | AnimaOI | D | Feb. 24, 2019, 12:18 p.m. | OK | GNU C++17 | TESTS | 110 | 156 | 8806400 | 2900 | |
| 45201391 | Shayan.P | D | Nov. 2, 2018, 10:12 a.m. | OK | GNU C++17 | TESTS | 110 | 187 | 12083200 | 2900 | |
| 42253671 | Benq | D | Aug. 29, 2018, 7:17 p.m. | OK | GNU C++17 | TESTS | 110 | 265 | 13721600 | 2900 | |
| 42667841 | Reem | D | Sept. 8, 2018, 9:04 a.m. | OK | GNU C++17 | TESTS | 110 | 265 | 15155200 | 2900 | |
| 68408908 | Jester | D | Jan. 8, 2020, 4:10 p.m. | OK | GNU C++17 | TESTS | 110 | 358 | 18022400 | 2900 | |
| 68406847 | Jester | D | Jan. 8, 2020, 3:17 p.m. | OK | GNU C++17 | TESTS | 110 | 358 | 18022400 | 2900 | |
| 55868102 | hyfzbtrs | D | June 21, 2019, 1:14 p.m. | OK | GNU C++17 | TESTS | 110 | 389 | 33587200 | 2900 | |
| 28094842 | uwi | D | June 27, 2017, 4:12 p.m. | OK | Java 8 | TESTS | 110 | 327 | 27340800 | 2900 | |
| 28100626 | AndreiNet | D | June 27, 2017, 5:47 p.m. | OK | Java 8 | TESTS | 110 | 639 | 28672000 | 2900 | |
| 28304270 | dalt | D | July 5, 2017, 12:52 p.m. | OK | Java 8 | TESTS | 110 | 1372 | 64204800 | 2900 | |
| 29495580 | Darth_Jar_Jar_Binks | D | Aug. 16, 2017, 3:56 a.m. | OK | Java 8 | TESTS | 110 | 1622 | 44032000 | 2900 |
Back to search problems