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;
vector<bool> tmp(B);
void get_to(int t, int x, int pos) {
    append_left(t, x, B - pos - 1);
    append_right(t, t, B - 1);
}
void construct_instructions(int s, int n, int k, int q) {
    tmp[0] = 1;
    append_store(99, tmp);
    if (k == 1) {
        append_right(1, 0, 1);
        append_and(0, 0, 1);
        return;
    }
    /// a*2 + b , c*2 + d
    get_to(1, 0, 1);
    get_to(2, 0, 0);
    //get_to(3, 0, 3);
    append_right(3, 0, 3);
    get_to(4, 0, 2);
    append_and(0, 1, 3);
    append_xor(10, 1, 3);   /// a^c  -> a!=c
    append_xor(11, 10, 99); /// a==c
    append_and(12, 2, 4);   /// b&d
    append_and(13, 11, 12); /// (a==c) & (b&d)
    append_and(14, 3, 2);   /// c&b -> (~a)&b
    append_and(15, 1, 4);   /// a&d -> (~c)&d
    append_or(16, 14, 15);
    append_and(16, 16, 10); /// (a!=c) & ((~a&b) | (~c&d))
    append_or(17, 13, 16);
    append_left(0, 0, 1);
    append_or(0, 0, 17);
}
| # | 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... |