Submission #443060

#TimeUsernameProblemLanguageResultExecution timeMemory
443060ltf0501Bit Shift Registers (IOI21_registers)C++17
33 / 100
1 ms332 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; v[0] = 1; append_store(one_index, v); for(int i = 0; i < k; i++) v[i] = 1; append_store(and_index, v); append_right(min_index, 0, 0); append_and(min_index, and_index, min_index); // a[0] at r[min_index] for(int i = 1; i < n; i++) { // compare a[i] and r[min_index] append_right(1, 0, i * k); // a[i] at r[1] append_and(1, 1, and_index); append_xor(2, 1, min_index); 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); } append_right(0, min_index, 0); }
#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...