제출 #303694

#제출 시각아이디문제언어결과실행 시간메모리
303694junseo비스킷 담기 (IOI20_biscuits)C++17
컴파일 에러
0 ms0 KiB
#include "biscuits.h" #include <bits/stdc++.h> #define fi first #define se second #define eb emplace_back #define all(v) (v).begin(), (v).end() #define rmin(r, x) r = min(r, x) #define rmax(r, x) r = max(r, x) #define ends ' ' #define endl '\n' #define fastio ios_base::sync_with_stdio(0), cin.tie(0) #pragma GCC optimize("O3") #pragma GCC target("avx,avx2") using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int maxk = 65; int k; ll s[maxk]; inline long long count_tastiness(long long x, std::vector<long long> a) { k = a.size(); a.resize(maxk); s[0] = a[0]; for(int i = 1; i <= 60; ++i) s[i] = s[i - 1] + (1LL << i) * a[i]; vector<ll> ans; ans.eb(0); for(register int i = 0; (1LL << i) <= s[60] && i <= 60; ++i) { int st = 0, ed = ans.size() - 1, r = -1; while(st <= ed) { int mid = st + ed >> 1; if(s[i] >= (__int128)(ans[mid] + (1LL << i)) * x) { r = mid; st = mid + 1; } else ed = mid - 1; } for(register int j = 0; j <= r; ++j) { ans.eb(ans[j] + (1LL << i)); } } assert(ans.size() <= 2e5); return ans.size(); }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:32:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   32 |  for(register int i = 0; (1LL << i) <= s[60] && i <= 60; ++i) {
      |                   ^
biscuits.cpp:35:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   35 |    int mid = st + ed >> 1;
      |              ~~~^~~~
biscuits.cpp:42:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   42 |   for(register int j = 0; j <= r; ++j) {
      |                    ^
/tmp/ccFJ0TXx.o: In function `main':
grader.cpp:(.text.startup+0x42a): undefined reference to `count_tastiness(long long, std::vector<long long, std::allocator<long long> >)'
collect2: error: ld returned 1 exit status