제출 #353678

#제출 시각아이디문제언어결과실행 시간메모리
353678antontsiorvas말 (IOI15_horses)C++14
컴파일 에러
0 ms0 KiB
#include "horses.h"
#include <algorithm>

int x[500005], y[500005];

int init(int N, int X[], int Y[]) {
	for(int i=0; i<N; i++){
		x[i] = X[i];
		y[i] = Y[i];
	}
	int horses=1, ret=0;
	for(int i=0; i<N; i++){
		horses *= x[i];
		ret %= 1000000007;
		horses %= 1000000007;
		ret = std::max(ret, (horses*y[i])%1000000007);
	}
	return ret;
}

int updateX(int pos, int val) {	
	x[pos] = val;
	int horses=1, ret=0;
	for(int i=0; i<N; i++){
		horses *= x[i];
		ret %= 1000000007;
		horses %= 1000000007;
		ret = std::max(ret, (horses*y[i])%1000000007);
	}
	return ret;
}

int updateY(int pos, int val) {
	y[pos] = val;
	int horses=1, ret=0;
	for(int i=0; i<N; i++){
		horses *= x[i];
		ret %= 1000000007;
		horses %= 1000000007;
		ret = std::max(ret, (horses*y[i])%1000000007);
	}
	return ret;
}

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

horses.cpp: In function 'int updateX(int, int)':
horses.cpp:24:17: error: 'N' was not declared in this scope
   24 |  for(int i=0; i<N; i++){
      |                 ^
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:36:17: error: 'N' was not declared in this scope
   36 |  for(int i=0; i<N; i++){
      |                 ^