제출 #996342

#제출 시각아이디문제언어결과실행 시간메모리
996342Rifal비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1073 ms432 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; long long count_tastiness(long long x, std::vector<long long> a) { long long ans = 0; int siz = a.size(); for(long long i = 0; i <= 200000; i++) { long long cur[siz] = {}; for(int j = 0; j < siz; j++) cur[j] = a[j]; bool ok = true; for(long long j = 0; j < 60; j++) { if((i&(1ll<<j)) > 0) { if(j >= siz) { ok = false; break; } if(cur[j] >= x) { cur[j] -= x; } else { ok = false; break; } } if(!ok) break; if(j+1 < siz && cur[j] != 0) cur[j+1] += (cur[j]/2ll); } if(ok) { ans++; } } return ans; }
#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...