Language: Java

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair < int , pair < int , int > > mp;

#define rep(i , j , n) for(long long i = j ; i <= n ; i++)
#define per(i , j , n) for(long long i = j ; i >= n ; i--)
 
const ll N = 153456;
const ll mod = 1e9 + 7;
const ld eps = 1e-6;
const ld pi = 3.1415926535;
long long a[N];

const long long LIM = 6e5 + 5;
long long seg[LIM];
long long lazy[LIM];
bool push[LIM];

long long combine(long long &a, long long &b) {
    return max(a, b);
}
void propagate(long long t, long long i, long long j) {
    if (push[t]) {
        seg[t] = seg[t] + lazy[t];
        if (i != j) {
            push[t*2] = true;
            push[t*2 + 1] = true;
            lazy[t*2] = lazy[t*2] + lazy[t];
            lazy[t*2 + 1] = lazy[t*2 + 1] + lazy[t];
        }
        push[t] = false;
        lazy[t] = 0;
    }
}
void build(long long t, long long i, long long j) {
    push[t] = false;
    lazy[t] = 0;
    if (i == j) {
        seg[t] = a[i];
        return ;
    }
    long long mid = (i + j) / 2;
    build(t*2, i, mid);
    build(t*2 + 1, mid + 1, j);
    seg[t] = combine(seg[2*t], seg[2*t+1]);
}
void update(long long t, long long i, long long j, long long l, long long r, long long x) {
    propagate(t, i, j);
    if (i > r || j < l) {
        return ;
    }
    if (l <= i && j <= r) {
        lazy[t] += x;
        push[t] = true;
        propagate(t, i, j);
        return ;
    }
    long long mid = (i + j) / 2;
    update(t*2, i, mid, l, r, x);
    update(t*2 + 1, mid + 1, j, l, r, x);
    seg[t] = combine(seg[2*t], seg[2*t+1]);
}
long long query(long long t, long long i, long long j, long long l, long long r) {
    propagate(t, i, j);
    if (i > r || j < l) {
        return 0;
    }
    if (l <= i && j <= r) {
        return seg[t];
    }
    long long mid = (i + j) / 2;
    if (l <= mid) {
        if (r <= mid) {
            return query(t*2, i, mid, l, r);
        }
        else {
            long long a = query(t*2, i, mid, l, r);
            long long b = query(t*2 + 1,  mid + 1, j, l, r);
            return combine(a, b);
        }
    }
    else {
        return query(t*2 + 1,  mid + 1, j, l, r);
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 
    cout << fixed << setprecision(12);

    int n , k , q;
    cin >> n >> k >> q;

    rep(i , 1 , n) a[i] = k;

    build(1 , 1 , n);
    while(q--) {
        int x;
        cin >> x;
        update(1 , 1 , n , 1 , x - 1 , -1);
        update(1 , 1 , n , x + 1 , n , -1);
    }

    rep(i , 1 , n) {
        int x = query(1 , 1 , n , i , i);
        string s = "";
        if(x <= 0) {
            s = "No";
        }
        else {
            s = "Yes";
        }
        cout << s << endl;
    }
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:5: error: class, interface, enum, or record expected
typedef long long ll;
^
Main.java:6: error: class, interface, enum, or record expected
typedef long double ld;
^
Main.java:7: error: class, interface, enum, or record expected
typedef pair < int , pair < int , int > > mp;
^
Main.java:9: error: illegal character: '#'
#define rep(i , j , n) for(long long i = j ; i <= n ; i++)
^
Main.java:9: error: class, interface, enum, or record expected
#define rep(i , j , n) for(long long i = j ; i <= n ; i++)
        ^
Main.java:9: error: class, interface, enum, or record expected
#define rep(i , j , n) for(long long i = j ; i <= n ; i++)
                                             ^
Main.java:9: error: class, interface, enum, or record expected
#define rep(i , j , n) for(long long i = j ; i <= n ; i++)
                                                      ^
Main.java:10: error: illegal character: '#'
#define per(i , j , n) for(long long i = j ; i >= n ; i--)
^
Main.java:10: error: class, interface, enum, or record expected
#define per(i , j , n) for(long long i = j ; i >= n ; i--)
                                             ^
Main.java:10: error: class, interface, enum, or record expected
#define per(i , j , n) for(long long i = j ; i >= n ; i--)
                                                      ^
Main.java:13: error: class, interface, enum, or record expected
const ll mod = 1e9 + 7;
^
Main.java:14: error: class, interface, enum, or record expected
const ld eps = 1e-6;
^
Main.java:15: error: class, interface, enum, or record expected
const ld pi = 3.1415926535;
^
Main.java:16: error: class, interface, enum, or record expected
long long a[N];
^
Main.java:18: error: class, interface, enum, or record expected
const long long LIM = 6e5 + 5;
^
Main.java:19: error: class, interface, enum, or record expected
long long seg[LIM];
^
Main.java:20: error: class, interface, enum, or record expected
long long lazy[LIM];
^
Main.java:21: error: class, interface, enum, or record expected
bool push[LIM];
^
Main.java:23: error: class, interface, enum, or record expected
long long combine(long long &a, long long &b) {
^
Main.java:25: error: class, interface, enum, or record expected
}
^
Main.java:29: error: class, interface, enum, or record expected
        if (i != j) {
        ^
Main.java:31: error: class, interface, enum, or record expected
            push[t*2 + 1] = true;
            ^
Main.java:32: error: class, interface, enum, or record expected
            lazy[t*2] = lazy[t*2] + lazy[t];
            ^
Main.java:33: error: class, interface, enum, or record expected
            lazy[t*2 + 1] = lazy[t*2 + 1] + lazy[t];
            ^
Main.java:34: error: class, interface, enum, or record expected
        }
        ^
Main.java:36: error: class, interface, enum, or record expected
        lazy[t] = 0;
        ^
Main.java:37: error: class, interface, enum, or record expected
    }
    ^
Main.java:41: error: class, interface, enum, or record expected
    lazy[t] = 0;
    ^
Main.java:42: error: class, interface, enum, or record expected
    if (i == j) {
    ^
Main.java:44: error: class, interface, enum, or record expected
        return ;
        ^
Main.java:45: error: class, interface, enum, or record expected
    }
    ^
Main.java:47: error: class, interface, enum, or record expected
    build(t*2, i, mid);
    ^
Main.java:48: error: class, interface, enum, or record expected
    build(t*2 + 1, mid + 1, j);
    ^
Main.java:49: error: class, interface, enum, or record expected
    seg[t] = combine(seg[2*t], seg[2*t+1]);
    ^
Main.java:50: error: class, interface, enum, or record expected
}
^
Main.java:53: error: class, interface, enum, or record expected
    if (i > r || j < l) {
    ^
Main.java:55: error: class, interface, enum, or record expected
    }
    ^
