Submission #307265

#TimeUsernameProblemLanguageResultExecution timeMemory
307265vipghn2003Horses (IOI15_horses)C++14
17 / 100
28 ms4472 KiB
#include<bits/stdc++.h> using namespace std; long long init(int N,int X[],int Y[]) { long long res; for(int i=0;i<N;i++) { long long cur=1; int id=-1; for(int j=i+1;j<N;j++) { cur*=X[j]; if(cur*Y[j]>=Y[i]) { id=j; break; } } if(id==-1) { res=Y[i]; for(int j=0;j<=i;j++) res*=X[j]; return res; } else i=id-1; } } long long updateX(int pos,int val) { return 0; } long long updateY(int pos,int val) { return 0; } /* int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin>>N; int X[N],Y[N]; for(int i=0;i<N;i++) cin>>X[i]; for(int i=0;i<N;i++) cin>>Y[i]; cout<<init(N,X,Y); }*/

Compilation message (stderr)

horses.cpp: In function 'long long int updateX(int, int)':
horses.cpp:31:23: warning: unused parameter 'pos' [-Wunused-parameter]
   31 | long long updateX(int pos,int val)
      |                   ~~~~^~~
horses.cpp:31:31: warning: unused parameter 'val' [-Wunused-parameter]
   31 | long long updateX(int pos,int val)
      |                           ~~~~^~~
horses.cpp: In function 'long long int updateY(int, int)':
horses.cpp:36:23: warning: unused parameter 'pos' [-Wunused-parameter]
   36 | long long updateY(int pos,int val)
      |                   ~~~~^~~
horses.cpp:36:31: warning: unused parameter 'val' [-Wunused-parameter]
   36 | long long updateY(int pos,int val)
      |                           ~~~~^~~
horses.cpp: In function 'long long int init(int, int*, int*)':
horses.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
   29 | }
      | ^
#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...