# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
374814 | 2021-03-08T08:59:35 Z | Jarif_Rahman | Packing Biscuits (IOI20_biscuits) | C++17 | 2 ms | 364 KB |
#include "biscuits.h" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; const int kk = 200; ll count_tastiness(ll x, vector<ll> a){ int k = a.size(); a.resize(kk, 0); ll ans = 0, ls = 1, cur = 0, cnt1 = 0, cnt2 = 0; for(int i = 0; i < kk; i++){ if(a[i] <= 1){ if(a[i] == 1) ans+=cur; ls*=max(1LL, cur); cur = 0; cnt1 = 0; cnt2 = 0; continue; } ll cc = cnt1; cc+=cnt2; cc = 1LL<<cc; ans+=cc*ls; cur+=cc; if(a[i]%2 == 0) cnt2++; else cnt1++; if(i != kk-1) a[i+1]+=a[i]/2; a[i]%=2; } ans++; return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |