結果

問題 No.18 うーさー暗号
ユーザー yun_appyun_app
提出日時 2016-05-09 12:34:27
言語 Java19
(openjdk 21)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 762 bytes
コンパイル時間 1,860 ms
コンパイル使用メモリ 72,640 KB
実行使用メモリ 49,400 KB
最終ジャッジ日時 2023-09-21 12:17:33
合計ジャッジ時間 3,123 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
49,104 KB
testcase_01 AC 41 ms
49,136 KB
testcase_02 AC 41 ms
48,988 KB
testcase_03 AC 43 ms
49,144 KB
testcase_04 AC 42 ms
49,112 KB
testcase_05 AC 41 ms
49,220 KB
testcase_06 AC 43 ms
49,132 KB
testcase_07 AC 44 ms
49,324 KB
testcase_08 AC 43 ms
49,028 KB
testcase_09 AC 43 ms
49,324 KB
testcase_10 AC 41 ms
49,248 KB
testcase_11 AC 41 ms
49,248 KB
testcase_12 AC 42 ms
49,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        StringBuilder ans = new StringBuilder();
        for(int i=1;i<=line.length();i++){
        	char c = (char)(line.charAt(i-1)-(char)i%26);
        	while(c<'A'){
        		c+=26;
        	}
        	while(c>'Z'){
        		c-=26;
        	}
            ans.append(c);
        }
        System.out.println(ans.toString());
    }
}
0