(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 #1082792

#TimeUsernameProblemLanguageResultExecution timeMemory
1082792beaconmcPacking Biscuits (IOI20_biscuits)C++14
9 / 100
140 ms432 KiB
#include "biscuits.h" #include <bits/stdc++.h> typedef long long ll; #define FOR(i,x,y) for(ll i=x; i<y; i++) #define FORNEG(i,x,y) for(ll i=x; i>y; i--) using namespace std; long long count_tastiness(long long x, std::vector<long long> a) { vector<ll> temp = a; if (x>100005) return 1; ll ans = 0; FOR(req,0,100005/x + 2){ a = temp; bool flag = false; ll cnt = 0; FOR(k,0,x){ ll sus = 0; FORNEG(i,a.size()-1, -1){ ll mini = min((req-sus)/(1<<i), a[i]); a[i] -= mini; sus += mini * (1<<i); } if (sus != req){ flag = true; break; } } if (!flag)ans++; } return ans; }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:25:6: warning: unused variable 'cnt' [-Wunused-variable]
   25 |   ll cnt = 0;
      |      ^~~
#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...