#include <bits/stdc++.h>
//#include "grader.cpp"
#include "registers.h"
using namespace std;
void construct_instructions(int s, int n, int k, int q) {
append_move(1, 0); /// get a
for (int i = 1; i < n; i++) {
append_move(2, 0); /// get b
append_print(1);
append_right(2, 2, k * i);
vector <bool> one = {};
one.clear();
for (int j = 0; j < k; j++) {
one.push_back(1);
}
while ((int)one.size() < 2000) {
one.push_back(0);
}
append_store(4, one);
// append_and(3, 3, 4);
append_and(1, 1, 4);
append_and(2, 2, 4);
append_move(3, 2);
one = {1};
while ((int)one.size() < 2000) {
one.push_back(0);
}
/// get -b
append_store(4, one);
append_not(3, 3);
append_add(3, 3, 4);
// append_print(3);
///get a-b
append_add(1, 1, 3);
append_move(3, 1);
/// get if a <= b then register have -1 else 0
append_right(3, 3, k);
append_and(1, 1, 3);
append_add(1, 1, 2);
}
append_move(0, 1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
4 ms |
852 KB |
Output is correct |
3 |
Correct |
4 ms |
724 KB |
Output is correct |
4 |
Correct |
4 ms |
852 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |