Submission #430554

#TimeUsernameProblemLanguageResultExecution timeMemory
430554REALITYNBHorses (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 h ){ return 0 ; } int updateX(int h , int h ){ 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: At global scope:
horses.cpp:19:25: error: redefinition of 'int h'
   19 | int updateX(int h , int h ){
      |                     ~~~~^
horses.cpp:19:17: note: 'int h' previously declared here
   19 | int updateX(int h , int h ){
      |             ~~~~^
horses.cpp: In function 'int updateX(int)':
horses.cpp:19:17: warning: unused parameter 'h' [-Wunused-parameter]
horses.cpp: At global scope:
horses.cpp:22:25: error: redefinition of 'int h'
   22 | int updateX(int h , int h ){
      |                     ~~~~^
horses.cpp:22:17: note: 'int h' previously declared here
   22 | int updateX(int h , int h ){
      |             ~~~~^
horses.cpp:22:5: error: redefinition of 'int updateX(int)'
   22 | int updateX(int h , int h ){
      |     ^~~~~~~
horses.cpp:19:5: note: 'int updateX(int)' previously defined here
   19 | int updateX(int h , int h ){
      |     ^~~~~~~
horses.cpp: In function 'int updateX(int)':
horses.cpp:22:17: warning: unused parameter 'h' [-Wunused-parameter]
   22 | int updateX(int h , int h ){
      |             ~~~~^