結果

問題 No.405 ローマ数字の腕時計
ユーザー tenten
提出日時 2020-11-11 14:47:56
言語 Java
(openjdk 23)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 1,915 ms
コンパイル使用メモリ 74,496 KB
実行使用メモリ 54,396 KB
最終ジャッジ日時 2024-07-06 19:30:54
合計ジャッジ時間 5,966 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

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