結果

問題 No.18 うーさー暗号
ユーザー beatdjambeatdjam
提出日時 2016-09-23 16:00:58
言語 PHP
(8.3.4)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 408 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 18,692 KB
実行使用メモリ 18,928 KB
最終ジャッジ日時 2023-09-21 12:27:52
合計ジャッジ時間 1,413 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

<?php

$input_lines = trim(fgets(STDIN));
$input_lines = str_replace(array("\r\n","\r","\n"), "", $input_lines);

foreach(str_split($input_lines) as $key => $value){
	print(decryptPos($value,$key+1));
}

function decryptPos($i_str,$i_count){
	$defStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	$tmpPos = strpos($defStr, $i_str);
	$tmpPos =  ($tmpPos - $i_count) % strlen($defStr);
	return substr($defStr,$tmpPos,1);
}
0