# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1261269 | Szymon_Pilipczuk | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++20 | 449 ms | 327680 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(),a.end()
#define rep(a,b) for(int a = 0;a<b;a++)
const int inf = 1e9;
const ll infl = 1e18;
vector<int> val;
void gen()
{
rep(i,12)
{
for(int j = i + 1;j<12;j++)
{
for(int q = j + 1;q<12;q++)
{
for(int r = q + 1;r < 12;r++)
{
for(int s = r + 1;s<12;s++)
{
for(int t = s + 1;t<12;t++)
{
val.pb((1<<i) + (1<<j) + (1<<q) + (1<<r) + (1<<t) + (1<<s));
}
}
}
}
}
}
}
int encode(int n,int a,int b)
{
gen();
a = val[a];
b = val[b];
rep(i,12)
{
if(((1<<i) & a) && !((1<<i) & b))
{
return i+1;
}
}
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(),a.end()
#define rep(a,b) for(int a = 0;a<b;a++)
const int inf = 1e9;
const ll infl = 1e18;
vector<int> val;
void gen()
{
rep(i,12)
{
for(int j = i + 1;j<12;j++)
{
for(int q = j + 1;q<12;q++)
{
for(int r = q + 1;r < 12;r++)
{
for(int s = r + 1;s<12;s++)
{
for(int t = s + 1;t<12;t++)
{
val.pb((1<<i) + (1<<j) + (1<<q) + (1<<r) + (1<<t) + (1<<s));
}
}
}
}
}
}
}
int decode(int n,int a,int b)
{
gen();
a = val[a];
b--;
if((1<<b) & a)
{
return 1;
}
else
{
return 0;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |