# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1244667 | nvujica | 질문 (CEOI14_question_grader) | C++20 | 7090 ms | 10220 KiB |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000;
int ozn[maxn];
void pre(){
int cnt = 0;
for(int mask = 0; mask < (1 << 12); mask++){
if(__builtin_popcount(mask) == 6){
cnt++;
ozn[cnt] = mask;
}
}
}
int encode (int n, int x, int y) {
pre();
for(int i = 0; i < 12; i++){
if((ozn[x] & (1 << i)) && !(ozn[y] & (1 << i))) return (i + 1);
}
}
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000;
int ozn[maxn];
void pre(){
int cnt = 0;
for(int mask = 0; mask < (1 << 12); mask++){
if(__builtin_popcount(mask) == 6){
cnt++;
ozn[cnt] = mask;
}
}
}
int decode (int n, int q, int h) {
if(ozn[q] & (1 << (h - 1))) return 1;
else return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |