結果

問題 No.482 あなたの名は
ユーザー jj
提出日時 2017-02-10 22:28:22
言語 Fortran
(gFortran 14.2.0)
結果
WA  
実行時間 -
コード長 503 bytes
コンパイル時間 2,056 ms
コンパイル使用メモリ 32,512 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-12-28 06:31:02
合計ジャッジ時間 31,940 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 3 RE * 6 TLE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer::N,K,i,j,count,tmp
  integer,allocatable::D(:)
  data count/0/
  read *,N,K
  allocate(D(N))
  read *,D

  do i=1, N-1
     do j=1, N-i
        if(D(j).gt.D(j+1)) then
           tmp = D(j+1)
           D(j+1) = D(j)
           D(j) = tmp
           count = count + 1
        end if
     end do
  end do
  if(count .gt. K ) then
     print '("NO")'
  else if(MOD(count,2).eq.MOD(K,2)) then
     print '("YES")'
  else
     print '("NO")'
  end if
end program main
0