結果

問題 No.18 うーさー暗号
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-24 00:20:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 472 bytes
コンパイル時間 3,231 ms
コンパイル使用メモリ 71,680 KB
実行使用メモリ 49,660 KB
最終ジャッジ日時 2023-09-21 12:53:19
合計ジャッジ時間 4,160 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
49,488 KB
testcase_01 AC 42 ms
49,280 KB
testcase_02 AC 42 ms
49,328 KB
testcase_03 AC 42 ms
49,172 KB
testcase_04 AC 42 ms
49,288 KB
testcase_05 AC 42 ms
49,560 KB
testcase_06 AC 42 ms
49,408 KB
testcase_07 AC 42 ms
49,204 KB
testcase_08 AC 41 ms
49,544 KB
testcase_09 AC 42 ms
49,404 KB
testcase_10 AC 42 ms
49,344 KB
testcase_11 AC 42 ms
49,536 KB
testcase_12 AC 41 ms
49,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class No18 {
	public static void main(String args[]) throws IOException{
		String str = new BufferedReader(new InputStreamReader(System.in)).readLine();
		byte[] inputToNum = str.getBytes();
		for(int i=0; i<str.length(); i++){
			inputToNum[i] -= (i+1) % 26;
			if(inputToNum[i] < 65){
				inputToNum[i] += 26;
			}
		}
		System.out.println(new String(inputToNum));
	}
}
0