제출 #999522

#제출 시각아이디문제언어결과실행 시간메모리
999522Alfraganus말 (IOI15_horses)C++17
17 / 100
1569 ms9164 KiB
#include "horses.h"
#include <bits/stdc++.h>
using namespace std;

const long long mod = 1e9 + 7;
vector<int> x, y;

int init(int n, int X[], int Y[]) {
	for(int i = 0; i < n; i ++)
		x.push_back(X[i]);
	for(int i = 0; i < n; i ++)
		y.push_back(Y[i]);
	long long ans = 1, p = 1;
	for(int i = 0; i < n; i ++){
		p = (p * x[i]) % mod;
		ans = max(ans, (p * y[i]) % mod);
	}
	int res = ans;
	return res;
}

int updateX(int pos, int val) {
	x[pos] = val;	
	long long ans = 1, p = 1;
	for(int i = 0; i < (int)x.size(); i ++)
		p = (p * x[i]) % mod, ans = max(ans, (p * y[i]) % mod);
	int res = ans;
	return res;
}

int updateY(int pos, int val) {
	y[pos] = val;
	long long ans = 1, p = 1;
	for(int i = 0; i < (int)y.size(); i ++)
		p = (p * x[i]) % mod, ans = max(ans, (p * y[i]) % mod);
	int res = ans;
	return res;
}

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

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:18:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   18 |  int res = ans;
      |            ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:27:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   27 |  int res = ans;
      |            ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:36:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   36 |  int res = ans;
      |            ^~~
#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...