Submission #68988

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
689882018-08-19 12:15:40theknife2001Horses (IOI15_horses)C++17
17 / 100
235 ms38408 KiB
#include "horses.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
#define mid (l+r)/2
using namespace std;
const int N=5e5+55;
long long tree[N*4];
long long x[N];
long long y[N];
int n;
int m=1e9+7;
void build(int l , int r , int node)
{
if(l==r)
{
tree[node]=x[l];
return ;
}
build(l,mid,node*2);
build(mid+1,r,node*2+1);
tree[node]=tree[node*2]*tree[node*2+1];
tree[node]%=m;
}
void update(int l , int r , int node , int ind , int val)
{
if(l==r&&l==ind)
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'long long int query(int, int, int, int, int)':
horses.cpp:42:57: warning: declaration of 'y' shadows a global declaration [-Wshadow]
 long long query(int l , int r , int node , int x , int y)
                                                         ^
horses.cpp:10:11: note: shadowed declaration is here
 long long y[N];
           ^
horses.cpp:42:57: warning: declaration of 'x' shadows a global declaration [-Wshadow]
 long long query(int l , int r , int node , int x , int y)
                                                         ^
horses.cpp:9:11: note: shadowed declaration is here
 long long x[N];
           ^
horses.cpp: In function 'int solve()':
horses.cpp:74:49: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     return (y[bestpos]*query(0,n-1,1,0,bestpos))%m;
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:77:33: warning: declaration of 'N' shadows a global declaration [-Wshadow]
 int init(int N, int X[], int Y[])
                                 ^
horses.cpp:7:11: note: shadowed declaration is here
 const int N=5e5+55;
           ^
#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...