제출 #306034

#제출 시각아이디문제언어결과실행 시간메모리
306034eriksuenderhauf비스킷 담기 (IOI20_biscuits)C++17
21 / 100
1093 ms15896 KiB
#pragma GCC optimize("O3") #include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define sz(x) (int)(x).size() unordered_map<ll,ll> dp[65]; void dfs(int d, ll p, ll& ret, ll x, vector<ll>& a) { if (d > 60 || (d >= sz(a) && p < x)) return; p = p / 2 + (d < sz(a) ? a[d] : 0); if (dp[d].count(p)) { ret += dp[d][p]; return; } ll t = ret; dfs(d + 1, p, ret, x, a); if (p >= x) { ret++; dfs(d + 1, p - x, ret, x, a); } dp[d][p] = ret - t; } ll count_tastiness(ll x, vector<ll> a) { int k = sz(a); for (int i = 0; i <= 60; i++) dp[i].clear(); ll ret = 1; dfs(0, 0, ret, x, a); return ret; }

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

biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:28:7: warning: unused variable 'k' [-Wunused-variable]
   28 |   int k = sz(a);
      |       ^
#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...