Submission #430558

#TimeUsernameProblemLanguageResultExecution timeMemory
430558REALITYNBHorses (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 updateY(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: In function 'int updateY(int, int)':
horses.cpp:22:17: warning: unused parameter 'h' [-Wunused-parameter]
   22 | int updateY(int h , int hh){
      |             ~~~~^
horses.cpp:22:25: warning: unused parameter 'hh' [-Wunused-parameter]
   22 | int updateY(int h , int hh){
      |                     ~~~~^~
/usr/bin/ld: /tmp/ccYbRvt2.o: in function `main':
grader.c:(.text.startup+0xaa): undefined reference to `init(int, int*, int*)'
collect2: error: ld returned 1 exit status