結果

問題 No.18 うーさー暗号
ユーザー jimanojimano
提出日時 2016-06-19 14:49:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 610 bytes
コンパイル時間 1,826 ms
コンパイル使用メモリ 71,976 KB
実行使用メモリ 51,376 KB
最終ジャッジ日時 2023-09-21 12:20:21
合計ジャッジ時間 3,335 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,196 KB
testcase_01 AC 42 ms
49,656 KB
testcase_02 AC 45 ms
49,300 KB
testcase_03 AC 86 ms
51,376 KB
testcase_04 AC 53 ms
47,156 KB
testcase_05 AC 53 ms
49,356 KB
testcase_06 AC 70 ms
50,904 KB
testcase_07 AC 80 ms
50,816 KB
testcase_08 AC 76 ms
51,120 KB
testcase_09 AC 80 ms
51,124 KB
testcase_10 AC 42 ms
49,272 KB
testcase_11 AC 43 ms
49,096 KB
testcase_12 AC 59 ms
50,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main{
    public static void main(String[] args) {

        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
char[] c = br.readLine().toCharArray();
           for (int i = 0; i < c.length; i++) {
				int idx = (int)c[i] - (i + 1) % 26;
					if (idx < 65) {
						System.out.print((char) (idx + 26));
					} else {
						System.out.print((char)idx);
					}
			}
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
0