結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
57,468 KB
testcase_01 AC 136 ms
57,540 KB
testcase_02 AC 133 ms
57,520 KB
testcase_03 AC 132 ms
57,472 KB
testcase_04 AC 131 ms
57,548 KB
testcase_05 AC 120 ms
56,300 KB
testcase_06 AC 131 ms
57,512 KB
testcase_07 AC 131 ms
57,540 KB
testcase_08 AC 131 ms
57,488 KB
testcase_09 AC 129 ms
57,512 KB
testcase_10 AC 132 ms
57,452 KB
testcase_11 AC 132 ms
57,556 KB
testcase_12 RE -
testcase_13 AC 139 ms
57,520 KB
testcase_14 AC 132 ms
57,460 KB
testcase_15 AC 131 ms
57,380 KB
testcase_16 AC 130 ms
57,520 KB
testcase_17 RE -
testcase_18 AC 136 ms
57,476 KB
testcase_19 AC 125 ms
56,212 KB
testcase_20 AC 134 ms
57,324 KB
testcase_21 AC 136 ms
57,492 KB
testcase_22 AC 140 ms
57,396 KB
testcase_23 AC 138 ms
55,652 KB
testcase_24 AC 132 ms
57,084 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{
			while(add<0){
			add += 12;
		}
			System.out.println(S1List[add-1]);
		}
	}
}
		
0