제출 #309896

#제출 시각아이디문제언어결과실행 시간메모리
309896CaroLinda비스킷 담기 (IOI20_biscuits)C++14
9 / 100
1130 ms1051368 KiB
#include "biscuits.h" #include <bits/stdc++.h> #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) ; } ; vector<ll> pos(1,0LL) ; ll curSoma = 0LL ; for(int i = 0 ; i < 30 && (LLONG_MAX/x) > (1LL<<i); i++ ) { curSoma += a[i] * (1LL<<i) ; int idx = upper_bound(all(pos), curSoma - x*(1LL<<i) ) - pos.begin() - 1 ; for(int j = 0 ; j <= idx ; j++ ) pos.push_back( pos[j] + x*(1LL<<i) ) ; } return (int)(pos.size() ) ; }
#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...