結果

問題 No.405 ローマ数字の腕時計
ユーザー RinRin
提出日時 2016-09-09 10:10:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 2,940 ms
コンパイル使用メモリ 72,128 KB
実行使用メモリ 56,472 KB
最終ジャッジ日時 2023-09-21 00:19:45
合計ジャッジ時間 7,268 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
56,096 KB
testcase_01 AC 117 ms
56,084 KB
testcase_02 AC 117 ms
55,796 KB
testcase_03 AC 118 ms
55,920 KB
testcase_04 AC 117 ms
55,592 KB
testcase_05 AC 117 ms
56,204 KB
testcase_06 AC 119 ms
56,084 KB
testcase_07 AC 119 ms
56,172 KB
testcase_08 AC 120 ms
56,132 KB
testcase_09 AC 120 ms
55,676 KB
testcase_10 AC 119 ms
55,860 KB
testcase_11 AC 119 ms
55,704 KB
testcase_12 AC 118 ms
56,180 KB
testcase_13 AC 121 ms
55,700 KB
testcase_14 AC 120 ms
56,304 KB
testcase_15 AC 119 ms
55,920 KB
testcase_16 AC 120 ms
56,184 KB
testcase_17 AC 119 ms
56,100 KB
testcase_18 AC 120 ms
56,164 KB
testcase_19 AC 119 ms
55,732 KB
testcase_20 AC 118 ms
56,212 KB
testcase_21 AC 119 ms
55,980 KB
testcase_22 AC 119 ms
56,384 KB
testcase_23 AC 119 ms
56,300 KB
testcase_24 AC 120 ms
55,776 KB
testcase_25 AC 120 ms
56,472 KB
testcase_26 AC 119 ms
56,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class b {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String foo[] = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"};
		String s = sc.next();
		int t = sc.nextInt();
		int i = 0;
		while(true){
			if(foo[i].equals(s))
				break;
			i++;
		}
		if(t >= 0)
			System.out.println(foo[(i + t) % 12]);
		else
			System.out.println(foo[(12 + ((i + t) % 12)) % 12]);
	}
}
0