제출 #1273785

#제출 시각아이디문제언어결과실행 시간메모리
1273785Petrix말 (IOI15_horses)C++20
컴파일 에러
0 ms0 KiB
#include "horses.h" #include<iostream> using namespace std; #define MOD 1000000007 #define int long long int n; int x[100001]; int y[100001]; int calc(){ int ci,prod,i,rasp=1,max1; for(i=1;i<=n;i++) max1=max(max1,y[i]); ci=n;prod=y[n]*x[n]; for(i=n-1;i>=1;i--){ if(prod>max1) break; if(y[i]>prod){ ci=i;prod=y[i]; } prod*=x[i]; } for(i=1;i<=ci;i++){ rasp=(rasp*x[i])%MOD; } rasp=(rasp*y[ci])%MOD; return rasp; } int init(int N,int X[],int Y[]){ int i; n=N; for(i=1;i<=n;i++){ x[i]=X[i-1]; y[i]=Y[i-1]; } return calc(); } int updateX(int pos,int val){ x[pos+1]=val; return calc(); } int updateY(int pos,int val){ y[pos+1]=val; return calc(); }

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

/usr/bin/ld: /tmp/ccp1kjAU.o: in function `main':
grader.c:(.text.startup+0xa1): undefined reference to `init(int, int*, int*)'
/usr/bin/ld: grader.c:(.text.startup+0xfb): undefined reference to `updateX(int, int)'
/usr/bin/ld: grader.c:(.text.startup+0x155): undefined reference to `updateY(int, int)'
collect2: error: ld returned 1 exit status