結果

問題 No.250 atetubouのzetubou
ユーザー jjjj
提出日時 2016-08-06 21:43:10
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 872 bytes
コンパイル時間 125 ms
コンパイル使用メモリ 32,000 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 19:29:01
合計ジャッジ時間 1,011 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 9 ms
5,376 KB
testcase_03 AC 11 ms
5,376 KB
testcase_04 AC 10 ms
5,376 KB
testcase_05 AC 10 ms
5,376 KB
testcase_06 AC 8 ms
5,376 KB
testcase_07 AC 4 ms
5,376 KB
testcase_08 AC 8 ms
5,376 KB
testcase_09 AC 6 ms
5,376 KB
testcase_10 AC 9 ms
5,376 KB
testcase_11 AC 6 ms
5,376 KB
testcase_12 AC 8 ms
5,376 KB
testcase_13 AC 5 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 9 ms
5,376 KB
testcase_16 AC 9 ms
5,376 KB
testcase_17 AC 8 ms
5,376 KB
testcase_18 AC 8 ms
5,376 KB
testcase_19 AC 9 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.f90:22:5:

   22 |      function combination(N, R)
      |     1
Warning: Interface mismatch in global procedure 'combination' at (1): INTENT mismatch in argument 'n'

ソースコード

diff #

function combination(N, R)
  integer*8::i,j
  integer*8,intent(in)::N,R
  integer*8::res,combination

  res = 1
  j = N

  do i=1, R
     res = (res*j)/i
     j   = j - 1
     if(res.gt.10**15_8) then
        res = 10**15_8
        exit
     end if
  end do
  combination = res
end function combination

program main
  interface
     function combination(N, R)
       integer*8::N,R,combination
     end function combination
  end interface
  type problem
     integer*8::D,X,T
  end type problem
  integer*8::Q,i,j,k,tmp
  integer*8::qd,qx,qt,qr
  type(problem)::P(10**4)
  integer*8::D,T

  read *, Q
  read *, P(1:Q)

  do i=1,Q
     qd = P(i)%D
     qx = P(i)%X
     qt = P(i)%T
     qr = MIN(qx, qd-1)
     tmp = combination(qd+qx-1,qr)
     if(tmp.gt.qt) then
        print '(a)', "ZETUBOU"
     else
        print '(a)', "AC"
     end if
  end do

end program main
0