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

#TimeUsernameProblemLanguageResultExecution timeMemory
1082789beaconmcPacking Biscuits (IOI20_biscuits)C++14
0 / 100
1084 ms760 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) { ll ans = 0; FOR(i,0,30) a.push_back(0); FOR(i,0,a.size()-1){ while (a[i]>2) a[i+1] += 1, a[i] -= 2; } vector<ll> temp = a; if (x>100005) return 1; 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){ while (sus + (1<<i) <= req && a[i]){ sus += (1<<i), a[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:5:33: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define FOR(i,x,y) for(ll i=x; i<y; i++)
......
   14 |  FOR(i,0,a.size()-1){
      |      ~~~~~~~~~~~~~~              
biscuits.cpp:14:2: note: in expansion of macro 'FOR'
   14 |  FOR(i,0,a.size()-1){
      |  ^~~
biscuits.cpp:29:6: warning: unused variable 'cnt' [-Wunused-variable]
   29 |   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...