Submission #717218

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7172182023-04-01 14:49:01dsyzHorses (IOI15_horses)C++17
17 / 100
1334 ms193844 KiB
#include <bits/stdc++.h>
#include "horses.h"
using namespace std;
using ll = long long;
using ld = long double;
#define MAXN (500005)
ll N;
ll mod = 1e9 + 7;
int x[MAXN], y[MAXN];
struct node{
ll s,e,m;
ld lazyadd;
pair<ld,ll> v;
node *l,*r;
node(ll _s,ll _e){
s = _s;
e = _e;
m = (s + e) / 2;
v = {0,s};
lazyadd = 0;
if(s != e){
l = new node(s,m);
r = new node(m + 1,e);
}
}
pair<ld,ll> value(){
if(s == e){
v.first += lazyadd;
lazyadd = 0;
return v;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In member function 'void node::update(ll, ll, ld)':
horses.cpp:38:22: warning: declaration of 'y' shadows a global declaration [-Wshadow]
   38 |  void update(ll x,ll y,ld val){
      |                   ~~~^
horses.cpp:9:14: note: shadowed declaration is here
    9 | int x[MAXN], y[MAXN];
      |              ^
horses.cpp:38:17: warning: declaration of 'x' shadows a global declaration [-Wshadow]
   38 |  void update(ll x,ll y,ld val){
      |              ~~~^
horses.cpp:9:5: note: shadowed declaration is here
    9 | int x[MAXN], y[MAXN];
      |     ^
horses.cpp: In member function 'std::pair<long double, long long int> node::rmq(ll, ll)':
horses.cpp:47:26: warning: declaration of 'y' shadows a global declaration [-Wshadow]
   47 |  pair<ld,ll> rmq(ll x,ll y){
      |                       ~~~^
horses.cpp:9:14: note: shadowed declaration is here
    9 | int x[MAXN], y[MAXN];
      |              ^
horses.cpp:47:21: warning: declaration of 'x' shadows a global declaration [-Wshadow]
   47 |  pair<ld,ll> rmq(ll x,ll y){
      |                  ~~~^
horses.cpp:9:5: note: shadowed declaration is here
    9 | int x[MAXN], y[MAXN];
      |     ^
horses.cpp: In member function 'void node2::update(int, int, ll)':
horses.cpp:84:22: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   84 |    else l->update(S, m, V),r->update(m+1, E, V);
      |                      ^
horses.cpp:84:39: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   84 |    else l->update(S, m, V),r->update(m+1, E, V);
      |                                      ~^~
horses.cpp: In member function 'll node2::query(int, int)':
horses.cpp:94:28: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   94 |   else return (l->query(S, m) + r->query(m+1, E)) % mod;
      |                            ^
horses.cpp:94:43: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   94 |   else return (l->query(S, m) + r->query(m+1, E)) % mod;
      |                                          ~^~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:114:19: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  114 |   root2 -> update(i,i,prefixX);
      |                   ^
horses.cpp:114:21: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  114 |   root2 -> update(i,i,prefixX);
      |                     ^
horses.cpp:118:25: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  118 |  return (root2 -> query(index,index) * y[index]) % mod;
      |                         ^~~~~
horses.cpp:118:31: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  118 |  return (root2 -> query(index,index) * y[index]) % mod;
      |                               ^~~~~
horses.cpp:118:50: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  118 |  return (root2 -> query(index,index) * y[index]) % mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:124:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  124 |  root2 -> update(pos,N - 1,-1 * front + mod);
      |                      ~~^~~
horses.cpp:129:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  129 |  root2 -> update(pos,N - 1,add);
      |                      ~~^~~
horses.cpp:132:25: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  132 |  return (root2 -> query(index,index) * y[index]) % mod;
      |                         ^~~~~
horses.cpp:132:31: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  132 |  return (root2 -> query(index,index) * y[index]) % mod;
      |                               ^~~~~
horses.cpp:132:50: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  132 |  return (root2 -> query(index,index) * y[index]) % mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:141:25: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  141 |  return (root2 -> query(index,index) * y[index]) % mod;
      |                         ^~~~~
horses.cpp:141:31: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  141 |  return (root2 -> query(index,index) * y[index]) % mod;
      |                               ^~~~~
horses.cpp:141:50: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  141 |  return (root2 -> query(index,index) * y[index]) % mod;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
#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...