Submission #431695

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4316952021-06-17 14:33:11arayi말 (IOI15_horses)C++17
100 / 100
1261 ms54568 KiB
#include "horses.h"
#include <bits/stdc++.h>
#define lli long long
using namespace std;
const int N = 5e5 + 30;
const lli mod = 1e9 + 7;
int n;
lli x[N], y[N];
lli t[4*N], t1[4*N];
set <int> fp;
void upd(int q, lli v, int l = 0, int r = n - 1, int nd = 1)
{
if(q > r || q < l) return;
if(l == r)
{
t[nd] = v;
return;
}
int md = (l + r) / 2;
upd(q, v, l, md, nd * 2);
upd(q, v, md + 1, r, nd * 2 + 1);
t[nd] = max(t[nd*2], t[nd*2+1]);
}
lli qry(int l, int r, int nl = 0, int nr = n - 1, int nd = 1)
{
if(l > nr || r < nl) return 0;
if(nl==l&&r==nr) return t[nd];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:71:14: warning: declaration of 'N' shadows a global declaration [-Wshadow]
   71 | int init(int N, int X[], int Y[])
      |          ~~~~^
horses.cpp:6:11: note: shadowed declaration is here
    6 | const int N = 5e5 + 30;
      |           ^
horses.cpp:82:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   82 |  return slv();
      |         ~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:91:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   91 |  return slv();
      |         ~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:98:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   98 |  return slv();
      |         ~~~^~
#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...