結果

問題 No.182 新規性の虜
ユーザー jjjj
提出日時 2016-07-30 09:21:08
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 84 ms / 5,000 ms
コード長 823 bytes
コンパイル時間 1,445 ms
コンパイル使用メモリ 29,696 KB
実行使用メモリ 4,840 KB
最終ジャッジ日時 2023-08-27 12:25:16
合計ジャッジ時間 3,492 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 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 2 ms
4,376 KB
testcase_08 AC 51 ms
4,376 KB
testcase_09 AC 84 ms
4,744 KB
testcase_10 AC 74 ms
4,576 KB
testcase_11 AC 60 ms
4,388 KB
testcase_12 AC 25 ms
4,380 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 47 ms
4,384 KB
testcase_19 AC 35 ms
4,380 KB
testcase_20 AC 24 ms
4,376 KB
testcase_21 AC 55 ms
4,840 KB
testcase_22 AC 29 ms
4,380 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 70 ms
4,380 KB
testcase_25 AC 18 ms
4,376 KB
testcase_26 AC 11 ms
4,376 KB
testcase_27 AC 2 ms
4,380 KB
evil01.txt AC 76 ms
4,380 KB
evil02.txt AC 76 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

recursive function qsort(x) result(y)
  integer,intent(in) ::x(:)
  integer,allocatable::y(:)
  integer::pivot,total
  total = size(x)
  if (total <=1) then
     y = x
  else
     pivot = x(total/2)
     y = [qsort(pack(x, x .lt. pivot)), &
          pack(x, x .eq. pivot),        &
          qsort(pack(x, x .gt. pivot))]
  endif
end function qsort

program main
  interface
     recursive function qsort(x) result(y)
       integer,intent(in) ::x(:)
       integer,allocatable::y(:)
     end function qsort
  end interface
  integer::N,total=0
  integer,allocatable::s(:),a(:)
  read *,N
  allocate(a(N),s(0:N+1))
  read *,a(1:N)
  s(1:N) = qsort(a)

  s(0)   = 0
  s(N+1) = 0
  do i=1,N
     if(s(i).ne.s(i-1).and.s(i).ne.s(i+1))then
        total = total + 1
     end if
  end do
  print '(i0)', total
end program main
0