제출 #309876

#제출 시각아이디문제언어결과실행 시간메모리
309876CaroLindaPacking Biscuits (IOI20_biscuits)C++14
0 / 100
1 ms384 KiB
#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()) ;
	
	ll ans = 0LL ;

	for(int i = 0 ; i < k ; i++ )
		ans += a[i] * (1LL << (ll)i) ;

	return ans+1LL ;
}

#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...