Submission #292577

#TimeUsernameProblemLanguageResultExecution timeMemory
292577crossing0verGame (IOI13_game)C++17
80 / 100
5946 ms256000 KiB
#include<bits/stdc++.h> #define ll long long #define tree int v,int tl,int tr #define tm (tl + tr >> 1) #define lhs L[v],tl,tm #define rhs R[v], tm+1,tr #include "game.h" using namespace std; const int N = 2E7; int L[N],R[N],A[N],id = 1,posx,posy, lx,ly,rx,ry; ll ans[N],val; ll get_y (tree) { if (tr < ly || tl > ry || !v) return 0; if (tl >= ly && tr <= ry) { return ans[v]; } return __gcd ( get_y(lhs),get_y(rhs)); } ll get_x (tree) { if (tr < lx || tl > rx ) return 0; if (tl >= lx && tr <= rx) { if (!A[v]) return 0; return get_y(A[v],0,1e9); } return __gcd ( get_x (lhs), get_x(rhs)); } void up_y(tree,int a,int b,bool flag) { if (tl == tr) { if (flag) ans[v] = val; else ans[v] = __gcd(ans[a],ans[b]); return; } if (posy <= tm) { if (!L[v]) L[v] = ++id; up_y(lhs,L[a],L[b],flag); } else { if (!R[v]) R[v] = ++id; up_y(rhs,R[a],R[b],flag); } ans[v] = __gcd(ans[ L[v] ],ans[ R[v] ]); } void up_x(tree) { if (tl < tr) { if (posx <= tm) { if (!L[v]) L[v] = ++id; up_x(lhs); } else { if (!R[v]) R[v] = ++id; up_x(rhs); } } if (!A[v]) A[v] = ++id; up_y(A[ v ],0,1e9,A[ L[v] ], A[ R[v] ],tl == tr); } void update(int x, int y, ll t){ posx = x; posy = y; val = t; up_x(1,0,1e9); } ll calculate(int a, int b, int a2, int b2){ lx = a; ly = b; rx = a2; ry = b2; return get_x(1,0,1e9); } void init(int a, int b) {}

Compilation message (stderr)

grader.c: In function 'int main()':
grader.c:25:5: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
   25 |     while(res != 1);
      |     ^~~~~
grader.c:26:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
   26 |  res = fscanf(f, "%d", &C);
      |  ^~~
grader.c:27:5: warning: this 'while' clause does not guard... [-Wmisleading-indentation]
   27 |     while(res != 1);
      |     ^~~~~
grader.c:28:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'while'
   28 |  res = fscanf(f, "%d", &N);
      |  ^~~
game.cpp: In function 'long long int get_y(int, int, int)':
game.cpp:4:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    4 | #define tm (tl + tr >> 1)
      |             ~~~^~~~
game.cpp:5:21: note: in expansion of macro 'tm'
    5 | #define lhs L[v],tl,tm
      |                     ^~
game.cpp:20:23: note: in expansion of macro 'lhs'
   20 |  return __gcd ( get_y(lhs),get_y(rhs));
      |                       ^~~
game.cpp:4:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    4 | #define tm (tl + tr >> 1)
      |             ~~~^~~~
game.cpp:6:19: note: in expansion of macro 'tm'
    6 | #define rhs R[v], tm+1,tr
      |                   ^~
game.cpp:20:34: note: in expansion of macro 'rhs'
   20 |  return __gcd ( get_y(lhs),get_y(rhs));
      |                                  ^~~
game.cpp: In function 'long long int get_x(int, int, int)':
game.cpp:4:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    4 | #define tm (tl + tr >> 1)
      |             ~~~^~~~
game.cpp:5:21: note: in expansion of macro 'tm'
    5 | #define lhs L[v],tl,tm
      |                     ^~
game.cpp:29:24: note: in expansion of macro 'lhs'
   29 |  return __gcd ( get_x (lhs), get_x(rhs));
      |                        ^~~
game.cpp:4:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    4 | #define tm (tl + tr >> 1)
      |             ~~~^~~~
game.cpp:6:19: note: in expansion of macro 'tm'
    6 | #define rhs R[v], tm+1,tr
      |                   ^~
game.cpp:29:36: note: in expansion of macro 'rhs'
   29 |  return __gcd ( get_x (lhs), get_x(rhs));
      |                                    ^~~
game.cpp: In function 'void up_y(int, int, int, int, int, bool)':
game.cpp:4:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    4 | #define tm (tl + tr >> 1)
      |             ~~~^~~~
game.cpp:37:14: note: in expansion of macro 'tm'
   37 |  if (posy <= tm) {
      |              ^~
game.cpp:4:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    4 | #define tm (tl + tr >> 1)
      |             ~~~^~~~
game.cpp:5:21: note: in expansion of macro 'tm'
    5 | #define lhs L[v],tl,tm
      |                     ^~
game.cpp:39:8: note: in expansion of macro 'lhs'
   39 |   up_y(lhs,L[a],L[b],flag);
      |        ^~~
game.cpp:4:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    4 | #define tm (tl + tr >> 1)
      |             ~~~^~~~
game.cpp:6:19: note: in expansion of macro 'tm'
    6 | #define rhs R[v], tm+1,tr
      |                   ^~
game.cpp:43:8: note: in expansion of macro 'rhs'
   43 |   up_y(rhs,R[a],R[b],flag);
      |        ^~~
game.cpp: In function 'void up_x(int, int, int)':
game.cpp:4:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    4 | #define tm (tl + tr >> 1)
      |             ~~~^~~~
game.cpp:49:16: note: in expansion of macro 'tm'
   49 |    if (posx <= tm) {
      |                ^~
game.cpp:4:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    4 | #define tm (tl + tr >> 1)
      |             ~~~^~~~
game.cpp:5:21: note: in expansion of macro 'tm'
    5 | #define lhs L[v],tl,tm
      |                     ^~
game.cpp:51:10: note: in expansion of macro 'lhs'
   51 |     up_x(lhs);
      |          ^~~
game.cpp:4:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
    4 | #define tm (tl + tr >> 1)
      |             ~~~^~~~
game.cpp:6:19: note: in expansion of macro 'tm'
    6 | #define rhs R[v], tm+1,tr
      |                   ^~
game.cpp:55:10: note: in expansion of macro 'rhs'
   55 |     up_x(rhs);
      |          ^~~
#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...