結果

問題 No.18 うーさー暗号
ユーザー ryosuke0825ryosuke0825
提出日時 2018-04-09 22:37:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 174 ms / 5,000 ms
コード長 388 bytes
コンパイル時間 3,816 ms
コンパイル使用メモリ 73,984 KB
実行使用メモリ 59,280 KB
最終ジャッジ日時 2023-09-09 03:38:02
合計ジャッジ時間 6,487 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 152 ms
57,000 KB
testcase_01 AC 153 ms
56,892 KB
testcase_02 AC 153 ms
56,736 KB
testcase_03 AC 168 ms
57,000 KB
testcase_04 AC 158 ms
56,696 KB
testcase_05 AC 164 ms
57,224 KB
testcase_06 AC 170 ms
59,280 KB
testcase_07 AC 162 ms
56,860 KB
testcase_08 AC 171 ms
56,916 KB
testcase_09 AC 166 ms
56,636 KB
testcase_10 AC 157 ms
57,040 KB
testcase_11 AC 157 ms
57,128 KB
testcase_12 AC 174 ms
56,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder1_0;

import java.util.Scanner;

public class No18 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		String ans = "";

		for (int i = 0; i < S.length(); i++) {
			int code = S.charAt(i)-'A' ;
			code += 2600;
			code -= i+1;
			code %= 26;
			ans += (char) ('A' + code);
		}

		System.out.println(ans);

	}

}
0