이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define m_p make_pair
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
const int M = 100, B = 2000;
int s, n, k, q;
void comp(int x, int y, int z)
{
append_xor(M - 1, x, y);
for (int i = 0; i < min(5, k); ++i)
{
append_left(M - 2, M - 1, (1 << i));
append_or(M - 1, M - 1, M - 2);
}
append_not(M - 1, M - 1);
append_right(M - 2, M - 1, 1);
append_or(M - 1, M - 1, M - 2);
append_xor(M - 2, x, y);
append_and(M - 2, M - 2, y);
append_and(z, M - 2, y);
for (int i = 0; i < min(5, k); ++i)
{
append_right(M - 2, z, (1 << i));
append_or(z, z, M - 2);
}
for (int i = 0; i < min(5, k); ++i)
{
append_left(M - 2, z, (1 << i));
append_or(z, z, M - 2);
}
}
void construct_instructions(int SS, int NN, int KK, int QQ) {
s = SS;
n = NN;
k = KK;
q = QQ;
vector<bool> v;
for (int i = 0; i < k; ++i)
v.push_back(1);
for (int i = 0; i < B - k; ++i)
v.push_back(0);
append_store(1, v);
append_and(2, 0, 1);
append_print(2);
for (int i = 1; i < n; ++i)
{
append_right(3, 0, i * k);
append_print(3);
append_and(3, 3, 1);
append_print(3);
comp(2, 3, 4);
append_print(4);
append_not(5, 4);
append_print(5);
append_and(3, 3, 5);
append_and(2, 2, 4);
append_print(2);
append_print(3);
append_or(2, 2, 3);
append_and(2, 2, 1);
}
append_move(0, 2);
}
/*
0 2 1 1000
1 1
0 1
1 0
0 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... |