Submission #309899

#TimeUsernameProblemLanguageResultExecution timeMemory
309899CaroLindaPacking Biscuits (IOI20_biscuits)C++14
0 / 100
2 ms384 KiB
#include "biscuits.h" #include <bits/stdc++.h> #define lp(i,a,b) for(int i = a; i < b; i++) #define debug printf #define ff first #define ss second #define sz(x) (int)(x.size()) #define all(x) x.begin(),x.end() #define ll long long using namespace std ; long long count_tastiness(long long x, vector<long long> a ) { while( (int)(a.size()) < 60 ) { a.push_back(0LL) ; } ; ll prod = 1LL ; for(int i = 0 ; i < 60 ; i++ ) { //Garantindo que jah era zero quando cheguei if(a[i] == 0) continue ; int r = i , cnt = 0 ; ll soma = 1LL ; ll carry = 0 ; while( true ) { carry += a[r++] ; if(carry&1) soma += (1LL << cnt) ; carry >>= 1LL ; cnt++ ; if(carry == 0 ) break ; } prod *= soma ; i = r ; } return prod ; }
#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...