Submission #560519

#TimeUsernameProblemLanguageResultExecution timeMemory
560519AlperenTPacking Biscuits (IOI20_biscuits)C++17
Compilation error
0 ms0 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; llong long count_tastiness(long long x, vector<long long> arr){ vector<pair<long long, long long>> prv, cur; while(!arr.empty() && arr.back() == 0) arr.pop_back(); cur.push_back({0, 1}); int k = 0; while(true){ bool flag = false; long long cnt = k < arr.size() ? arr[k] : 0; for(auto i : cur) if(i.first / 2 + cnt - x >= 0) flag = true; if(flag || k < arr.size()){ prv.clear(); sort(cur.begin(), cur.end()); for(auto p : cur){ if(prv.empty() || (prv.back().first != p.first / 2)) prv.push_back({p.first / 2, p.second}); else prv.back().second += p.second; } cur.clear(); for(auto i : prv){ cur.push_back({i.first + cnt, i.second}); if(i.first + cnt - x >= 0) cur.push_back({i.first + cnt - x, i.second}); } } else break; k++; } long long ans = 0; for(auto p : cur) ans += p.second; return ans; }

Compilation message (stderr)

biscuits.cpp:6:1: error: 'llong' does not name a type; did you mean 'ulong'?
    6 | llong long count_tastiness(long long x, vector<long long> arr){
      | ^~~~~
      | ulong