#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
void construct_instructions(int s, int n, int k, int q) {
//seperate
for(int i = 1; i<n; i++){
append_move(i,0);
append_right(i,i,i*k);
}
vector<bool> v(2000);
for(int i = 0; i<k; i++) v[i] = 1;
append_store(n,v);
for(int i = 0; i<n; i++) append_and(i,i,n);
for(int i = 1; i<k; i++) v[i] = 0;
append_store(99,v);
//find min
//result is in register n
for(int i = 0; i<n; i++){
append_not(n+1,n);
append_not(n+2,i);
append_add(n+1,n+1,99);
append_add(n+2,n+2,99);
append_add(n+3,i,n+1);
append_print(n+3);
append_add(n+4,n,n+2);
//n+3 := i-n
//n+4 := n-i
append_right(n+3,n+3,k);
append_right(n+4,n+4,k);
append_not(n+3,n+3);
append_not(n+4,n+4);
append_and(n+3,n,n+3);
append_and(n+4,i,n+4);
append_or(n,n+3,n+4);
append_print(n);
}
append_move(0,n);
return;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
440 KB |
Wrong answer detected in grader |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 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 |
- |