結果

問題 No.482 あなたの名は
ユーザー jjjj
提出日時 2017-02-10 22:37:53
言語 Fortran
(gFortran 13.2.0)
結果
WA  
実行時間 -
コード長 680 bytes
コンパイル時間 1,240 ms
コンパイル使用メモリ 26,900 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-27 22:39:03
合計ジャッジ時間 3,482 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 50 ms
4,392 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 49 ms
4,384 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 49 ms
4,428 KB
testcase_24 AC 48 ms
4,384 KB
testcase_25 AC 50 ms
4,380 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 49 ms
4,396 KB
testcase_29 AC 49 ms
4,376 KB
testcase_30 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.f90:31:30:

     write(cformat(5:9),'(i0)'),size(array)
                              1
Warning: Legacy Extension: Comma before i/o item list at (1)

ソースコード

diff #

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

  do i=1, N-1
     if(D(i).ne.i) then
        tmp = D(i)
        D(i) = D(tmp)
        D(tmp) = tmp
        count = count + 1
     end if
  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
!  call aprinter(D)
contains
  subroutine aprinter(array)
    integer*8::array(:)
    character*32::cformat='(i0,     (1x,i0))'
    write(cformat(5:9),'(i0)'),size(array)
    write(*,cformat) array
  end subroutine aprinter
end program main
0