# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
429763 | dreezy | Packing Biscuits (IOI20_biscuits) | C++17 | 0 ms | 0 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>
using namespace std;
/* subtask1 : brutazo*/
/*subtask 2 easy brutazo*/
/***
answer is you either chose a bit or you dont
but, when we have multiple of the same bits we get repetition
we need to count how many times that happens
if they were all differente then answer is
a.size() chose x
we need to count repetitions
2^2 + 2^2 + 2^4 == 8 + 16 = 24
2^3 + 2^3 + 2^3 = 8 + 8 + 8 = 16
*/
long long count_tastiness(long long x, vector<long long> a) {
ll ans = 0;
//vector that stores how many bits we can use to make this power of two
for(int pow : a)
ans+= pow!= 0;
return ans;
}