#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void init0(int n, int k){
vector<bool> V(2000, 0);
for (int i=k*n;i<2000;i++) V[i] = 1;
append_store(71, V);
for (int z=1;z<=7;z++){
fill(V.begin(), V.end(), 0);
for (int i=0;i<128;i++) if (i%(1<<z)==0){
for (int j=i*k;j<(i+1)*k;j++) V[j] = 1;
}
append_store(90+z, V);
append_not(80+z, 90+z);
}
}
void copy_bit(int t, int k){
++k;
int len = 1;
while(len<k){
if (len*2 <= k) append_right(61, t, len);
else append_right(61, t, k-len);
append_or(t, t, 61);
len *= 2;
}
}
void solve0(int n, int k){
init0(n, k);
append_or(0, 0, 71);
for (int z=0;z<7;z++){
append_right(1, 0, k*(1<<z));
if (z==0){append_and(0, 0, 91); append_and(1, 1, 91);}
append_xor(2, 0, 1);
append_xor(1, 1, 90+z+1);
append_add(1, 0, 1);
append_and(1, 1, 80+z+1);
copy_bit(1, k);
append_and(1, 1, 2);
append_xor(0, 0, 1);
append_and(0, 0, 90+z+1);
}
}
void construct_instructions(int s, int n, int k, int q) {
if (s==0) solve0(n, k);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
300 KB |
Output is correct |
3 |
Correct |
1 ms |
300 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
340 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |