// In the name of Allah
#include <bits/stdc++.h>
#include "registers.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define endl '\n'
#define sep ' '
#define F first
#define S second
#define all(x) (x).begin(),(x).end()
#define len(x) ((ll) (x).size())
#define pb push_back
#define Mp make_pair
const int M = 100;
int n, k, q;
vector<bool> vc;
void solve(int n, int k) {
if (n <= 1) return ;
int j = (n / 2) * (2 * k);
append_right(1, 0, j);
vc.clear(); vc.resize(2000);
for (int i = 0; i < j; i++) vc[i] = 1;
append_store(2, vc); append_and(0, 0, 2);
n = (n + 1) / 2;
append_xor(2, 0, M - 3);
append_add(2, 2, M - 4);
append_add(3, 1, 2);
append_and(3, 3, M - 5);
append_right(3, 3, k);
append_left(4, 3, 2 * k);
append_not(3, 3);
append_store(5, vc); append_add(3, 3, M - 6);
append_add(3, 3, 4);
append_not(4, 3);
append_and(5, 0, 3);
append_and(6, 1, 4);
append_or(0, 5, 6);
solve(n, k);
}
void construct_instructions(int sx, int nx, int kx, int qx) {
n = nx; k = kx; q = qx;
vc.clear(); vc.resize(2000);
for (int i = 0; i < n * k; i++) {
if (i % (2 * k) < k) vc[i] = 1;
}
append_store(M - 1, vc);
vc.clear(); vc.resize(2000);
for (int i = 0; i < n * k; i++) {
if (i % (2 * k) >= k) vc[i] = 1;
}
append_store(M - 2, vc);
vc.clear(); vc.resize(2000);
for (int i = 0; i < 2000; i++) {
if (i % (2 * k) <= k) vc[i] = 1;
}
append_store(M - 3, vc);
vc.clear(); vc.resize(2000);
for (int i = 0; i < 2000; i++) {
if (i % (2 * k) == 0) vc[i] = 1;
}
append_store(M - 4, vc);
vc.clear(); vc.resize(2000);
for (int i = 0; i < 2000; i++) {
if (i % (2 * k) == k) vc[i] = 1;
}
append_store(M - 5, vc);
vc.clear(); vc.resize(2000); vc[0] = 1;
append_store(M - 6, vc);
vc.clear(); vc.resize(2000);
for (int i = 0; i < n * k; i++) vc[i] = 1;
append_store(M - 7, vc);
append_xor(0, 0, M - 7);
append_and(1, 0, M - 1); append_and(2, 0, M - 2);
int j = n * k;
if (n % 2 == 1) j += k;
append_left(2, 2, j - k);
append_or(0, 1, 2);
solve(n, k);
append_xor(0, 0, M - 7);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
344 KB |
Output is correct |
4 |
Correct |
1 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |