제출 #805263

#제출 시각아이디문제언어결과실행 시간메모리
805263SamAnd레지스터 (IOI21_registers)C++17
10 / 100
1 ms648 KiB
#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 - 1); ++i) { append_right(M - 2, M - 1, (1 << i)); append_or(M - 1, M - 1, M - 2); } append_not(M - 1, M - 1); append_right(M - 1, M - 1, 1); append_xor(M - 2, x, y); append_and(M - 2, M - 2, y); append_and(z, M - 2, M - 1); for (int i = 0; i < min(5, k - 1); ++i) { append_right(M - 2, z, (1 << i)); append_or(z, z, M - 2); } for (int i = 0; i < min(5, k - 1); ++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); for (int i = 1; i < n; ++i) { append_right(3, 0, i * k); append_and(3, 3, 1); comp(2, 3, 4); append_not(5, 4); append_and(3, 3, 5); append_and(2, 2, 4); append_or(2, 2, 3); } append_move(0, 2); } /* 0 2 2 1000 2 1 -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...