結果

問題 No.18 うーさー暗号
ユーザー scachescache
提出日時 2014-11-12 03:47:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 5,000 ms
コード長 514 bytes
コンパイル時間 3,018 ms
コンパイル使用メモリ 72,476 KB
実行使用メモリ 39,940 KB
最終ジャッジ日時 2023-09-21 11:31:23
合計ジャッジ時間 4,653 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
39,752 KB
testcase_01 AC 120 ms
39,720 KB
testcase_02 AC 120 ms
39,520 KB
testcase_03 AC 127 ms
39,076 KB
testcase_04 AC 122 ms
39,080 KB
testcase_05 AC 124 ms
39,280 KB
testcase_06 AC 125 ms
39,680 KB
testcase_07 AC 122 ms
39,528 KB
testcase_08 AC 124 ms
39,464 KB
testcase_09 AC 126 ms
39,940 KB
testcase_10 AC 117 ms
39,500 KB
testcase_11 AC 120 ms
39,092 KB
testcase_12 AC 125 ms
39,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

/**
 * yukicoder no.18
 * @author scache
 *
 */
public class Main {
	public static void main(String[] args) {
		Main p = new Main();
	}

	public Main() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		solve(s);
	}

	public void solve(String s) {
		StringBuilder sb = new StringBuilder(s.length());
		for(int i=0;i<s.length();i++){
			sb.append((char)((26+(s.charAt(i)-'A'-(i+1)%26))%26+'A'));
		}
		System.out.println(sb.toString());
	}

}
0