제출 #285079

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
2850792020-08-28 09:53:50Shafin666말 (IOI15_horses)C++14
100 / 100
238 ms58488 KiB
#include "horses.h"
#include <bits/stdc++.h>
#define pb push_back
#define pii pair<ll, ll>
#define nyan "(=^・ω・^=)"
#define read_input freopen("in.txt","r", stdin)
#define print_output freopen("out.txt","w", stdout)
typedef long long ll;
typedef long double ld;
using namespace std;
const int maxn = 5e5+10, mod = 1e9+7;
ll x[maxn], y[maxn], n;
struct node {
double lg; // log x0 + log x1 + ...
double mxlg; // max log (x0 x1 x2 .... xi * yi)
ll mul; // x0 x1 x2 ... % mod
ll mxmul; // max x0 x1 ... xi * yi
} tree[4 * maxn];
node merge(node a, node b) {
node ret;
ret.lg = a.lg + b.lg;
ret.mul = (a.mul * b.mul) % mod;
if(a.mxlg <= a.lg + b.mxlg) {
ret.mxlg = a.lg + b.mxlg;
ret.mxmul = (a.mul * b.mxmul) % mod;
} else {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

horses.cpp: In function 'void build(int, int, int)':
horses.cpp:47:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   47 |  int mid = L + R >> 1;
      |            ~~^~~
horses.cpp: In function 'void update(int, int, int, int)':
horses.cpp:62:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   62 |  int mid = L + R >> 1;
      |            ~~^~~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:73:15: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   73 |  build(1, 0, n-1);
      |              ~^~
horses.cpp:74:17: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   74 |  return tree[1].mxmul;
      |         ~~~~~~~~^~~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:80:16: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   80 |  update(1, 0, n-1, pos);
      |               ~^~
horses.cpp:81:17: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   81 |  return tree[1].mxmul;
      |         ~~~~~~~~^~~~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:87:16: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   87 |  update(1, 0, n-1, pos);
      |               ~^~
horses.cpp:88:17: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   88 |  return tree[1].mxmul;
      |         ~~~~~~~~^~~~~
#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...