# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1004990 | Mr_Husanboy | 말 (IOI15_horses) | C++17 | 32 ms | 16988 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "horses.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
template<typename T>
int len(T &a){return a.size();}
#define ff first
#define ss second
#define all(a) (a).begin(), (a).end()
int mod = 1e9 + 7;
vector<ll> x, y;
const int inf = 1e9;
int n;
vector<ll> pref;
int init(int N, int X[], int Y[]) {
n = N;
x.resize(n), y.resize(n);
pref.resize(n);
for(int i = 0; i < n; i ++) x[i] = X[i], y[i] = Y[i];
pref[0] = x[0];
for(int i = 1; i < n; i ++) pref[i] = pref[i - 1] * x[i] % mod;
ll mult = 1;
ll mx = 0;
int lim = -1;
for(int i = n - 1; i >= 0; i --){
mult *= x[i];
if(mult >= inf){
lim = i;
break;
}
}
mult = 1;
for(int i = lim + 1; i < n; i ++){
mult *= x[i];
mx = max(mx, mult * y[i]);
}
mx %= mod;
if(lim >= 0) mx = mx * pref[lim] % mod;
//cout << mx << endl;
return mx;
}
int updateX(int pos, int val) {
x[pos] = val;
ll mult = 1;
ll mx = 0;
int lim = -1;
for(int i = n - 1; i >= 0; i --){
mult *= x[i];
if(mult >= inf){
lim = i - 1;
break;
}
}
mult = 1;
for(int i = lim + 1; i < n; i ++){
mult *= x[i];
mx = max(mx, mult * y[i]);
}
mx %= mod;
if(lim >= 0) mx = mx * pref[lim] % mod;
//cout << mx << endl;
return mx;
}
int updateY(int pos, int val) {
y[pos] = val;
ll mult = 1;
ll mx = 0;
int lim = -1;
for(int i = n - 1; i >= 0; i --){
mult *= x[i];
if(mult >= inf){
lim = i;
break;
}
}
mult = 1;
for(int i = lim + 1; i < n; i ++){
mult *= x[i];
mx = max(mx, mult * y[i]);
}
mx %= mod;
if(lim >= 0) mx = pref[lim] * mx % mod;
//cout << mx << endl;
return mx;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |