結果

問題 No.69 文字を自由に並び替え
ユーザー sorchsorch
提出日時 2020-12-29 10:23:54
言語 PHP
(8.3.4)
結果
AC  
実行時間 46 ms / 5,000 ms
コード長 398 bytes
コンパイル時間 2,321 ms
コンパイル使用メモリ 30,528 KB
実行使用メモリ 31,472 KB
最終ジャッジ日時 2024-04-15 10:35:14
合計ジャッジ時間 1,474 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
30,988 KB
testcase_01 AC 43 ms
31,068 KB
testcase_02 AC 44 ms
31,224 KB
testcase_03 AC 45 ms
30,876 KB
testcase_04 AC 46 ms
30,992 KB
testcase_05 AC 42 ms
30,988 KB
testcase_06 AC 42 ms
31,196 KB
testcase_07 AC 41 ms
30,912 KB
testcase_08 AC 42 ms
30,960 KB
testcase_09 AC 42 ms
30,992 KB
testcase_10 AC 43 ms
31,064 KB
testcase_11 AC 42 ms
31,472 KB
testcase_12 AC 44 ms
31,004 KB
testcase_13 AC 42 ms
31,060 KB
testcase_14 AC 43 ms
31,404 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

/**
 * @see https://yukicoder.me/problems/35
 */

$A = str_split(trim(fgets(STDIN)));
$B = str_split(trim(fgets(STDIN)));

$canSort2SameWord = true;
foreach ($B as $char) {
    $index = array_search($char, $A);
    if ($index === false) {
        $canSort2SameWord = false;
        break;
    }
    array_splice($A, $index, 1);
}

$ret = ($canSort2SameWord) ? 'YES' : 'NO';
echo $ret . "\n";
0