結果

問題 No.231 めぐるはめぐる (1)
ユーザー 綾地寧々綾地寧々
提出日時 2015-06-26 22:35:17
言語 PHP
(8.3.4)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 751 bytes
コンパイル時間 543 ms
コンパイル使用メモリ 18,632 KB
実行使用メモリ 19,000 KB
最終ジャッジ日時 2023-08-07 18:35:34
合計ジャッジ時間 1,721 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,904 KB
testcase_01 AC 15 ms
18,896 KB
testcase_02 AC 15 ms
18,900 KB
testcase_03 AC 15 ms
18,876 KB
testcase_04 AC 15 ms
19,000 KB
testcase_05 AC 16 ms
18,772 KB
testcase_06 AC 16 ms
18,856 KB
testcase_07 AC 15 ms
18,864 KB
testcase_08 AC 15 ms
18,744 KB
testcase_09 AC 15 ms
18,900 KB
testcase_10 AC 15 ms
18,940 KB
testcase_11 AC 14 ms
18,896 KB
testcase_12 AC 16 ms
18,868 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
// yukicoder No.231
define("DEATH_PENALTY", 30000);
define("NEED_EXP", DEATH_PENALTY*100);
define("PLAY_TIME", 6);
$dungeons = trim(fgets(STDIN));
$exp_array = array();
$death_array = array();
$get_exp = array_fill(0,$dungeons,0);
$max_exp = 0;
$max_dungeons = FALSE;
for ( $i=0; $i<$dungeons; $i++ ) {
	list($exp_array[], $death_array[]) = explode(" ", trim(fgets(STDIN)));
	$get_exp[$i] = $exp_array[$i] - ($death_array[$i] * DEATH_PENALTY);
	$max_exp = max($get_exp[$i], $max_exp);
	if ( $max_exp == $get_exp[$i] ) {
		$max_dungeons = $i;
	}
}
if ( ($max_dungeons === FALSE) || ($max_exp * PLAY_TIME) < NEED_EXP ) {
	echo 'NO'.PHP_EOL;
}
else {
	echo 'YES'.PHP_EOL;
	for ( $i=0; $i<PLAY_TIME; $i++ ) {
		echo ($max_dungeons+1) .PHP_EOL;
	}
}
0