제출 #1046932

#제출 시각아이디문제언어결과실행 시간메모리
1046932dpsaveslives말 (IOI15_horses)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#define ll long long 
using namespace std;
const int MAXN = 5e5+1; 
const int MOD = 1e9+7; 
int x[MAXN], y[MAXN]; 
ll init(int N, int X[], int Y[]){
    ll cur = 1ll, ans = 1ll; 
    for(int i = 0;i<N;++i){
        x[i] = X[i]; 
        y[i] = Y[i]; 
        cur = cur*X[i]%MOD; 
        ans = max(ans,cur*Y[i]%MOD); 
    }
    return ans;
}
ll updateX(int pos, int val){
    x[pos] = val;
    ll cur = 1ll, ans = 1ll; 
    for(int i = 0;i<N;++i){
        cur = cur*x[i]%MOD; 
        ans = max(ans,cur*y[i]%MOD); 
    }
    return ans;
}
ll updateY(int pos, int val){
    y[pos] = val;
    ll cur = 1ll, ans = 1ll; 
    for(int i = 0;i<N;++i){
        cur = cur*x[i]%MOD; 
        ans = max(ans,cur*y[i]%MOD); 
    }
    return ans;
}

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

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