Submission #1261269

#TimeUsernameProblemLanguageResultExecution timeMemory
1261269Szymon_PilipczukQuestion (Grader is different from the original contest) (CEOI14_question_grader)C++20
0 / 100
449 ms327680 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)

# 1번째 컴파일 단계

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