# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
452130 | kingfran1907 | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 3453 ms | 24116 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int fac[20];
inline int chos(int n, int k) {return fac[n] / (fac[k] * fac[n - k]);}
vector< int > get(int x) {
vector< int > out;
int cnt = 6;
for (int i = 1; i < 13 && cnt; i++) {
int tr = chos(12 - i, cnt - 1);
if (x >= tr) x-= tr;
else {
out.push_back(i);
cnt--;
}
}
return out;
}
int encode (int n, int x, int y) {
fac[0] = 1;
for (int i = 1; i < 13; i++) fac[i] = i * fac[i - 1];
vector< int > vx = get(x), vy = get(y);
for (int tren : vx) {
bool flag = true;
for (int ng : vy)
if (tren == ng) flag = false;
if (flag) return tren;
}
}
#include <bits/stdc++.h>
using namespace std;
int fac[20];
inline int chos(int n, int k) {return fac[n] / (fac[k] * fac[n - k]);}
vector< int > get(int x) {
vector< int > out;
int cnt = 6;
for (int i = 1; i < 13 && cnt; i++) {
int tr = chos(12 - i, cnt - 1);
if (x >= tr) x-= tr;
else {
out.push_back(i);
cnt--;
}
}
return out;
}
int decode (int n, int q, int h) {
fac[0] = 1;
for (int i = 1; i < 13; i++) fac[i] = i * fac[i - 1];
vector< int > v = get(q);
bool flag = false;
for (int tren : v)
if (h == tren) flag = true;
return flag;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |