제출 #788736

#제출 시각아이디문제언어결과실행 시간메모리
788736thimote75레지스터 (IOI21_registers)C++17
0 / 100
1 ms340 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...