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 M = 100, B = 2000;
// 99 - zero
// 98 - one
// 97 - 2^k - 1
// 1 - a[0]
// 2 - a[1]
// 3 - !a[1]
// 4 - -a[1] or !a[1] + 1
// 5 - a[0] - a[1]
// 6 - coef[0] base
// 7 - coef[0]
// 8 - coef[1] base
// 9 - coef[1]
// 10 - coef[0] & a[0]
// 11 - coef[1] & a[1]
void construct_instructions(int s, int n, int k, int q) {
/// init
vector<bool> stv(B);
stv[0] = 1;
append_store(98, stv); // <------ 1
for(int i = 1; i < k; i++) stv[i] = 1;
append_store(97, stv); // <------ 2
///
append_and(1, 97, 0); // <------ 3
append_right(2, 0, k); // <------ 4
/// subtraction
append_not(3, 2); // <------ 5
append_add(4, 3, 98); // <------ 6
append_add(5, 1, 4); // <------ 7
///
append_right(6, 5, B - 1); // <------ 7
append_xor(8, 6, 98); // <------ 8
append_left(7, 6, 1); // <------ 9
append_add(7, 7, 6); // <------ 10
append_left(9, 8, 1); // <------ 11
append_add(9, 9, 8); // <------ 12
append_and(10, 1, 7); // <------ 13
append_and(11, 2, 9); // <------ 14
append_add(0, 10, 11); // <------ 15
}
# | 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... |