이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "horses.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for (int i = (a); i <= (b); i++)
#define repa(i,a,b) for (int i = (a); i >= (b); i--)
#define lli long long int
#define debugsl(a) cout << #a << " = " << a << ", "
#define debug(a) cout << #a << " = " << a << endl
lli x[1002],y[1002],n,MAX,a;
int init(int N, int X[], int Y[]) {
n = N;
MAX = 0;
rep (i,0,n-1) {
if (i > 0) x[i] = X[i] * x[i-1];
else x[i] = X[i];
y[i] = Y[i];
a = x[i] * y[i];
if (a > MAX) MAX = a;
}
return MAX;
}
int updateX(int pos, int val) {
lli pas = x[pos];
MAX = 0;
rep(i,0,n-1) {
if (i >= pos){
x[i] /= pas;
x[i] *= val;
}
a = x[i]*y[i];
if (a > MAX) MAX = a;
}
return MAX;
}
int updateY(int pos, int val) {
MAX = 0;
rep(i,0,n-1) {
if (i == pos) y[i] = val;
a = x[i]*y[i];
if (a > MAX) MAX = a;
}
return MAX;
}
컴파일 시 표준 에러 (stderr) 메시지
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:27:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
27 | return MAX;
| ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:44:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
44 | return MAX;
| ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:57:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
57 | return MAX;
| ^~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |