61822023-11-05 20:32:59jeviczkiKártyajátékpython3Accepted 30/30133ms51736 KiB
from sys import stdin, stderr
def main():
    n,k=(int(x) for x in stdin.readline().split())
    ke=[int(x) for x in stdin.readline().split()]
    h=sorted(ke)[::-1]
    u, v=0,0
    for x in ke:
        if (x<u): continue
        u=x 
        if h[-1]<x:v+=1
        while len(h)>0 and h[-1]<=x:
            h.pop()
    print(v)






main()
SubtaskSumTestVerdictTimeMemory
base30/30
1Accepted0/017ms11252 KiB
2Accepted0/0133ms38416 KiB
3Accepted1/118ms13776 KiB
4Accepted1/117ms14252 KiB
5Accepted1/117ms14172 KiB
6Accepted2/217ms14344 KiB
7Accepted2/217ms14740 KiB
8Accepted2/218ms14796 KiB
9Accepted1/178ms30916 KiB
10Accepted2/2109ms37188 KiB
11Accepted3/3109ms38120 KiB
12Accepted3/3108ms38744 KiB
13Accepted1/1125ms43768 KiB
14Accepted2/2127ms45656 KiB
15Accepted3/3127ms47676 KiB
16Accepted3/3129ms49744 KiB
17Accepted3/3128ms51736 KiB