結果

問題 No.18 うーさー暗号
ユーザー TatsuDXTatsuDX
提出日時 2016-09-08 23:27:39
言語 Java19
(openjdk 21)
結果
AC  
実行時間 182 ms / 5,000 ms
コード長 352 bytes
コンパイル時間 4,769 ms
コンパイル使用メモリ 74,496 KB
実行使用メモリ 59,080 KB
最終ジャッジ日時 2023-09-21 12:27:42
合計ジャッジ時間 8,417 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
56,924 KB
testcase_01 AC 160 ms
56,980 KB
testcase_02 AC 164 ms
56,964 KB
testcase_03 AC 182 ms
59,080 KB
testcase_04 AC 169 ms
56,728 KB
testcase_05 AC 171 ms
56,828 KB
testcase_06 AC 171 ms
56,752 KB
testcase_07 AC 172 ms
54,856 KB
testcase_08 AC 173 ms
57,052 KB
testcase_09 AC 177 ms
56,752 KB
testcase_10 AC 163 ms
56,452 KB
testcase_11 AC 164 ms
57,064 KB
testcase_12 AC 173 ms
56,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

		String s = sc.next(), ans = "";
		char[] ch = s.toCharArray();

		for(int i = 0; i < ch.length; i++){
			ch[i] -= (i+1)%26;
			while(ch[i] < 'A'){
				ch[i] += 26;
			}
			ans += ch[i];
		}
		System.out.println(ans);
	}
}
0