Submission #443065

#TimeUsernameProblemLanguageResultExecution timeMemory
443065ltf0501Bit Shift Registers (IOI21_registers)C++17
0 / 100
1 ms460 KiB
#include "registers.h" #include <bits/stdc++.h> using namespace std; void construct_instructions(int s, int n, int k, int q) { vector<bool> v(2000); const int min_index = 99, and_index = 98, one_index = 97, max_index = 80; v[0] = 1; append_store(one_index, v); for(int i = 0; i < k; i++) v[i] = 1; append_store(and_index, v); append_move(50, 0); for(int j = 0; j < n; j++) { for(int i = 0; i < n - 1; i++) { append_right(min_index, 0, i * k); append_and(min_index, and_index, min_index); // a[i] at r[min_index] append_right(1, 0, (i + 1) * k); // a[i + 1] at r[1] append_and(1, 1, and_index); append_xor(2, 1, min_index); // a[i] ^ a[i + 1] at r[2] append_not(96, min_index); append_add(96, 96, 97); append_add(96, 96, 1); // y - x at r[96] append_right(96, 96, 1000); // y >= x: all 0, y < x: all 1 append_and(2, 2, 96); append_xor(min_index, 2, min_index); // min(a[i], a[i + 1]) at r[min_index] append_xor(max_index, min_index, 2); // max(a[i], a[i + 1]) at r[max_index] append_left(min_index, min_index, i * k); append_left(max_index, max_index, (i + 1) * k); append_or(0, 0, min_index); append_or(0, 0, max_index); } } }
#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...