제출 #1357125

#제출 시각아이디문제언어결과실행 시간메모리
1357125ezzzay말 (IOI15_horses)C++20
컴파일 에러
0 ms0 KiB
#include "horses.h"
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
vector<int>vx,vy;
int init(int N, int X[], int Y[]) {
    vx.clear();
    vy.clear();
    for(int i=0;i<N;i++)vx.pb(X[i]);
    for(int i=0;i<N;i++)vy.pb(Y[i]);
    int p=1;
    int mx=1;
    for(int i=0;i<N;i++){
        p=p*X[i];
        mx=max(mx,p*Y[i]);
    }
	return mx;
}

int updateX(int pos, int val) {	
    int N=vx.size();
    vx[pos]=val;
	 int p=1;
    int mx=1;
    for(int i=0;i<N;i++){
        p=p*X[i];
        mx=max(mx,p*Y[i]);
    }
	return mx;
}

int updateY(int pos, int val) {
    int N=vx.size();
    vy[pos]=val;
     int p=1;
    int mx=1;
    for(int i=0;i<N;i++){
        p=p*X[i];
        mx=max(mx,p*Y[i]);
    }
	return mx;
}

컴파일 시 표준 에러 (stderr) 메시지

horses.cpp: In function 'int updateX(int, int)':
horses.cpp:26:13: error: 'X' was not declared in this scope
   26 |         p=p*X[i];
      |             ^
horses.cpp:27:21: error: 'Y' was not declared in this scope
   27 |         mx=max(mx,p*Y[i]);
      |                     ^
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:38:13: error: 'X' was not declared in this scope
   38 |         p=p*X[i];
      |             ^
horses.cpp:39:21: error: 'Y' was not declared in this scope
   39 |         mx=max(mx,p*Y[i]);
      |                     ^