結果
問題 | No.70 睡眠の重要性! |
ユーザー |
|
提出日時 | 2016-04-01 11:27:16 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 131 ms / 5,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 2,025 ms |
コンパイル使用メモリ | 74,332 KB |
実行使用メモリ | 54,300 KB |
最終ジャッジ日時 | 2024-10-02 08:45:47 |
合計ジャッジ時間 | 3,365 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
package yukicoder070; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int sum=0; for(int i=0;i<n;i++){ String str1=sc.next(); String str2=sc.next(); String[] Str1=str1.split(":"); String[] Str2=str2.split(":"); int t1=Integer.parseInt(Str1[0])*60+Integer.parseInt(Str1[1]); int t2=Integer.parseInt(Str2[0])*60+Integer.parseInt(Str2[1]); int t=t2-t1; if(t<0)t+=24*60; sum+=t; } System.out.println(sum); } }