이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
const int b = 2000;
void construct_instructions(int s, int n, int k, int q){
if (s == 0){
int rnds = log2(n), tlen = k * (1 << rnds);
vector<bool> fl(b, 0), kgrp(b, 0);
for (int i = n * k; i < tlen; i++) fl[i] = 1;
append_store(10, fl);
append_or(0, 0, 10);
for (int i = 0; i < tlen; i += k)
for (int j = 0; j < k; j++, i++)
kgrp[i] = 1;
append_store(11, kgrp);
for (int i = 0, len = k; i < rnds; i++, len <<= 1){
append_right(1, 0, len); // 0 has odd pos, 1 has even pos
append_and(0, 0, 11);
append_not(2, 1);
append_and(2, 2, 11); // 2 is negative 1, clean higher pos of 0 and 2
append_add(3, 0, 2);
append_right(3, 3, k);
append_and(3, 3, 11); // 0 if v0 < v1, 1 if v0 > v1
append_add(3, 3, 11); // 1...1 and 0...0
append_and(4, 0, 3);
append_not(3, 3);
append_and(5, 1, 3);
append_or(0, 4, 5); // (v0 & v3) | (v1 & !v3)
}
}
}
| # | 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... |