제출 #424959

#제출 시각아이디문제언어결과실행 시간메모리
424959InternetPerson10Horses (IOI15_horses)C++17
17 / 100
38 ms15972 KiB
#include "horses.h"
#include <bits/stdc++.h>
typedef long long ll;

using namespace std;

const ll MOD = 1000000007;

vector<ll> x, y;

ll getBest() {
	ll horses = 1;
	ll best = 1;
	for(int i = 0; i < x.size(); i++) {
		horses *= x[i];
		best = max(best, horses * y[i]);
	}
	return best%MOD;
}

int init(int N, int X[], int Y[]) {
	x.resize(N);
	y.resize(N);
	for(int i = 0; i < N; i++) {
		x[i] = X[i]; y[i] = Y[i];
	}
	return (int)getBest();
}

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

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

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

horses.cpp: In function 'll getBest()':
horses.cpp:14:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |  for(int i = 0; i < x.size(); i++) {
      |                 ~~^~~~~~~~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:30:17: warning: unused parameter 'pos' [-Wunused-parameter]
   30 | int updateX(int pos, int val) {
      |             ~~~~^~~
horses.cpp:30:26: warning: unused parameter 'val' [-Wunused-parameter]
   30 | int updateX(int pos, int val) {
      |                      ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:34:17: warning: unused parameter 'pos' [-Wunused-parameter]
   34 | int updateY(int pos, int val) {
      |             ~~~~^~~
horses.cpp:34:26: warning: unused parameter 'val' [-Wunused-parameter]
   34 | int updateY(int pos, int val) {
      |                      ~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...