제출 #1065997

#제출 시각아이디문제언어결과실행 시간메모리
1065997Ahmed57비스킷 담기 (IOI20_biscuits)C++17
9 / 100
1051 ms428 KiB
#include "bits/stdc++.h" using namespace std; #define int long long long long count_tastiness(long long x,vector<long long> a){ int k = a.size(); int ans = 0; for(int i = 0;i<a.size();i++){ ans/=2; ans+=a[i]; } while(ans>1){ ans/=2; a.push_back(0); } k = a.size(); long long all =0; for(int val = 0;val<=min((long long)1000000,(1ll<<k)-1);val++){ long long ans = 0;bool bad = 0; for(int i = 0;i<k;i++){ ans/=2; ans+=a[i]; if(val&(1ll<<i)){ if(ans<x){ bad = 1;break; } ans-=x; } } if(!bad)all++; } return all; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:7: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]
    7 |     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...