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 <bits/stdc++.h>
using namespace std;
const long long bignum=1e9+7;
struct year{int x,y;}a[500100];
int n;
int cnt(){
long long ans=0,m=0,ho=1,tmp=1;
ans=a[0].x*a[0].y%bignum;
for (int i=0;i<n;i++){
ho=ho*a[i].x%bignum;
tmp=tmp*a[i].x&bignum;
if (a[m].y<a[i].y*tmp){
ans=ho*a[i].y%bignum;
m=i;tmp=1;
}
}
return ans;
}
int init(int N, int X[], int Y[]){
n=N;
for (int i=0;i<n;i++){a[i].x=X[i];a[i].y=Y[i];}
return cnt();
}
int updateX(int pos, int val) {
a[pos].x=val;
return cnt();
}
int updateY(int pos, int val) {
a[pos].y=val;
return cnt();
}
Compilation message (stderr)
horses.cpp: In function 'int cnt()':
horses.cpp:18:12: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
return ans;
^~~
# | 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... |