# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
140522 | PedroBigMan | Horses (IOI15_horses) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//#include "horses.h"
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=a; i<b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define INF ((ll) pow(2,63) -1)
ll insig;
#define In(vecBRO, LENBRO) REP(IBRO,0,LENBRO) {cin>>insig; vecBRO.pb(insig);}
void Out(vector<ll> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}
ll mod = 1000000007;
int init(int N, int X[], int Y[])
{
vector<ld> lx,ly;
REP(i,0,N)
{
lx.pb((ld) log10(X[i]));
ly.pb((ld) log10(Y[i]));
}
ld am = lx[0]+ly[0]; ld mx=am;
REP(i,1,N)
{
am-=ly[i-1]; am+=ly[i]; am+= lx[i];
mx=max(mx,am);
}
ld ans=(ld) 1;
while(mx>=1)
{
ans*=(ld) 10; ans%=(ld) mod; mx=(ld) ((mx)-(ld) (1));
}
ans *= (ld) ((pow(10,mx)));
ans%=mod; int t_ans=(int) round(ans);
return t_ans;
}
int updateX(int pos, int val)
{
return 0;
}
int updateY(int pos, int val)
{
return 0;
}
/*int main()
{
ll N; cin>>N; int X[N], Y[N];
REP(i,0,N) {cin>>X[i]>>Y[i];}
cout<<init(N,X,Y)<<endl;
}*/