#include "light.h"
#include <vector>
using namespace std;
int cnt;
vector<long long>v;
void prepare(){
cnt = 1;
v.push_back(1);
}
std::pair<long long, std::vector<long long>> join(long long p){
v.clear();
cnt+=p;
v.clear();
for(int i=1;i<=cnt;i++) {
if(i%5==1)
v.push_back(i);
}
if(v.back()!=cnt)
v.push_back(cnt);
return {5*p,v};
}
std::pair<long long, std::vector<long long>> leave(long long p){
cnt-=p;
while(v.back()>cnt)
v.pop_back();
if(v.back()!=cnt)
v.push_back(cnt);
return {5*p,v};
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Runtime error |
783 ms |
1048576 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
307 ms |
344 KB |
Output is correct |
3 |
Correct |
47 ms |
344 KB |
Output is correct |
4 |
Correct |
297 ms |
344 KB |
Output is correct |
5 |
Correct |
291 ms |
344 KB |
Output is correct |
6 |
Correct |
5 ms |
344 KB |
Output is correct |
7 |
Correct |
264 ms |
344 KB |
Output is correct |
8 |
Correct |
15 ms |
344 KB |
Output is correct |
9 |
Correct |
289 ms |
344 KB |
Output is correct |
10 |
Correct |
270 ms |
344 KB |
Output is correct |
11 |
Correct |
89 ms |
344 KB |
Output is correct |
12 |
Correct |
309 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
307 ms |
344 KB |
Output is correct |
3 |
Correct |
47 ms |
344 KB |
Output is correct |
4 |
Correct |
297 ms |
344 KB |
Output is correct |
5 |
Correct |
291 ms |
344 KB |
Output is correct |
6 |
Correct |
5 ms |
344 KB |
Output is correct |
7 |
Correct |
264 ms |
344 KB |
Output is correct |
8 |
Correct |
15 ms |
344 KB |
Output is correct |
9 |
Correct |
289 ms |
344 KB |
Output is correct |
10 |
Correct |
270 ms |
344 KB |
Output is correct |
11 |
Correct |
89 ms |
344 KB |
Output is correct |
12 |
Correct |
309 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
314 ms |
344 KB |
Output is correct |
15 |
Correct |
41 ms |
344 KB |
Output is correct |
16 |
Correct |
252 ms |
344 KB |
Output is correct |
17 |
Correct |
300 ms |
344 KB |
Output is correct |
18 |
Correct |
9 ms |
460 KB |
Output is correct |
19 |
Correct |
294 ms |
344 KB |
Output is correct |
20 |
Correct |
20 ms |
428 KB |
Output is correct |
21 |
Correct |
242 ms |
436 KB |
Output is correct |
22 |
Correct |
287 ms |
356 KB |
Output is correct |
23 |
Correct |
83 ms |
344 KB |
Output is correct |
24 |
Correct |
276 ms |
344 KB |
Output is correct |
25 |
Incorrect |
0 ms |
344 KB |
Not correct |
26 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
307 ms |
344 KB |
Output is correct |
3 |
Correct |
47 ms |
344 KB |
Output is correct |
4 |
Correct |
297 ms |
344 KB |
Output is correct |
5 |
Correct |
291 ms |
344 KB |
Output is correct |
6 |
Correct |
5 ms |
344 KB |
Output is correct |
7 |
Correct |
264 ms |
344 KB |
Output is correct |
8 |
Correct |
15 ms |
344 KB |
Output is correct |
9 |
Correct |
289 ms |
344 KB |
Output is correct |
10 |
Correct |
270 ms |
344 KB |
Output is correct |
11 |
Correct |
89 ms |
344 KB |
Output is correct |
12 |
Correct |
309 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
314 ms |
344 KB |
Output is correct |
15 |
Correct |
41 ms |
344 KB |
Output is correct |
16 |
Correct |
252 ms |
344 KB |
Output is correct |
17 |
Correct |
300 ms |
344 KB |
Output is correct |
18 |
Correct |
9 ms |
460 KB |
Output is correct |
19 |
Correct |
294 ms |
344 KB |
Output is correct |
20 |
Correct |
20 ms |
428 KB |
Output is correct |
21 |
Correct |
242 ms |
436 KB |
Output is correct |
22 |
Correct |
287 ms |
356 KB |
Output is correct |
23 |
Correct |
83 ms |
344 KB |
Output is correct |
24 |
Correct |
276 ms |
344 KB |
Output is correct |
25 |
Incorrect |
0 ms |
344 KB |
Not correct |
26 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
307 ms |
344 KB |
Output is correct |
3 |
Correct |
47 ms |
344 KB |
Output is correct |
4 |
Correct |
297 ms |
344 KB |
Output is correct |
5 |
Correct |
291 ms |
344 KB |
Output is correct |
6 |
Correct |
5 ms |
344 KB |
Output is correct |
7 |
Correct |
264 ms |
344 KB |
Output is correct |
8 |
Correct |
15 ms |
344 KB |
Output is correct |
9 |
Correct |
289 ms |
344 KB |
Output is correct |
10 |
Correct |
270 ms |
344 KB |
Output is correct |
11 |
Correct |
89 ms |
344 KB |
Output is correct |
12 |
Correct |
309 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
314 ms |
344 KB |
Output is correct |
15 |
Correct |
41 ms |
344 KB |
Output is correct |
16 |
Correct |
252 ms |
344 KB |
Output is correct |
17 |
Correct |
300 ms |
344 KB |
Output is correct |
18 |
Correct |
9 ms |
460 KB |
Output is correct |
19 |
Correct |
294 ms |
344 KB |
Output is correct |
20 |
Correct |
20 ms |
428 KB |
Output is correct |
21 |
Correct |
242 ms |
436 KB |
Output is correct |
22 |
Correct |
287 ms |
356 KB |
Output is correct |
23 |
Correct |
83 ms |
344 KB |
Output is correct |
24 |
Correct |
276 ms |
344 KB |
Output is correct |
25 |
Incorrect |
0 ms |
344 KB |
Not correct |
26 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
307 ms |
344 KB |
Output is correct |
3 |
Correct |
47 ms |
344 KB |
Output is correct |
4 |
Correct |
297 ms |
344 KB |
Output is correct |
5 |
Correct |
291 ms |
344 KB |
Output is correct |
6 |
Correct |
5 ms |
344 KB |
Output is correct |
7 |
Correct |
264 ms |
344 KB |
Output is correct |
8 |
Correct |
15 ms |
344 KB |
Output is correct |
9 |
Correct |
289 ms |
344 KB |
Output is correct |
10 |
Correct |
270 ms |
344 KB |
Output is correct |
11 |
Correct |
89 ms |
344 KB |
Output is correct |
12 |
Correct |
309 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Correct |
314 ms |
344 KB |
Output is correct |
15 |
Correct |
41 ms |
344 KB |
Output is correct |
16 |
Correct |
252 ms |
344 KB |
Output is correct |
17 |
Correct |
300 ms |
344 KB |
Output is correct |
18 |
Correct |
9 ms |
460 KB |
Output is correct |
19 |
Correct |
294 ms |
344 KB |
Output is correct |
20 |
Correct |
20 ms |
428 KB |
Output is correct |
21 |
Correct |
242 ms |
436 KB |
Output is correct |
22 |
Correct |
287 ms |
356 KB |
Output is correct |
23 |
Correct |
83 ms |
344 KB |
Output is correct |
24 |
Correct |
276 ms |
344 KB |
Output is correct |
25 |
Incorrect |
0 ms |
344 KB |
Not correct |
26 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
344 KB |
Partially correct |
2 |
Runtime error |
690 ms |
1048576 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |