Submission #1261272

#TimeUsernameProblemLanguageResultExecution timeMemory
1261272Szymon_PilipczukQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++20
100 / 100
4342 ms39788 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; int gen(int c) { int d = 0; 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++) { if(c == d) { return ((1<<i) + (1<<j) + (1<<q) + (1<<r) + (1<<t) + (1<<s)); } d++; } } } } } } } int encode(int n,int a,int b) { a = gen(a); b = gen(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; int gen(int c) { int d = 0; 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++) { if(c == d) { return ((1<<i) + (1<<j) + (1<<q) + (1<<r) + (1<<t) + (1<<s)); } d++; } } } } } } } int decode(int n,int a,int b) { a = gen(a); b--; if((1<<b) & a) { return 1; } else { return 0; } }

Compilation message (stderr)

# 1번째 컴파일 단계

encoder.cpp: In function 'int gen(int)':
encoder.cpp:38:1: warning: control reaches end of non-void function [-Wreturn-type]
   38 | }
      | ^
encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:50:1: warning: control reaches end of non-void function [-Wreturn-type]
   50 | }
      | ^

# 2번째 컴파일 단계

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