結果

問題 No.18 うーさー暗号
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 23:55:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 124 ms / 5,000 ms
コード長 348 bytes
コンパイル時間 2,571 ms
コンパイル使用メモリ 72,432 KB
実行使用メモリ 56,100 KB
最終ジャッジ日時 2023-10-11 12:50:10
合計ジャッジ時間 4,291 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,716 KB
testcase_01 AC 115 ms
55,892 KB
testcase_02 AC 116 ms
55,784 KB
testcase_03 AC 119 ms
55,556 KB
testcase_04 AC 124 ms
55,988 KB
testcase_05 AC 118 ms
55,860 KB
testcase_06 AC 120 ms
54,036 KB
testcase_07 AC 120 ms
56,012 KB
testcase_08 AC 119 ms
55,892 KB
testcase_09 AC 119 ms
56,100 KB
testcase_10 AC 116 ms
55,412 KB
testcase_11 AC 119 ms
55,844 KB
testcase_12 AC 120 ms
55,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		String s = sc.next();
		StringBuilder ans = new StringBuilder();
		for (int i=0; i<s.length(); i++) {
			char c = s.charAt(i);
			c -= (i+1)%26;
			if (c < 65) c += 26;
			ans.append(c);
		}
		System.out.println(ans);
	}
}
0