# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
336660 | Joshc | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++11 | 2165 ms | 24576 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 <vector>
#include <algorithm>
using namespace std;
vector<int> ans[921];
void init() {
if (ans[1].empty()) {
int cur = 0;
for (int i=1; i<=7; i++) {
for (int j=i+1; j<=8; j++) {
for (int k=j+1; k<=9; k++) {
for (int l=k+1; l<=10; l++) {
for (int m=l+1; m<=11; m++) {
for (int n=m+1; n<=12; n++) ans[++cur] = {i, j, k, l, m, n};
}
}
}
}
}
}
}
int encode(int n, int x, int y) {
init();
for (int i : ans[x]) {
if (find(ans[y].begin(), ans[y].end(), i) == ans[y].end()) return i;
}
}
#include <vector>
#include <algorithm>
using namespace std;
vector<int> ans[921];
void init() {
if (ans[1].empty()) {
int cur = 0;
for (int i=1; i<=7; i++) {
for (int j=i+1; j<=8; j++) {
for (int k=j+1; k<=9; k++) {
for (int l=k+1; l<=10; l++) {
for (int m=l+1; m<=11; m++) {
for (int n=m+1; n<=12; n++) ans[++cur] = {i, j, k, l, m, n};
}
}
}
}
}
}
}
int decode(int n, int q, int h) {
return find(ans[q].begin(), ans[q].end(), h) != ans[q].end();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |