# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
565518 | Rifal | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 3105 ms | 24276 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>
#include <fstream>
#define endl '\n'
#define mod 32768
#define INF 100000000000000
//#define ll long long
//#define cin fin
//#define cout fout
using namespace std;
//ofstream fout("convention.out");
//ifstream fin("convention.in");
bool sta = false;
int arr[930][13];
void bu()
{
int cnt = 1;
for(int i = 0; i < (1<<12); i++)
{
int cc = 0;
for(int j = 0; j < 12; j++)
{
if((i&(1<<j)) > 0)
{
arr[cnt][j+1] = 1;
cc++;
}
else
{
arr[cnt][j+1] = 0;
}
}
if(cc == 6)
{
cnt++;
}
}
}
int encode (int n, int x, int y) {
if(!sta)
bu();
sta = true;
for(int i = 1; i <= 12; i++)
{
if(arr[x][i] == 1 && arr[y][i] == 0)
{
return i;
}
}
}
#include <bits/stdc++.h>
#include <fstream>
#define endl '\n'
#define mod 32768
#define INF 100000000000000
//#define ll long long
//#define cin fin
//#define cout fout
using namespace std;
//ofstream fout("convention.out");
//ifstream fin("convention.in");
bool sta = false;
int arr[930][13];
void bu()
{
int cnt = 1;
for(int i = 0; i < (1<<12); i++)
{
int cc = 0;
for(int j = 0; j < 12; j++)
{
if((i&(1<<j)) > 0)
{
arr[cnt][j+1] = 1;
cc++;
}
else
{
arr[cnt][j+1] = 0;
}
}
if(cc == 6)
{
cnt++;
}
}
}
int decode (int n, int q, int h) {
if(!sta)
bu();
sta = true;
return arr[q][h];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |