제출 #987329

#제출 시각아이디문제언어결과실행 시간메모리
987329AdamGSPacking Biscuits (IOI20_biscuits)C++17
42 / 100
1067 ms37592 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; #define rep(a, b) for(int a = 0; a < (b); ++a) unordered_map<ll,ll>dp[65]; vector<ll>T; ll x; ll solve(ll a, ll b) { if(a==T.size()) return b/x+1; b+=T[a]; if(dp[a].find(b)!=dp[a].end()) return dp[a][b]; dp[a][b]=solve(a+1, b/2); if(b>=x) dp[a][b]+=solve(a+1, (b-x)/2); return dp[a][b]; } ll count_tastiness(ll _x, vector<ll>_T) { T=_T; x=_x; rep(i, T.size()) dp[i].clear(); return solve(0, 0); }

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

biscuits.cpp: In function 'll solve(ll, ll)':
biscuits.cpp:10:7: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |   if(a==T.size()) return b/x+1;
      |      ~^~~~~~~~~~
biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:5:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 | #define rep(a, b) for(int a = 0; a < (b); ++a)
      |                                    ^
biscuits.cpp:19:3: note: in expansion of macro 'rep'
   19 |   rep(i, T.size()) dp[i].clear();
      |   ^~~
#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...