제출 #437977

#제출 시각아이디문제언어결과실행 시간메모리
437977illyakr말 (IOI15_horses)C++14
17 / 100
1581 ms12040 KiB
#include <bits/stdc++.h>
#include "horses.h"
using namespace std;
#define ll long long
const ll mod = 1000000007;

int n;
ll x[501010], y[501010];
int init(int N, int X[], int Y[]) {
	n = N;
	for (int i = 0; i < n; i++) {
        x[i] = X[i];
        y[i] = Y[i];
	}
	ll ans = 0, cnt = 1;
	for (int i = 0; i < n; i++) {
        cnt *= X[i];
        ans = max(ans, Y[i] * cnt);
        ans %= mod;
	}
	return ans;
}

int updateX(int pos, int val) {
    x[pos] = val;
	ll ans = 0, cnt = 1;
	for (int i = 0; i < n; i++) {
        cnt *= x[i];
        ans = max(ans, y[i] * cnt);
        ans %= mod;
	}
	return ans;
}

int updateY(int pos, int val) {
    y[pos] = val;
	ll ans = 0, cnt = 1;
	for (int i = 0; i < n; i++) {
        cnt *= x[i];
        ans = max(ans, y[i] * cnt);
        ans %= mod;
	}
	return ans;
}

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

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:21:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   21 |  return ans;
      |         ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:32:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   32 |  return ans;
      |         ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:43:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   43 |  return 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...