#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define m_p make_pair
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
const int M = 100, B = 2000;
int s, n, k, q;
void comp(int x, int y, int z)
{
append_xor(M - 1, x, y);
append_and(M - 3, M - 1, y);
for (int i = 0; i < min(4, k - 1); ++i)
{
append_right(M - 2, M - 1, (1 << i));
append_or(M - 1, M - 1, M - 2);
}
append_not(M - 1, M - 1);
append_right(M - 1, M - 1, 1);
append_and(z, M - 3, M - 1);
for (int i = 0; i < min(4, k - 1); ++i)
{
append_right(M - 2, z, (1 << i));
append_or(z, z, M - 2);
}
for (int i = 0; i < min(4, k - 1); ++i)
{
append_left(M - 2, z, (1 << i));
append_or(z, z, M - 2);
}
}
void construct_instructions(int SS, int NN, int KK, int QQ) {
s = SS;
n = NN;
k = KK;
q = QQ;
vector<bool> v;
for (int i = 0; i < k; ++i)
v.push_back(1);
for (int i = 0; i < B - k; ++i)
v.push_back(0);
append_store(1, v);
append_and(2, 0, 1);
for (int i = 1; i < n; ++i)
{
append_right(3, 0, i * k);
append_and(3, 3, 1);
comp(2, 3, 4);
append_not(5, 4);
append_and(3, 3, 5);
append_and(2, 2, 4);
append_or(2, 2, 3);
}
append_move(0, 2);
}
/*
0 2 10 1000
2 1
-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 |
1 ms |
628 KB |
Output is correct |
3 |
Correct |
1 ms |
628 KB |
Output is correct |
4 |
Correct |
2 ms |
628 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 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 |
- |