結果

問題 No.18 うーさー暗号
ユーザー abcabc
提出日時 2016-10-17 18:35:10
言語 Java21
(openjdk 21)
結果
AC  
実行時間 170 ms / 5,000 ms
コード長 415 bytes
コンパイル時間 2,529 ms
コンパイル使用メモリ 71,508 KB
実行使用メモリ 56,144 KB
最終ジャッジ日時 2023-09-21 12:31:16
合計ジャッジ時間 5,357 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,580 KB
testcase_01 AC 122 ms
53,516 KB
testcase_02 AC 130 ms
55,560 KB
testcase_03 AC 159 ms
56,144 KB
testcase_04 AC 156 ms
56,140 KB
testcase_05 AC 149 ms
55,536 KB
testcase_06 AC 168 ms
55,560 KB
testcase_07 AC 170 ms
55,812 KB
testcase_08 AC 170 ms
55,780 KB
testcase_09 AC 165 ms
55,952 KB
testcase_10 AC 125 ms
55,512 KB
testcase_11 AC 127 ms
55,540 KB
testcase_12 AC 161 ms
55,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        for (int i = 0; i < s.length(); i++) {

            int charIndex = (s.charAt(i) - 'A' - (i + 1)) % 26;
            char character = (char) (((charIndex + 26) % 26) + 'A');

            System.out.print(character);

        }

    }

}
0