Submission #252034

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2520342020-07-23 20:56:50DS007Horses (IOI15_horses)C++14
0 / 100
1303 ms52324 KiB
#include <bits/stdc++.h>
using namespace std;
const long long N = 5e5, mod = 1e9 + 7;
int n, *x, *y;
set<int> s;
class SegmentTree1 {
int t[N * 4];
public:
SegmentTree1() {
fill(t, t + N * 4, 0);
}
void update(int v, int l, int r, int tl, int k) {
if (l == r && l == tl) {
t[v] = k;
return;
}
int mid = (l + r) / 2;
if (tl <= mid)
update(v * 2, l, mid, tl, k);
else
update(v * 2 + 1, mid + 1, r, tl, k);
t[v] = max(t[v * 2], t[v * 2 + 1]);
}
long long query(int v, int l, int r, int tl, int tr) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'int query()':
horses.cpp:97:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < v.size(); i++) {
                     ~~^~~~~~~~~~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:108:33: warning: declaration of 'N' shadows a global declaration [-Wshadow]
 int init(int N, int X[], int Y[]) {
                                 ^
horses.cpp:4:17: note: shadowed declaration is here
 const long long N = 5e5, mod = 1e9 + 7;
                 ^
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:127:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (val > 1)
     ^~
horses.cpp:129:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  return query();
  ^~~~~~
#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...