結果

問題 No.87 Advent Calendar Problem
ユーザー jjjj
提出日時 2016-08-15 21:57:16
言語 Fortran
(gFortran 13.2.0)
結果
RE  
実行時間 -
コード長 652 bytes
コンパイル時間 917 ms
コンパイル使用メモリ 31,488 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 07:42:10
合計ジャッジ時間 2,135 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
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 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 AC 1 ms
5,376 KB
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

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