結果

問題 No.18 うーさー暗号
ユーザー Ruizi_LuigiRuizi_Luigi
提出日時 2015-10-19 01:04:28
言語 PHP
(8.3.4)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 272 bytes
コンパイル時間 797 ms
コンパイル使用メモリ 18,692 KB
実行使用メモリ 18,924 KB
最終ジャッジ日時 2023-09-21 11:56:07
合計ジャッジ時間 1,825 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,704 KB
testcase_01 AC 16 ms
18,900 KB
testcase_02 AC 16 ms
18,696 KB
testcase_03 AC 17 ms
18,856 KB
testcase_04 AC 16 ms
18,880 KB
testcase_05 AC 16 ms
18,748 KB
testcase_06 AC 17 ms
18,924 KB
testcase_07 AC 17 ms
18,784 KB
testcase_08 AC 17 ms
18,732 KB
testcase_09 AC 17 ms
18,880 KB
testcase_10 AC 16 ms
18,784 KB
testcase_11 AC 16 ms
18,896 KB
testcase_12 AC 17 ms
18,732 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$s = (string)trim(fgets(STDIN));
$line = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

for ($i = 1; $i <= strlen($s); $i++) {
    $idx = strpos($line, $s[$i-1]);
    $i_tmp = $idx - $i;

    while($i_tmp < 0) {
        $i_tmp += 26;
    }
    echo $line[$i_tmp];
}
echo PHP_EOL;
?>
0