Submission #1034875

#TimeUsernameProblemLanguageResultExecution timeMemory
1034875Marco_EscandonPacking Biscuits (IOI20_biscuits)C++17
9 / 100
1094 ms604 KiB
#include<bits/stdc++.h> //#include "biscuits.h" using namespace std; typedef long long ll; vector<ll> temp; map<pair<ll,ll>,ll> mapa; ll sol(ll n) { if(n<=0) return 0; if(n==1) return 1; ll bs=0; for(ll i=0; i<63; i++) { if((1LL<<i)<n&&n<=(1LL<<(i+1))) { bs=sol(1LL<<i)+sol(min(n,1+temp[i])-(1LL<<i)); } } return bs; } long long count_tastiness(long long x, std::vector<long long> a) { a.resize(63); temp=a; ll ac=0; for(int i=0; i<a.size(); i++) { ac+=(a[i]<<i); temp[i]=ac/x; } return sol(2e18); }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:25:16: warning: comparison of integer expressions of different signedness: '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...