結果

問題 No.18 うーさー暗号
ユーザー shinwisteriashinwisteria
提出日時 2018-03-04 18:09:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 428 bytes
コンパイル時間 3,996 ms
コンパイル使用メモリ 72,032 KB
実行使用メモリ 55,884 KB
最終ジャッジ日時 2023-09-22 18:00:56
合計ジャッジ時間 5,748 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,828 KB
testcase_01 AC 125 ms
55,676 KB
testcase_02 AC 124 ms
55,884 KB
testcase_03 AC 129 ms
55,568 KB
testcase_04 AC 125 ms
55,672 KB
testcase_05 AC 124 ms
55,760 KB
testcase_06 AC 125 ms
55,452 KB
testcase_07 AC 124 ms
55,744 KB
testcase_08 AC 125 ms
55,552 KB
testcase_09 AC 125 ms
55,476 KB
testcase_10 AC 124 ms
55,356 KB
testcase_11 AC 125 ms
55,476 KB
testcase_12 AC 124 ms
55,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;
public class Con18 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		String str = s.nextLine();
		s.close();

		byte[] sbyte = str.getBytes();
		for(int i = 0;i < sbyte.length;i++){
			sbyte[i] -= 64;
			sbyte[i] -= (i + 1) % 26;
			while(sbyte[i] <= 0){
				sbyte[i] += 26;
			}
			sbyte[i] += 64;
		}
		System.out.println(new String(sbyte));

	}
}

0