#include<bits/stdc++.h>
#include "registers.h"
using namespace std;
constexpr int m = 100;
constexpr int b = 2000;
constexpr int B = 2000;
void construct_instructions(int s, int n, int k, int q) {
assert(s==0);
int used = 1;
int mask, ones;
vector<bool> maskv(B), onesv(B, 1);
for (int i = 0; i < n; i++)
maskv[k * (i+1) - 1] = 1;
append_store(mask = used++, maskv);
append_store(ones = used++, onesv);
int ans = used++;
int val = used++;
int has_zero = used++;
int tmp = used++;
int premask = used++;
int curans = used++;
for (int bit = k-1; bit >= 0; bit--) {
append_and(val, 0, mask);
append_xor(val, val, mask);
append_add(has_zero, ones, val);
append_right(curans, has_zero, b-1);
append_left(curans, curans, bit);
append_or(ans, curans, ans);
if (!bit) break;
append_right(has_zero, has_zero, b / 2 + 1);
append_left(tmp, has_zero, 1);
append_or(has_zero, has_zero, tmp);
append_and(premask, mask, has_zero);
append_or(mask, premask, val);
append_right(mask, mask, 1);
}
append_move(0, ans);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
300 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
468 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
468 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |