제출 #590559

#제출 시각아이디문제언어결과실행 시간메모리
590559ogibogi2004비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1230 ms2097152 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; #define ll long long unordered_map<ll,ll>dp; ll s[64]; ll xx; ll calc(ll n) { if(n==1)return s[0]>=xx; if(dp.count(n))return dp[n]; int t=0,pw2=1; while(pw2<n){pw2*=2ll;t++;} pw2/=2ll;t--; return dp[n]=calc(pw2)+calc(min(n,1+s[t]/xx)-pw2); } long long count_tastiness(long long x, vector<long long> a) { dp.clear(); s[0]=a[0];xx=x; for(int i=1;i<a.size();i++) { s[i]=s[i-1]+a[i]*(1ll<<i); } for(int i=0;i<=a.size();i++) { calc((1ll<<i)); } return dp[(1ll<<a.size())]; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:20:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for(int i=1;i<a.size();i++)
      |                 ~^~~~~~~~~
biscuits.cpp:24:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |     for(int i=0;i<=a.size();i++)
      |                 ~^~~~~~~~~~
#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...