# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
792968 | enerelt14 | 비교 (balkan11_cmp) | C++14 | 1365 ms | 96032 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "cmp.h"
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>
using namespace std;
void remember(int a) {
int pre = 0;
for(int i = 5; i >= 0; i--) {
int x = (a >> (2 * i)) & 3;
pre *= 4;
pre += x + 1;
bit_set(pre);
}
}
int compare(int b) {
int pre = 0, pos[6];
for(int i = 5; i >= 0; i--) {
int x = (b >> (2 * i)) & 3;
pre *= 4;
pre += x + 1;
pos[5 - i] = pre;
}
if(bit_get(pos[2])) {
if(bit_get(pos[4])) {
if(bit_get(pos[5])) {
return 0;
}
else {
if(pos[5] % 4 == 0) return 1;
if(pos[5] % 4 == 1) return -1;
if(pos[5] % 4 == 2) {
if(bit_get(pos[5] - 1)) return 1;
else return -1;
}
if(pos[5] % 4 == 3) {
if(bit_get(pos[5] + 1)) return -1;
else return 1;
}
}
}
else {
if(bit_get(pos[3])) {
if(pos[4] % 4 == 0) return 1;
if(pos[4] % 4 == 1) return -1;
if(pos[4] % 4 == 2) {
if(bit_get(pos[4] - 1)) return 1;
else return -1;
}
if(pos[4] % 4 == 3) {
if(bit_get(pos[4] + 1)) return -1;
else return 1;
}
}
else {
if(pos[3] % 4 == 0) return 1;
if(pos[3] % 4 == 1) return -1;
if(pos[3] % 4 == 2) {
if(bit_get(pos[3] - 1)) return 1;
else return -1;
}
if(pos[3] % 4 == 3) {
if(bit_get(pos[3] + 1)) return -1;
else return 1;
}
}
}
}
else {
if(bit_get(pos[1])) {
if(pos[2] % 4 == 0) return 1;
if(pos[2] % 4 == 1) return -1;
if(pos[2] % 4 == 2) {
if(bit_get(pos[2] - 1)) return 1;
else return -1;
}
if(pos[2] % 4 == 3) {
if(bit_get(pos[2] + 1)) return -1;
else return 1;
}
}
else {
if(bit_get(pos[0])) {
if(pos[1] % 4 == 0) return 1;
if(pos[1] % 4 == 1) return -1;
if(pos[1] % 4 == 2) {
if(bit_get(pos[1] - 1)) return 1;
else return -1;
}
if(pos[1] % 4 == 3) {
if(bit_get(pos[1] + 1)) return -1;
else return 1;
}
}
else {
if(pos[0] % 4 == 0) return 1;
if(pos[0] % 4 == 1) return -1;
if(pos[0] % 4 == 2) {
if(bit_get(pos[0] - 1)) return 1;
else return -1;
}
if(pos[0] % 4 == 3) {
if(bit_get(pos[0] + 1)) return -1;
else return 1;
}
}
}
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |