結果

問題 No.405 ローマ数字の腕時計
ユーザー nCk_cvnCk_cv
提出日時 2016-08-27 14:30:29
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 503 bytes
コンパイル時間 1,870 ms
コンパイル使用メモリ 71,292 KB
実行使用メモリ 56,596 KB
最終ジャッジ日時 2023-08-25 18:20:12
合計ジャッジ時間 5,986 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 111 ms
56,000 KB
testcase_03 AC 114 ms
56,160 KB
testcase_04 AC 111 ms
56,200 KB
testcase_05 AC 115 ms
56,428 KB
testcase_06 AC 115 ms
56,564 KB
testcase_07 AC 111 ms
56,596 KB
testcase_08 AC 114 ms
55,820 KB
testcase_09 AC 114 ms
55,756 KB
testcase_10 AC 111 ms
56,128 KB
testcase_11 WA -
testcase_12 AC 107 ms
55,732 KB
testcase_13 AC 113 ms
55,968 KB
testcase_14 AC 113 ms
56,272 KB
testcase_15 AC 114 ms
55,540 KB
testcase_16 AC 115 ms
56,336 KB
testcase_17 AC 109 ms
56,156 KB
testcase_18 AC 109 ms
56,056 KB
testcase_19 AC 110 ms
55,512 KB
testcase_20 WA -
testcase_21 AC 111 ms
53,964 KB
testcase_22 WA -
testcase_23 AC 119 ms
55,968 KB
testcase_24 AC 124 ms
55,816 KB
testcase_25 AC 119 ms
55,700 KB
testcase_26 AC 119 ms
56,548 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 = 11;
			System.out.println(ti[a]);
		}
}
0