Language: C++

1.#include <cstdio>
2.#include <cstring>
3.#include <cmath>
4.#include <algorithm>
5.#include <vector>
6.#include <string>
7.#include <map>
8.#include <set>
9.#include <cassert>
10.using namespace std;
11.#define rep(i,a,n) for (int i=a;i<n;i++)
12.#define per(i,a,n) for (int i=n-1;i>=a;i--)
13.#define pb push_back
14.#define mp make_pair
15.#define all(x) (x).begin(),(x).end()
16.#define fi first
17.#define se second
18.#define SZ(x) ((int)(x).size())
19.typedef vector<int> VI;
20.typedef long long ll;
21.typedef pair<int,int> PII;
22.const ll mod=1000000007;
23.ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
24.// head
25. 
26.const int N=201000;
27.int p[N],q[N],n;
28.bool check(int x) {
29.	rep(i,1,2*n) if (p[i]>=x) q[i]=1; else q[i]=0;
30.	int pr=1;
31.//	rep(i,1,2*n) printf("%d",q[i]);
32.//	puts("");
33.	rep(i,2,2*n+1) {
34.		if (q[i]==q[i-1]||i==2*n) {
35.			if (pr==i-1) pr=i;
36.			else {
37.				if (q[pr]==q[i-1]) {
38.					rep(j,pr,i) q[j]=q[pr];
39.				} else {
40.					int md=(pr+i)/2;
41.					rep(j,pr,md) q[j]=q[pr];
42.					rep(j,md,i) q[j]=q[i-1];
43.				}
44.				pr=i;
45.			}
46.		}
47.	}
48.//	rep(i,1,2*n) printf("%d",q[i]);
49.//	puts("");
50.	return q[n];
51.}
52.int main() {
53.	scanf("%d",&n);
54.	rep(i,1,2*n) scanf("%d",p+i);
55.	int l=0,r=2*n-1;
56.	while (l+1<r) {
57.		int md=(l+r)>>1;
58.		if (check(md)==0) r=md; else l=md;
59.	}
60.	printf("%d\n",l);
61.}



Compiler output:
a.cc:1:3: error: stray '#' in program
    1 | 1.#include <cstdio>
      |   ^
a.cc:2:3: error: stray '#' in program
    2 | 2.#include <cstring>
      |   ^
a.cc:3:3: error: stray '#' in program
    3 | 3.#include <cmath>
      |   ^
a.cc:4:3: error: stray '#' in program
    4 | 4.#include <algorithm>
      |   ^
a.cc:5:3: error: stray '#' in program
    5 | 5.#include <vector>
      |   ^
a.cc:6:3: error: stray '#' in program
    6 | 6.#include <string>
      |   ^
a.cc:7:3: error: stray '#' in program
    7 | 7.#include <map>
      |   ^
a.cc:8:3: error: stray '#' in program
    8 | 8.#include <set>
      |   ^
a.cc:9:3: error: stray '#' in program
    9 | 9.#include <cassert>
      |   ^
a.cc:11:4: error: stray '#' in program
   11 | 11.#define rep(i,a,n) for (int i=a;i<n;i++)
      |    ^
a.cc:12:4: error: stray '#' in program
   12 | 12.#define per(i,a,n) for (int i=n-1;i>=a;i--)
      |    ^
a.cc:13:4: error: stray '#' in program
   13 | 13.#define pb push_back
      |    ^
a.cc:14:4: error: stray '#' in program
   14 | 14.#define mp make_pair
      |    ^
a.cc:15:4: error: stray '#' in program
   15 | 15.#define all(x) (x).begin(),(x).end()
      |    ^
a.cc:16:4: error: stray '#' in program
   16 | 16.#define fi first
      |    ^
a.cc:17:4: error: stray '#' in program
   17 | 17.#define se second
      |    ^
a.cc:18:4: error: stray '#' in program
   18 | 18.#define SZ(x) ((int)(x).size())
      |    ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1.#include <cstdio>
      | ^~
a.cc:11:1: error: expected unqualified-id before numeric constant
   11 | 11.#define rep(i,a,n) for (int i=a;i<n;i++)
      | ^~~
a.cc:11:36: error: 'i' does not name a type
   11 | 11.#define rep(i,a,n) for (int i=a;i<n;i++)
      |                                    ^
a.cc:11:40: error: 'i' does not name a type
   11 | 11.#define rep(i,a,n) for (int i=a;i<n;i++)
      |                                        ^
a.cc:12:38: error: 'i' does not name a type
   12 | 12.#define per(i,a,n) for (int i=n-1;i>=a;i--)
      |                                      ^
a.cc:12:43: error: 'i' does not name a type
   12 | 12.#define per(i,a,n) for (int i=n-1;i>=a;i--)
      |                                           ^
a.cc:20:1: error: expected unqualified-id before numeric constant
   20 | 20.typedef long long ll;
      | ^~~~~~~~~~
a.cc:21:1: error: expected unqualified-id before numeric constant
   21 | 21.typedef pair<int,int> PII;
      | ^~~~~~~~~~
a.cc:22:1: error: expected unqualified-id before numeric constant
   22 | 22.const ll mod=1000000007;
      | ^~~~~~~~
a.cc:23:1: error: expected unqualified-id before numeric constant
   23 | 23.ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
      | ^~~~~
a.cc:24:1: error: expected unqualified-id before numeric constant
   24 | 24.// head
      | ^~~
a.cc:27:1: error: expected unqualified-id before numeric constant
   27 | 27.int p[N],q[N],n;
      | ^~~~~~
a.cc:28:1: error: expected unqualified-id before numeric constant
   28 | 28.bool check(int x) {
      | ^~~~~~~
a.cc:52:1: error: expected unqualified-id before numeric constant
   52 | 52.int main() {
      | ^~~~~~