| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1348809 | ElayV13 | 말 (IOI15_horses) | C++20 | 1594 ms | 8232 KiB |
#include "horses.h"
#include "bits/stdc++.h"
using namespace std;
const int mod=1e9+7;
int n;
vector<int>x,y;
int init(int N,int X[],int Y[])
{
n=N;
x.resize(n);
y.resize(n);
for(int i=0;i<n;i++) x[i]=X[i],y[i]=Y[i];
for(int bp=0;bp<N;bp++){
int cur=1;
bool br=1;
for(int j=bp+1;j<N;j++){
cur*=X[j];
if(cur*Y[j]>Y[bp]) br=0;
}
if(br){
int res=1;
for(int j=0;j<=bp;j++){
res*=X[j];
res%=mod;
if(j==bp){
res*=Y[j];
res%=mod;
}
}
return res;
}
}
}
int updateX(int pos,int val)
{
x[pos]=val;
for(int bp=0;bp<n;bp++){
int cur=1;
bool br=1;
for(int j=bp+1;j<n;j++){
cur*=x[j];
if(cur*y[j]>y[bp]) br=0;
}
if(br){
int res=1;
for(int j=0;j<=bp;j++){
res*=x[j];
res%=mod;
if(j==bp){
res*=y[j];
res%=mod;
}
}
return res;
}
}
}
int updateY(int pos,int val)
{
y[pos]=val;
for(int bp=0;bp<n;bp++){
int cur=1;
bool br=1;
for(int j=bp+1;j<n;j++){
cur*=x[j];
if(cur*y[j]>y[bp]) br=0;
}
if(br){
int res=1;
for(int j=0;j<=bp;j++){
res*=x[j];
res%=mod;
if(j==bp){
res*=y[j];
res%=mod;
}
}
return res;
}
}
}
컴파일 시 표준 에러 (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... | ||||
