# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
68967 | 2018-08-19T11:39:59 Z | theknife2001 | 말 (IOI15_horses) | C++17 | 1500 ms | 16220 KB |
#include "horses.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; const int N=5e5+55; long long x[N]; long long y[N]; long long s[N]; int n; int m=1e9+7; int solve() { int i=n-1; long long ret=0; long long temp=1; while(i) { s[i]=x[i]*s[i+1]; if(s[i]>1000000000) break; i--; } i++; int bestpos=n-1; for(;i<n;i++) { temp*=x[i]; if(y[i]*temp>ret) { ret=y[i]*temp; bestpos=i; } } ret=1; for(int i=0;i<=bestpos;i++) { ret*=x[i]; ret%=m; } ret*=y[bestpos]; ret%=m; return ret; } int init(int N, int X[], int Y[]) { n=N; for(int i=0;i<N;i++) { s[i]=1; x[i]=X[i]; y[i]=Y[i]; } s[n]=1; s[n+1]=1; return solve(); } int updateX(int pos, int val) { x[pos]=val; return solve(); } int updateY(int pos, int val) { y[pos]=val; return solve(); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 3 ms | 484 KB | Output is correct |
3 | Correct | 3 ms | 564 KB | Output is correct |
4 | Correct | 2 ms | 564 KB | Output is correct |
5 | Correct | 2 ms | 592 KB | Output is correct |
6 | Incorrect | 3 ms | 592 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 592 KB | Output is correct |
2 | Correct | 3 ms | 592 KB | Output is correct |
3 | Correct | 2 ms | 592 KB | Output is correct |
4 | Correct | 2 ms | 592 KB | Output is correct |
5 | Correct | 2 ms | 592 KB | Output is correct |
6 | Incorrect | 3 ms | 592 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1578 ms | 16220 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 16220 KB | Output is correct |
2 | Correct | 2 ms | 16220 KB | Output is correct |
3 | Correct | 3 ms | 16220 KB | Output is correct |
4 | Correct | 2 ms | 16220 KB | Output is correct |
5 | Correct | 2 ms | 16220 KB | Output is correct |
6 | Incorrect | 3 ms | 16220 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 16220 KB | Output is correct |
2 | Correct | 2 ms | 16220 KB | Output is correct |
3 | Correct | 3 ms | 16220 KB | Output is correct |
4 | Correct | 2 ms | 16220 KB | Output is correct |
5 | Correct | 2 ms | 16220 KB | Output is correct |
6 | Incorrect | 2 ms | 16220 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |