제출 #332432

#제출 시각아이디문제언어결과실행 시간메모리
332432giorgikob비스킷 담기 (IOI20_biscuits)C++14
0 / 100
3 ms364 KiB
#include<bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back using namespace std; #include "biscuits.h" const int K = 61; long long count_tastiness(long long x, std::vector<long long> a) { vector<ll>dp(K,0); dp[0] = 1; ll sum = a[0]; for(ll i = 1; i < K; i++){ ll p = (1LL<<i); ll y = min(sum, (p-1)*x); //cout << sum << " " << y << endl; int k = i-1; while(y >= 0 && k >= 0){ dp[i] += dp[k]; y -= x*(1LL<<k); //cout << y << endl; if(y < x && y >= 0){ dp[i]++; break; } while((1LL<<k)*x > y) k--; } //cout << dp[i] << endl; if(i < a.size())sum += a[i]*p; } return dp[K-1]; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:33:14: 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]
   33 |         if(i < a.size())sum += a[i]*p;
      |            ~~^~~~~~~~~~
#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...