結果

問題 No.73 helloworld
ユーザー jjjj
提出日時 2016-09-13 23:01:00
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 707 bytes
コンパイル時間 1,604 ms
コンパイル使用メモリ 26,720 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-12 04:34:59
合計ジャッジ時間 2,474 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer*8::C(26)
  integer*8::h,e,l,o,w,r,d,ml,mo
  read *,C
  h = C(8)
  e = C(5)
  l = C(12)
  o = C(15)
  w = C(23)
  r = C(18)
  d = C(4)
  if(h.lt.1 .or. e.lt.1 .or. l.lt.3 .or. &
     o.lt.2 .or. w.lt.1 .or. r.lt.1 .or. &
     d.lt.1) then
     print '(i0)',0
  else
     ml = get_maxl(l)
     mo = get_maxo(o)
     print '(i0)',h*e*ml*mo*w*r*d
  end if
contains
  function get_maxl(l) result(m)
    integer*8::i,m,l
    m = 1
    do i=2,l-1
       m = MAX(m, (l-i)*i*(i-1)/2)
    end do
  end function get_maxl
  function get_maxo(o) result(m)
    integer*8::i,m,o
    m = 1
    do i=1,o-1
       m = MAX(m, (o-i)*i)
    end do
  end function get_maxo
end program main
0