This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |