結果

問題 No.420 mod2漸化式
ユーザー jjjj
提出日時 2016-09-09 22:48:37
言語 Fortran
(gFortran 13.2.0)
結果
WA  
実行時間 -
コード長 698 bytes
コンパイル時間 1,423 ms
コンパイル使用メモリ 31,104 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-28 02:26:14
合計ジャッジ時間 1,602 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 1 ms
5,376 KB
testcase_33 AC 1 ms
5,376 KB
testcase_34 AC 1 ms
5,376 KB
testcase_35 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function get_combination(N,R) result(res)
  integer*8::i,j,res
  integer*8,intent(in)::N,R
  res = 1
  j = N
  do i=1, R
     res = (res*j)/i
     j   = j - 1
  end do
  return
end function get_combination

program main
  implicit none
  interface
     function get_combination(N,R) result(res)
       integer*8::i,j,res
       integer*8,intent(in)::N,R
     end function get_combination
  end interface
  integer*8::x,res,sum,n
  n = 31
  read *,x

  if(x.gt.31.or.x.le.0) then
     print '(i0," ",i0)',0,0
     return
  end if
  if(x.gt.15) then
     x = 31 - x
  end if
  res = get_combination(n,x)
  sum = 2147483647_8 * get_combination(n-1,x-1)
  print '(i0," ",i0)',res,sum
end program main

0