結果

問題 No.405 ローマ数字の腕時計
ユーザー nCk_cvnCk_cv
提出日時 2016-08-27 14:30:59
言語 Java19
(openjdk 21)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 502 bytes
コンパイル時間 1,967 ms
コンパイル使用メモリ 71,700 KB
実行使用メモリ 56,208 KB
最終ジャッジ日時 2023-09-21 00:18:10
合計ジャッジ時間 6,460 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
56,096 KB
testcase_01 AC 123 ms
55,800 KB
testcase_02 AC 125 ms
55,560 KB
testcase_03 AC 121 ms
55,920 KB
testcase_04 AC 123 ms
55,752 KB
testcase_05 AC 122 ms
55,848 KB
testcase_06 AC 122 ms
56,160 KB
testcase_07 AC 122 ms
55,524 KB
testcase_08 AC 122 ms
55,656 KB
testcase_09 AC 122 ms
55,904 KB
testcase_10 AC 121 ms
56,004 KB
testcase_11 AC 121 ms
55,776 KB
testcase_12 AC 119 ms
55,832 KB
testcase_13 AC 122 ms
56,016 KB
testcase_14 AC 125 ms
54,260 KB
testcase_15 AC 123 ms
56,092 KB
testcase_16 AC 123 ms
55,868 KB
testcase_17 AC 122 ms
56,024 KB
testcase_18 AC 122 ms
56,188 KB
testcase_19 AC 124 ms
55,804 KB
testcase_20 AC 122 ms
56,188 KB
testcase_21 AC 124 ms
55,600 KB
testcase_22 AC 122 ms
55,736 KB
testcase_23 AC 121 ms
55,832 KB
testcase_24 AC 121 ms
56,208 KB
testcase_25 AC 121 ms
56,032 KB
testcase_26 AC 121 ms
56,048 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 = 0;
			System.out.println(ti[a]);
		}
}
0