結果

問題 No.18 うーさー暗号
ユーザー aikon_marimoaikon_marimo
提出日時 2018-01-29 22:34:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 160 ms / 5,000 ms
コード長 375 bytes
コンパイル時間 5,588 ms
コンパイル使用メモリ 73,552 KB
実行使用メモリ 58,736 KB
最終ジャッジ日時 2023-09-21 12:58:55
合計ジャッジ時間 5,337 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 145 ms
56,968 KB
testcase_01 AC 143 ms
56,728 KB
testcase_02 AC 142 ms
56,840 KB
testcase_03 AC 149 ms
56,828 KB
testcase_04 AC 147 ms
57,308 KB
testcase_05 AC 156 ms
56,680 KB
testcase_06 AC 149 ms
57,036 KB
testcase_07 AC 149 ms
56,488 KB
testcase_08 AC 150 ms
56,836 KB
testcase_09 AC 160 ms
58,736 KB
testcase_10 AC 141 ms
56,708 KB
testcase_11 AC 143 ms
58,492 KB
testcase_12 AC 148 ms
56,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		String S = in.next();
		
		String ans = "";
		for (int i = 1; i <= S.length(); i++) {
			int d = S.charAt(i-1) - 'A';
	        d += 2600;
	        d -= i;
	        d %= 26;
	        ans += (char)('A' + d);
		}
		System.out.println(ans);
	}
}
0