# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
113995 | dndhk | 질문 (CEOI14_question_grader) | C++14 | 1260 ms | 124544 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int num = 0;
int cnt = 0;
void chk(int x){
if(x==13){
if(cnt==6){
v.push_back(num);
}
return;
}
num = num * 2;
chk(x+1);
num++;
cnt++;
chk(x+1);
num/=2;
cnt--;
}
int encode (int n, int x, int y) {
if(v.empty()){
chk(1);
sort(v.begin(), v.end());
}
x = v[x-1], y = v[y-1];
int i = 1, two = 1;
while(1){
if((x&two)>0 && (y&two)==0){
return i;
}
i++;
two*=2;
}
}
#include <bits/stdc++.h>
using namespace std;
vector<int> v2;
int num2 = 0;
int cnt2 = 0;
void chk2(int x){
if(x==13){
if(cnt2==6){
v2.push_back(num2);
}
return;
}
num2 = num2 * 2;
chk2(x+1);
num2++;
cnt2++;
chk2(x+1);
num2/=2;
cnt2--;
}
int decode (int n, int q, int h) {
if(v2.empty()){
chk2(1);
sort(v2.begin(), v2.end());
}
int t = v2[q-1];
if((t & (1<<h-1))>0){
return 1;
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |