제출 #792968

#제출 시각아이디문제언어결과실행 시간메모리
792968enerelt14비교 (balkan11_cmp)C++14
100 / 100
1365 ms96032 KiB
#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) 메시지

cmp.cpp: In function 'int compare(int)':
cmp.cpp:125:1: warning: control reaches end of non-void function [-Wreturn-type]
  125 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...