#include "registers.h"
#include <bits/stdc++.h>
#define LEN 2000
#define INPUT 0
#define MASK 1
#define TOO_BIG 2
#define REMOVE_MASK 3
#define ONE 4
#define NOT_REMOVE 5
#define TOO_BIG_MASK 7
#define FINAL_SHIFT 8
using namespace std;
void construct_instructions(int s, int n, int k, int q) {
if (s == 0) {
append_print(INPUT);
for (int bit = 0; bit < k; bit++)
{
vector<bool> mask(LEN);
for (int i = 0; i < n; i++)
{
mask[i * k] = true;
}
append_store(MASK, mask);
append_left(MASK, MASK, bit);
append_and(TOO_BIG, INPUT, MASK);
for (int i = 0; i < k; i++)
{
append_or(REMOVE_MASK, TOO_BIG, REMOVE_MASK);
append_left(TOO_BIG, TOO_BIG, MASK);
}
vector<bool> one(2000);
one[0] = true;
append_store(ONE, one);
append_add(NOT_REMOVE, REMOVE_MASK, ONE);
vector<bool> too_big(2000);
too_big[n * k] = true;
append_store(TOO_BIG, too_big);
append_and(TOO_BIG, TOO_BIG, NOT_REMOVE);
append_move(TOO_BIG_MASK, TOO_BIG);
for (int i = 1; i <= n * k; i <<= 1)
{
append_left(TOO_BIG, TOO_BIG, i);
append_or(TOO_BIG_MASK, TOO_BIG_MASK, TOO_BIG);
append_move(TOO_BIG_MASK, TOO_BIG);
}
append_not(TOO_BIG_MASK, TOO_BIG_MASK);
append_and(REMOVE_MASK, REMOVE_MASK, TOO_BIG_MASK);
append_or(INPUT, INPUT, REMOVE_MASK);
append_print(INPUT);
}
append_not(INPUT, INPUT);
append_move(FINAL_SHIFT, INPUT);
append_print(INPUT);
for (int i = 1; i < n; i++)
{
append_right(FINAL_SHIFT, FINAL_SHIFT, k);
append_or(INPUT, INPUT, FINAL_SHIFT);
append_print(INPUT);
}
append_not(INPUT, INPUT);
}
if (s == 1) {
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Incorrect min value |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
Incorrect min value |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |