# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
471359 | lovrot | 질문 (CEOI14_question_grader) | C++11 | 4782 ms | 24248 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
bool breakb = false;
vector<int> out;
int m;
void shuffle(int x, int pos, int par){
//cout << x << ' ' << pos << ' ' << par << "\n";
if(breakb) return;
if(pos >= 12){
out.push_back(par);
if(out.size() > m)
breakb = true;
return;
}
if(x)
shuffle(x - 1, pos + 1, par ^ (1 << pos));
if(12 - pos > x)
shuffle(x, pos + 1, par);
}
int encode(int n, int x, int y){
ios_base::sync_with_stdio(false);
m = n;
shuffle(6, 0, 0);
for (int i = 0; i < 12; i++)
if ((out[x] & (1 << i)) && (!(out[y] & (1 << i))))
return i+1;
}
#include <bits/stdc++.h>
using namespace std;
bool breakb = false;
vector<int> out;
int m;
void shuffle(int x, int pos, int par){
//cout << x << ' ' << pos << ' ' << par << "\n";
if(breakb) return;
if(pos >= 12){
out.push_back(par);
if(out.size() > m)
breakb = true;
return;
}
if(x)
shuffle(x - 1, pos + 1, par ^ (1 << pos));
if(12 - pos > x)
shuffle(x, pos + 1, par);
}
int decode(int n, int q, int h){
ios_base::sync_with_stdio(false);
m = n;
shuffle(6, 0, 0);
if(out[q] & (1 << (h - 1))) return 1;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |