This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
const int M = 100, B = 2000;
void construct_instructions(int s, int n, int k, int q)
{
vector<bool> even(B, 0), odd(B, 0);
for (int i = 0; i < (n - 1) * k; i++)
if (i / k % 2 == 0)
even[i] = 1;
else
odd[i] = 1;
append_store(5, even);
append_store(6, odd);
auto bubble = [&](int mask)
{
append_print(0);
append_right(10, 0, k);
append_xor(15, 10, 0);
append_print(15);
append_and(15, 15, mask);
append_move(20, 15);
append_move(35, 99);
for (int i = 1; i < k; i++)
{
append_right(30, 20, i);
append_or(35, 30, 35);
}
append_not(30, 35);
append_and(20, 30, 20);
append_print(20);
append_and(20, 20, mask);
append_print(20);
append_and(40, 20, 0);
append_add(50, 40, mask);
append_right(50, 50, k);
append_and(50, 50, mask);
append_add(50, 50, mask);
append_not(50, 50);
append_and(50, 50, mask);
append_and(15, 50, 15);
append_left(60, 15, k);
append_or(15, 60, 15);
append_print(15);
append_xor(0, 0, 15);
};
for (int i = 0; i <= n; i++)
if (i % 2 == 0)
bubble(5);
else
bubble(6);
// 11010101010101
// 00100000101000
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |