| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 795741 | Username4132 | 말 (IOI15_horses) | C++14 | 14 ms | 9952 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "horses.h"
#include<iostream>
#include<cmath>
using namespace std;
using ll = long long;
using ld = long double;
#define forn(i, n) for(int i=0; i<(int)n; ++i)
const int MAXN = 1010, MOD = 1000000007;
int n, arr[MAXN], brr[MAXN];
ld pa[MAXN], pb[MAXN];
int calc(){
ll prod=1, res=-1;
ld mx=0, sum=0;
forn(i, n){
sum+=pa[i];
prod=(prod*arr[i])%MOD;
if(mx<sum+pb[i]){
mx=sum+pb[i];
res=(prod*brr[i])%MOD;
}
}
return res;
}
int init(int N, int X[], int Y[]) {
n=N;
forn(i, n){
arr[i]=X[i];
brr[i]=Y[i];
pa[i]=log2((ld)X[i]);
pb[i]=log2((ld)Y[i]);
}
return calc();
}
int updateX(int pos, int val) {
arr[pos]=val;
pa[pos]=log2(val);
return calc();
}
int updateY(int pos, int val) {
brr[pos]=val;
pb[pos]=log2(val);
return calc();
}컴파일 시 표준 에러 (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... | ||||
