結果

問題 No.405 ローマ数字の腕時計
ユーザー matsuyoshi30matsuyoshi30
提出日時 2017-01-12 23:32:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 649 bytes
コンパイル時間 2,630 ms
コンパイル使用メモリ 73,296 KB
実行使用メモリ 56,452 KB
最終ジャッジ日時 2023-09-21 00:24:40
合計ジャッジ時間 6,434 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,568 KB
testcase_01 AC 118 ms
56,324 KB
testcase_02 AC 118 ms
56,216 KB
testcase_03 AC 118 ms
55,988 KB
testcase_04 AC 118 ms
56,064 KB
testcase_05 AC 119 ms
56,228 KB
testcase_06 AC 117 ms
55,988 KB
testcase_07 AC 120 ms
56,408 KB
testcase_08 AC 118 ms
55,808 KB
testcase_09 AC 118 ms
56,028 KB
testcase_10 AC 119 ms
56,272 KB
testcase_11 AC 117 ms
56,452 KB
testcase_12 AC 119 ms
55,892 KB
testcase_13 AC 119 ms
56,096 KB
testcase_14 AC 121 ms
56,112 KB
testcase_15 AC 119 ms
55,416 KB
testcase_16 AC 120 ms
55,932 KB
testcase_17 AC 119 ms
55,820 KB
testcase_18 AC 119 ms
55,944 KB
testcase_19 AC 120 ms
55,916 KB
testcase_20 AC 119 ms
55,644 KB
testcase_21 AC 123 ms
56,196 KB
testcase_22 AC 118 ms
55,424 KB
testcase_23 AC 117 ms
56,188 KB
testcase_24 AC 119 ms
55,848 KB
testcase_25 AC 117 ms
56,036 KB
testcase_26 AC 117 ms
55,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        String[] time = {"XII", "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI"};

        String s1 = in.next();
        int t = in.nextInt();

        int p = 0;

        for(int i=0; i<time.length; i++) {
            if(s1.equals(time[i])) {
                    p = i;
            }
        }

        t = p + t;

        t = (t % 12 + 12) % 12;

        System.out.println(time[t]);

        in.close();
    }
}
0