結果

問題 No.729 文字swap
ユーザー mondomondo
提出日時 2019-08-06 11:47:01
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 324 bytes
コンパイル時間 465 ms
コンパイル使用メモリ 12,056 KB
実行使用メモリ 12,244 KB
最終ジャッジ日時 2023-09-25 17:39:46
合計ジャッジ時間 1,246 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

<?php
$moji = trim(fgets(STDIN));
list($first, $second) = explode(" ", trim(fgets(STDIN)));
$firstmoji = substr($moji, $first,1);
$secondmoji = substr($moji, $second,1);
$newmoji = str_replace($firstmoji, "?", $moji);
$newmoji2 = str_replace($secondmoji, $firstmoji, $newmoji);
echo str_replace("?", $secondmoji, $newmoji2);
0