Language: C++

#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,M,V,P=MI()
    A=LI()
    A.sort()
    rival = N-P
    while rival>0 and A[rival]==A[rival-1]:
        rival-=1
    rival = A[rival]
    def is_ok(x,V):
        # V-=x+1 #自分含め下位
        if x==N-1:
            return True
        if V==N:#全員投票される
            return A[x]>=rival
        print(x,rival-A[x],M)
        return A[x]>=rival or rival-A[x]<=M
        # if V<=0:
        #     return abs(A[x]-rival)<=M
        # if V>=N-1-rival:
        #     return abs(A[x]-rival)
        # else:
        #     print(x)
        #     return abs(A[N-V-1]-A[x])<M
            
        
    print(A)
    ok = N-1
    ng = -1
    while abs(ok-ng)>1:
        mid = (ok-ng)//2
        print(ok,ng,mid,is_ok(mid,V))
        if is_ok(mid,V):
            ok = mid
        else:
            ng = mid
    print(N-ok)
if __name__ == '__main__':
    main()

Compiler output:
a.cc:2:3: error: extended character 　 is not valid in an identifier
    2 | # 　　  ⋀_⋀　
      |   ^
a.cc:2:3: error: extended character 　 is not valid in an identifier
a.cc:2:3: error: invalid preprocessing directive #\U00003000\U00003000
    2 | # 　　  ⋀_⋀　
      |   ^~~~
a.cc:2:9: error: extended character ⋀ is not valid in an identifier
    2 | # 　　  ⋀_⋀　
      |         ^
a.cc:2:9: error: extended character ⋀ is not valid in an identifier
a.cc:2:9: error: extended character 　 is not valid in an identifier
a.cc:3:2: error: extended character 　 is not valid in an identifier
    3 | #　　  (･ω･)
      |  ^
a.cc:3:2: error: extended character 　 is not valid in an identifier
a.cc:3:2: error: invalid preprocessing directive #\U00003000\U00003000
    3 | #　　  (･ω･)
      |  ^~~~
a.cc:4:3: error: invalid preprocessing directive #.
    4 | # .／ Ｕ ∽ Ｕ＼
      |   ^
a.cc:4:10: error: extended character ∽ is not valid in an identifier
    4 | # .／ Ｕ ∽ Ｕ＼
      |          ^
a.cc:5:4: error: extended character │ is not valid in an identifier
    5 | #  │＊　合　＊│
      |    ^
a.cc:5:4: error: extended character 　 is not valid in an identifier
a.cc:5:4: error: extended character 　 is not valid in an identifier
a.cc:5:4: error: extended character │ is not valid in an identifier
a.cc:5:4: error: invalid preprocessing directive #\U00002502\U0000ff0a\U00003000\U00005408\U00003000\U0000ff0a\U00002502
    5 | #  │＊　合　＊│
      |    ^~~~~~~~~~~~
a.cc:6:4: error: extended character │ is not valid in an identifier
    6 | #  │＊　格　＊│
      |    ^
a.cc:6:4: error: extended character 　 is not valid in an identifier
a.cc:6:4: error: extended character 　 is not valid in an identifier
a.cc:6:4: error: extended character │ is not valid in an identifier
a.cc:6:4: error: invalid preprocessing directive #\U00002502\U0000ff0a\U00003000\U0000683c\U00003000\U0000ff0a\U00002502
    6 | #  │＊　格　＊│
      |    ^~~~~~~~~~~~
a.cc:7:4: error: extended character │ is not valid in an identifier
    7 | #  │＊　祈　＊│
      |    ^
a.cc:7:4: error: extended character 　 is not valid in an identifier
a.cc:7:4: error: extended character 　 is not valid in an identifier
a.cc:7:4: error: extended character │ is not valid in an identifier
a.cc:7:4: error: invalid preprocessing directive #\U00002502\U0000ff0a\U00003000\U00007948\U00003000\U0000ff0a\U00002502
    7 | #  │＊　祈　＊│
      |    ^~~~~~~~~~~~
a.cc:8:4: error: extended character │ is not valid in an identifier
    8 | #  │＊　願　＊│
      |    ^
a.cc:8:4: error: extended character 　 is not valid in an identifier
a.cc:8:4: error: extended character 　 is not valid in an identifier
a.cc:8:4: error: extended character │ is not valid in an identifier
a.cc:8:4: error: invalid preprocessing directive #\U00002502\U0000ff0a\U00003000\U00009858\U00003000\U0000ff0a\U00002502
    8 | #  │＊　願　＊│
      |    ^~~~~~~~~~~~
a.cc:9:4: error: extended character │ is not valid in an identifier
    9 | #  │＊　　　＊│
      |    ^
a.cc:9:4: error: extended character 　 is not valid in an identifier
a.cc:9:4: error: extended character 　 is not valid in an identifier
a.cc:9:4: error: extended character 　 is not valid in an identifier
a.cc:9:4: error: extended character │ is not valid in an identifier
a.cc:9:4: error: invalid preprocessing directive #\U00002502\U0000ff0a\U00003000\U00003000\U00003000\U0000ff0a\U00002502
    9 | #  │＊　　　＊│
      |    ^~~~~~~~~~~~
a.cc:10:8: error: invalid preprocessing directive #\U0000ffe3
   10 | #      ￣
      |        ^~
a.cc:15:54: error: stray '#' in program
   15 | from math import floor,ceil,sqrt,factorial,hypot,log #log2ないｙｐ
      |                                                      ^
a.cc:21:11: warning: multi-character character constant [-Wmultichar]
   21 | inf=float('inf')
      |           ^~~~~
a.cc:38:40: error: empty character constant
   38 | def ST(): return input().replace('\n', '')
      |                                        ^~
a.cc:48:11: error: invalid preprocessing directive #V
   48 |         # V-=x+1 #自分含め下位
      |           ^
a.cc:51:17: error: stray '#' in program
   51 |         if V==N:#全員投票される
      |                 ^
a.cc:55:18: error:  ':' without preceding '?'
   55 |         # if V<=0:
      |                  ^
a.cc:57: error: unterminated #else
   57 |         # if V>=N-1-rival:
a.cc:55: error: unterminated #if
   55 |         # if V<=0:
a.cc:12:1: error: 'import' does not name a type
   12 | import sys
      | ^~~~~~
a.cc:12:1: note: C++20 'import' only available with '-fmodules-ts'