Submission #1075781

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10757812024-08-26 09:08:46Joshua_AnderssonTeams (IOI15_teams)C++14
34 / 100
1775 ms524288 KiB
#include "teams.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll linf = ll(1e18);
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> p2;
#define rep(i, high) for (int i = 0; i < high; i++)
#define repp(i, low, high) for (int i = low; i < high; i++)
#define repe(i, container) for (auto& i : container)
#define sz(container) ((int)container.size())
#define all(x) begin(x),end(x)
#if _LOCAL
#define assert(x) if (!(x)) __debugbreak()
#endif
struct node
{
node* lc=0, * rc=0;
int sum = 0;
node(node* lc, node* rc, int s) : lc(lc), rc(rc), sum(s) {}
};
node* build(int l, int r)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

teams.cpp: In constructor 'node::node(node*, node*, int)':
teams.cpp:27:23: warning: declaration of 'rc' shadows a member of 'node' [-Wshadow]
   27 |  node(node* lc, node* rc, int s) : lc(lc), rc(rc), sum(s) {}
      |                 ~~~~~~^~
teams.cpp:25:16: note: shadowed declaration is here
   25 |  node* lc=0, * rc=0;
      |                ^~
teams.cpp:27:13: warning: declaration of 'lc' shadows a member of 'node' [-Wshadow]
   27 |  node(node* lc, node* rc, int s) : lc(lc), rc(rc), sum(s) {}
      |       ~~~~~~^~
teams.cpp:25:8: note: shadowed declaration is here
   25 |  node* lc=0, * rc=0;
      |        ^~
teams.cpp: In constructor 'node::node(node*, node*, int)':
teams.cpp:27:23: warning: declaration of 'rc' shadows a member of 'node' [-Wshadow]
   27 |  node(node* lc, node* rc, int s) : lc(lc), rc(rc), sum(s) {}
      |                 ~~~~~~^~
teams.cpp:25:16: note: shadowed declaration is here
   25 |  node* lc=0, * rc=0;
      |                ^~
teams.cpp:27:13: warning: declaration of 'lc' shadows a member of 'node' [-Wshadow]
   27 |  node(node* lc, node* rc, int s) : lc(lc), rc(rc), sum(s) {}
      |       ~~~~~~^~
teams.cpp:25:8: note: shadowed declaration is here
   25 |  node* lc=0, * rc=0;
      |        ^~
teams.cpp: In constructor 'node::node(node*, node*, int)':
teams.cpp:27:23: warning: declaration of 'rc' shadows a member of 'node' [-Wshadow]
   27 |  node(node* lc, node* rc, int s) : lc(lc), rc(rc), sum(s) {}
      |                 ~~~~~~^~
teams.cpp:25:16: note: shadowed declaration is here
   25 |  node* lc=0, * rc=0;
      |                ^~
teams.cpp:27:13: warning: declaration of 'lc' shadows a member of 'node' [-Wshadow]
   27 |  node(node* lc, node* rc, int s) : lc(lc), rc(rc), sum(s) {}
      |       ~~~~~~^~
teams.cpp:25:8: note: shadowed declaration is here
   25 |  node* lc=0, * rc=0;
      |        ^~
