結果

問題 No.188 HAPPY DAY
ユーザー concon
提出日時 2018-10-24 16:55:16
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 869 bytes
コンパイル時間 405 ms
コンパイル使用メモリ 32,128 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-04-29 21:25:12
合計ジャッジ時間 775 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

program calendar
implicit none
integer(8) a,b,c,i,y
y=0
do i=1,6
   if (i==2) then
      call twentyeight(b,y)
   else if (mod(i,2)==0) then
      call thirty(c,i,y)
   else
      call thirtyone(a,i,y)
   end if
end do
do i=7,12
   if (i==9) then
      call thirty(c,i,y)
   else if (i==11) then
      call thirty(c,i,y)
   else
      call thirtyone(a,i,y)
   end if
end do
write(*,*) y
end program calendar

subroutine twentyeight(b,y)
integer(8) i,x,b,y
b=28
do i=1,b
   x=int(i/10)+mod(i,10)
   if (x==2) then
      y=y+1
   end if
end do
end subroutine twentyeight

subroutine thirty(c,i,y)
integer(8) j,x,c,y,i
c=30
do j=1,c
   x=int(j/10)+mod(j,10)
   if (x==i) then
      y=y+1
   end if
end do
end subroutine 

subroutine thirtyone(a,i,y)
integer(8) j,x,a,y,i
a=31
do j=1,a
   x=int(j/10)+mod(j,10)
   if (x==i) then
      y=y+1
   end if
end do
end subroutine 
0