結果

問題 No.482 あなたの名は
ユーザー jjjj
提出日時 2017-02-10 22:58:49
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 929 bytes
コンパイル時間 1,412 ms
コンパイル使用メモリ 26,952 KB
実行使用メモリ 4,424 KB
最終ジャッジ日時 2023-08-28 16:14:29
合計ジャッジ時間 2,975 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 50 ms
4,404 KB
testcase_16 AC 50 ms
4,380 KB
testcase_17 AC 50 ms
4,424 KB
testcase_18 AC 50 ms
4,396 KB
testcase_19 AC 50 ms
4,392 KB
testcase_20 AC 50 ms
4,380 KB
testcase_21 AC 50 ms
4,376 KB
testcase_22 AC 50 ms
4,420 KB
testcase_23 AC 50 ms
4,416 KB
testcase_24 AC 50 ms
4,380 KB
testcase_25 AC 51 ms
4,376 KB
testcase_26 AC 50 ms
4,376 KB
testcase_27 AC 49 ms
4,376 KB
testcase_28 AC 50 ms
4,380 KB
testcase_29 AC 49 ms
4,380 KB
testcase_30 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.f90:41: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,tmp2,total
  integer*8,allocatable::D(:)
  data count/0/,total/0/
  read *,N,K
  allocate(D(N))
  read *,D

  do i=1, N-1
     if(D(i).ne.i) then
        count = 0
        tmp = i
        do
           tmp2 = D(tmp)
!           print *,tmp,tmp2
           D(tmp) = tmp
           tmp = tmp2
           count = count + 1
           if(tmp.eq.i) then
              total = total +  count - 1
              exit
           end if
        end do
     end if
  end do

  if(total .gt. K ) then
     print '("NO")'
  else if(MOD(total,2).eq.MOD(K,2)) then
     print '("YES")'
  else
     print '("NO")'
  end if
!  print *, total, K
!  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