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;
const int b=2000;
int k;
void minimize(int d){
append_right(1,0,d);
append_and(0,0,98);
append_and(1,1,98);
append_not(2,1);
append_add(2,0,2);
append_right(2,2,k);
append_not(3,2);
append_and(4,2,1);
append_and(5,3,0);
append_and(2,2,0);
append_and(3,3,1);
append_or(0,2,3);
append_or(1,4,5);
}
void construct_instructions(int s, int n, int k, int q){
::k=k;
vector <bool> ve(b,0);
for (int i=n*k;i<b;i++)
ve[i]=1;
append_store(99,ve);
append_or(0,0,99);
for (int i=0;i<b;i++)
ve[i]=(i%(k*2)<k);
append_store(98,ve);
if (!s){
int d=k;
while (n>1){
minimize(d);
n=(n+1)/2;
d*=2;
}
return;
}
for (int i=0;i<n;i++){
if (i&1){
append_left(6,0,b-k);
append_right(6,6,b-k);
append_right(0,0,k);
append_or(0,0,99);
}
minimize(k);
append_left(1,1,k);
append_or(0,0,1);
if (i&1){
append_left(0,0,k);
append_or(0,0,6);
}
}
}
# | 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... |