#include "light.h"
#include <bits/stdc++.h>
using namespace std;
const int LOG = 63;
int sz;
int cnt;
bool flag;
vector<long long> indices;
void prepare(){
cnt = 0;
sz = 1;
indices.push_back(1);
}
pair<long long, vector<long long>> join(long long p){
cnt++;
sz += p;
vector<long long> nindices;
for (int i = 1; i < sz; i += 5) {
nindices.push_back(i);
}
nindices.push_back(sz);
indices = nindices;
return {5 * p, indices};
}
pair<long long, vector<long long>> leave(long long p){// I just need to make sure after one leave I'm able to keep the rightmost lit
cnt++;
sz -= p;
vector<long long> nindices;
for (int i = 1; i < sz; i += 5) {
nindices.push_back(i);
}
nindices.push_back(sz);
indices = nindices;
return {5 * p, indices};
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Runtime error |
609 ms |
1048576 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
294 ms |
344 KB |
Output is correct |
3 |
Correct |
60 ms |
344 KB |
Output is correct |
4 |
Correct |
296 ms |
448 KB |
Output is correct |
5 |
Correct |
313 ms |
344 KB |
Output is correct |
6 |
Correct |
6 ms |
344 KB |
Output is correct |
7 |
Correct |
316 ms |
344 KB |
Output is correct |
8 |
Correct |
17 ms |
344 KB |
Output is correct |
9 |
Correct |
281 ms |
456 KB |
Output is correct |
10 |
Correct |
297 ms |
344 KB |
Output is correct |
11 |
Correct |
96 ms |
344 KB |
Output is correct |
12 |
Correct |
274 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
294 ms |
344 KB |
Output is correct |
3 |
Correct |
60 ms |
344 KB |
Output is correct |
4 |
Correct |
296 ms |
448 KB |
Output is correct |
5 |
Correct |
313 ms |
344 KB |
Output is correct |
6 |
Correct |
6 ms |
344 KB |
Output is correct |
7 |
Correct |
316 ms |
344 KB |
Output is correct |
8 |
Correct |
17 ms |
344 KB |
Output is correct |
9 |
Correct |
281 ms |
456 KB |
Output is correct |
10 |
Correct |
297 ms |
344 KB |
Output is correct |
11 |
Correct |
96 ms |
344 KB |
Output is correct |
12 |
Correct |
274 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
328 ms |
344 KB |
Output is correct |
15 |
Correct |
53 ms |
344 KB |
Output is correct |
16 |
Correct |
353 ms |
600 KB |
Output is correct |
17 |
Correct |
300 ms |
344 KB |
Output is correct |
18 |
Correct |
9 ms |
344 KB |
Output is correct |
19 |
Correct |
313 ms |
344 KB |
Output is correct |
20 |
Correct |
17 ms |
600 KB |
Output is correct |
21 |
Correct |
325 ms |
464 KB |
Output is correct |
22 |
Correct |
345 ms |
344 KB |
Output is correct |
23 |
Correct |
93 ms |
344 KB |
Output is correct |
24 |
Correct |
319 ms |
476 KB |
Output is correct |
25 |
Incorrect |
0 ms |
344 KB |
Not correct |
26 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
294 ms |
344 KB |
Output is correct |
3 |
Correct |
60 ms |
344 KB |
Output is correct |
4 |
Correct |
296 ms |
448 KB |
Output is correct |
5 |
Correct |
313 ms |
344 KB |
Output is correct |
6 |
Correct |
6 ms |
344 KB |
Output is correct |
7 |
Correct |
316 ms |
344 KB |
Output is correct |
8 |
Correct |
17 ms |
344 KB |
Output is correct |
9 |
Correct |
281 ms |
456 KB |
Output is correct |
10 |
Correct |
297 ms |
344 KB |
Output is correct |
11 |
Correct |
96 ms |
344 KB |
Output is correct |
12 |
Correct |
274 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
328 ms |
344 KB |
Output is correct |
15 |
Correct |
53 ms |
344 KB |
Output is correct |
16 |
Correct |
353 ms |
600 KB |
Output is correct |
17 |
Correct |
300 ms |
344 KB |
Output is correct |
18 |
Correct |
9 ms |
344 KB |
Output is correct |
19 |
Correct |
313 ms |
344 KB |
Output is correct |
20 |
Correct |
17 ms |
600 KB |
Output is correct |
21 |
Correct |
325 ms |
464 KB |
Output is correct |
22 |
Correct |
345 ms |
344 KB |
Output is correct |
23 |
Correct |
93 ms |
344 KB |
Output is correct |
24 |
Correct |
319 ms |
476 KB |
Output is correct |
25 |
Incorrect |
0 ms |
344 KB |
Not correct |
26 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
294 ms |
344 KB |
Output is correct |
3 |
Correct |
60 ms |
344 KB |
Output is correct |
4 |
Correct |
296 ms |
448 KB |
Output is correct |
5 |
Correct |
313 ms |
344 KB |
Output is correct |
6 |
Correct |
6 ms |
344 KB |
Output is correct |
7 |
Correct |
316 ms |
344 KB |
Output is correct |
8 |
Correct |
17 ms |
344 KB |
Output is correct |
9 |
Correct |
281 ms |
456 KB |
Output is correct |
10 |
Correct |
297 ms |
344 KB |
Output is correct |
11 |
Correct |
96 ms |
344 KB |
Output is correct |
12 |
Correct |
274 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
328 ms |
344 KB |
Output is correct |
15 |
Correct |
53 ms |
344 KB |
Output is correct |
16 |
Correct |
353 ms |
600 KB |
Output is correct |
17 |
Correct |
300 ms |
344 KB |
Output is correct |
18 |
Correct |
9 ms |
344 KB |
Output is correct |
19 |
Correct |
313 ms |
344 KB |
Output is correct |
20 |
Correct |
17 ms |
600 KB |
Output is correct |
21 |
Correct |
325 ms |
464 KB |
Output is correct |
22 |
Correct |
345 ms |
344 KB |
Output is correct |
23 |
Correct |
93 ms |
344 KB |
Output is correct |
24 |
Correct |
319 ms |
476 KB |
Output is correct |
25 |
Incorrect |
0 ms |
344 KB |
Not correct |
26 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
294 ms |
344 KB |
Output is correct |
3 |
Correct |
60 ms |
344 KB |
Output is correct |
4 |
Correct |
296 ms |
448 KB |
Output is correct |
5 |
Correct |
313 ms |
344 KB |
Output is correct |
6 |
Correct |
6 ms |
344 KB |
Output is correct |
7 |
Correct |
316 ms |
344 KB |
Output is correct |
8 |
Correct |
17 ms |
344 KB |
Output is correct |
9 |
Correct |
281 ms |
456 KB |
Output is correct |
10 |
Correct |
297 ms |
344 KB |
Output is correct |
11 |
Correct |
96 ms |
344 KB |
Output is correct |
12 |
Correct |
274 ms |
344 KB |
Output is correct |
13 |
Correct |
1 ms |
344 KB |
Output is correct |
14 |
Correct |
328 ms |
344 KB |
Output is correct |
15 |
Correct |
53 ms |
344 KB |
Output is correct |
16 |
Correct |
353 ms |
600 KB |
Output is correct |
17 |
Correct |
300 ms |
344 KB |
Output is correct |
18 |
Correct |
9 ms |
344 KB |
Output is correct |
19 |
Correct |
313 ms |
344 KB |
Output is correct |
20 |
Correct |
17 ms |
600 KB |
Output is correct |
21 |
Correct |
325 ms |
464 KB |
Output is correct |
22 |
Correct |
345 ms |
344 KB |
Output is correct |
23 |
Correct |
93 ms |
344 KB |
Output is correct |
24 |
Correct |
319 ms |
476 KB |
Output is correct |
25 |
Incorrect |
0 ms |
344 KB |
Not correct |
26 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Partially correct |
1 ms |
344 KB |
Partially correct |
2 |
Runtime error |
538 ms |
1048576 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |