結果

問題 No.70 睡眠の重要性!
ユーザー papinianuspapinianus
提出日時 2016-06-07 15:27:07
言語 PHP
(8.3.4)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 413 bytes
コンパイル時間 1,215 ms
コンパイル使用メモリ 32,144 KB
実行使用メモリ 32,528 KB
最終ジャッジ日時 2024-04-17 05:40:51
合計ジャッジ時間 1,951 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
32,528 KB
testcase_01 AC 39 ms
32,400 KB
testcase_02 AC 40 ms
32,528 KB
testcase_03 AC 39 ms
32,528 KB
testcase_04 AC 39 ms
32,016 KB
testcase_05 AC 39 ms
32,528 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$count = trim(fgets(STDIN));
$sum = 0;
for($i = 1; $i <= $count; $i++) {
    list($start, $end) = explode(' ', trim(fgets(STDIN)));
    list($start_h, $start_m) = explode(':', $start);
    list($end_h, $end_m) = explode(':', $end);
    if($end_m < $start_m) {$end_m += 60;$end_h--;}
    if($end_h < $start_h) {$end_h += 24;}
    $sum += (($end_h - $start_h) * 60) + ($end_m - $start_m);
}
echo $sum.PHP_EOL;
0