| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 525173 | Deepesson | 질문 (CEOI14_question_grader) | C++17 | 4242 ms | 24104 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
int popcount(int x){
int res=0;
while(x){
res+=x&1;
x/=2;
}
return res;
}
int vals[1000];
int diferenca(int x,int y){
for(int i=0;i!=20;++i){
int a=x&(1<<i);
int b=y&(1<<i);
if(a&&!b)return i;
}
assert(0);
}
bool foi=false;
void iniciar(void)
{
if(foi)return;
foi=true;
int cur=1;
for(int i=0;i!=4096;++i){
int k = popcount(i);
if(k==6){
vals[cur]=i;
++cur;
}
}
}
int encode (int n, int x, int y) {
iniciar();
int a=vals[x],b=vals[y];
int place = diferenca(a,b);
return place+1;
}
#include <bits/stdc++.h>
int popcount(int x){
int res=0;
while(x){
res+=x&1;
x/=2;
}
return res;
}
int vals[1000];
int diferenca(int x,int y){
for(int i=0;i!=20;++i){
int a=x&(1<<i);
int b=y&(1<<i);
if(a&&!b)return i;
}
assert(0);
}
bool foi=false;
void iniciar(void)
{
if(foi)return;
foi=true;
int cur=1;
for(int i=0;i!=4096;++i){
int k = popcount(i);
if(k==6){
vals[cur]=i;
++cur;
}
}
}
int decode (int n, int q, int h) {
--h;
iniciar();
if(vals[q]&(1<<h)){
return 1;
}else return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
