結果

問題 No.18 うーさー暗号
ユーザー shinshin
提出日時 2022-05-12 18:56:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 155 ms / 5,000 ms
コード長 365 bytes
コンパイル時間 5,271 ms
コンパイル使用メモリ 78,400 KB
実行使用メモリ 56,844 KB
最終ジャッジ日時 2023-09-27 18:34:08
合計ジャッジ時間 5,901 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
56,584 KB
testcase_01 AC 141 ms
56,528 KB
testcase_02 AC 138 ms
56,604 KB
testcase_03 AC 150 ms
56,692 KB
testcase_04 AC 142 ms
56,744 KB
testcase_05 AC 141 ms
56,844 KB
testcase_06 AC 146 ms
56,660 KB
testcase_07 AC 155 ms
56,264 KB
testcase_08 AC 147 ms
56,828 KB
testcase_09 AC 147 ms
56,696 KB
testcase_10 AC 143 ms
56,352 KB
testcase_11 AC 144 ms
56,828 KB
testcase_12 AC 152 ms
56,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

public class No18 {

	public static void main(String[] args) {
		java.util.Scanner s = new java.util.Scanner(System.in);
		String S = s.nextLine();
		s.close();

		char[] c = S.toCharArray();
		S = "";
		for(int i = 0;i < c.length;i++) {
			int ci = c[i] - ((i + 1) % 26);
			if(ci < 65) {
				ci += 26;
			}
			S = S + (char)ci;
		}

		System.out.println(S);
	}

}
0