結果

問題 No.405 ローマ数字の腕時計
ユーザー nCk_cvnCk_cv
提出日時 2016-08-27 14:30:29
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 503 bytes
コンパイル時間 1,867 ms
コンパイル使用メモリ 74,408 KB
実行使用メモリ 41,416 KB
最終ジャッジ日時 2024-06-06 12:29:52
合計ジャッジ時間 5,994 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 138 ms
40,168 KB
testcase_03 AC 137 ms
40,848 KB
testcase_04 AC 122 ms
41,328 KB
testcase_05 AC 116 ms
40,936 KB
testcase_06 AC 124 ms
40,980 KB
testcase_07 AC 105 ms
40,084 KB
testcase_08 AC 115 ms
41,056 KB
testcase_09 AC 116 ms
41,316 KB
testcase_10 AC 105 ms
39,888 KB
testcase_11 WA -
testcase_12 AC 120 ms
41,212 KB
testcase_13 AC 122 ms
41,192 KB
testcase_14 AC 122 ms
41,400 KB
testcase_15 AC 114 ms
41,416 KB
testcase_16 AC 117 ms
40,888 KB
testcase_17 AC 116 ms
40,924 KB
testcase_18 AC 105 ms
40,072 KB
testcase_19 AC 114 ms
41,212 KB
testcase_20 WA -
testcase_21 AC 123 ms
41,412 KB
testcase_22 WA -
testcase_23 AC 120 ms
40,912 KB
testcase_24 AC 105 ms
39,676 KB
testcase_25 AC 105 ms
39,664 KB
testcase_26 AC 117 ms
41,168 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