#include "registers.h"
using namespace std;
void construct_instructions(int s, int n, int k, int q) {
for(int i = 1; i <= k; i++) append_right(i, 0, i-1); // k
vector<bool> v(2000), v1(2000), v2(2000);
v1[0] = 1;
for(int i = 0; i < k*n; i++) {
if(i%k) v[i] = 1;
v2[i] = 1;
}
append_store(k+1, v); // 1
append_store(k+3, v1);
append_store(k+4, v2);
for(int i = k; i >= 1; i--) {
append_or(i, i, k+1);
append_add(k+2, i, k+3);
append_right(k+2, k+2, k*n); // adicionar na resposta
append_add(i, i, k+2);
append_or(k+1, k+1, i);
append_and(k+1, k+1, k+4);
if(i > 1) append_left(k+2, k+2, i-1);
if(i != k) append_add(0, 0, k+2);
else append_move(0, k+2);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
424 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
424 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |