結果

問題 No.18 うーさー暗号
ユーザー 37zigen37zigen
提出日時 2016-03-31 16:43:02
言語 Java19
(openjdk 21)
結果
AC  
実行時間 165 ms / 5,000 ms
コード長 1,433 bytes
コンパイル時間 2,730 ms
コンパイル使用メモリ 77,368 KB
実行使用メモリ 56,780 KB
最終ジャッジ日時 2023-09-21 12:11:06
合計ジャッジ時間 6,021 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
56,388 KB
testcase_01 AC 112 ms
55,536 KB
testcase_02 AC 119 ms
55,788 KB
testcase_03 AC 165 ms
56,444 KB
testcase_04 AC 148 ms
55,764 KB
testcase_05 AC 147 ms
56,780 KB
testcase_06 AC 161 ms
55,840 KB
testcase_07 AC 161 ms
56,076 KB
testcase_08 AC 164 ms
55,892 KB
testcase_09 AC 161 ms
56,012 KB
testcase_10 AC 120 ms
55,880 KB
testcase_11 AC 118 ms
55,816 KB
testcase_12 AC 150 ms
56,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder018;
import java.util.HashMap;
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		HashMap<Integer,String> map=new HashMap<>();
		map.put(1, "A");
		map.put(2, "B");
		map.put(3, "C");
		map.put(4, "D");
		map.put(5, "E");
		map.put(6, "F");
		map.put(7, "G");
		map.put(8, "H");
		map.put(9, "I");
		map.put(10, "J");
		map.put(11, "K");
		map.put(12, "L");
		map.put(13, "M");
		map.put(14, "N");
		map.put(15, "O");
		map.put(16, "P");
		map.put(17, "Q");
		map.put(18, "R");
		map.put(19, "S");
		map.put(20, "T");
		map.put(21, "U");
		map.put(22, "V");
		map.put(23, "W");
		map.put(24, "X");
		map.put(25, "Y");
		map.put(0, "Z");
		HashMap<String,Integer> map2=new HashMap<>();
		map2.put("A",1);
		map2.put("B",2);
		map2.put("C",3);
		map2.put("D",4);
		map2.put("E",5);
		map2.put("F",6);
		map2.put("G",7);
		map2.put("H",8);
		map2.put("I",9);
		map2.put("J",10);
		map2.put("K",11);
		map2.put("L",12);
		map2.put("M",13);
		map2.put("N",14);
		map2.put("O",15);
		map2.put("P",16);
		map2.put("Q",17);
		map2.put("R",18);
		map2.put("S",19);
		map2.put("T",20);
		map2.put("U",21);
		map2.put("V",22);
		map2.put("W",23);
		map2.put("X",24);
		map2.put("Y",25);
		map2.put("Z",26);
		String str=sc.next();
		for(int i=0;i<str.length();i++){
			System.out.print(map.get((map2.get((str.charAt(i)+""))+26*1024-1-i)%26));
		}
	}
}
0