Submission #204777

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2047772020-02-27 05:55:34TAISA_Horses (IOI15_horses)C++14
100 / 100
1101 ms61048 KiB
#include "horses.h"
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using P=pair<int,int>;
int x[500000],y[500000];
int n;
const ll mod=1000000007LL;
struct segtree{
int n;
vector<ll> dat;
void build(int n_){
n=1;
while(n<n_)n<<=1;
dat.resize(2*n,1);
}
void upd(int k,ll s){
k+=n;
dat[k]=s%mod;
k>>=1;
while(k>0){
dat[k]=dat[k<<1]*dat[k<<1|1]%mod;
k>>=1;
}
}
ll get(int a,int b,int k,int l,int r){
if(b<=l||r<=a)return 1LL;
if(a<=l&&r<=b)return dat[k]%mod;
int m=(l+r)/2;
return get(a,b,k<<1,l,m)*get(a,b,k<<1|1,m,r)%mod;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'll calc()':
horses.cpp:73:24: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return by*seg.get(0,id+1)%mod;
                      ~~^~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:91:13: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return calc();
         ~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:94:28: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  if(x[pos]==val)return calc();
                        ~~~~^~
horses.cpp:114:13: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return calc();
         ~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:120:13: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return calc();
         ~~~~^~
#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...