結果

問題 No.405 ローマ数字の腕時計
ユーザー HEGO55HEGO55
提出日時 2017-05-27 15:22:51
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 750 bytes
コンパイル時間 2,207 ms
コンパイル使用メモリ 76,916 KB
実行使用メモリ 57,620 KB
最終ジャッジ日時 2023-10-21 13:20:49
合計ジャッジ時間 6,588 ms
ジャッジサーバーID
(参考情報)
judge10 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
57,076 KB
testcase_01 AC 131 ms
57,508 KB
testcase_02 AC 129 ms
55,540 KB
testcase_03 AC 129 ms
57,424 KB
testcase_04 AC 130 ms
57,512 KB
testcase_05 AC 132 ms
57,308 KB
testcase_06 AC 129 ms
57,376 KB
testcase_07 AC 129 ms
57,556 KB
testcase_08 AC 130 ms
57,388 KB
testcase_09 AC 130 ms
57,524 KB
testcase_10 AC 131 ms
57,468 KB
testcase_11 AC 133 ms
57,468 KB
testcase_12 AC 130 ms
57,516 KB
testcase_13 AC 133 ms
57,340 KB
testcase_14 AC 133 ms
57,332 KB
testcase_15 AC 132 ms
57,068 KB
testcase_16 AC 132 ms
57,332 KB
testcase_17 AC 132 ms
57,620 KB
testcase_18 AC 138 ms
57,464 KB
testcase_19 AC 130 ms
57,268 KB
testcase_20 AC 130 ms
57,416 KB
testcase_21 AC 135 ms
57,460 KB
testcase_22 AC 131 ms
57,460 KB
testcase_23 AC 134 ms
57,584 KB
testcase_24 AC 132 ms
57,612 KB
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class No405{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int t = 0;
		
		String[] S1List = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
		int[] TList     = {1,2,3,4,5,6,7,8,9,10,11,12};
			
		String S1 = sc.next();
		int T = sc.nextInt();
		
		for(int i=0; i<S1List.length; i++){
			if(S1List[i].equals(S1)){
				t = TList[i];
			}
		}
		
		int add = T + t;
		if(add>0){
			if(add<=12){
				System.out.println(S1List[add-1]);
			}else{
				while(add>12){
				   add -= 12;
				}
				System.out.println(S1List[add-1]);
			}
		}else if(add<0){
			while(add<0){
			add += 12;
		}
			System.out.println(S1List[add-1]);
		}else{
			System.out.println(S1List[11]);
		}
	}
}
		
0