結果
問題 | No.70 睡眠の重要性! |
ユーザー |
![]() |
提出日時 | 2017-08-19 05:51:09 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 133 ms / 5,000 ms |
コード長 | 517 bytes |
コンパイル時間 | 2,530 ms |
コンパイル使用メモリ | 74,332 KB |
実行使用メモリ | 41,340 KB |
最終ジャッジ日時 | 2024-10-14 15:21:10 |
合計ジャッジ時間 | 3,699 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
import java.util.Scanner;public class Main {public static void main(String args[]){Scanner sc=new Scanner(System.in);int n=Integer.parseInt(sc.nextLine()),begin,end,sum=0;String s[];int are[]=new int[4];for(int i=0;i<n;i++){s=sc.nextLine().split(" |:");for(int j=0;j<4;j++)are[j]=Integer.parseInt(s[j]);if(are[0]>are[2] || (are[0]==are[2] && are[1]>are[3]))are[2]+=24;begin=are[0]*60+are[1];end=are[2]*60+are[3];sum+=(end-begin);}System.out.println(sum);}}