Submission #620597

#TimeUsernameProblemLanguageResultExecution timeMemory
6205978e7Packing Biscuits (IOI20_biscuits)C++17
9 / 100
1130 ms1040040 KiB
//Challenge: Accepted #include <bits/stdc++.h> using namespace std; #ifdef zisk void debug(){cout << endl;} template<class T, class ... U> void debug(T a, U ... b){cout << a << " ", debug(b...);} template<class T> void pary(T l, T r){ while (l != r) cout << *l << " ", l++; cout << endl; } #else #define debug(...) 0 #define pary(...) 0 #endif #define ll long long #define maxn 100005 #define pii pair<int, int> #define ff first #define ss second #include "biscuits.h" long long count_tastiness(long long x, std::vector<long long> a) { for (int i = 0;i < 60;i++) a.push_back(0); int k = a.size(); for (int i = 0;i < k-1;i++) { ll d = max(0LL, ((a[i] - x)/2)*2); a[i] -= d; a[i+1] += d/2; } pary(a.begin(), a.end()); vector<ll> v; v.push_back(0); for (int i = 0;i < k;i++) { if (i < k) { for (ll &j:v) j += a[i]; } int tmp = v.size(); for (int j = 0;j < tmp;j++) { if (v[j] >= x) v.push_back(v[j] - x); } for (ll &j:v) j /= 2; } return v.size(); }

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:13:19: warning: statement has no effect [-Wunused-value]
   13 | #define pary(...) 0
      |                   ^
biscuits.cpp:30:2: note: in expansion of macro 'pary'
   30 |  pary(a.begin(), a.end());
      |  ^~~~
#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...