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 |
|---|---|---|---|---|---|---|
| 883 | 2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest (Online Mirror, ACM-ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 267832523 | Oct. 21, 2017, 8:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 649 ) | A | Automatic Door | PROGRAMMING | implementation | 2300 |
There is an automatic door at the entrance of a factory. The door works in the following way: when one or several people come to the door and it is closed, the door immediately opens automatically and all people immediately come inside, when one or several people come to the door and it is open, all people immediately come inside, opened door immediately closes in d seconds after its opening, if the door is closing and one or several people are coming to the door at the same moment, then all of them will have enough time to enter and only after that the door will close. For example, if d = 3 and four people are coming at four different moments of time t 1 = 4 , t 2 = 7 , t 3 = 9 and t 4 = 13 then the door will open three times: at moments 4 , 9 and 13 . It will close at moments 7 and 12 . It is known that n employees will enter at moments a , 2· a , 3· a , ..., n · a (the value a is positive integer). Also m clients will enter at moments t 1 , t 2 , ..., t m . Write program to find the number of times the automatic door will open. Assume that the door is initially closed. The first line contains four integers n , m , a and d ( 1 ≤ n , a ≤ 10 9 , 1 ≤ m ≤ 10 5 , 1 ≤ d ≤ 10 18 ) — the number of the employees, the number of the clients, the moment of time when the first employee will come and the period of time in which the door closes. The second line contains integer sequence t 1 , t 2 , ..., t m ( 1 ≤ t i ≤ 10 18 ) — moments of time when clients will come. The values t i are given in non-decreasing order. Print the number of times the door will open. In the first example the only employee will come at moment 3 . At this moment the door will open and will stay open until the moment 7 . At the same moment of time the client will come, so at first he will enter and only after it the door will close. Thus the door will open one time. |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 31622424 | zcyhhh | A | Oct. 23, 2017, 8:06 a.m. | OK | GNU C++ | TESTS | 131 | 31 | 2048000 | 2300 | |
| 31615141 | Acorasick | A | Oct. 22, 2017, 11 p.m. | OK | GNU C++ | TESTS | 131 | 31 | 2048000 | 2300 | |
| 31603094 | VISCARIA | A | Oct. 22, 2017, 12:12 p.m. | OK | GNU C++ | TESTS | 131 | 31 | 2867200 | 2300 | |
| 31591684 | iamqzh | A | Oct. 22, 2017, 4:48 a.m. | OK | GNU C++ | TESTS | 131 | 31 | 2867200 | 2300 | |
| 31602609 | Magolor | A | Oct. 22, 2017, 11:52 a.m. | OK | GNU C++ | TESTS | 131 | 31 | 3072000 | 2300 | |
| 31578025 | vjudge1 | A | Oct. 21, 2017, 2:45 p.m. | OK | GNU C++ | TESTS | 131 | 31 | 3072000 | 2300 | |
| 31577949 | Magolor | A | Oct. 21, 2017, 2:43 p.m. | OK | GNU C++ | TESTS | 131 | 31 | 3072000 | 2300 | |
| 31577882 | Magolor | A | Oct. 21, 2017, 2:40 p.m. | OK | GNU C++ | TESTS | 131 | 31 | 3072000 | 2300 | |
| 32514888 | vjudge3 | A | Nov. 21, 2017, 3:26 a.m. | OK | GNU C++ | TESTS | 131 | 46 | 819200 | 2300 | |
| 32368232 | vjudge5 | A | Nov. 17, 2017, 2:26 a.m. | OK | GNU C++ | TESTS | 131 | 46 | 819200 | 2300 | |
| 31621816 | Qudrat_Ibadullayev | A | Oct. 23, 2017, 7:29 a.m. | OK | GNU C++11 | TESTS | 131 | 31 | 2048000 | 2300 | |
| 31598907 | laofudasuan | A | Oct. 22, 2017, 9:22 a.m. | OK | GNU C++11 | TESTS | 131 | 31 | 2048000 | 2300 | |
| 31615774 | choutii | A | Oct. 23, 2017, 12:22 a.m. | OK | GNU C++11 | TESTS | 131 | 31 | 2867200 | 2300 | |
| 31604105 | hzy9819 | A | Oct. 22, 2017, 12:48 p.m. | OK | GNU C++11 | TESTS | 131 | 31 | 2867200 | 2300 | |
| 31577794 | xy20130630 | A | Oct. 21, 2017, 2:37 p.m. | OK | GNU C++11 | TESTS | 131 | 31 | 2867200 | 2300 | |
| 31577701 | xy20130630 | A | Oct. 21, 2017, 2:34 p.m. | OK | GNU C++11 | TESTS | 131 | 31 | 2867200 | 2300 | |
| 31620661 | SSW | A | Oct. 23, 2017, 6:13 a.m. | OK | GNU C++11 | TESTS | 131 | 31 | 3174400 | 2300 | |
| 31731575 | doooodle hahaschool SssssssssssssbbbBBBB | A | Oct. 26, 2017, 7:47 a.m. | OK | GNU C++11 | TESTS | 131 | 31 | 4915200 | 2300 | |
| 39867097 | nowhere132 | A | July 2, 2018, 11:58 a.m. | OK | GNU C++11 | TESTS | 131 | 46 | 819200 | 2300 | |
| 32368197 | your_name_ | A | Nov. 17, 2017, 2:20 a.m. | OK | GNU C++11 | TESTS | 131 | 46 | 819200 | 2300 | |
| 31691397 | molamola. | A | Oct. 24, 2017, 6:04 p.m. | OK | GNU C++14 | TESTS | 131 | 46 | 2764800 | 2300 | |
| 32009165 | MicGor yarek Anadi | A | Nov. 3, 2017, 1:57 p.m. | OK | GNU C++14 | TESTS | 131 | 61 | 819200 | 2300 | |
| 31684620 | Rmatrix | A | Oct. 24, 2017, 2:12 p.m. | OK | GNU C++14 | TESTS | 131 | 61 | 2867200 | 2300 | |
| 32237245 | cucrui | A | Nov. 12, 2017, 7:40 a.m. | OK | GNU C++14 | TESTS | 131 | 62 | 0 | 2300 | |
| 31993326 | victoragnez RailtonT helio | A | Nov. 2, 2017, 9:29 p.m. | OK | GNU C++14 | TESTS | 131 | 62 | 0 | 2300 | |
| 31738186 | NilakshiRocks | A | Oct. 26, 2017, 12:36 p.m. | OK | GNU C++14 | TESTS | 131 | 62 | 0 | 2300 | |
| 48526015 | vjudge4 | A | Jan. 18, 2019, 9:05 a.m. | OK | GNU C++14 | TESTS | 131 | 62 | 819200 | 2300 | |
| 43496081 | Anton_Chernev iddilov daninnm | A | Sept. 27, 2018, 2:45 p.m. | OK | GNU C++14 | TESTS | 131 | 62 | 819200 | 2300 | |
| 39866259 | hiep622032001 | A | July 2, 2018, 11:25 a.m. | OK | GNU C++14 | TESTS | 131 | 62 | 819200 | 2300 | |
| 32048383 | ckw1140 yswon petil777 | A | Nov. 4, 2017, 9:51 a.m. | OK | GNU C++14 | TESTS | 131 | 62 | 819200 | 2300 | |
| 48550142 | vjudge1 | A | Jan. 19, 2019, 12:58 a.m. | OK | GNU C++17 | TESTS | 131 | 62 | 1024000 | 2300 | |
| 48525944 | 7989 | A | Jan. 18, 2019, 9:03 a.m. | OK | GNU C++17 | TESTS | 131 | 62 | 1024000 | 2300 | |
| 58200928 | vjudge1 | A | Aug. 3, 2019, 4:11 a.m. | OK | GNU C++17 | TESTS | 131 | 77 | 819200 | 2300 | |
| 58198890 | hbi1998 | A | Aug. 3, 2019, 2:46 a.m. | OK | GNU C++17 | TESTS | 131 | 77 | 921600 | 2300 | |
| 56263639 | hjk1030 | A | June 29, 2019, 9:04 a.m. | OK | GNU C++17 | TESTS | 131 | 78 | 819200 | 2300 | |
| 43969242 | honey6 brecurse | A | Oct. 7, 2018, 6:44 p.m. | OK | GNU C++17 | TESTS | 131 | 78 | 819200 | 2300 | |
| 52569259 | ThroughTheNight | A | April 10, 2019, 1:36 p.m. | OK | GNU C++17 | TESTS | 131 | 312 | 1638400 | 2300 | |
| 31590398 | tmwilliamlin168 | A | Oct. 22, 2017, 2:51 a.m. | OK | Java 8 | TESTS | 131 | 139 | 20684800 | 2300 | |
| 31704101 | catchup | A | Oct. 25, 2017, 9:31 a.m. | OK | Java 8 | TESTS | 131 | 265 | 2969600 | 2300 | |
| 31684752 | Sharon Carson BiIIy | A | Oct. 24, 2017, 2:16 p.m. | OK | Java 8 | TESTS | 131 | 420 | 20992000 | 2300 | |
| 31961155 | mohitdayal | A | Nov. 1, 2017, 7:20 p.m. | OK | Java 8 | TESTS | 131 | 498 | 19660800 | 2300 | |
| 32782089 | 2158090 | A | Nov. 29, 2017, 1:39 p.m. | OK | Java 8 | TESTS | 131 | 499 | 42393600 | 2300 | |
| 31874088 | og.kostya | A | Oct. 29, 2017, 6:03 p.m. | OK | MS C# | TESTS | 131 | 77 | 921600 | 2300 | |
| 31595531 | Borisp | A | Oct. 22, 2017, 7:40 a.m. | OK | MS C++ | TESTS | 131 | 155 | 2867200 | 2300 | |
| 45124580 | vjudge3 | A | Oct. 31, 2018, 7:13 a.m. | OK | MS C++ | TESTS | 131 | 156 | 16281600 | 2300 | |
| 31687864 | 11fingers | A | Oct. 24, 2017, 3:53 p.m. | OK | Python 2 | TESTS | 131 | 358 | 13516800 | 2300 | |
| 31734398 | franckmy | A | Oct. 26, 2017, 10:02 a.m. | OK | Python 2 | TESTS | 131 | 389 | 9011200 | 2300 | |
| 39402017 | Ali_Pi | A | June 19, 2018, 7:33 a.m. | OK | Python 2 | TESTS | 131 | 795 | 9011200 | 2300 | |
| 33208046 | atryapa | A | Dec. 13, 2017, 9:13 a.m. | OK | Python 3 | TESTS | 131 | 358 | 15872000 | 2300 | |
| 42120176 | Mk_Python_v1 | A | Aug. 26, 2018, 12:03 p.m. | OK | Python 3 | TESTS | 131 | 405 | 10342400 | 2300 | |
| 32143619 | atryapa | A | Nov. 8, 2017, 5:47 p.m. | OK | Python 3 | TESTS | 131 | 436 | 10240000 | 2300 | |
| 42348582 | nns2009 | A | Sept. 2, 2018, 2:01 a.m. | OK | Python 3 | TESTS | 131 | 530 | 10240000 | 2300 |
Back to search problems