#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
const int b = 2000;
const int m = 100;
//task, array size, num bits, query limit
void construct_instructions(int s, int n, int k, int q)
{//bit k+1
int clean_k = 52;
vector<bool> f(b, 0);
for(int i = 0; i < k; i++) f[i] = 1;
append_store(clean_k, f);
int A = 0;
//do nothing
int B = 1;
append_right(B, A, k);
append_and(A, A, clean_k);
append_print(A);
append_print(B);
int sum_AB = 2;
append_add(sum_AB, A, B);
append_print(sum_AB);
int one = 3;
vector<bool> one_vector(b, 0);
one_vector[0] = 1;
append_store(one, one_vector);
append_print(one);
int minus_B = 4;
append_not(minus_B, B);
append_add(minus_B, minus_B, one);
append_print(minus_B);
int diff_AB = 5;
append_add(diff_AB, A, minus_B);
append_print(diff_AB);
int full_0 = 6;
vector<bool> full_zero_vector(b, 0);
append_store(full_0, full_zero_vector);
append_print(full_0);
int lone_sign_diff_AB = 7;
append_right(lone_sign_diff_AB, diff_AB, k+1);
append_and(lone_sign_diff_AB, lone_sign_diff_AB, one);
append_print(lone_sign_diff_AB);
int full_1 = 8;
vector<bool> full_one_vector(b, 1);
append_store(full_1, full_one_vector);
append_print(full_1);
int not_full_sign_diff_AB = 9;
append_add(not_full_sign_diff_AB, full_1, lone_sign_diff_AB);
append_print(not_full_sign_diff_AB);
int full_sign_diff_AB = 10;
append_not(full_sign_diff_AB, not_full_sign_diff_AB);
append_print(full_sign_diff_AB);
int abs_diff_AB = 11;
append_xor(abs_diff_AB, full_sign_diff_AB, diff_AB);
append_print(abs_diff_AB);
int minus_abs_diff_AB = 12;
append_not(minus_abs_diff_AB, abs_diff_AB);
append_add(minus_abs_diff_AB, minus_abs_diff_AB, one);
append_print(minus_abs_diff_AB);
int twice_min = 13;
append_add(twice_min, minus_abs_diff_AB, sum_AB);
append_print(twice_min);
int twice_max = 14;
append_add(twice_max, abs_diff_AB, sum_AB);
append_print(twice_max);
int min_value = 15;
append_right(min_value, twice_min, 1);
int max_value = 16;
append_right(max_value, twice_max, 1);
append_left(max_value, max_value, k);
append_and(0, 0, full_0);
append_or(0, 0, min_value);
append_or(0, 0, max_value);
append_print(0);
append_print(0);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 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 |
Incorrect |
0 ms |
212 KB |
Incorrect min value |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Incorrect min value |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
308 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
308 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |