結果

問題 No.405 ローマ数字の腕時計
ユーザー fukuseifukusei
提出日時 2017-05-27 15:00:38
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 1,973 ms
コンパイル使用メモリ 74,980 KB
実行使用メモリ 57,720 KB
最終ジャッジ日時 2023-10-21 13:19:59
合計ジャッジ時間 6,339 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
57,544 KB
testcase_01 AC 120 ms
57,464 KB
testcase_02 AC 117 ms
57,368 KB
testcase_03 AC 108 ms
56,132 KB
testcase_04 AC 115 ms
57,292 KB
testcase_05 AC 115 ms
57,036 KB
testcase_06 WA -
testcase_07 AC 115 ms
55,284 KB
testcase_08 AC 105 ms
56,176 KB
testcase_09 WA -
testcase_10 AC 124 ms
57,504 KB
testcase_11 AC 117 ms
57,384 KB
testcase_12 WA -
testcase_13 AC 119 ms
57,488 KB
testcase_14 AC 120 ms
57,664 KB
testcase_15 AC 124 ms
57,528 KB
testcase_16 AC 124 ms
57,084 KB
testcase_17 WA -
testcase_18 AC 118 ms
57,292 KB
testcase_19 AC 118 ms
57,720 KB
testcase_20 AC 112 ms
56,780 KB
testcase_21 AC 122 ms
57,480 KB
testcase_22 AC 118 ms
57,396 KB
testcase_23 AC 113 ms
56,728 KB
testcase_24 AC 120 ms
57,400 KB
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class test{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		String S1 = sc.next();
		int def = 0;
		int sum = 0;
		int T = sc.nextInt();
		
		String roma[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
		
		for(int i=0; i<roma.length; i++){
			if(S1.equals(roma[i])){
				def = i+1;
			}
		}
		
		while(def >= 12){
			def -= 12;
		}
		while(def <= -12){
			def += 12;
		}
		while(T >= 12){
			T -= 12;
		}
		while(T <= -12){
			T += 12;
		}
		
		sum = def + T;
		
		while(sum >= 12){
			sum -= 12;
		}
		while(sum < 0){
			sum += 12;
		}
		
		for(int i=0; i<roma.length; i++){
			if(sum == i+1){
				System.out.println(roma[i]);
			}
		}
		
	}
}
0