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;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;
typedef vector<vvpii> vvvpii;
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
void construct_instructions(int s, int n, int k, int q)
{
vb mask;
// mask for number
mask.assign(2000, 0);
for (int i = 0; i < k; ++i)
mask[i] = 1;
append_store(99, mask);
// mask for 1
mask.assign(2000, 0);
mask[0] = 1;
append_store(98, mask);
// get first number in R1
append_and(1, 0, 99); // x (and later candidate minimum) in 1
append_right(0, 0, k); // remaining n-1 numbers in 0
for (int i = 1; i < n; ++i)
{
append_and(2, 0, 99); // y to compare with in 2
append_right(0, 0, k); // remaining n - i - 1 numbers in 0;
append_not(3, 1); // ~x
append_add(3, 3, 98); // -x
append_add(4, 2, 3); // y - x in 4
append_right(5, 4, k); // right shift of this in 5
append_and(4, 4, 5); // will it be used in 4
append_add(1, 1, 4); // result in 1
append_print(1);
}
append_move(0, 1);
}
# | 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... |