結果

問題 No.18 うーさー暗号
ユーザー yy05853yy05853
提出日時 2018-11-22 00:06:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 114 ms / 5,000 ms
コード長 439 bytes
コンパイル時間 2,290 ms
コンパイル使用メモリ 70,988 KB
実行使用メモリ 56,376 KB
最終ジャッジ日時 2023-08-26 02:43:29
合計ジャッジ時間 4,041 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
56,096 KB
testcase_01 AC 109 ms
53,792 KB
testcase_02 AC 110 ms
56,160 KB
testcase_03 AC 110 ms
56,016 KB
testcase_04 AC 109 ms
55,708 KB
testcase_05 AC 108 ms
55,880 KB
testcase_06 AC 112 ms
56,376 KB
testcase_07 AC 111 ms
55,996 KB
testcase_08 AC 110 ms
55,784 KB
testcase_09 AC 114 ms
56,076 KB
testcase_10 AC 109 ms
55,744 KB
testcase_11 AC 108 ms
56,000 KB
testcase_12 AC 109 ms
55,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		String line = sc.next();
		int len = line.length();
		
		char[] retsu = new char[len];
		retsu = line.toCharArray();
		
		for(int i = 0; i < len; i++) {
			int moji = (int)retsu[i] - (i + 1) % 26;
			retsu[i] = (char)moji;
			if(retsu[i] < 65)
				retsu[i] += 26;
		}
		
		System.out.println(retsu);
	}
}

0