제출 #342640

#제출 시각아이디문제언어결과실행 시간메모리
342640monus1042말 (IOI15_horses)C++17
17 / 100
54 ms20176 KiB
#include "horses.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> ii; int n; vector<int> x, y; int dp[11][1001]; int f(int pos, int factor){ if (pos == n) return 0; int &answer = dp[pos][factor]; if (answer > -1) return answer; int horses = factor * x[pos]; for (int i=0; i<=horses; i++){ int delta = i * y[pos]; answer = max(answer, f(pos+1, horses - i) + delta); } return answer; } int init(int N, int X[], int Y[]) { n = N; for (int i=0; i<n; i++) x.push_back(X[i]), y.push_back(Y[i]); memset(dp, -1, sizeof dp); return f(0, 1); } int updateX(int pos, int val) { return 0; } int updateY(int pos, int val) { return 0; }

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

horses.cpp: In function 'int updateX(int, int)':
horses.cpp:31:17: warning: unused parameter 'pos' [-Wunused-parameter]
   31 | int updateX(int pos, int val) {
      |             ~~~~^~~
horses.cpp:31:26: warning: unused parameter 'val' [-Wunused-parameter]
   31 | int updateX(int pos, int val) {
      |                      ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:35:17: warning: unused parameter 'pos' [-Wunused-parameter]
   35 | int updateY(int pos, int val) {
      |             ~~~~^~~
horses.cpp:35:26: warning: unused parameter 'val' [-Wunused-parameter]
   35 | int updateY(int pos, int val) {
      |                      ~~~~^~~
#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...