# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
728392 | beaconmc | Packing Biscuits (IOI20_biscuits) | C++14 | 3 ms | 340 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "biscuits.h"
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
typedef long long ll;
using namespace std;
//using namespace __gnu_pbds;
#define FOR(i, x, y) for(ll i=x; i<y; i++)
#define FORNEG(i, x, y) for(ll i=x; i>y; i--)
//#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)
long long count_tastiness(long long x, vector<long long> a) {
vector<ll> sus;
ll cur = 0;
FOR(i,0,100){
if (i < a.size()){
cur += a[i];
}
if (cur==0) continue;
if (cur%2==0){
sus.push_back(2);
cur-= 2;
cur /= 2;
}else{
sus.push_back(1);
cur -= 1;
cur /= 2;
}
}
reverse(sus.begin(), sus.end());
ll ans = 1;
for (auto&i : sus){
if (i==2){
ans *= 2;
ans++;
}else{
ans *= 2;
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |