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.
Problems
The m -floor ( m > 1) office of international corporation CodeForces has the advanced elevator control system established. It works as follows. All office floors are sequentially numbered with integers from 1 to m . At time t = 0 , the elevator is on the first floor, the elevator is empty and nobody is waiting for the elevator on other floors. Next, at times t i ( t i > 0) people come to the elevator. For simplicity, we assume that one person uses the elevator only once during the reported interval. For every person we know three parameters: the time at which the person comes to the elevator, the floor on which the person is initially, and the floor to which he wants to go. The movement of the elevator between the floors is as follows. At time t ( t ≥ 0 , t is an integer) the elevator is always at some floor. First the elevator releases all people who are in the elevator and want to get to the current floor. Then it lets in all the people waiting for the elevator on this floor. If a person comes to the elevator exactly at time t , then he has enough time to get into it. We can assume that all of these actions (going in or out from the elevator) are made instantly. After that the elevator decides, which way to move and at time ( t + 1) the elevator gets to the selected floor. The elevator selects the direction of moving by the following algorithm. If the elevator is empty and at the current time no one is waiting for the elevator on any floor, then the elevator remains at the current floor. Otherwise, let's assume that the elevator is on the floor number x (1 ≤ x ≤ m ) . Then elevator calculates the directions' "priorities" p up and p down : p up is the sum of the number of people waiting for the elevator on the floors with numbers greater than x , and the number of people in the elevator, who want to get to the floors with the numbers greater than x ; p down is the sum of the number of people waiting for the elevator on the floors with numbers less than x |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
9370213 |
wwx |
E |
Jan. 6, 2015, 7:02 a.m. |
OK |
GNU C++ |
TESTS |
29 |
186 |
4403200 |
|
2500 |
|
2903587 |
MeinKraft |
E |
Jan. 10, 2013, 9:45 p.m. |
OK |
GNU C++ |
TESTS |
29 |
187 |
4915200 |
|
2500 |
|
9369548 |
wwx |
E |
Jan. 6, 2015, 3:57 a.m. |
OK |
GNU C++ |
TESTS |
29 |
218 |
5836800 |
|
2500 |
|
38212394 |
vjudge3 |
E |
May 14, 2018, 11:28 a.m. |
OK |
GNU C++ |
TESTS |
29 |
218 |
7884800 |
|
2500 |
|
2900503 |
lostfaith |
E |
Jan. 9, 2013, 8:18 p.m. |
OK |
GNU C++ |
TESTS |
29 |
234 |
4710400 |
|
2500 |
|
3315357 |
Voro94 |
E |
March 14, 2013, 9:28 a.m. |
OK |
GNU C++ |
TESTS |
29 |
234 |
6963200 |
|
2500 |
|
3085363 |
ae23love |
E |
Feb. 9, 2013, 4:50 a.m. |
OK |
GNU C++ |
TESTS |
29 |
234 |
6963200 |
|
2500 |
|
2895022 |
Hello_World |
E |
Jan. 9, 2013, 3:46 a.m. |
OK |
GNU C++ |
TESTS |
29 |
234 |
6963200 |
|
2500 |
|
25362377 |
Jin_Haonan |
E |
March 9, 2017, 2:35 p.m. |
OK |
GNU C++ |
TESTS |
29 |
248 |
7782400 |
|
2500 |
|
2898350 |
liouzhou_101 |
E |
Jan. 9, 2013, 7:28 a.m. |
OK |
GNU C++ |
TESTS |
29 |
249 |
6553600 |
|
2500 |
|
2893013 |
xlk |
E |
Jan. 8, 2013, 5:50 p.m. |
OK |
GNU C++0x |
TESTS |
29 |
281 |
6963200 |
|
2500 |
|
9561891 |
superfish |
E |
Jan. 26, 2015, 3:12 p.m. |
OK |
GNU C++0x |
TESTS |
29 |
312 |
6041600 |
|
2500 |
|
9561906 |
superfish |
E |
Jan. 26, 2015, 3:14 p.m. |
OK |
GNU C++0x |
TESTS |
29 |
342 |
6041600 |
|
2500 |
|
9295947 |
equation314 |
E |
Dec. 29, 2014, 7:09 a.m. |
OK |
GNU C++0x |
TESTS |
29 |
342 |
10956800 |
|
2500 |
|
2890893 |
hex539 |
E |
Jan. 8, 2013, 4:56 p.m. |
OK |
GNU C++0x |
TESTS |
29 |
421 |
16588800 |
|
2500 |
|
8770676 |
zshi |
E |
Nov. 21, 2014, 4:04 a.m. |
OK |
GNU C++0x |
TESTS |
29 |
436 |
8192000 |
|
2500 |
|
2898543 |
Archon.JK |
E |
Jan. 9, 2013, 8:24 a.m. |
OK |
GNU C++0x |
TESTS |
29 |
468 |
6963200 |
|
2500 |
|
5634213 |
DanAlex |
E |
Jan. 7, 2014, 6:52 p.m. |
OK |
GNU C++0x |
TESTS |
29 |
468 |
16588800 |
|
2500 |
|
2906100 |
Andrew_Makar |
E |
Jan. 11, 2013, 8:17 p.m. |
OK |
GNU C++0x |
TESTS |
29 |
484 |
13004800 |
|
2500 |
|
2890864 |
Andrew_Makar |
E |
Jan. 8, 2013, 4:56 p.m. |
OK |
GNU C++0x |
TESTS |
29 |
500 |
13004800 |
|
2500 |
|
53954358 |
time_interspace |
E |
May 10, 2019, 11:16 a.m. |
OK |
GNU C++11 |
TESTS |
29 |
248 |
5734400 |
|
2500 |
|
52065382 |
oldjang |
E |
March 31, 2019, 5:02 a.m. |
OK |
GNU C++11 |
TESTS |
29 |
278 |
7270400 |
|
2500 |
|
35469600 |
vjudge4 |
E |
Feb. 19, 2018, 12:03 p.m. |
OK |
GNU C++11 |
TESTS |
29 |
278 |
10444800 |
|
2500 |
|
18975898 |
Melnyk |
E |
July 8, 2016, 9:11 p.m. |
OK |
GNU C++11 |
TESTS |
29 |
310 |
7270400 |
|
2500 |
|
57821636 |
py_ultron |
E |
July 26, 2019, 11:50 p.m. |
OK |
GNU C++11 |
TESTS |
29 |
310 |
10854400 |
|
2500 |
|
10797148 |
I_love_Ender_Babal66 |
E |
April 20, 2015, 11:45 a.m. |
OK |
GNU C++11 |
TESTS |
29 |
312 |
8499200 |
|
2500 |
|
18975841 |
Melnyk |
E |
July 8, 2016, 9:04 p.m. |
OK |
GNU C++11 |
TESTS |
29 |
312 |
10444800 |
|
2500 |
|
17129602 |
freebsdx |
E |
April 2, 2016, 12:04 p.m. |
OK |
GNU C++11 |
TESTS |
29 |
342 |
8396800 |
|
2500 |
|
57897988 |
lopare |
E |
July 28, 2019, 2:25 p.m. |
OK |
GNU C++11 |
TESTS |
29 |
342 |
10854400 |
|
2500 |
|
35855598 |
______u______ |
E |
March 2, 2018, 8:03 p.m. |
OK |
GNU C++11 |
TESTS |
29 |
342 |
12902400 |
|
2500 |
|
35516241 |
I_love_Y_UME |
E |
Feb. 20, 2018, 8:59 a.m. |
OK |
GNU C++14 |
TESTS |
29 |
310 |
10547200 |
|
2500 |
|
62080131 |
pikmike |
E |
Oct. 7, 2019, 8:15 p.m. |
OK |
GNU C++14 |
TESTS |
29 |
404 |
8601600 |
|
2500 |
|
52065342 |
vjudge1 |
E |
March 31, 2019, 5 a.m. |
OK |
GNU C++14 |
TESTS |
29 |
436 |
7372800 |
|
2500 |
|
35222152 |
vjudge5 |
E |
Feb. 14, 2018, 3:10 a.m. |
OK |
GNU C++14 |
TESTS |
29 |
436 |
11468800 |
|
2500 |
|
46569464 |
dasinlsb |
E |
Dec. 4, 2018, 4:17 a.m. |
OK |
GNU C++14 |
TESTS |
29 |
466 |
6144000 |
|
2500 |
|
28643684 |
SssssssssssssbbbBBBB |
E |
July 17, 2017, 3:32 p.m. |
OK |
GNU C++14 |
TESTS |
29 |
468 |
11673600 |
|
2500 |
|
61386340 |
stefdasca |
E |
Sept. 27, 2019, 7:16 p.m. |
OK |
GNU C++14 |
TESTS |
29 |
496 |
7782400 |
|
2500 |
|
23642380 |
Ali.Pi |
E |
Jan. 8, 2017, 8:02 a.m. |
OK |
GNU C++14 |
TESTS |
29 |
498 |
7270400 |
|
2500 |
|
34573220 |
boook |
E |
Jan. 26, 2018, 11:07 a.m. |
OK |
GNU C++14 |
TESTS |
29 |
590 |
13824000 |
|
2500 |
|
22340654 |
McGinn |
E |
Nov. 20, 2016, 4:56 a.m. |
OK |
GNU C++14 |
TESTS |
29 |
686 |
127180800 |
|
2500 |
|
60712615 |
qiyue |
E |
Sept. 17, 2019, 9:06 a.m. |
OK |
GNU C++17 |
TESTS |
29 |
404 |
11366400 |
|
2500 |
|
51400931 |
ruo |
E |
March 17, 2019, 7:18 a.m. |
OK |
GNU C++17 |
TESTS |
29 |
436 |
68710400 |
|
2500 |
|
68760478 |
segmentfault |
E |
Jan. 14, 2020, 8:38 a.m. |
OK |
GNU C++17 |
TESTS |
29 |
498 |
13107200 |
|
2500 |
|
66272575 |
-is-this-fft- |
E |
Dec. 4, 2019, 12:48 p.m. |
OK |
GNU C++17 |
TESTS |
29 |
686 |
6656000 |
|
2500 |
|
2894110 |
watashi |
E |
Jan. 8, 2013, 7:26 p.m. |
OK |
Haskell |
TESTS |
29 |
2000 |
94617600 |
|
2500 |
|
2890633 |
uwi |
E |
Jan. 8, 2013, 4:52 p.m. |
OK |
Java 6 |
TESTS |
29 |
468 |
307200 |
|
2500 |
|
2907127 |
arya5691 |
E |
Jan. 12, 2013, 8:54 a.m. |
OK |
Java 6 |
TESTS |
29 |
1859 |
36044800 |
|
2500 |
|
3424488 |
niyaznigmatul |
E |
March 30, 2013, 8:27 p.m. |
OK |
Java 7 |
TESTS |
29 |
843 |
46592000 |
|
2500 |
|
2890746 |
qwerty787788 |
E |
Jan. 8, 2013, 4:54 p.m. |
OK |
Java 7 |
TESTS |
29 |
953 |
14643200 |
|
2500 |
|
5025972 |
pschuprikov |
E |
Nov. 8, 2013, 12:56 a.m. |
OK |
Java 7 |
TESTS |
29 |
1092 |
16384000 |
|
2500 |
|
2906200 |
yarrr |
E |
Jan. 11, 2013, 9:17 p.m. |
OK |
Java 7 |
TESTS |
29 |
1248 |
48435200 |
|
2500 |
|
6021399 |
jakabfia |
E |
March 15, 2014, 2:59 p.m. |
OK |
Java 7 |
TESTS |
29 |
1434 |
18329600 |
|
2500 |
|
15143240 |
HappyNewYearMike |
E |
Dec. 31, 2015, 11:07 p.m. |
OK |
Java 7 |
TESTS |
29 |
1526 |
17817600 |
|
2500 |
|
2892012 |
Leonidas2 |
E |
Jan. 8, 2013, 5:17 p.m. |
OK |
Java 7 |
TESTS |
29 |
1531 |
51404800 |
|
2500 |
|
41580941 |
Nesrin |
E |
Aug. 14, 2018, 8:02 a.m. |
OK |
Java 8 |
TESTS |
29 |
1216 |
15564800 |
|
2500 |
|
30967364 |
Omar_Morsi |
E |
Oct. 3, 2017, 12:40 p.m. |
OK |
Java 8 |
TESTS |
29 |
2120 |
41369600 |
|
2500 |
|
2929560 |
Eugene |
E |
Jan. 16, 2013, 11:59 a.m. |
OK |
Mono C# |
TESTS |
29 |
1453 |
35225600 |
|
2500 |
|
2983928 |
Gzs_iceberg |
E |
Jan. 22, 2013, 1:32 p.m. |
OK |
MS C++ |
TESTS |
29 |
250 |
10137600 |
|
2500 |
|
3038734 |
illuminator |
E |
Jan. 31, 2013, 12:05 a.m. |
OK |
MS C++ |
TESTS |
29 |
296 |
8908800 |
|
2500 |
|
2892126 |
Milanin |
E |
Jan. 8, 2013, 5:19 p.m. |
OK |
MS C++ |
TESTS |
29 |
375 |
7782400 |
|
2500 |
|
2909489 |
skytyba |
E |
Jan. 12, 2013, 8:48 p.m. |
OK |
MS C++ |
TESTS |
29 |
421 |
8908800 |
|
2500 |
|
2905131 |
NickAltair |
E |
Jan. 11, 2013, 1:43 p.m. |
OK |
MS C++ |
TESTS |
29 |
468 |
10035200 |
|
2500 |
|
2891311 |
KhaustovPavel |
E |
Jan. 8, 2013, 5:04 p.m. |
OK |
MS C++ |
TESTS |
29 |
468 |
10444800 |
|
2500 |
|
2890300 |
Olja |
E |
Jan. 8, 2013, 4:45 p.m. |
OK |
MS C++ |
TESTS |
29 |
500 |
10035200 |
|
2500 |
|
2984161 |
Elun |
E |
Jan. 22, 2013, 2:38 p.m. |
OK |
MS C++ |
TESTS |
29 |
500 |
21299200 |
|
2500 |
|
12960075 |
absi2011 |
E |
Sept. 11, 2015, 2:03 p.m. |
OK |
MS C++ |
TESTS |
29 |
560 |
8499200 |
|
2500 |
|
2910904 |
frussi |
E |
Jan. 13, 2013, 11:19 a.m. |
OK |
MS C++ |
TESTS |
29 |
562 |
10854400 |
|
2500 |
remove filters
Back to search problems