#include <bits/stdc++.h>
#include "registers.h"
using namespace std;
#define rep(i, k, n) for (int i=k; i<n; i++)
void construct_instructions(int s, int n, int k, int q) {
if (s==0) {
vector<bool> tmp(2000, 0);
rep(i, 0, k) tmp[i] = 1;
append_store(50, tmp);
tmp.assign(2000, 0);
tmp[0] = 1;
append_store(25, tmp);
rep(i, 0, n) {
//x = a[i];
//y = register[50];
//1 = register[25];
append_left(1, 0, 2000-k);
append_right(1, 1, 2000-k);
append_not(2, 50);
append_add(3, 2, 25);
//x-y
append_add(4, 3, 1);
//(x-y)>>bits
append_right(5, 4, k);
append_and(6, 5, 4);
append_add(50, 50, 6);
append_right(0, 0, k);
}
append_move(0, 50);
}
}
# | 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... |