제출 #602147

#제출 시각아이디문제언어결과실행 시간메모리
602147definitelynotmee비스킷 담기 (IOI20_biscuits)C++17
42 / 100
1092 ms43448 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define all(x) x.begin(), x.end() using ll = long long; using pii = pair<int,int>; using pll = pair<ll,ll>; template<typename T> using matrix = vector<vector<T>>; const int MAXN = 65; long long count_tastiness(long long x, std::vector<long long> a) { vector<ll> ct(MAXN); for(int i = 0; i < a.size(); i++) ct[i] = a[i]; vector<unordered_map<ll,ll>> state(MAXN); auto solve=[&](int id, ll extra, auto solve)->ll{ if(id == MAXN) return extra/x+1; if(state[id].count(extra)) return state[id][extra]; ll resp = solve(id+1,(ct[id]+extra)/2,solve); if(ct[id]+extra >=x) resp+=solve(id+1,(ct[id]+extra-x)/2,solve); state[id][extra] = resp; return resp; }; return solve(0,0,solve); }

컴파일 시 표준 에러 (stderr) 메시지

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:18:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |     for(int i = 0; i < a.size(); i++)
      |                    ~~^~~~~~~~~~
#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...