結果
| 問題 | No.24 数当てゲーム |
| コンテスト | |
| ユーザー |
jshimazu0820
|
| 提出日時 | 2014-11-23 15:51:50 |
| 言語 | PHP (843.2) |
| 結果 |
AC
|
| 実行時間 | 50 ms / 5,000 ms |
| コード長 | 663 bytes |
| コンパイル時間 | 120 ms |
| コンパイル使用メモリ | 36,116 KB |
| 実行使用メモリ | 36,504 KB |
| 最終ジャッジ日時 | 2025-02-07 08:40:34 |
| 合計ジャッジ時間 | 1,346 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
$N = (int)trim(fgets(STDIN));
$inputs = [];
$input_adds = [];
for ($i = 0; $i<$N; $i++) {
$input = explode(' ', trim(fgets(STDIN)));
$inputs[$i] = $input;
if ($input[4] == 'YES') {
$input_adds[$i] = 1;
} else {
$input_adds[$i] = -1;
}
}
$score = [];
foreach (range(0, 9) as $key) {
$score[$key] = 0;
}
foreach ($inputs as $index => $input) {
$score[$input[0]] += $input_adds[$index];
$score[$input[1]] += $input_adds[$index];
$score[$input[2]] += $input_adds[$index];
$score[$input[3]] += $input_adds[$index];
}
arsort($score);
foreach ($score as $key => $s) {
echo $key. "\n";
break;
}
jshimazu0820