Submission #134161

#TimeUsernameProblemLanguageResultExecution timeMemory
134161Runtime_error_말 (IOI15_horses)C++14
17 / 100
19 ms10616 KiB
#include "horses.h" #include <bits/stdc++.h> #define ll long long using namespace std; const ll inf = 1e3+9,mod = 1e9+7; ll dp[inf],x[inf],y[inf]; int init(int N, int X[], int Y[]) { for(int i=1;i<=N;i++) x[i] = X[i-1] , y[i] = Y[i-1]; ll cur = 1,ret = 0; for(int i=1;i<=N;i++){ cur = 1; for(int j=i;j>0;j--){ cur = (cur*x[j])%mod; dp[i] = max(dp[i], (mod+dp[j-1]-y[j-1] + (cur*y[i])%mod)%mod ); } ret = max( ret ,dp[i] ); //cout<<dp[i]<<" "; } return (int)ret; } int updateX(int pos, int val) { return 0; } int updateY(int pos, int val) { return 0; }

Compilation message (stderr)

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