Submission #399521

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3995212021-05-05 23:56:20biggHorses (IOI15_horses)C++14
100 / 100
590 ms106052 KiB
#include "horses.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 5e5 + 10;
const ll MOD = 1e9 + 7;
#define esq(x) x << 1
#define dir(x) (x<<1) | 1
#define mid(x,y,t) ((x+y)>>1) + t
ll Y[MAXN], X[MAXN];
int n;
struct nodeseg
{
ll v, id, xm;
bool flag;
nodeseg(ll _v = 0, ll _id = 0, ll _xm = 0, bool f = 0){
v = _v;
id = _id;
xm = _xm;
flag = f;
}
nodeseg operator + (nodeseg b){
if(flag && b.flag) return nodeseg(0,0,0,1);
if(flag) return b;
if(b.flag) return *this;
nodeseg ans;
if(v >= b.v){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'll makeans()':
horses.cpp:103:24: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  103 |  return (query(1,1,n,1,id).xm*Y[id])%MOD;
      |                        ^~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:116:16: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  116 |  return makeans();
      |         ~~~~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:126:16: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  126 |  return makeans();
      |         ~~~~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:133:16: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
  133 |  return makeans();
      |         ~~~~~~~^~
#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...