Submission #430557

#TimeUsernameProblemLanguageResultExecution timeMemory
430557REALITYNBHorses (IOI15_horses)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "horses.h" #define ll long long #define md ((ll)1e9+7) using namespace std; vector<ll> x,y ; int init(int n , vector<int> fx, vector<int> fy){ for(int y: fx) x.push_back(y) ; for(int x :fy) y.push_back(x); ll horses = 1 ; ll mx = 0 ; for(ll i=0;i<n;i++){ horses*=x[i] ; mx=max(mx,horses*y[i]) ; } mx%=md; return (int)(mx); } int updateX(int h , int hh ){ return 0 ; } int updateX(int h , int hh){ return 0 ; }

Compilation message (stderr)

horses.cpp: In function 'int init(int, std::vector<int>, std::vector<int>)':
horses.cpp:8:13: warning: declaration of 'y' shadows a global declaration [-Wshadow]
    8 |     for(int y: fx) x.push_back(y) ;
      |             ^
horses.cpp:6:14: note: shadowed declaration is here
    6 | vector<ll> x,y ;
      |              ^
horses.cpp:9:13: warning: declaration of 'x' shadows a global declaration [-Wshadow]
    9 |     for(int x :fy) y.push_back(x);
      |             ^
horses.cpp:6:12: note: shadowed declaration is here
    6 | vector<ll> x,y ;
      |            ^
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:19:17: warning: unused parameter 'h' [-Wunused-parameter]
   19 | int updateX(int h , int hh ){
      |             ~~~~^
horses.cpp:19:25: warning: unused parameter 'hh' [-Wunused-parameter]
   19 | int updateX(int h , int hh ){
      |                     ~~~~^~
horses.cpp: At global scope:
horses.cpp:22:5: error: redefinition of 'int updateX(int, int)'
   22 | int updateX(int h , int hh){
      |     ^~~~~~~
horses.cpp:19:5: note: 'int updateX(int, int)' previously defined here
   19 | int updateX(int h , int hh ){
      |     ^~~~~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:22:17: warning: unused parameter 'h' [-Wunused-parameter]
   22 | int updateX(int h , int hh){
      |             ~~~~^
horses.cpp:22:25: warning: unused parameter 'hh' [-Wunused-parameter]
   22 | int updateX(int h , int hh){
      |                     ~~~~^~