제출 #416548

#제출 시각아이디문제언어결과실행 시간메모리
416548LouayFarah휴가 (IOI14_holiday)C++14
0 / 100
18 ms8488 KiB
#include "bits/stdc++.h" #include "holiday.h" using namespace std; #define ll long long int vector<ll> dp; ll solve(ll i, int d, int n, int attraction[]) { if(d<=0) return 0; if(i==n) return 0; if(dp[d]!=-1) return dp[d]; return dp[d] = max(solve(i+1, d-1, n, attraction), solve(i+1, d-2, n, attraction) + attraction[i]); } long long int findMaxAttraction(int n, int start, int d, int attraction[]) { dp.assign(d+1, -1); ll res = solve(start, d, n, attraction); return dp[d]; }

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

holiday.cpp: In function 'long long int findMaxAttraction(int, int, int, int*)':
holiday.cpp:25:8: warning: unused variable 'res' [-Wunused-variable]
   25 |     ll res = solve(start, d, n, attraction);
      |        ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...