이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "horses.h"
#include<bits/stdc++.h>
using namespace std;
struct ABC{int A, x, y; double X, Y, m;} a[2000010];
int n, u=1000000007, I;
void upd(int l, int r, int i, int k, int x, int y){
if(r<k || k<l) return;
if(l==k && l==r){
if(x) a[i].X=log10(x), a[i].x=x, a[i].m=a[i].X+a[i].Y;
if(y) a[i].Y=log10(y), a[i].y=y, a[i].m=a[i].X+a[i].Y;
a[i].A=1LL*a[i].x*a[i].y%u;
return;
}int L=i*2, R=i*2+1;
upd(l, (l+r)/2, L,k,x,y);
upd((l+r)/2+1,r,R,k,x,y);
a[i].X=a[L].X+a[R].X;
a[i].x=1LL*a[L].x*a[R].x%u;
if(a[L].m<a[R].m+a[L].X)
a[i].m=a[R].m+a[L].X,
a[i].A=1LL* a[R].A*a[L].x%u;
else
a[i].m=a[L].m,
a[i].A=a[L].A;
}
int init(int N,int X[],int Y[]){n=N; for(I=0;I<n;I++) upd(0,n-1,1,I,X[I],Y[I]); return a[1].A;}
int updateX(int pos,int val){upd(0,n-1,1,pos,val,0); return a[1].A;}
int updateY(int pos,int val){upd(0,n-1,1,pos,0,val); return a[1].A;}
컴파일 시 표준 에러 (stderr) 메시지
horses.cpp: In function 'void upd(int, int, int, int, int, int)':
horses.cpp:11:30: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
a[i].A=1LL*a[i].x*a[i].y%u;
~~~~~~~~~~~~~~~~~^~
horses.cpp:18:29: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
a[i].x=1LL*a[L].x*a[R].x%u;
~~~~~~~~~~~~~~~~~^~
horses.cpp:22:28: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
a[i].A=1LL* a[R].A*a[L].x%u;
~~~~~~~~~~~~~~~~~~^~
# | 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... |