제출 #387662

#제출 시각아이디문제언어결과실행 시간메모리
387662Pichon5말 (IOI15_horses)C++17
17 / 100
14 ms8396 KiB
#include "horses.h"
#define vi vector<int>
#define ll long long int
#include <bits/stdc++.h>
using namespace std;
const ll mod=1e9+7;
const ll tam =1005;
ll x[tam];
ll y[tam];
ll n;
ll solve(){
    ll num=1;
    ll res=0;
    for(int i=0;i<n;i++){
        num=(num*x[i])%mod;
        res=max(res,(y[i]*num)%mod);
    }
    return res;
}
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];
    }
    return solve();
}
int updateX(int pos, int val) {
	x[pos]=val;
	return solve();
}

int updateY(int pos, int val) {
	y[pos]=val;
	return solve();
}

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

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:26:17: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   26 |     return solve();
      |            ~~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:30:14: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   30 |  return solve();
      |         ~~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:35:14: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   35 |  return solve();
      |         ~~~~~^~
#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...