# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1221875 | vladilius | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++20 | 707 ms | 41164 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
int encode(int n, int x, int y){
if (x > y){
for (int i = 10; i >= 1; i--){
int j = i - 1;
bool x1 = (x >> j) & 1, y1 = (y >> j) & 1;
if (x1 != y1){
return i;
}
}
}
else {
for (int i = 10; i >= 1; i--){
int j = i - 1;
bool x1 = (x >> j) & 1, y1 = (y >> j) & 1;
if (x1 != y1){
return (i + 10);
}
}
}
return 0;
}
int decode(int n, int q, int h){
if (h <= 10){
if ((q >> (h - 1)) & 1){
return 1;
}
return 0;
}
else {
h -= 10;
if ((q >> (h - 1)) & 1){
return 0;
}
return 1;
}
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
int encode(int n, int x, int y){
if (x > y){
for (int i = 10; i >= 1; i--){
int j = i - 1;
bool x1 = (x >> j) & 1, y1 = (y >> j) & 1;
if (x1 != y1){
return i;
}
}
}
else {
for (int i = 10; i >= 1; i--){
int j = i - 1;
bool x1 = (x >> j) & 1, y1 = (y >> j) & 1;
if (x1 != y1){
return (i + 10);
}
}
}
return 0;
}
int decode(int n, int q, int h){
if (h <= 10){
if ((q >> (h - 1)) & 1){
return 1;
}
return 0;
}
else {
h -= 10;
if ((q >> (h - 1)) & 1){
return 0;
}
return 1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |