minmaxtree.cpp:2:1: error: 'import' does not name a type; did you mean 'short'?
import java.util.*;
^~~~~~
short
minmaxtree.cpp:3:1: error: 'import' does not name a type; did you mean 'short'?
import java.io.*;
^~~~~~
short
minmaxtree.cpp:6:12: error: expected ':' before 'static'
public static void main(String [] args) {
^~~~~~
minmaxtree.cpp:6:29: error: 'String' has not been declared
public static void main(String [] args) {
^~~~~~
minmaxtree.cpp:6:39: error: expected ',' or '...' before 'args'
public static void main(String [] args) {
^~~~
minmaxtree.cpp:10:2: error: expected ';' after class definition
}
^
;
minmaxtree.cpp: In static member function 'static void MinMaxTree::main(int*)':
minmaxtree.cpp:7:9: error: 'Solver' was not declared in this scope
Solver s = new Solver();
^~~~~~
minmaxtree.cpp:8:9: error: 's' was not declared in this scope
s.solve();
^
minmaxtree.cpp: At global scope:
minmaxtree.cpp:13:5: error: 'Reader' does not name a type
Reader in = new Reader ();
^~~~~~
minmaxtree.cpp:14:5: error: 'Writer' does not name a type
Writer out = new Writer ();
^~~~~~
minmaxtree.cpp:15:5: error: 'ArrayList' does not name a type
ArrayList <Integer> [] g = new ArrayList [70010];
^~~~~~~~~
minmaxtree.cpp:16:9: error: expected unqualified-id before '[' token
int [] mn = new int [70010];
^
minmaxtree.cpp:17:9: error: expected unqualified-id before '[' token
int [] mx = new int [70010];
^
minmaxtree.cpp:18:9: error: expected unqualified-id before '[' token
int [] par = new int [70010];
^
minmaxtree.cpp:19:9: error: expected unqualified-id before '[' token
int [] dep = new int [70010];
^
minmaxtree.cpp:20:9: error: expected unqualified-id before '[' token
int [] sub = new int [70010];
^
minmaxtree.cpp:22:9: error: expected unqualified-id before '[' token
int [] l = new int [70010];
^
minmaxtree.cpp:23:9: error: expected unqualified-id before '[' token
int [] r = new int [70010];
^
minmaxtree.cpp:25:9: error: expected unqualified-id before '[' token
int [] al = new int [70010];
^
minmaxtree.cpp:26:9: error: expected unqualified-id before '[' token
int [] ar = new int [70010];
^
minmaxtree.cpp:27:5: error: 'boolean' does not name a type; did you mean 'bool'?
boolean [] good = new boolean [70010];
^~~~~~~
bool
minmaxtree.cpp:28:5: error: 'boolean' does not name a type; did you mean 'bool'?
boolean [] vis = new boolean [70010];
^~~~~~~
bool
minmaxtree.cpp:30:5: error: 'ArrayList' does not name a type
ArrayList <Integer> aux[] = new ArrayList [70010];
^~~~~~~~~
minmaxtree.cpp:98:9: error: expected unqualified-id before '[' token
int [] anc = new int [70010];
^
minmaxtree.cpp:99:9: error: expected unqualified-id before '[' token
int [] rev = new int [70010];
^
minmaxtree.cpp:100:9: error: expected unqualified-id before '[' token
int [] col = new int [70010];
^
minmaxtree.cpp:101:5: error: 'boolean' does not name a type; did you mean 'bool'?
boolean found;
^~~~~~~
bool
minmaxtree.cpp:31:31: error: flexible array member 'Solver::ans' in an otherwise empty 'class Solver'
int ans[] = new int [70010];
^
minmaxtree.cpp:194:2: error: expected ';' after class definition
}
^
;
minmaxtree.cpp:31:31: error: initializer for flexible array member 'int Solver::ans []'
int ans[] = new int [70010];
^
minmaxtree.cpp: In member function 'void Solver::dfs(int, int)':
minmaxtree.cpp:34:9: error: 'sub' was not declared in this scope
sub[x] = 1;
^~~
minmaxtree.cpp:35:9: error: 'par' was not declared in this scope
par[x] = p;
^~~
minmaxtree.cpp:35:9: note: suggested alternative: 'char'
par[x] = p;
^~~
char
minmaxtree.cpp:36:21: error: 'g' was not declared in this scope
for(int e : g[x]) {
^
minmaxtree.cpp:37:21: error: 'l' was not declared in this scope
int y = l[e] ^ r[e] ^ x;
^
minmaxtree.cpp:37:28: error: 'r' was not declared in this scope
int y = l[e] ^ r[e] ^ x;
^
minmaxtree.cpp:39:17: error: 'dep' was not declared in this scope
dep[y] = 1 + dep[x];
^~~
minmaxtree.cpp: In member function 'void Solver::putMin(int, int, int)':
minmaxtree.cpp:46:15: error: 'dep' was not declared in this scope
while(dep[p] > dep[q]) {
^~~
minmaxtree.cpp:51:15: error: 'dep' was not declared in this scope
while(dep[p] < dep[q]) {
^~~
minmaxtree.cpp:52:21: error: 'par' was not declared in this scope
int e = par[q];
^~~
minmaxtree.cpp:53:13: error: 'mn' was not declared in this scope
mn[e] = Math.min(mn[e], val);
^~
minmaxtree.cpp:53:21: error: 'Math' was not declared in this scope
mn[e] = Math.min(mn[e], val);
^~~~
minmaxtree.cpp:54:18: error: 'l' was not declared in this scope
q ^= l[e] ^ r[e];
^
minmaxtree.cpp:54:25: error: 'r' was not declared in this scope
q ^= l[e] ^ r[e];
^
minmaxtree.cpp:57:22: error: 'par' was not declared in this scope
int e1 = par[p];
^~~
minmaxtree.cpp:59:13: error: 'mn' was not declared in this scope
mn[e1] = Math.min(mn[e1], val);
^~
minmaxtree.cpp:59:22: error: 'Math' was not declared in this scope
mn[e1] = Math.min(mn[e1], val);
^~~~
minmaxtree.cpp:61:18: error: 'l' was not declared in this scope
p ^= l[e1] ^ r[e1];
^
minmaxtree.cpp:61:26: error: 'r' was not declared in this scope
p ^= l[e1] ^ r[e1];
^
minmaxtree.cpp: In member function 'void Solver::putMax(int, int, int)':
minmaxtree.cpp:67:15: error: 'dep' was not declared in this scope
while(dep[p] > dep[q]) {
^~~
minmaxtree.cpp:72:15: error: 'dep' was not declared in this scope
while(dep[p] < dep[q]) {
^~~
minmaxtree.cpp:73:21: error: 'par' was not declared in this scope
int e = par[q];
^~~
minmaxtree.cpp:74:13: error: 'mx' was not declared in this scope
mx[e] = Math.max(mx[e], val);
^~
minmaxtree.cpp:74:21: error: 'Math' was not declared in this scope
mx[e] = Math.max(mx[e], val);
^~~~
minmaxtree.cpp:75:18: error: 'l' was not declared in this scope
q ^= l[e] ^ r[e];
^
minmaxtree.cpp:75:25: error: 'r' was not declared in this scope
q ^= l[e] ^ r[e];
^
minmaxtree.cpp:78:22: error: 'par' was not declared in this scope
int e1 = par[p];
^~~
minmaxtree.cpp:80:13: error: 'mx' was not declared in this scope
mx[e1] = Math.max(mx[e1], val);
^~
minmaxtree.cpp:80:22: error: 'Math' was not declared in this scope
mx[e1] = Math.max(mx[e1], val);
^~~~
minmaxtree.cpp:82:18: error: 'l' was not declared in this scope
p ^= l[e1] ^ r[e1];
^
minmaxtree.cpp:82:26: error: 'r' was not declared in this scope
p ^= l[e1] ^ r[e1];
^
minmaxtree.cpp: In member function 'void Solver::normal_assign(int)':
minmaxtree.cpp:88:9: error: 'vis' was not declared in this scope
vis[x] = true;
^~~
minmaxtree.cpp:88:9: note: suggested alternative: 'this'
vis[x] = true;
^~~
this
minmaxtree.cpp:89:21: error: 'aux' was not declared in this scope
for(int e : aux[x]) {
^~~
minmaxtree.cpp:89:21: note: suggested alternative: 'auto'
for(int e : aux[x]) {
^~~
auto
minmaxtree.cpp:90:21: error: 'al' was not declared in this scope
int y = al[e] ^ ar[e] ^ x;
^~
minmaxtree.cpp:90:29: error: 'ar' was not declared in this scope
int y = al[e] ^ ar[e] ^ x;
^~
minmaxtree.cpp: In member function 'void Solver::cycle(int, int)':
minmaxtree.cpp:104:9: error: 'col' was not declared in this scope
col[x] = 1;
^~~
minmaxtree.cpp:104:9: note: suggested alternative: 'bool'
col[x] = 1;
^~~
bool
minmaxtree.cpp:105:9: error: 'anc' was not declared in this scope
anc[x] = p;
^~~
minmaxtree.cpp:105:9: note: suggested alternative: 'ans'
anc[x] = p;
^~~
ans
minmaxtree.cpp:106:21: error: 'aux' was not declared in this scope
for(int e : aux[x]) {
^~~
minmaxtree.cpp:106:21: note: suggested alternative: 'auto'
for(int e : aux[x]) {
^~~
auto
minmaxtree.cpp:107:21: error: 'al' was not declared in this scope
int y = al[e] ^ ar[e] ^ x;
^~
minmaxtree.cpp:107:29: error: 'ar' was not declared in this scope
int y = al[e] ^ ar[e] ^ x;
^~
minmaxtree.cpp:110:50: error: 'found' was not declared in this scope
} else if (e != p && col[y] == 1 && !found) {
^~~~~
minmaxtree.cpp:115:21: error: 'good' was not declared in this scope
good[cur] = true;
^~~~
minmaxtree.cpp:115:21: note: suggested alternative: 'bool'
good[cur] = true;
^~~~
bool
minmaxtree.cpp:118:17: error: 'good' was not declared in this scope
good[y] = true;
^~~~
minmaxtree.cpp:118:17: note: suggested alternative: 'bool'
good[y] = true;
^~~~
bool
minmaxtree.cpp: In member function 'void Solver::solve()':
minmaxtree.cpp:127:17: error: 'in' was not declared in this scope
int n = in.nextInt();
^~
minmaxtree.cpp:127:17: note: suggested alternative: 'n'
int n = in.nextInt();
^~
n
minmaxtree.cpp:128:9: error: 'Arrays' was not declared in this scope
Arrays.fill(ans, -1);
^~~~~~
minmaxtree.cpp:130:13: error: 'g' was not declared in this scope
g[i] = new ArrayList <> ();
^
minmaxtree.cpp:130:24: error: 'ArrayList' does not name a type
g[i] = new ArrayList <> ();
^~~~~~~~~
minmaxtree.cpp:130:35: error: expected primary-expression before '>' token
g[i] = new ArrayList <> ();
^
minmaxtree.cpp:130:38: error: expected primary-expression before ')' token
g[i] = new ArrayList <> ();
^
minmaxtree.cpp:131:13: error: 'mn' was not declared in this scope
mn[i] = Integer.MAX_VALUE;
^~
minmaxtree.cpp:131:13: note: suggested alternative: 'n'
mn[i] = Integer.MAX_VALUE;
^~
n
minmaxtree.cpp:131:21: error: 'Integer' was not declared in this scope
mn[i] = Integer.MAX_VALUE;
^~~~~~~
minmaxtree.cpp:132:13: error: 'mx' was not declared in this scope
mx[i] = Integer.MIN_VALUE;
^~
minmaxtree.cpp:135:13: error: 'l' was not declared in this scope
l[i] = in.nextInt();
^
minmaxtree.cpp:136:13: error: 'r' was not declared in this scope
r[i] = in.nextInt();
^
minmaxtree.cpp:137:13: error: 'g' was not declared in this scope
g[l[i]].add(i);
^
minmaxtree.cpp:142:9: error: 'TreeMap' was not declared in this scope
TreeMap <Integer, Integer> t = new TreeMap <> ();
^~~~~~~
minmaxtree.cpp:142:18: error: 'Integer' was not declared in this scope
TreeMap <Integer, Integer> t = new TreeMap <> ();
^~~~~~~
minmaxtree.cpp:142:36: error: 't' was not declared in this scope
TreeMap <Integer, Integer> t = new TreeMap <> ();
^
minmaxtree.cpp:142:44: error: 'TreeMap' does not name a type
TreeMap <Integer, Integer> t = new TreeMap <> ();
^~~~~~~
minmaxtree.cpp:142:53: error: expected primary-expression before '>' token
TreeMap <Integer, Integer> t = new TreeMap <> ();
^
minmaxtree.cpp:142:56: error: expected primary-expression before ')' token
TreeMap <Integer, Integer> t = new TreeMap <> ();
^
minmaxtree.cpp:155:13: error: 'rev' was not declared in this scope
rev[i] = val;
^~~
minmaxtree.cpp:158:13: error: 'aux' was not declared in this scope
aux[i] = new ArrayList <> ();
^~~
minmaxtree.cpp:158:13: note: suggested alternative: 'auto'
aux[i] = new ArrayList <> ();
^~~
auto
minmaxtree.cpp:158:26: error: 'ArrayList' does not name a type
aux[i] = new ArrayList <> ();
^~~~~~~~~
minmaxtree.cpp:158:37: error: expected primary-expression before '>' token
aux[i] = new ArrayList <> ();
^
minmaxtree.cpp:158:40: error: expected primary-expression before ')' token
aux[i] = new ArrayList <> ();
^
minmaxtree.cpp:161:16: error: 'mx' was not declared in this scope
if(mx[i] == Integer.MIN_VALUE) {
^~
minmaxtree.cpp:162:17: error: 'good' was not declared in this scope
good[t.get(mn[i])] = true;
^~~~
minmaxtree.cpp:162:17: note: suggested alternative: 'bool'
good[t.get(mn[i])] = true;
^~~~
bool
minmaxtree.cpp:162:28: error: 'mn' was not declared in this scope
good[t.get(mn[i])] = true;
^~
minmaxtree.cpp:162:28: note: suggested alternative: 'n'
good[t.get(mn[i])] = true;
^~
n
minmaxtree.cpp:164:24: error: 'mn' was not declared in this scope
} else if (mn[i] == Integer.MAX_VALUE) {
^~
minmaxtree.cpp:164:24: note: suggested alternative: 'n'
} else if (mn[i] == Integer.MAX_VALUE) {
^~
n
minmaxtree.cpp:165:17: error: 'good' was not declared in this scope
good[t.get(mx[i])] = true;
^~~~
minmaxtree.cpp:165:17: note: suggested alternative: 'bool'
good[t.get(mx[i])] = true;
^~~~
bool
minmaxtree.cpp:168:17: error: 'al' was not declared in this scope
al[i] = t.get(mx[i]);
^~
minmaxtree.cpp:169:17: error: 'ar' was not declared in this scope
ar[i] = t.get(mn[i]);
^~
minmaxtree.cpp:169:17: note: suggested alternative: 'qr'
ar[i] = t.get(mn[i]);
^~
qr
minmaxtree.cpp:170:17: error: 'aux' was not declared in this scope
aux[al[i]].add(i);
^~~
minmaxtree.cpp:170:17: note: suggested alternative: 'auto'
aux[al[i]].add(i);
^~~
auto
minmaxtree.cpp:176:16: error: 'col' was not declared in this scope
if(col[i] == 0) {
^~~
minmaxtree.cpp:176:16: note: suggested alternative: 'bool'
if(col[i] == 0) {
^~~
bool
minmaxtree.cpp:177:17: error: 'found' was not declared in this scope
found = false;
^~~~~
minmaxtree.cpp:182:16: error: 'good' was not declared in this scope
if(good[i] && !vis[i]) {
^~~~
minmaxtree.cpp:182:16: note: suggested alternative: 'bool'
if(good[i] && !vis[i]) {
^~~~
bool
minmaxtree.cpp:182:28: error: 'vis' was not declared in this scope
if(good[i] && !vis[i]) {
^~~
/var/loc