結果

問題 No.216 FAC
ユーザー mizzsigmizzsig
提出日時 2018-02-04 15:47:28
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 500 bytes
コンパイル時間 755 ms
コンパイル使用メモリ 11,996 KB
実行使用メモリ 12,492 KB
最終ジャッジ日時 2023-09-12 16:00:40
合計ジャッジ時間 2,385 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,300 KB
testcase_01 AC 7 ms
12,364 KB
testcase_02 AC 7 ms
12,416 KB
testcase_03 AC 7 ms
12,356 KB
testcase_04 AC 7 ms
12,392 KB
testcase_05 AC 7 ms
12,368 KB
testcase_06 WA -
testcase_07 AC 7 ms
12,372 KB
testcase_08 AC 7 ms
12,432 KB
testcase_09 AC 7 ms
12,412 KB
testcase_10 AC 7 ms
12,472 KB
testcase_11 AC 7 ms
12,368 KB
testcase_12 AC 7 ms
12,368 KB
testcase_13 WA -
testcase_14 AC 7 ms
12,308 KB
testcase_15 WA -
testcase_16 AC 7 ms
12,308 KB
testcase_17 AC 7 ms
12,492 KB
testcase_18 AC 7 ms
12,304 KB
testcase_19 AC 8 ms
12,460 KB
testcase_20 AC 8 ms
12,340 KB
testcase_21 AC 7 ms
12,428 KB
testcase_22 AC 7 ms
12,432 KB
testcase_23 AC 7 ms
12,372 KB
testcase_24 AC 7 ms
12,324 KB
testcase_25 AC 7 ms
12,376 KB
testcase_26 AC 7 ms
12,392 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    $n = trim(fgets(STDIN));
    $points = trim(fgets(STDIN));
    $points = explode(' ', $points);
    $answer = trim(fgets(STDIN));
    $answer = explode(' ', $answer);

    for ($i = 0; $i < $n; $i++) {
        $sum[$answer[$i]] += $points[$i];
    }

    $flag = true;

    for ($i = 1; $i < $n; $i++) {
        if ($sum[0] < $sum[$i]) {
            $flag = false;
            break;
        }
    }

    if ($flag) {
        echo 'YES' . "\n";
    } else {
        echo 'NO' . "\n";
    }
0