結果

問題 No.18 うーさー暗号
ユーザー takoshi186takoshi186
提出日時 2016-08-01 13:37:25
言語 PHP
(8.2.11)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 330 bytes
コンパイル時間 851 ms
コンパイル使用メモリ 18,480 KB
実行使用メモリ 18,904 KB
最終ジャッジ日時 2023-09-21 12:22:35
合計ジャッジ時間 1,839 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

<?php

    $text = trim(fgets(STDIN));
    $all_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    
    for( $i = 1; $i < strlen($text)+1; $i++ ){
        $idx_pre =  strpos($all_alphabet, $text[$i -1]);

        $idx = $idx_pre - $i;

        while( $idx < 0 ){
            $idx += 26;
        }
        echo $all_alphabet[$idx];
    }
0