#include <bits/stdc++.h>
#include "registers.h"
using namespace std;
using ll = long long;
ll n, m, q, k, x, y, a, b, c;
void construct_instructions(int s, int n, int k, int q) {
vector<bool> v(2000);
v[0] = 1;
append_store(99, v);
for (int i = 1; i < k; i++) {
v[i] = 1;
}
append_store(98, v);
append_and(1, 0, 98);
for (int j = 1; j < n; j++) {
append_right(2, 0, j * k);
append_and(2, 2, 98);
append_not(3, 2);
append_add(3, 3, 99);
append_add(3, 3, 1);
append_right(3, 3, 1999);
ll cnt = 1;
for (ll i = 1; cnt < k; i *= 2) {
append_left(97, 3, min(k - cnt, i));
append_or(3, 97, 3);
cnt += min(k - cnt, i);
}
// append_print(3);
append_not(4, 3);
append_and(3, 3, 1);
append_and(4, 4, 2);
append_move(1, 3);
append_add(1, 1, 4);
}
append_move(0, 1);
}
# |
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 |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
604 KB |
Output is correct |
3 |
Correct |
1 ms |
604 KB |
Output is correct |
4 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |