結果

問題 No.216 FAC
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-14 18:57:51
言語 PHP
(8.3.4)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 413 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 30,476 KB
実行使用メモリ 31,260 KB
最終ジャッジ日時 2024-04-16 19:50:51
合計ジャッジ時間 1,996 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
30,796 KB
testcase_01 AC 43 ms
31,036 KB
testcase_02 AC 43 ms
30,812 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 41 ms
30,868 KB
testcase_08 AC 41 ms
30,692 KB
testcase_09 AC 43 ms
30,748 KB
testcase_10 AC 42 ms
30,772 KB
testcase_11 AC 42 ms
30,780 KB
testcase_12 AC 41 ms
30,828 KB
testcase_13 AC 41 ms
30,740 KB
testcase_14 AC 43 ms
30,824 KB
testcase_15 AC 42 ms
30,788 KB
testcase_16 AC 42 ms
30,916 KB
testcase_17 AC 41 ms
30,632 KB
testcase_18 AC 42 ms
30,712 KB
testcase_19 AC 42 ms
30,868 KB
testcase_20 AC 41 ms
30,604 KB
testcase_21 WA -
testcase_22 AC 42 ms
30,824 KB
testcase_23 AC 42 ms
31,012 KB
testcase_24 AC 41 ms
30,788 KB
testcase_25 AC 42 ms
30,640 KB
testcase_26 AC 41 ms
30,872 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$N = trim(fgets(STDIN));
$a = explode(" ", trim(fgets(STDIN)));
$b = explode(" ", trim(fgets(STDIN)));
$score = array();
for($i = 0; $i < $N; $i++) {
  if(array_key_exists($b[$i], $score)) {
    $score[$b[$i]] += $a[$i];
  } else {
    $score[$b[$i]] = $a[$i];
  }
}
$max = 0;
foreach($score as $key => $value) {
  $max = max($max, $value);
}
$ans = "NO";
if($max == $score[0]) $ans = "YES";
print($ans);
?>
0