Submission #443072

#TimeUsernameProblemLanguageResultExecution timeMemory
443072ltf0501Bit Shift Registers (IOI21_registers)C++17
34 / 100
2 ms648 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); for(int j = 0; j < n - 1; 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(3, 2, 96); append_xor(min_index, 3, 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] for(int o = 0; o < 2000; o++) v[o] = 1; for(int o = i * k; o < (i + 2) * k; o++) v[o] = 0; append_store(50, v); //append_print(0); //append_print(50); append_and(0, 0, 50); 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); //append_print(2); //append_print(min_index); //append_print(max_index); //append_print(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...