結果

問題 No.87 Advent Calendar Problem
ユーザー jj
提出日時 2016-08-15 21:57:16
言語 Fortran
(gFortran 14.2.0)
結果
RE  
実行時間 -
コード長 652 bytes
コンパイル時間 1,468 ms
コンパイル使用メモリ 32,000 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 18:02:18
合計ジャッジ時間 2,707 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 RE * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

function get_num(N) result(t)
  integer::N,t
  if(MOD(N,400).eq.0) then
     t = 2
  else if(MOD(N,100).eq.0) then
     t = 1
  else if(MOD(N,4).eq.0) then
     t = 2
  else
     t = 1
  end if
end function get_num

program main
  implicit none
  interface
     function get_num(N) result(t)
       integer::N,t
     end function get_num
  end interface
  integer::N,M,i,youbi,onaji
  read *,N
  M = (N-2014)/400

  onaji = 0
  youbi = 0
  do i=2015,(N-M*400)
     youbi = MOD(youbi+get_num(i),7)
     if(youbi.eq.0) then
        onaji = onaji + 1
     end if
!     print '(i0," ",i0)', i, youbi
  end do

  print '(i0)', onaji + M*57
end program main
0