제출 #303839

#제출 시각아이디문제언어결과실행 시간메모리
303839cgiosy비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1 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(); for(int i=1; i<N; i++) A[i]=A[i-1]+(A[i]<<i); for(int i=0; i<N; i++) A[i]=min(A[i]/x, (1LL<<i+1)-1); for(int i=1; i<N; i++) A[i]=min(A[i], A[i-1]|(A[i]&1LL<<i)); ll mx=1; vector<ll> D(N, 1); for(int i=0; i<N; i++) { ll mx2=mx; for(int j=0; j<N; j++) if(A[j]&1LL<<i) mx2=max(mx2, D[j]+=mx); mx=mx2; } return mx; }

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

biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:9:49: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
    9 |  for(int i=0; i<N; i++) A[i]=min(A[i]/x, (1LL<<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...