# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
488567 | AmirElarbi | Packing Biscuits (IOI20_biscuits) | C++14 | 2 ms | 332 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 <bits/stdc++.h>
#include "biscuits.h"
#define vi vector<int>
#define ve vector
#define ll long long
#define vf vector<float>
#define vll vector<pair<ll,ll>>
#define ii pair<int,int>
#define vvi vector<vi>
#define vii vector<ii>
#define gii greater<ii>
#define pb push_back
#define fi first
#define se second
#define INF 1e8
#define eps 1e-7
#define eps1 1e-25
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX_A 1e5+5
#define V 450
using namespace std;
const int MOD = 1e9+7;
const int nax = 100005;
int s[64];
ll count_tastiness(ll x, ve<ll> a){
for (int i = 0; i < a.size(); ++i)
{
s[i] = a[i];
}
for (int i = 0; i < 64; ++i)
{
if(s[i] >= 3){
if(s[i]%2 == 1){
s[i+1] += s[i]/2;
s[i] = 1;
} else {
s[i+1] += (s[i]-1)/2;
s[i] = 2;
}
}
}
int res = 1, cur = 0;
for (int i = 0; i < 64; ++i)
{
if(a[i] == 0 && cur!=0){
res *= cur;
cur = 0;
}
else {
cur += a[i]*pow(2,i);
}
}
return res;
}
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... |