제출 #1069460

#제출 시각아이디문제언어결과실행 시간메모리
1069460HD1비스킷 담기 (IOI20_biscuits)C++14
0 / 100
1038 ms416 KiB
#include "biscuits.h" #include <iostream> using namespace std; long long count_tastiness(long long x, std::vector<long long> a) { int s = 0,k = a.size(); for(int i = 0; i < k; i++) s += a[i] * (1<<i); int ans = 1; for(int i = 1; i <= s/x; i++){ vector<long long> b = a; bool go = true; for(int j = 0; j < 20; j++){ if(i&(1<<j)){ for(int _ = 0; _ < x; _++){ int c = j, cant = 1; if(c >= k){ go= false; break; } while(b[c] < cant){ b[c] = 0; cant -= b[c]; cant *= 2; c--; } if(c==-1) { go = false; break; } b[c] -= cant; } } } if(go) { 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...