Submission #1348805

#TimeUsernameProblemLanguageResultExecution timeMemory
1348805ElayV13Horses (IOI15_horses)C++20
17 / 100
1595 ms4100 KiB
#include "horses.h"
#include "bits/stdc++.h"
using namespace std;

const int mod=1e9+7;

int init(int N,int X[],int Y[])
{
      for(int bp=0;bp<N;bp++){
            int cur=1;
            bool br=1;
            for(int j=bp+1;j<N;j++){
                  cur*=X[j];
                  if(cur*Y[j]>Y[bp]) br=0;
            }
            if(br){
                  int res=1;
                  for(int j=0;j<=bp;j++){
                        res*=X[j];
                        res%=mod;
                        if(j==bp){
                              res*=Y[j];
                              res%=mod;
                        }
                  }
                  return res;
            }
      }
}

int updateX(int pos,int val)
{

}

int updateY(int pos,int val)
{

}

Compilation message (stderr)

horses.cpp: In function 'int updateX(int, int)':
horses.cpp:34:1: warning: no return statement in function returning non-void [-Wreturn-type]
   34 | }
      | ^
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:39:1: warning: no return statement in function returning non-void [-Wreturn-type]
   39 | }
      | ^
horses.cpp: In function '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...