結果

問題 No.405 ローマ数字の腕時計
ユーザー tentententen
提出日時 2020-11-11 14:47:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 4,265 ms
コンパイル使用メモリ 71,580 KB
実行使用メモリ 57,892 KB
最終ジャッジ日時 2023-09-21 00:48:16
合計ジャッジ時間 6,905 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,784 KB
testcase_01 AC 125 ms
55,764 KB
testcase_02 AC 124 ms
56,032 KB
testcase_03 AC 125 ms
55,512 KB
testcase_04 AC 124 ms
56,420 KB
testcase_05 AC 122 ms
56,160 KB
testcase_06 AC 122 ms
56,228 KB
testcase_07 AC 121 ms
56,096 KB
testcase_08 AC 123 ms
55,848 KB
testcase_09 AC 123 ms
55,788 KB
testcase_10 AC 124 ms
55,776 KB
testcase_11 AC 124 ms
55,872 KB
testcase_12 AC 122 ms
55,804 KB
testcase_13 AC 121 ms
55,752 KB
testcase_14 AC 125 ms
56,580 KB
testcase_15 AC 124 ms
55,940 KB
testcase_16 AC 125 ms
57,892 KB
testcase_17 AC 123 ms
56,124 KB
testcase_18 AC 122 ms
56,204 KB
testcase_19 AC 121 ms
56,464 KB
testcase_20 AC 124 ms
56,292 KB
testcase_21 AC 124 ms
55,508 KB
testcase_22 AC 126 ms
56,112 KB
testcase_23 AC 125 ms
55,720 KB
testcase_24 AC 124 ms
55,912 KB
testcase_25 AC 124 ms
56,016 KB
testcase_26 AC 123 ms
55,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String current = sc.next();
        String[] romans = new String[]{"XII", "I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"};
        int next = sc.nextInt();
        for (int i = 0; i < romans.length; i++) {
            if (romans[i].equals(current)) {
                System.out.println(romans[(i + next + 12 * 100) % 12]);
                return;
            }
        }
    }
}
0