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;
vector<bool> tmp;
void construct_instructions(int s, int n, int k, int q) {
if(s==0) {
tmp.clear();
for(int i=0; i<n*k; i++) {
tmp.push_back(true);
}
for(int i=n*k; i<2000; i++) {
tmp.push_back(false);
}
append_store(99, tmp); // 11111...1111
tmp.clear();
tmp.push_back(true);
for(int i=1; i<2000; i++) {
tmp.push_back(false);
}
append_store(98, tmp); // 000...0001
tmp.clear();
for(int i=0; i<k; i++) tmp.push_back(true);
for(int i=k; i<2000; i++) tmp.push_back(false);
append_store(97, tmp);
append_xor(0, 0, 99);
for(int i=k-1; i>=0; i--) {
tmp.clear();
for(int j=0; j<n*k; j++) {
if(j%k==i) tmp.push_back(true);
else tmp.push_back(false);
}
for(int j=n*k; j<2000; j++) tmp.push_back(false);
append_store(10, tmp);
append_and(10, 0, 10);
append_left(9, 10, k-i);
append_right(8, 10, i);
append_not(8, 8);
append_add(8, 8, 98);
append_add(8, 8, 9);
// 8 stores the mask, 7 used
append_add(7, 8, 99);
append_right(7, 7, n*k);
append_add(7, 7, 99);
append_xor(8, 7, 8);
append_and(0, 0, 8);
}
for(int i=0; i<7; i++) {
append_right(1, 0, k);
append_or(0, 0, 1);
}
append_and(0, 0, 97);
append_xor(0, 0, 97);
} else {
}
}
# | 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... |