結果

問題 No.405 ローマ数字の腕時計
ユーザー nullzinenullzine
提出日時 2017-01-25 21:23:47
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 718 bytes
コンパイル時間 2,067 ms
コンパイル使用メモリ 71,464 KB
実行使用メモリ 56,548 KB
最終ジャッジ日時 2023-08-25 18:25:25
合計ジャッジ時間 5,830 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
56,548 KB
testcase_01 AC 106 ms
56,056 KB
testcase_02 AC 109 ms
56,404 KB
testcase_03 AC 102 ms
55,904 KB
testcase_04 AC 109 ms
56,376 KB
testcase_05 AC 110 ms
56,048 KB
testcase_06 AC 106 ms
55,840 KB
testcase_07 AC 107 ms
55,684 KB
testcase_08 AC 112 ms
56,328 KB
testcase_09 AC 108 ms
56,212 KB
testcase_10 AC 110 ms
56,536 KB
testcase_11 RE -
testcase_12 AC 109 ms
55,596 KB
testcase_13 AC 111 ms
56,108 KB
testcase_14 AC 108 ms
56,032 KB
testcase_15 AC 106 ms
56,232 KB
testcase_16 AC 111 ms
56,120 KB
testcase_17 AC 112 ms
56,408 KB
testcase_18 AC 110 ms
56,092 KB
testcase_19 AC 109 ms
55,804 KB
testcase_20 RE -
testcase_21 AC 106 ms
56,304 KB
testcase_22 RE -
testcase_23 AC 109 ms
55,664 KB
testcase_24 RE -
testcase_25 AC 114 ms
56,220 KB
testcase_26 AC 109 ms
56,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

public class Main {

    public static void main(String[] args){
        new Main().run();
    }

    private void run(){
        String[] clock = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
        String[] strs = new java.util.Scanner(System.in).nextLine().split(" ");
        System.out.println(clock[Integer.parseInt(strs[1])<0?clock.length+(search(clock,strs[0])+Integer.parseInt(strs[1]))%clock.length:(search(clock,strs[0])+Integer.parseInt(strs[1]))%clock.length]);
    }

    private int search(String[] clock,String target){
        for(int i=0;i<clock.length;i++){
            if(clock[i].equals(target)){
                return i;
            }
        }
        return -1;
    }

}
0