結果
問題 | No.70 睡眠の重要性! |
ユーザー |
![]() |
提出日時 | 2016-07-30 08:42:41 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 1,180 bytes |
コンパイル時間 | 397 ms |
コンパイル使用メモリ | 33,664 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-06 20:18:24 |
合計ジャッジ時間 | 697 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
module suiminTYPE timeinteger::Hinteger::Mend type timeTYPE sleeptype(time)::shuusintype(time)::kishouinteger::sleep_timeend type sleepcontainsinteger function kaiseki(s,str,N)implicit nonecharacter*16,allocatable::str(:,:)type(sleep),allocatable::s(:)integer::colon1,colon2,N,i,total=0do i=1,Ncolon1 = INDEX(str(1,i),':')colon2 = INDEX(str(2,i),':')read(str(1,i)(1:colon1-1),*) s(i)%shuusin%Hread(str(1,i)(colon1+1:LEN_TRIM(str(1,i))),*) s(i)%shuusin%Mread(str(2,i)(1:colon2-1),*) s(i)%kishou%Hread(str(2,i)(colon2+1:LEN_TRIM(str(2,i))),*) s(i)%kishou%Ms(i)%sleep_time = MOD(((s(i)%kishou%H +24)*60 + s(i)%kishou%M) &- ((s(i)%shuusin%H )*60 + s(i)%shuusin%M), 60*24)total = total + s(i)%sleep_timeend dokaiseki = totalend function kaisekiend module suiminprogram mainuse suimininteger::Ncharacter*16,allocatable::str(:,:)type(sleep),allocatable::s(:)read *,Nallocate(str(2,N))allocate(s(N))read *, strprint '(i0)', kaiseki(s,str,N)end program main