Submission #1024156

#TimeUsernameProblemLanguageResultExecution timeMemory
1024156mdn2002Bit Shift Registers (IOI21_registers)C++17
0 / 100
2 ms792 KiB
#include "registers.h" #include <bits/stdc++.h> using namespace std; int b = 2000; void construct_instructions(int s, int n, int k, int q) { vector<bool> v(k, 1), vv(b, 0); while (v.size() != 2000) v.push_back(0); append_store(2, v); append_store(99, v); for (int i = 1; i <= n; i ++) { append_and(1, 0, 99); // take the number append_left(0, 0, k); // delete the number // now we take the max between 1, 2 for (int j = k - 1; j >= 0; j --) { vv[j] = 1; append_store(98, vv); append_and(4, 1, 98); // take the j-th bit append_and(5, 2, 98); append_right(7, 7, j); append_right(8, 8, j); append_or(4, 4, 7); append_or(5, 5, 8); append_left(7, 7, j); append_left(8, 8, j); append_and(6, 4, 5); // min between the two bits append_or(3, 3, 6); // storing it in ans if (j == 0) break; append_left(4, 4, j); append_left(5, 5, j); append_xor(9, 4, 5); // dif bits append_and(10, 9, 4); // has the 1 bit append_and(11, 9, 5); append_or(7, 7, 10); append_or(8, 8, 11); } } append_move(0, 3); }
#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...