제출 #135277

#제출 시각아이디문제언어결과실행 시간메모리
135277tinjyu말 (IOI15_horses)C++14
17 / 100
1570 ms12380 KiB
#include "horses.h"
#include <iostream>
using namespace std;
long long int n,x[1000005],y[1000005];
int init(int N, int X[], int Y[]) {
    n=N;
    for(int i=0;i<n;i++)x[i]=X[i];
    for(int i=0;i<n;i++)y[i]=Y[i];
    long long int tmp=1,ans=0;
    for(int i=0;i<n;i++)
    {
        tmp*=x[i];
        if(tmp*y[i]>ans)
        {
            ans=tmp*y[i];
        }
    }
    ans%=1000000007;
    int a=(int)ans;
	return a;
}

int updateX(int pos, int val) {
    x[pos]=val;
    long long int tmp=1,ans=0;
    for(int i=0;i<n;i++)
    {
        tmp*=x[i];
        if(tmp*y[i]>ans)
        {
            ans=tmp*y[i];
        }
    }
	ans%=1000000007;
    int a=(int)ans;
	return a;
}

int updateY(int pos, int val) {
    y[pos]=val;
    long long int tmp=1,ans=0;
    for(int i=0;i<n;i++)
    {
        tmp*=x[i];
        if(tmp*y[i]>ans)
        {
            ans=tmp*y[i];
        }
    }
	ans%=1000000007;
    int a=(int)ans;
	return a;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...