結果

問題 No.405 ローマ数字の腕時計
ユーザー nCk_cvnCk_cv
提出日時 2016-08-27 14:29:59
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 503 bytes
コンパイル時間 3,900 ms
コンパイル使用メモリ 72,120 KB
実行使用メモリ 56,604 KB
最終ジャッジ日時 2023-08-25 18:19:51
合計ジャッジ時間 6,031 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 112 ms
55,636 KB
testcase_03 AC 114 ms
54,288 KB
testcase_04 AC 122 ms
55,760 KB
testcase_05 AC 124 ms
55,680 KB
testcase_06 AC 120 ms
55,508 KB
testcase_07 AC 112 ms
56,340 KB
testcase_08 AC 113 ms
55,932 KB
testcase_09 AC 109 ms
56,560 KB
testcase_10 AC 113 ms
56,184 KB
testcase_11 RE -
testcase_12 AC 115 ms
56,100 KB
testcase_13 AC 111 ms
55,636 KB
testcase_14 AC 108 ms
55,808 KB
testcase_15 AC 113 ms
55,552 KB
testcase_16 AC 111 ms
55,544 KB
testcase_17 AC 113 ms
56,604 KB
testcase_18 AC 119 ms
55,800 KB
testcase_19 AC 118 ms
53,616 KB
testcase_20 RE -
testcase_21 AC 112 ms
55,804 KB
testcase_22 RE -
testcase_23 AC 114 ms
55,892 KB
testcase_24 AC 113 ms
56,172 KB
testcase_25 AC 114 ms
54,644 KB
testcase_26 AC 122 ms
55,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main {
		static String[] ti = {"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 S1 = sc.next();
			int t = sc.nextInt();
			int a = 0;
			for(int i = 0; i < ti.length; i++) {
				if(S1.equals(ti[i])) {
					a = i+1;
					break;
				}
			}
			a += t;
			a %= 12;
			if(a <= 0) a += 12;
			a -= 1;
			if(a == 0) a = 12;
			System.out.println(ti[a]);
		}
}
0