# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
320251 | tasfiq4 | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 7074 ms | 1048 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>
using namespace std;
typedef pair<int,int > pii;
typedef long long int lld;
#define pi acos(-1)
#define fr(i,m,n) for(i=m;i<n;i++)
#define fu(i,m,n) for(i=m;i>=n;i--)
#define vec vector<int>
#define pb push_back
#define pp pop_back()
#define ft first
#define sd second
#define all(v) v.begin(),v.end()
#define mom(ara) memset(ara,0,sizeof(ara));
#define m1m(ara) memset(ara,-1,sizeof(ara));
#define endl "\n"
#define eps 1.19209e-07
int encode (int n, int x, int y) {
vec code[1000];
int mask,i,j,cnt=1;
fr(mask,0,(1<<12))
{
vec h;
fr(i,0,12)
{
if(mask&(1<<i)) h.pb(i+1);
}
if(h.size()==6) code[cnt++]=h;
}
while(1){
fr(j,0,code[y].size())
{
if(code[x][0]==code[y][j])
{
code[x].erase(code[x].begin());
break;
}
}
if(j==code[y].size()) break;
}
return code[x][0];
}
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int > pii;
typedef long long int lld;
#define pi acos(-1)
#define fr(i,m,n) for(i=m;i<n;i++)
#define fu(i,m,n) for(i=m;i>=n;i--)
#define vec vector<int>
#define pb push_back
#define pp pop_back()
#define ft first
#define sd second
#define all(v) v.begin(),v.end()
#define mom(ara) memset(ara,0,sizeof(ara));
#define m1m(ara) memset(ara,-1,sizeof(ara));
#define endl "\n"
#define eps 1.19209e-07
int decode (int n, int q, int h) {
vec code[1000];
int mask,i,j,cnt=1;
fr(mask,0,(1<<12))
{
vec h;
fr(i,0,12)
{
if(mask&(1<<i)) h.pb(i+1);
}
if(h.size()==6) code[cnt++]=h;
}
fr(i,0,code[q].size())
{
if(code[q][i]==h) return 1;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |