제출 #656542

#제출 시각아이디문제언어결과실행 시간메모리
656542definitelynotmee질문 (CEOI14_question_grader)C++98
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define mp make_pair #define mt make_tuple #define all(x) x.begin(), x.end() #define ff first #define ss second using namespace std; template <typename T> using matrix = vector<vector<T>>; typedef unsigned int uint; typedef unsigned long long ull; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const ll INFL = (1LL<<62)-1; const int INF = (1<<30)-1; const double EPS = 1e-7; const int MOD = 1e9 + 7; const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count(); const int MAXN = 1e6+1; int encode (int n, int x, int y) { vector<int> v(n+1); int id = 1; for(uint i = 0; id <= n; i++){ if(popcount(i) == 6){ v[id] = i; id++; } } for(int i = 0; i < 12; i++){ if(bool(x&(1<<i)) && !bool(y&(1<<i))) return i+1; } }
#include<bits/stdc++.h> #define mp make_pair #define mt make_tuple #define all(x) x.begin(), x.end() #define ff first #define ss second using namespace std; template <typename T> using matrix = vector<vector<T>>; typedef unsigned int uint; typedef unsigned long long ull; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const ll INFL = (1LL<<62)-1; const int INF = (1<<30)-1; const double EPS = 1e-7; const int MOD = 1e9 + 7; const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count(); const int MAXN = 1e6+1; int encode (int n, int x, int y) { vector<int> v(n+1); int id = 1; for(uint i = 0; id <= n; i++){ if(__builtin_popcount(i) == 6){ v[id] = i; id++; } } for(int i = 0; i < 12; i++){ if(bool(x&(1<<i)) && !bool(y&(1<<i))) return i+1; } }

컴파일 시 표준 에러 (stderr) 메시지

encoder.cpp: In function 'int encode(int, int, int)':
encoder.cpp:26:12: error: 'popcount' was not declared in this scope
   26 |         if(popcount(i) == 6){
      |            ^~~~~~~~
encoder.cpp:23:22: warning: control reaches end of non-void function [-Wreturn-type]
   23 |     vector<int> v(n+1);
      |                      ^

decoder.cpp: In function 'int encode(int, int, int)':
decoder.cpp:23:22: warning: control reaches end of non-void function [-Wreturn-type]
   23 |     vector<int> v(n+1);
      |                      ^
/usr/bin/ld: /tmp/ccivLyDM.o: in function `main':
grader_decode.c:(.text.startup+0x22f): undefined reference to `decode(int, int, int)'
collect2: error: ld returned 1 exit status