結果

問題 No.1380 Borderline
ユーザー jj1guj
提出日時 2021-02-07 20:39:16
言語 Fortran
(gFortran 14.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 331 bytes
コンパイル時間 517 ms
コンパイル使用メモリ 32,640 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 17:02:04
合計ジャッジ時間 1,569 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
    implicit none
    integer::N,K,ans=0,ref,i,j
    integer,allocatable::P(:)
    read*,N,K
    allocate(P(N))
    read*,P
    do i=minval(P)-1,maxval(P)+1
        ref=0
        do j=1,N
            if(P(j)>=i)ref=ref+1
        end do
        if(ref<=K)ans=max(ans,ref)
    end do
    print'(i0)',ans
end program main
0