結果

問題 No.18 うーさー暗号
ユーザー 綾地寧々綾地寧々
提出日時 2015-04-30 17:18:50
言語 PHP
(8.3.4)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 247 bytes
コンパイル時間 1,028 ms
コンパイル使用メモリ 18,776 KB
実行使用メモリ 18,944 KB
最終ジャッジ日時 2023-09-21 11:43:51
合計ジャッジ時間 1,211 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
18,844 KB
testcase_01 AC 14 ms
18,832 KB
testcase_02 AC 14 ms
18,820 KB
testcase_03 AC 14 ms
18,800 KB
testcase_04 AC 14 ms
18,832 KB
testcase_05 AC 14 ms
18,792 KB
testcase_06 AC 14 ms
18,796 KB
testcase_07 AC 14 ms
18,820 KB
testcase_08 AC 14 ms
18,944 KB
testcase_09 AC 14 ms
18,804 KB
testcase_10 AC 15 ms
18,680 KB
testcase_11 AC 15 ms
18,660 KB
testcase_12 AC 15 ms
18,820 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$input = trim(fgets(STDIN));

for ( $index=0; $index<strlen($input); $index++ ) {
	$ascii = ord($input[$index]);
	$ascii -= (($index+1) % 26);
	if ( $ascii < 65 ) {
		$ascii += 26;
	}
	$input[$index] = chr($ascii);
}

echo $input . PHP_EOL;
0