이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef long double ld;
#include "registers.h"
void construct_instructions(int s, int n, int k, int q) {
append_move(1 , 0);
vector < bool > empt(2000), one(2000);
for(int t=0;t<k;++t)
empt[t]=1;
one[0] = 1;
for(int i = 1; i < n; ++i){
append_move(2 , 0);
append_right(2 , 2 , k * i);
append_store(3 , empt);
append_and(1 , 1 , 3);
append_and(2 , 2 , 3);
/// a, b
append_move(3 , 2);
/// a, b , b
append_not(3 , 3);
append_store(4 , one);
append_print(3);
append_add(3 , 3 , 4);
append_add(3 , 3 , 1);
/// in 3 we have a-b
/// if (a - b) > 0 then by this op we will have zeros otherwise ones
append_move(1 , 3);
append_right(3 , 3 , k);
/// if there are zeros than a - b > 0 then b is the option
/// otherwise a is option and a - b < 0 a-b + b = a
append_and(1 , 1 , 3);
append_add(1 , 1 , 2);
}
append_store(2 , empt);
append_and(1 , 1 , 2);
append_move(0 , 1);
}
| # | 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... |