Submission #432155

#TimeUsernameProblemLanguageResultExecution timeMemory
432155OzyPacking Biscuits (IOI20_biscuits)C++17
0 / 100
1 ms332 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; #define lli long long int #define rep(i,a,b) for(int i = (a); i <= (b); i++) #define repa(i,a,b) for(int i = (a); i >= (b); i--) #define debug(a) cout << #a << " = " << a << endl #define debugsl(a) cout << #a << " = " << a << ", " #define MAX 70 lli n,res,cant,sec,bloque; lli pot[64]; void calcula() { pot[0] = 1; rep(i,1,63) pot[i] = pot[i-1]*2; } long long count_tastiness(long long x, std::vector<long long> a) { if (pot[0] == 0) calcula(); if (x > 1) return 0; n = a.size(); rep(i,n,63) a.push_back(0); n = 64; cant = 0; res = 1; sec = 1; bloque = 0; rep(i,0,n-1) { if (a[i] > 0) { sec += pot[bloque] * a[i]; bloque++; } else if (bloque > 0){ res *= sec; bloque = sec = 0; } } return res; }
#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...