Submission #565518

#TimeUsernameProblemLanguageResultExecution timeMemory
565518RifalQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++14
100 / 100
3105 ms24276 KiB
#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)

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:49:1: warning: control reaches end of non-void function [-Wreturn-type]
   49 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...