답안 #715464

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
715464 2023-03-26T21:24:10 Z mseebacher 말 (IOI15_horses) C++17
컴파일 오류
0 ms 0 KB
#include "horses.h"
#include <bits/stdc++.h>

int init(int N, int X[], int Y[]) {
	ll ans = 0;
	ll horses = 1;
	const int MOD = 1e9+7;
	for(int i = 0;i<N;i++){
		ans = max(ans,horses*Y[i]%MOD);
		horses*=X[i]%MOD;
	}
	return ans;
}

int updateX(int pos, int val) {	
	return 0;
}

int updateY(int pos, int val) {
	return 0;
}

Compilation message

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:5:2: error: 'll' was not declared in this scope
    5 |  ll ans = 0;
      |  ^~
horses.cpp:6:4: error: expected ';' before 'horses'
    6 |  ll horses = 1;
      |    ^~~~~~~
      |    ;
horses.cpp:9:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   ans = max(ans,horses*Y[i]%MOD);
      |   ^~~
      |   abs
horses.cpp:9:17: error: 'horses' was not declared in this scope; did you mean 'horses_h'?
    9 |   ans = max(ans,horses*Y[i]%MOD);
      |                 ^~~~~~
      |                 horses_h
horses.cpp:9:9: error: 'max' was not declared in this scope; did you mean 'std::max'?
    9 |   ans = max(ans,horses*Y[i]%MOD);
      |         ^~~
      |         std::max
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from horses.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
horses.cpp:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |  return ans;
      |         ^~~
      |         abs
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:15:17: warning: unused parameter 'pos' [-Wunused-parameter]
   15 | int updateX(int pos, int val) {
      |             ~~~~^~~
horses.cpp:15:26: warning: unused parameter 'val' [-Wunused-parameter]
   15 | int updateX(int pos, int val) {
      |                      ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:19:17: warning: unused parameter 'pos' [-Wunused-parameter]
   19 | int updateY(int pos, int val) {
      |             ~~~~^~~
horses.cpp:19:26: warning: unused parameter 'val' [-Wunused-parameter]
   19 | int updateY(int pos, int val) {
      |                      ~~~~^~~