Submission #750955

#TimeUsernameProblemLanguageResultExecution timeMemory
750955mohav48173Packing Biscuits (IOI20_biscuits)C++14
0 / 100
1067 ms340 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; long long count_tastiness(long long x, vector<long long> a) { while(a.size()<20)a.push_back(0); int ans=0; for(int i=0;i<=100000;i++) { vector<int>corr; int copyi=i; while(copyi>0) { corr.push_back(copyi&1); copyi>>=1; } vector<long long>copya=a; bool isgood=1; for(int j=0;j<copya.size();j++) { if(copya[j]==1 && a[j]<x){isgood=0;break;} if(copya[j]==1)a[j]-=x; a[j+1]+=a[j]/2; } ans+=isgood; } return ans; }

Compilation message (stderr)

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