結果

問題 No.18 うーさー暗号
ユーザー m2543315647m2543315647
提出日時 2015-05-13 09:31:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 309 bytes
コンパイル時間 3,221 ms
コンパイル使用メモリ 72,140 KB
実行使用メモリ 58,080 KB
最終ジャッジ日時 2023-09-21 11:45:56
合計ジャッジ時間 5,315 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
56,012 KB
testcase_01 AC 115 ms
58,080 KB
testcase_02 AC 115 ms
55,884 KB
testcase_03 AC 120 ms
55,944 KB
testcase_04 AC 114 ms
55,648 KB
testcase_05 AC 116 ms
55,792 KB
testcase_06 AC 117 ms
55,912 KB
testcase_07 AC 114 ms
55,804 KB
testcase_08 AC 115 ms
53,936 KB
testcase_09 AC 115 ms
55,728 KB
testcase_10 AC 115 ms
56,064 KB
testcase_11 AC 114 ms
55,660 KB
testcase_12 AC 117 ms
56,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class No18 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.nextLine().toCharArray();
		for(int i=0;i<s.length;i++){
			s[i]-=(i%('Z'-'A'+1))+1;
			if(s[i]<'A')s[i]+='Z'-'A'+1;
		}
		System.out.println(String.valueOf(s));
	}
}
0