結果

問題 No.70 睡眠の重要性!
ユーザー 綾地寧々綾地寧々
提出日時 2015-05-21 12:25:18
言語 PHP
(8.3.4)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 453 bytes
コンパイル時間 686 ms
コンパイル使用メモリ 18,508 KB
実行使用メモリ 18,788 KB
最終ジャッジ日時 2023-09-20 08:37:45
合計ジャッジ時間 1,235 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

<?php
$days = trim(fgets(STDIN));
$sleep_sum = 0;
for ( $i=0; $i<$days; $i++ ) {
	list($start, $end) = explode(" ", trim(fgets(STDIN)));
	list($start_h, $start_m) = explode(":", $start);
	list($end_h, $end_m) = explode(":", $end);
	$start_minute = ($start_h * 60) + $start_m;
	$end_minute = ($end_h * 60) + $end_m;
	if ( $start_minute > $end_minute ) {
		$end_minute += 24*60;
	}
	$sleep_sum += ($end_minute - $start_minute);
}
echo $sleep_sum.PHP_EOL;
0