제출 #1066029

#제출 시각아이디문제언어결과실행 시간메모리
1066029Ahmed57비스킷 담기 (IOI20_biscuits)C++17
42 / 100
1060 ms20248 KiB
#include "bits/stdc++.h" using namespace std; #define int long long unordered_map<int, int> dp[61]; vector<int> A; int lim , X; int solve(int i,int ans){ if(i==lim){ return 1; } if(dp[i].find(ans)!=dp[i].end())return dp[i][ans]; int nans = ans+A[i]; int c1 = solve(i+1,nans/2); if(nans>=X){ c1 += solve(i+1,(nans-X)/2); } return dp[i][ans] = c1; } long long count_tastiness(long long x,vector<long long> a){ A.clear(); for(int i = 0;i<=60;i++)dp[i].clear(); for(int i = 0;i<a.size();i++)A.push_back(a[i]); int k = A.size(); int ans = 0; for(int i = 0;i<A.size();i++){ ans/=2; ans+=A[i]; } while(ans>=x){ ans/=2; A.push_back(0); } k = A.size(); lim = k; X = x; return solve(0,0); }

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

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