제출 #304620

#제출 시각아이디문제언어결과실행 시간메모리
304620medmdg비스킷 담기 (IOI20_biscuits)C++14
0 / 100
2 ms384 KiB
#include <bits/stdc++.h> #include "biscuits.h" using namespace std; long long int count_tastiness(long long int x,vector<long long int> a){ vector<long long int> b; int k=62; bool an[k]; for(int i=0;i<a.size();i++) b.push_back(a[i]); for(int i=0;i<62;i++){ while(b.size()<=i){ b.push_back(0); } if(b[i]>=x){ an[i]=true; b[i]-=x; }else{ an[i]=false; } b[i+1]+=b[i]/2; b[i]=0; } unsigned long long int ans=0; for(int i=0;i<62;i++){ if(an[i]) ans+=1<<i; } ans++; return ans; }

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

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