#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
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];
| ~~^~~~~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect min value |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Incorrect min value |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |