(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #1080357

#TimeUsernameProblemLanguageResultExecution timeMemory
1080357UmairAhmadMirzaPacking Biscuits (IOI20_biscuits)C++17
9 / 100
1050 ms440 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int const K=20; int cnt[K]; int cp[K]; long long count_tastiness(long long x, vector<long long> a){ for(int i=0;i<K;i++) cnt[i]=0; for(int i=0;i<a.size();i++) cnt[i]=a[i]; int ans=0; for(int n=0;n<=100000;n++){ for(int i=0;i<K;i++) cp[i]=cnt[i]; ans++; for(int i=0;i<K-1;i++){ if((1<<i)&(n)){ if(cp[i]<x){ ans--; break; } cp[i]-=x; } cp[i+1]+=cp[i]/2; } } return ans; }

Compilation message (stderr)

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