factories.cpp:7:9: error: 'pair' does not name a type
typedef pair <ll, ll> pll;
^
factories.cpp:15:1: error: 'vector' does not name a type
vector <pll> conn[500050];
^
factories.cpp: In function 'void DFS(int)':
factories.cpp:19:17: error: 'conn' was not declared in this scope
for (auto it : conn[n]) {
^
factories.cpp: At global scope:
factories.cpp:32:1: error: 'pll' does not name a type
pll lca(int a, int b) {
^
factories.cpp: In function 'void Init(int, int*, int*, int*)':
factories.cpp:59:3: error: 'conn' was not declared in this scope
conn[A[i]].emplace_back(D[i], B[i]);
^
factories.cpp:57:9: warning: unused variable 'j' [-Wunused-variable]
int i, j;
^
factories.cpp: In function 'void update(int, int, int, int, int, ll)':
factories.cpp:85:22: error: 'min' was not declared in this scope
update(st, min(en, M), S, M, 2 * n, v);
^
factories.cpp:85:22: note: suggested alternative:
In file included from /usr/include/c++/5/algorithm:62:0,
from factories.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:3451:5: note: 'std::min'
min(initializer_list<_Tp> __l, _Compare __comp)
^
factories.cpp:86:22: error: 'max' was not declared in this scope
update(max(M + 1, st), en, M + 1, E, 2 * n + 1, v);
^
factories.cpp:86:22: note: suggested alternative:
In file included from /usr/include/c++/5/algorithm:62:0,
from factories.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:3463:5: note: 'std::max'
max(initializer_list<_Tp> __l, _Compare __comp)
^
factories.cpp: At global scope:
factories.cpp:91:1: error: 'vector' does not name a type
vector <int> Vv;
^
factories.cpp:92:1: error: 'vector' does not name a type
vector <int> Vv2;
^
factories.cpp:93:1: error: 'vector' does not name a type
vector <pll> conn2[500050];
^
factories.cpp:94:1: error: 'vector' does not name a type
vector <pll> son2[500050];
^
factories.cpp: In function 'void DFS2(int)':
factories.cpp:101:17: error: 'conn2' was not declared in this scope
for (auto it : conn2[n]) {
^
factories.cpp:103:3: error: 'son2' was not declared in this scope
son2[n].push_back(it);
^
factories.cpp: In function 'void DFS3(int)':
factories.cpp:110:47: error: 'min' was not declared in this scope
if (tchk[n] == 1) qans = min(qans, indt[1].mn);
^
factories.cpp:110:47: note: suggested alternative:
In file included from /usr/include/c++/5/algorithm:62:0,
from factories.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:3451:5: note: 'std::min'
min(initializer_list<_Tp> __l, _Compare __comp)
^
factories.cpp:111:17: error: 'son2' was not declared in this scope
for (auto it : son2[n]) {
^
factories.cpp:113:51: error: 'IT_MAX' was not declared in this scope
update(lr2[it.second][0], lr2[it.second][1], 1, IT_MAX, 1, -2 * it.first);
^
factories.cpp: In function 'long long int Query(int, int*, int, int*)':
factories.cpp:120:2: error: 'Vv' was not declared in this scope
Vv.reserve(2 * (S + T));
^
factories.cpp:121:2: error: 'Vv2' was not declared in this scope
Vv2.reserve(S + T);
^
factories.cpp:125:13: error: 'all' was not declared in this scope
sort(all(Vv), [](int a, int b) {
^
factories.cpp:127:3: error: 'sort' was not declared in this scope
});
^
factories.cpp:127:3: note: suggested alternative:
In file included from /usr/include/c++/5/algorithm:62:0,
from factories.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:4718:5: note: 'std::sort'
sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
^
factories.cpp:129:72: error: 'lca' was not declared in this scope
for (i = 0; i + 1 < Vv.size(); i++) Vv2.push_back(lca(Vv[i], Vv[i + 1]).second);
^
factories.cpp:130:17: error: unable to deduce 'auto&&' from 'Vv2'
for (auto it : Vv2) Vv.push_back(it);
^
factories.cpp:134:25: error: 'unique' was not declared in this scope
Vv.erase(unique(all(Vv)), Vv.end());
^
factories.cpp:134:25: note: suggested alternative:
In file included from /usr/include/c++/5/algorithm:62:0,
from factories.cpp:1:
/usr/include/c++/5/bits/stl_algo.h:1022:5: note: 'std::unique'
unique(_ForwardIterator __first, _ForwardIterator __last,
^
factories.cpp:135:17: error: unable to deduce 'auto&&' from 'Vv'
for (auto it : Vv) tchk[it] = 0;
^
factories.cpp:142:15: error: 'lca' was not declared in this scope
x = lca(x, y).second;
^
factories.cpp:143:3: error: 'pll' was not declared in this scope
pll u = lca(x, y);
^
factories.cpp:144:3: error: 'conn2' was not declared in this scope
conn2[x].emplace_back(u.first, y);
^
factories.cpp:144:25: error: 'u' was not declared in this scope
conn2[x].emplace_back(u.first, y);
^
factories.cpp:154:7: error: 'IT_MAX' was not declared in this scope
for (IT_MAX = 2; IT_MAX < Vv.size(); IT_MAX *= 2);
^
factories.cpp:155:22: error: 'IT_MAX' was not declared in this scope
for (i = 1; i < 2 * IT_MAX; i++) indt[i] = Node(0, 0);
^
factories.cpp:160:43: error: 'IT_MAX' was not declared in this scope
update(lr2[Vv[i]][0], lr2[Vv[i]][0], 1, IT_MAX, 1, v);
^
factories.cpp:162:24: error: 'IT_MAX' was not declared in this scope
update(Vv.size() + 1, IT_MAX, 1, IT_MAX, 1, LL_INF);
^
factories.cpp:166:17: error: unable to deduce 'auto&&' from 'Vv'
for (auto it : Vv) {
^
factories.cpp:167:3: error: 'conn2' was not declared in this scope
conn2[it].clear();
^
factories.cpp:168:3: error: 'son2' was not declared in this scope
son2[it].clear();
^
factories.cpp:122:9: warning: unused variable 'j' [-Wunused-variable]
int i, j;
^