Submission #794006

#TimeUsernameProblemLanguageResultExecution timeMemory
794006finn__레지스터 (IOI21_registers)C++17
21 / 100
1 ms304 KiB
#include "registers.h" #include <bits/stdc++.h> using namespace std; void construct_instructions(int s, int n, int k, int q) { // Store a in r0 and b in r1 vector<bool> bits(2000); for (size_t i = 0; i < k; ++i) bits[i] = 1; append_store(11, bits); append_move(1, 0); append_and(1, 1, 11); append_right(0, 0, k); if (k == 1) { append_and(0, 0, 1); } else { append_or(2, 0, 1); // r2 = a or b append_xor(3, 0, 1); // r3 = a xor b append_and(2, 2, 3); // r2 = (a or b) and (a xor b) append_right(3, 2, 1); // r3 = (a or b) and (a xor b) right shifted by 1 append_and(2, 2, 3); // r2 = first criterion to add 1 append_right(4, 0, 1); append_and(4, 4, 1); append_right(5, 1, 1); append_and(5, 5, 0); append_or(4, 4, 5); // r4 = second criterion to add 1 append_and(2, 2, 4); // r2 = the stuff to be added append_and(0, 1, 0); append_add(0, 0, 2); } }

Compilation message (stderr)

registers.cpp: In function 'void construct_instructions(int, int, int, int)':
registers.cpp:9:26: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    9 |     for (size_t i = 0; i < k; ++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...