teams.cpp: In lambda function:
teams.cpp:85:29: warning: declaration of 'b' shadows a previous local [-Wshadow]
   85 |  sort(all(pts), [](p2 a, p2 b)
      |                          ~~~^
teams.cpp:78:5: note: shadowed declaration is here
   78 |  vi b(n);
      |     ^
teams.cpp:85:23: warning: declaration of 'a' shadows a previous local [-Wshadow]
   85 |  sort(all(pts), [](p2 a, p2 b)
      |                    ~~~^
teams.cpp:77:5: note: shadowed declaration is here
   77 |  vi a(n);
      |     ^
teams.cpp: In constructor 'tnode::tnode(p2, int)':
teams.cpp:106:23: warning: declaration of 'value' shadows a member of 'tnode' [-Wshadow]
  106 |  tnode(p2 corner, int value) : corner(corner), prio(rand()), value(value) {}
      |                   ~~~~^~~~~
teams.cpp:104:6: note: shadowed declaration is here
  104 |  int value, sum=0, prio, cnt=1;
      |      ^~~~~
teams.cpp:106:11: warning: declaration of 'corner' shadows a member of 'tnode' [-Wshadow]
  106 |  tnode(p2 corner, int value) : corner(corner), prio(rand()), value(value) {}
      |        ~~~^~~~~~
teams.cpp:103:5: note: shadowed declaration is here
  103 |  p2 corner;
      |     ^~~~~~
teams.cpp:104:20: warning: 'tnode::prio' will be initialized after [-Wreorder]
  104 |  int value, sum=0, prio, cnt=1;
      |                    ^~~~
teams.cpp:104:6: warning:   'int tnode::value' [-Wreorder]
  104 |  int value, sum=0, prio, cnt=1;
      |      ^~~~~
teams.cpp:106:2: warning:   when initialized here [-Wreorder]
  106 |  tnode(p2 corner, int value) : corner(corner), prio(rand()), value(value) {}
      |  ^~~~~
teams.cpp: In constructor 'tnode::tnode(p2, int)':
teams.cpp:106:23: warning: declaration of 'value' shadows a member of 'tnode' [-Wshadow]
  106 |  tnode(p2 corner, int value) : corner(corner), prio(rand()), value(value) {}
      |                   ~~~~^~~~~
teams.cpp:104:6: note: shadowed declaration is here
  104 |  int value, sum=0, prio, cnt=1;
      |      ^~~~~
teams.cpp:106:11: warning: declaration of 'corner' shadows a member of 'tnode' [-Wshadow]
  106 |  tnode(p2 corner, int value) : corner(corner), prio(rand()), value(value) {}
      |        ~~~^~~~~~
teams.cpp:103:5: note: shadowed declaration is here
  103 |  p2 corner;
      |     ^~~~~~
teams.cpp: In constructor 'tnode::tnode(p2, int)':
teams.cpp:106:23: warning: declaration of 'value' shadows a member of 'tnode' [-Wshadow]
  106 |  tnode(p2 corner, int value) : corner(corner), prio(rand()), value(value) {}
      |                   ~~~~^~~~~
teams.cpp:104:6: note: shadowed declaration is here
  104 |  int value, sum=0, prio, cnt=1;
      |      ^~~~~
teams.cpp:106:11: warning: declaration of 'corner' shadows a member of 'tnode' [-Wshadow]
  106 |  tnode(p2 corner, int value) : corner(corner), prio(rand()), value(value) {}
      |        ~~~^~~~~~
teams.cpp:103:5: note: shadowed declaration is here
  103 |  p2 corner;
      |     ^~~~~~
teams.cpp: In function 'int sum(tnode*&, int, int, int)':
teams.cpp:169:7: warning: declaration of 'lo' shadows a previous local [-Wshadow]
  169 |   int lo = -2;
      |       ^~
teams.cpp:152:6: note: shadowed declaration is here
  152 |  int lo = -1;
      |      ^~
teams.cpp:150:6: warning: unused variable 'prev' [-Wunused-variable]
  150 |  int prev = -1;
      |      ^~~~
teams.cpp:151:6: warning: unused variable 'taken' [-Wunused-variable]
  151 |  int taken = 0;
      |      ^~~~~
teams.cpp:148:35: warning: unused parameter 'ylo' [-Wunused-parameter]
  148 | int sum(pnode& root, int xhi, int ylo, int yhi)
      |                               ~~~~^~~
teams.cpp: In lambda function:
teams.cpp:247:7: warning: declaration of 'lo' shadows a previous local [-Wshadow]
  247 |    p2 lo = rev_bound(hull, new_corner.first);
      |       ^~
teams.cpp:226:6: note: shadowed declaration is here
  226 |   p2 lo = lower_bound(hull, new_corner.first);
      |      ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...