# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
566797 | 2fat2code | 비스킷 담기 (IOI20_biscuits) | C++17 | 2 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>
#define fr first
#define sc second
#define all(s) s.begin(), s.end()
#define int long long
using namespace std;
int ans, k;
int count_tastiness(int x, vector<int> a) {
ans = 1LL;
k = (int)a.size();
for(int i=0;i<(int)a.size();i++){
if(a[i] >= 3){
if(i == a.size() - 1){
a.push_back(0);
}
a[i + 1] += ( (a[i] - 1LL) / 2LL);
if(a[i] % 2 == 1LL) a[i] = 1;
else a[i]= 2;
}
}
int j = 0;
while(j < (int)a.size()){
int curr = 0;
int pos = j;
while(j < (int)a.size() && a[j] != 0){
curr = (curr + a[j] * (1LL << (j - pos)));
++j;
}
curr++;
ans *= curr;
j++;
}
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... |