이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
using bdata = vector<bool>;
static const int m = 100;
static const int b = 2000;
const int MAX_REG = m - 1;
const int XOR_REG = m - 2;
const int SUM_REG = m - 3;
const int EXT_REG = m - 4;
void init_min () {
append_store( MAX_REG, bdata(b, true) );
}
void min (int f, int s, int target) {
bdata one (b, false); one[0] = true;
append_store(SUM_REG, one);
append_xor( XOR_REG, s, MAX_REG );
append_add( SUM_REG, f, SUM_REG );
append_add( SUM_REG, XOR_REG, SUM_REG );
append_right( SUM_REG, SUM_REG, 10 );
append_and ( XOR_REG, SUM_REG, f );
append_not ( SUM_REG, SUM_REG );
append_and ( SUM_REG, SUM_REG, s );
append_add ( target, SUM_REG, XOR_REG );
}
void extract (int target, int sizes, int index) {
append_move(EXT_REG, 0);
int l = sizes * index;
append_right(EXT_REG, EXT_REG, l);
int del = b - sizes;
append_left (EXT_REG, EXT_REG, del);
append_right(EXT_REG, EXT_REG, del);
append_move (target, EXT_REG);
}
void construct_instructions(int s, int n, int k, int q) {
assert(s == 0);
init_min();
extract(1, k, 0);
for (int i = 1; i < n; i ++) {
extract(2, k, 1);
min(3, 2, 1);
append_move(1, 3);
}
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... |