| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 712204 | raysh07 | 말 (IOI15_horses) | C++17 | 53 ms | 16004 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "horses.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int n;
const int N = 5e5 + 69;
const int mod = 1e9 + 7;
ll x[N], y[N];
int init(int N, int X[], int Y[]) {
n = N;
for (int i=1; i<=n; i++)
x[i] = X[i-1];
for (int i=1; i<=n; i++)
y[i] = Y[i-1];
ll best = 0;
int pos = -1;
ll mult = 1;
for (int i=n; i>=1; i--){
if (best * mult <= y[i]){
mult = 1;
best = y[i];
pos = i;
}
mult *= x[i-1];
if (mult >= (ll)1e9) break;
}
assert(pos != -1);
ll ans = 0;
for (int i=1; i<=pos; i++)
ans = (ans * x[i]) % mod;
ans *= y[pos]; ans %= mod;
int rans = ans;
return rans;
}
int updateX(int pos, int val) {
pos++;
x[pos] = val;
ll best = 0;
pos = -1;
ll mult = 1;
for (int i=n; i>=1; i--){
if (best * mult <= y[i]){
mult = 1;
best = y[i];
pos = i;
}
mult *= x[i-1];
if (mult >= (ll)1e9) break;
}
assert(pos != -1);
ll ans = 0;
for (int i=1; i<=pos; i++)
ans = (ans * x[i]) % mod;
ans *= y[pos]; ans %= mod;
int rans = ans;
return rans;
}
int updateY(int pos, int val) {
pos++;
y[pos] = val;
ll best = 0;
pos = -1;
ll mult = 1;
for (int i=n; i>=1; i--){
if (best * mult <= y[i]){
mult = 1;
best = y[i];
pos = i;
}
mult *= x[i-1];
if (mult >= (ll)1e9) break;
}
assert(pos != -1);
ll ans = 0;
for (int i=1; i<=pos; i++)
ans = (ans * x[i]) % mod;
ans *= y[pos]; ans %= mod;
int rans = ans;
return rans;
}
컴파일 시 표준 에러 (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... | ||||
