結果

問題 No.70 睡眠の重要性!
ユーザー gemmarogemmaro
提出日時 2019-10-12 07:16:15
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 460 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 11,236 KB
実行使用メモリ 15,348 KB
最終ジャッジ日時 2023-08-18 03:47:18
合計ジャッジ時間 1,314 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,268 KB
testcase_01 AC 81 ms
15,128 KB
testcase_02 AC 81 ms
15,108 KB
testcase_03 AC 83 ms
15,152 KB
testcase_04 AC 81 ms
15,348 KB
testcase_05 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i    
sum = 0    
n.times {    
    line = gets.chomp.split    
    begin_h, begin_m = line[0].split(':').map &:to_i    
    end_h, end_m = line[1].split(':').map &:to_i    
    if begin_h > end_h                                                 
        begin_h -= 24    
    end    
    minute_begin = begin_h * 60 + begin_m    
    minute_end = end_h * 60 + end_m    
    time = minute_end - minute_begin    
    sum += time    
}    
p sum
0