結果
問題 | No.70 睡眠の重要性! |
ユーザー | リチウム |
提出日時 | 2014-11-18 23:43:08 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 131 ms / 5,000 ms |
コード長 | 463 bytes |
コンパイル時間 | 2,580 ms |
コンパイル使用メモリ | 76,720 KB |
実行使用メモリ | 54,456 KB |
最終ジャッジ日時 | 2025-01-02 18:58:42 |
合計ジャッジ時間 | 3,347 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int ans=0; for(int i=0;i<n;i++){ String S=sc.next(); String t[]=S.split(":"); S=sc.next(); String u[]=S.split(":"); int k=Integer.valueOf(u[0])*60+Integer.valueOf(u[1])-Integer.valueOf(t[0])*60-Integer.valueOf(t[1]); if(k<0)k=1440+k; ans+=k; } System.out.println(ans); }}