結果

問題 No.405 ローマ数字の腕時計
ユーザー fkwnw3_1243fkwnw3_1243
提出日時 2017-05-03 13:34:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 929 bytes
コンパイル時間 2,003 ms
コンパイル使用メモリ 73,252 KB
実行使用メモリ 49,840 KB
最終ジャッジ日時 2023-09-21 00:26:23
合計ジャッジ時間 4,228 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,556 KB
testcase_01 AC 43 ms
49,640 KB
testcase_02 AC 42 ms
49,296 KB
testcase_03 AC 42 ms
49,376 KB
testcase_04 AC 42 ms
49,352 KB
testcase_05 AC 42 ms
49,192 KB
testcase_06 AC 42 ms
49,324 KB
testcase_07 AC 43 ms
49,312 KB
testcase_08 AC 43 ms
49,360 KB
testcase_09 AC 42 ms
49,748 KB
testcase_10 AC 42 ms
49,372 KB
testcase_11 AC 42 ms
49,248 KB
testcase_12 AC 42 ms
49,372 KB
testcase_13 AC 43 ms
49,468 KB
testcase_14 AC 42 ms
49,380 KB
testcase_15 AC 42 ms
49,248 KB
testcase_16 AC 42 ms
49,328 KB
testcase_17 AC 43 ms
49,728 KB
testcase_18 AC 43 ms
49,460 KB
testcase_19 AC 43 ms
49,312 KB
testcase_20 AC 43 ms
49,840 KB
testcase_21 AC 43 ms
49,376 KB
testcase_22 AC 42 ms
49,456 KB
testcase_23 AC 42 ms
49,324 KB
testcase_24 AC 42 ms
49,368 KB
testcase_25 AC 42 ms
49,320 KB
testcase_26 AC 42 ms
49,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

import static java.lang.System.in;

public class Main {
    public static void main(String[] args) throws IOException {

        String[] table = new String[]{"XII", "I", "II", "III", "IIII", "V", "VI",
                "VII", "VIII", "IX", "X", "XI"};
        Map<String, Integer> map1 = new HashMap<>();
        Map<Integer, String> map2 = new HashMap<>();

        for (int i = 0; i < table.length; i++) {
            map1.put(table[i], i);
            map2.put(i, table[i]);
        }

        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String[] inputs = reader.readLine().split(" ");
        String S1 = inputs[0];
        int T = Integer.parseInt(inputs[1]);

        System.out.println(map2.get((map1.get(S1) + T + 1200) % 12));
        
    }
}
0