結果

問題 No.69 文字を自由に並び替え
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-14 10:17:00
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 526 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 12,104 KB
実行使用メモリ 12,488 KB
最終ジャッジ日時 2023-09-09 21:20:52
合計ジャッジ時間 1,220 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 6 ms
12,488 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 6 ms
12,404 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 6 ms
12,352 KB
testcase_10 AC 6 ms
12,416 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 7 ms
12,376 KB
testcase_14 AC 6 ms
12,336 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$A = trim(fgets(STDIN));
$B = trim(fgets(STDIN));
$array1 = array();
for($i = 0; $i < strlen($A); $i++) {
  $str = substr($A, $i, 1);
  if(array_key_exists($str, $array1)) {
    $array1[$str] = $array1[$str] + 1;
  } else {
    $array1[$str] = 1;
  }
}
$array2 = array();
for($i = 0; $i < strlen($B); $i++) {
  $str = substr($B, $i, 1);
  if(array_key_exists($str, $array2)) {
    $array2[$str] = $array2[$str] + 1;
  } else {
    $array2[$str] = 1;
  }
}
$ans = 'NO';
if($array == $array2) $ans = 'YES';
print($ans);
?>
0