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 ll long long
using namespace std ;
//obviamente a mask nao pode ser maior que a mask que eu tenho agora
//senao a soma eh maior, absurdo
//entao, se a mask eh menor: existe um bit que eu tenho e a mask y nao tem
//mas se eu tenho um bit que ele nao tem, esse bit pode se transformar em todos os outros
//entao, basicamente, a resposta eh todo o resto
long long count_tastiness(long long x, vector<long long> a )
{
int k = (int)(a.size()) ;
vector<ll> online ;
ll carry = 0LL ;
for(int i = 0 ; i < k ; i++ , carry >>= 1LL )
{
carry += a[i] ;
if(carry&1) online.push_back(i) ;
}
//Nao pode sobrar de qualquer
ll ans = 0LL;
for(auto e : online ) ans += (1LL<<e) ;
return ans+1LL ;
}
# | 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... |