結果

問題 No.70 睡眠の重要性!
ユーザー gemmarogemmaro
提出日時 2019-10-12 07:16:15
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 460 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-05-05 10:16:52
合計ジャッジ時間 1,302 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
12,288 KB
testcase_01 AC 78 ms
12,288 KB
testcase_02 AC 79 ms
12,288 KB
testcase_03 AC 78 ms
12,288 KB
testcase_04 AC 78 ms
12,288 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