Main.java:58: error: class, interface, enum, or record expected
        push[t] = true;
        ^
Main.java:59: error: class, interface, enum, or record expected
        propagate(t, i, j);
        ^
Main.java:60: error: class, interface, enum, or record expected
        return ;
        ^
Main.java:61: error: class, interface, enum, or record expected
    }
    ^
Main.java:63: error: class, interface, enum, or record expected
    update(t*2, i, mid, l, r, x);
    ^
Main.java:64: error: class, interface, enum, or record expected
    update(t*2 + 1, mid + 1, j, l, r, x);
    ^
Main.java:65: error: class, interface, enum, or record expected
    seg[t] = combine(seg[2*t], seg[2*t+1]);
    ^
Main.java:66: error: class, interface, enum, or record expected
}
^
Main.java:69: error: class, interface, enum, or record expected
    if (i > r || j < l) {
    ^
Main.java:71: error: class, interface, enum, or record expected
    }
    ^
Main.java:74: error: class, interface, enum, or record expected
    }
    ^
Main.java:76: error: class, interface, enum, or record expected
    if (l <= mid) {
    ^
Main.java:79: error: class, interface, enum, or record expected
        }
        ^
Main.java:82: error: class, interface, enum, or record expected
            long long b = query(t*2 + 1,  mid + 1, j, l, r);
            ^
Main.java:83: error: class, interface, enum, or record expected
            return combine(a, b);
            ^
Main.java:84: error: class, interface, enum, or record expected
        }
        ^
Main.java:88: error: class, interface, enum, or record expected
    }
    ^
Main.java:93: error: class, interface, enum, or record expected
    cin.tie(NULL);
    ^
Main.java:95: error: class, interface, enum, or record expected
    cout << fixed << setprecision(12);
    ^
Main.java:97: error: class, interface, enum, or record expected
    int n , k , q;
    ^
Main.java:98: error: class, interface, enum, or record expected
    cin >> n >> k >> q;
    ^
Main.java:100: error: class, interface, enum, or record expected
    rep(i , 1 , n) a[i] = k;
    ^
Main.java:102: error: class, interface, enum, or record expected
    build(1 , 1 , n);
    ^
Main.java:103: error: class, interface, enum, or record expected
    while(q--) {
    ^
Main.java:105: error: class, interface, enum, or record expected
        cin >> x;
        ^
Main.java:106: error: class, interface, enum, or record expected
        update(1 , 1 , n , 1 , x - 1 , -1);
        ^
Main.java:107: error: class, interface, enum, or record expected
        update(1 , 1 , n , x + 1 , n , -1);
        ^
Main.java:108: error: class, interface, enum, or record expected
    }
    ^
Main.java:112: error: unnamed classes are a preview feature and are disabled by default.
        string s = "";
        ^
  (use --enable-preview to enable unnamed classes)
Main.java:113: error: class, interface, enum, or record expected
        if(x <= 0) {
        ^
Main.java:115: error: class, interface, enum, or record expected
        }
        ^
Main.java:118: error: class, interface, enum, or record expected
        }
        ^
Main.java:120: error: class, interface, enum, or record expected
    }
    ^
Main.java:122: error: class, interface, enum, or record expected
}
^
73 errors