# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
354403 | rqi | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 2 ms | 796 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vpi;
#define pb push_back
#define f first
#define s second
#define mp make_pair
#define ins insert
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
const int maxh = 12;
vector<vi> subs;
vi sub;
void genSub(int curnum = 1){
if(sz(sub) == maxh/2){
subs.pb(sub);
// for(auto u: sub){
// cout << u << " ";
// }
// cout << "\n";
return;
}
for(int i = curnum; i <= maxh; i++){
sub.pb(i);
genSub(i+1);
sub.pop_back();
}
}
int encode (int n, int x, int y) {
genSub();
x--;
y--;
vector<bool> insub1(maxh+1, 0);
vector<bool> insub2(maxh+1, 1);
for(int k = 0; k < sz(subs[x]); k++){
insub1[subs[x][k]] = 1;
insub2[subs[x][k]] = 0;
}
for(int h = 1; h <= maxh; h++){
if(insub1[h] && insub2[h]){
return h;
}
}
return -1;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vpi;
#define pb push_back
#define f first
#define s second
#define mp make_pair
#define ins insert
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
const int maxh = 12;
vector<vi> subs;
vi sub;
void genSub(int curnum = 1){
if(sz(sub) == maxh/2){
subs.pb(sub);
// for(auto u: sub){
// cout << u << " ";
// }
// cout << "\n";
return;
}
for(int i = curnum; i <= maxh; i++){
sub.pb(i);
genSub(i+1);
sub.pop_back();
}
}
int decode (int n, int q, int h) {
genSub();
q--;
for(int i = 0; i < sz(subs[q]); i++){
if(subs[q][i] == h) return 1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |