結果

問題 No.405 ローマ数字の腕時計
ユーザー ぴろずぴろず
提出日時 2016-08-16 21:38:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 3,136 ms
コンパイル使用メモリ 71,068 KB
実行使用メモリ 56,364 KB
最終ジャッジ日時 2023-09-21 00:17:44
合計ジャッジ時間 6,569 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,760 KB
testcase_01 AC 122 ms
54,236 KB
testcase_02 AC 124 ms
56,116 KB
testcase_03 AC 124 ms
55,880 KB
testcase_04 AC 123 ms
55,500 KB
testcase_05 AC 120 ms
55,460 KB
testcase_06 AC 120 ms
55,556 KB
testcase_07 AC 119 ms
55,640 KB
testcase_08 AC 125 ms
55,576 KB
testcase_09 AC 121 ms
55,484 KB
testcase_10 AC 123 ms
55,864 KB
testcase_11 AC 126 ms
55,716 KB
testcase_12 AC 126 ms
56,008 KB
testcase_13 AC 122 ms
55,728 KB
testcase_14 AC 123 ms
55,724 KB
testcase_15 AC 122 ms
55,716 KB
testcase_16 AC 120 ms
55,608 KB
testcase_17 AC 122 ms
55,780 KB
testcase_18 AC 122 ms
55,656 KB
testcase_19 AC 123 ms
55,444 KB
testcase_20 AC 121 ms
55,432 KB
testcase_21 AC 123 ms
55,572 KB
testcase_22 AC 126 ms
55,256 KB
testcase_23 AC 125 ms
55,320 KB
testcase_24 AC 124 ms
56,364 KB
testcase_25 AC 123 ms
55,596 KB
testcase_26 AC 122 ms
55,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no405;

import java.util.Scanner;

public class Main {
	public static final String[] ROMAN = {"","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int t = sc.nextInt();
		int h = 0;
		for(int i=1;i<ROMAN.length;i++) {
			if (ROMAN[i].equals(s)) {
				h = i;
				break;
			}
		}
		h = ((h + t) % 12 + 12) % 12;
		System.out.println(ROMAN[h == 0 ? 12 : h]);
	}

}
0