Submission #1057589

#TimeUsernameProblemLanguageResultExecution timeMemory
1057589TrentBit Shift Registers (IOI21_registers)C++17
10 / 100
1 ms348 KiB
#include "registers.h" #include "bits/stdc++.h" using namespace std; void store_short(int t, vector<int> store) { vector<bool> ret(2000, false); for(int i = 0; i < store.size(); ++i) ret[i] = store[i]; append_store(t, ret); } void construct_instructions(int s, int n, int k, int q) { if(n == 2 && k == 1) { append_move(1, 0); append_right(1, 1, 1); append_and(0, 0, 1); } else if(n == 2 && k == 2) { append_move(1, 0); store_short(99, {1, 1}); append_and(0, 0, 99); append_right(1, 1, 2); append_not(2, 0); append_not(3, 1); append_and(4, 0, 3); append_and(5, 1, 2); append_right(6, 4, 1); append_right(7, 5, 1); append_xor(8, 6, 7); append_not(8, 8); append_and(9, 8, 0); append_and(10, 8, 1); append_left(11, 6, 1); append_or(11, 11, 6); append_left(12, 7, 1); append_or(12, 12, 7); append_left(13, 9, 1); append_or(13, 13, 9); append_left(14, 10, 1); append_or(14, 14, 10); append_and(11, 11, 1); append_and(12, 12, 0); append_and(13, 13, 1); append_and(14, 14, 0); for(int i = 0; i < 14; i++) { append_print(i); } append_move(0, 11); append_or(0, 0, 12); append_or(0, 0, 13); append_or(0, 0, 14); } }

Compilation message (stderr)

registers.cpp: In function 'void store_short(int, std::vector<int>)':
registers.cpp:7:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |  for(int i = 0; i < store.size(); ++i) ret[i] = store[i];
      |                 ~~^~~~~~~~~~~~~~
#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...