# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1260896 | M_W_13 | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++20 | 511 ms | 39652 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define st first
#define nd second
#define pb push_back
vector<int> vec;
int przerzut(int a) {
int c = 0;
while ((int)vec.size() < 922) {
while (__builtin_popcount(c) != 6) {
c++;
}
vec.pb(c);
c++;
}
return vec[a - 1];
}
int encode (int n, int x, int y) {
x = przerzut(x);
y = przerzut(y);
int a = 1;
int kt = 1;
while (true) {
if (((a & x) == a) && ((a & y) != a)) {
return kt;
}
a *= 2;
kt++;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define st first
#define nd second
#define pb push_back
vector<int> vec;
int przerzut(int a) {
int c = 0;
while ((int)vec.size() < 922) {
while (__builtin_popcount(c) != 6) {
c++;
}
vec.pb(c);
c++;
}
return vec[a - 1];
}
int decode (int n, int q, int h) {
q = przerzut(q);
int a = 1;
rep(i, h) {
a *= 2;
}
if ((a & q) == a) {
return 1;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |