제출 #303626

#제출 시각아이디문제언어결과실행 시간메모리
303626cgiosy비스킷 담기 (IOI20_biscuits)C++17
0 / 100
2 ms384 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; using ll=long long; ll count_tastiness(ll x, vector<ll> A) { const int N=A.size(); vector<ll> D(N); for(int i=1; i<N; i++) A[i]=A[i-1]+(A[i]<<i); D[0]=(A[0]>=x)+1; for(int i=1; i<N; i++) { D[i]=D[i-1]; ll v=min(A[i]/x, (ll(1)<<i+1)-1); if(!(v&ll(1)<<i)) continue; D[i]+=(v&1)+1; for(int j=1; j<i; j++) if(v&1<<j) D[i]+=D[j-1]; } return D[N-1]; }

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

biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:13:29: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   13 |   ll v=min(A[i]/x, (ll(1)<<i+1)-1);
      |                            ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...