Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#define F first
#define S second
using namespace std;
typedef pair<int, int> P;
const int INF = 1 << 30;
int main(){
????int n, m;
????int dp[2000];
????P doll[2000];
????while(cin >> n && n){
????????fill(doll, doll+2000, P(0, 0));
????????fill(dp, dp + 2000, INF);
????????for (int i = 0; i < n; i++){
????????????int a, b;
????????????cin >> a >> b;
????????????doll[i] = P(a, b);
????????}
????????cin >> m;
????????for (int i = n; i < n + m; i++){
????????????int a, b;
????????????cin >> a >> b;
????????????doll[i] = P(a, b);
????????}
????????sort(doll, doll + n + m);
????????for (int i = 0; i < n + m; i++){
????????*lower_bound(dp, dp + 2000, doll[i].S) = doll[i].S;
????????}
??????????int ans;
????????????????for(int i=n+m-1; i>=0; --i){
????????????????????????if(dp[i] != INF){
????????????????????????????????ans = i + 1;
????????????????????????????????break;
????????????????????????}
????????????????}
????????cout << ans << endl;
????}
????return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:1: error: expected primary-expression before '?' token
   10 | ????int n, m;
      | ^
a.cc:10:2: error: expected primary-expression before '?' token
   10 | ????int n, m;
      |  ^
a.cc:10:3: error: expected primary-expression before '?' token
   10 | ????int n, m;
      |   ^
a.cc:10:4: error: expected primary-expression before '?' token
   10 | ????int n, m;
      |    ^
a.cc:10:5: error: expected primary-expression before 'int'
   10 | ????int n, m;
      |     ^~~
a.cc:10:5: error: expected ':' before 'int'
   10 | ????int n, m;
      |     ^~~
      |     :
a.cc:10:5: error: expected primary-expression before 'int'
   10 | ????int n, m;
      |     ^~~
a.cc:10:5: error: expected ':' before 'int'
   10 | ????int n, m;
      |     ^~~
      |     :
a.cc:10:5: error: expected primary-expression before 'int'
   10 | ????int n, m;
      |     ^~~
a.cc:10:5: error: expected ':' before 'int'
   10 | ????int n, m;
      |     ^~~
      |     :
a.cc:10:5: error: expected primary-expression before 'int'
   10 | ????int n, m;
      |     ^~~
a.cc:10:5: error: expected ':' before 'int'
   10 | ????int n, m;
      |     ^~~
      |     :
a.cc:10:5: error: expected primary-expression before 'int'
   10 | ????int n, m;
      |     ^~~
a.cc:11:1: error: expected primary-expression before '?' token
   11 | ????int dp[2000];
      | ^
a.cc:11:2: error: expected primary-expression before '?' token
   11 | ????int dp[2000];
      |  ^
a.cc:11:3: error: expected primary-expression before '?' token
   11 | ????int dp[2000];
      |   ^
a.cc:11:4: error: expected primary-expression before '?' token
   11 | ????int dp[2000];
      |    ^
a.cc:11:5: error: expected primary-expression before 'int'
   11 | ????int dp[2000];
      |     ^~~
a.cc:11:5: error: expected ':' before 'int'
   11 | ????int dp[2000];
      |     ^~~
      |     :
a.cc:11:5: error: expected primary-expression before 'int'
   11 | ????int dp[2000];
      |     ^~~
a.cc:11:5: error: expected ':' before 'int'
   11 | ????int dp[2000];
      |     ^~~
      |     :
a.cc:11:5: error: expected primary-expression before 'int'
   11 | ????int dp[2000];
      |     ^~~
a.cc:11:5: error: expected ':' before 'int'
   11 | ????int dp[2000];
      |     ^~~
      |     :
a.cc:11:5: error: expected primary-expression before 'int'
   11 | ????int dp[2000];
      |     ^~~
a.cc:11:5: error: expected ':' before 'int'
   11 | ????int dp[2000];
      |     ^~~
      |     :
a.cc:11:5: error: expected primary-expression before 'int'
   11 | ????int dp[2000];
      |     ^~~
a.cc:12:1: error: expected primary-expression before '?' token
   12 | ????P doll[2000];
      | ^
a.cc:12:2: error: expected primary-expression before '?' token
   12 | ????P doll[2000];
      |  ^
a.cc:12:3: error: expected primary-expression before '?' token
   12 | ????P doll[2000];
      |   ^
a.cc:12:4: error: expected primary-expression before '?' token
   12 | ????P doll[2000];
      |    ^
a.cc:12:7: error: expected primary-expression before 'doll'
   12 | ????P doll[2000];
      |       ^~~~
a.cc:12:6: error: expected ':' before 'doll'
   12 | ????P doll[2000];
      |      ^~~~~
      |      :
a.cc:12:7: error: 'doll' was not declared in this scope
   12 | ????P doll[2000];
      |       ^~~~
a.cc:12:17: error: expected ':' before ';' token
   12 | ????P doll[2000];
      |                 ^
      |                 :
a.cc:12:17: error: expected primary-expression before ';' token
a.cc:12:17: error: expected ':' before ';' token
   12 | ????P doll[2000];
      |                 ^
      |                 :
a.cc:12:17: error: expected primary-expression before ';' token
a.cc:12:17: error: expected ':' before ';' token
   12 | ????P doll[2000];
      |                 ^
      |                 :
a.cc:12:17: error: expected primary-expression before ';' token
a.cc:13:1: error: expected primary-expression before '?' token
   13 | ????while(cin >> n && n){
      | ^
a.cc:13:2: error: expected primary-expression before '?' token
   13 | ????while(cin >> n && n){
      |  ^
a.cc:13:3: error: expected primary-expression before '?' token
   13 | ????while(cin >> n && n){
      |   ^
a.cc:13:4: error: expected primary-expression before '?' token
   13 | ????while(cin >> n && n){
      |    ^
a.cc:13:5: error: expected primary-expression before 'while'
   13 | ????while(cin >> n && n){
      |     ^~~~~
a.cc:13:5: error: expected ':' before 'while'
   13 | ????while(cin >> n && n){
      |     ^~~~~
      |     :
a.cc:13:5: error: expected primary-expression before 'while'
   13 | ????while(cin >> n && n){
      |     ^~~~~
a.cc:13:5: error: expected ':' before 'while'
   13 | ????while(cin >> n && n){
      |     ^~~~~
      |     :
a.cc:13:5: error: expected primary-expression before 'while'
   13 | ????while(cin >> n && n){
      |     ^~~~~
a.cc:13:5: error: expected ':' before 'while'
   13 | ????while(cin >> n && n){
      |     ^~~~~
      |     :
a.cc:13:5: error: expected primary-expression before 'while'
   13 | ????while(cin >> n && n){
      |     ^~~~~
a.cc:13:5: error: expected ':' before 'while'
   13 | ????while(cin >> n && n){
      |     ^~~~~
      |     :
a.cc:13:5: error: expected primary-expression before 'while'
   13 | ????while(cin >> n && n){
      |     ^~~~~
a.cc:40:1: error: expected primary-expression before '?' token
   40 | ????return 0;
      | ^
a.cc:40:2: error: expected primary-expression before '?' token
   40 | ????return 0;
      |  ^
a.cc:40:3: error: expected primary-expression before '?' token
   40 | ????return 0;
      |   ^
a.cc:40:4: error: expected primary-expression before '?' token
   40 | ????return 0;
      |    ^
a.cc:40:5: error: expected primary-expression before 'return'
   40 | ????return 0;
      |     ^~~~~~
a.cc:40:5: error: expected ':' before 'return'
   40 | ????return 0;
      |     ^~~~~~
      |     :
a.cc:40:5: error: expected primary-expression before 'return'
   40 | ????return 0;
      |     ^~~~~~
a.cc:40:5: error: expected ':' before 'return'
   40 | ????return 0;
      |     ^~~~~~
      |     :
a.cc:40:5: error: expected primary-expression before 'return'
   40 | ????return 0;
      |     ^~~~~~
a.cc:40:5: error: expected ':' before 'return'
   40 | ????return 0;
      |     ^~~~~~
      |     :
a.cc:40:5: error: expected primary-expression before 'return'
   40 | ????return 0;
      |     ^~~~~~
a.cc:40:5: error: expected ':' before 'return'
   40 | ????return 0;
      |     ^~~~~~
      |     :
a.cc:40:5: error: expected primary-expression before 'return'
   40 | ????return 0;
      |     ^~~~~~