結果

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

テストケース

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

ソースコード

diff #

function get_num(N) result(t)
  integer*8::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*8::N,t
     end function get_num
  end interface
  integer*8::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