# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
564822 | almothana05 | 질문 (CEOI14_question_grader) | C++14 | 3022 ms | 24180 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <stdlib.h>
#include<bits/stdc++.h>
using namespace std;
string bi(int x){
string cmp;
while(x){
if(x % 2 == 0){
cmp +='0';
}
else{
cmp += '1';
}
x /= 2;
}
while(cmp.size() < 10){
cmp += '0';
}
return cmp;
}
int encode (int n, int x, int y) {
int re1 = 0 , re2 = 0;
string s , t;
s = bi(x);
t = bi(y);
for(int i = 0 ; i < s.size() ; i++){
if(s[i] == '1' && t[i] == '0'){
return i + 1;
}
re1 += s[i] - '0';
re2 += t[i] - '0';
}
s = bi(re1);
t = bi(re2);
for(int i = 0 ; i < t.size() ; i++){
if(s[i] == '0' && t[i] == '1'){
return 10 + i + 1;
}
}
assert(5 == 6);
}
#include <stdio.h>
#include <stdlib.h>
#include<bits/stdc++.h>
using namespace std;
string bi(int x){
string cmp;
while(x){
if(x % 2 == 0){
cmp +='0';
}
else{
cmp += '1';
}
x /= 2;
}
while(cmp.size() < 10){
cmp += '0';
}
return cmp;
}
int decode (int n, int q, int h) {
int re = 0;
string s = bi(q);
if(h <= 10){
if(s[h - 1] == '1'){
return 1;
}
else{
return 0;
}
}
h -= 11;
for(int i = 0 ; i <s.size() ; i++){
if(s[i] == '1'){
re++;
}
}
s = bi(re);
if(s[h] == '0'){
return 1;
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |