gift.cpp:1:9: error: 'pair' does not name a type
1 | typedef pair<int, int> pii;
| ^~~~
gift.cpp:3:12: error: variable or field 'craft' declared void
3 | void craft(string& s);
| ^~~~~~
gift.cpp:3:12: error: 'string' was not declared in this scope
gift.cpp:3:20: error: 's' was not declared in this scope
3 | void craft(string& s);
| ^
gift.cpp:5:29: error: 'vector' has not been declared
5 | int construct(int n, int r, vector<int> a, vector<int> b, vector<int> x){
| ^~~~~~
gift.cpp:5:35: error: expected ',' or '...' before '<' token
5 | int construct(int n, int r, vector<int> a, vector<int> b, vector<int> x){
| ^
gift.cpp: In function 'int construct(int, int, int)':
gift.cpp:6:2: error: 'vector' was not declared in this scope
6 | vector<pii> one, two;
| ^~~~~~
gift.cpp:6:9: error: 'pii' was not declared in this scope
6 | vector<pii> one, two;
| ^~~
gift.cpp:6:14: error: 'one' was not declared in this scope
6 | vector<pii> one, two;
| ^~~
gift.cpp:6:19: error: 'two' was not declared in this scope
6 | vector<pii> one, two;
| ^~~
gift.cpp:8:6: error: 'x' was not declared in this scope
8 | if(x[i] == 1) one.push_back({a[i], b[i]});
| ^
gift.cpp:8:32: error: 'a' was not declared in this scope
8 | if(x[i] == 1) one.push_back({a[i], b[i]});
| ^
gift.cpp:8:38: error: 'b' was not declared in this scope
8 | if(x[i] == 1) one.push_back({a[i], b[i]});
| ^
gift.cpp:9:6: error: 'x' was not declared in this scope
9 | if(x[i] == 2) two.push_back({a[i], b[i]});
| ^
gift.cpp:9:32: error: 'a' was not declared in this scope
9 | if(x[i] == 2) two.push_back({a[i], b[i]});
| ^
gift.cpp:9:38: error: 'b' was not declared in this scope
9 | if(x[i] == 2) two.push_back({a[i], b[i]});
| ^
gift.cpp:11:2: error: 'sort' was not declared in this scope; did you mean 'short'?
11 | sort(one.begin(), one.end());
| ^~~~
| short
gift.cpp:13:2: error: 'string' was not declared in this scope
13 | string ans(n, 'R');
| ^~~~~~
gift.cpp:17:4: error: 'ans' was not declared in this scope
17 | ans[f] = ans[f-1] == 'R'? 'B' : 'R';
| ^~~
gift.cpp:21:4: error: 'ans' was not declared in this scope
21 | ans[f] = ans[f-1];
| ^~~
gift.cpp:26:9: error: expected primary-expression before 'int'
26 | vector<int> vld(two.size(), 1);
| ^~~
gift.cpp:29:21: error: 'ans' was not declared in this scope
29 | while(diff < n && ans[diff] == ans[diff - 1]) ++diff;
| ^~~
gift.cpp:32:32: error: 'vld' was not declared in this scope
32 | if(two[idx].second >= diff) vld[idx] = 1;
| ^~~
gift.cpp:36:14: error: 'vld' was not declared in this scope
36 | for(int i : vld) if(!i) return 0;
| ^~~
gift.cpp:37:8: error: 'ans' was not declared in this scope
37 | craft(ans);
| ^~~
gift.cpp:37:2: error: 'craft' was not declared in this scope
37 | craft(ans);
| ^~~~~