# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
41558 | farmersrice | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 1598 ms | 170688 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>
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")
//#pragma GCC target ("avx,tune=native")
//Use above if bruteforcing with lots of small operations. Or just use it anytime, there's no downside. AVX is better slightly
/*
TASK: hidden
LANG: C++11
*/
using namespace std;
typedef long long ll;
typedef pair<int, int> pair2;
typedef pair<int, pair<int, int> > pair3;
typedef pair<int, pair<int, pair<int, int> > > pair4;
#define MAXN 950
#define INF 1000000000000000000LL
#define mp make_pair
#define add push_back
#define remove pop
int subset[MAXN];
bool generated;
void generateSubsets() {
int gc = 1;
for (int i = 0; i < (1 << 12); i++) {
int counter = 0;
for (int j = 0; j < 12; j++) {
if ((i & (1 << j))) counter++;
}
if (counter == 6) {
subset[gc++] = i;
}
}
}
int encode(int n, int x, int y) {
if (!generated) {
generated = true;
generateSubsets();
}
for (int i = 0; i < 12; i++) {
if ((subset[x] & (1 << i)) && !(subset[y] & (1 << i))) return i + 1;
}
}
#include <bits/stdc++.h>
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")
//#pragma GCC target ("avx,tune=native")
//Use above if bruteforcing with lots of small operations. Or just use it anytime, there's no downside. AVX is better slightly
/*
TASK: hidden
LANG: C++11
*/
using namespace std;
typedef long long ll;
typedef pair<int, int> pair2;
typedef pair<int, pair<int, int> > pair3;
typedef pair<int, pair<int, pair<int, int> > > pair4;
#define MAXN 200013
#define INF 1000000000000000000LL
#define mp make_pair
#define add push_back
#define remove pop
int subset[MAXN];
bool generated;
void generateSubsets() {
int gc = 1;
for (int i = 0; i < (1 << 12); i++) {
int counter = 0;
for (int j = 0; j < 12; j++) {
if ((i & (1 << j))) counter++;
}
if (counter == 6) {
subset[gc++] = i;
}
}
}
int decode(int n, int q, int h) {
if (!generated) {
generated = true;
generateSubsets();
}
h--;
for (int i = 0; i < 12; i++) {
if (subset[q] & (1 << h)) {
return 1;
} else {
return 0;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |