結果

問題 No.405 ローマ数字の腕時計
ユーザー RinRin
提出日時 2016-09-02 18:15:04
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 446 bytes
コンパイル時間 5,112 ms
コンパイル使用メモリ 71,776 KB
実行使用メモリ 56,188 KB
最終ジャッジ日時 2023-08-25 18:20:53
合計ジャッジ時間 9,407 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,872 KB
testcase_01 AC 124 ms
55,600 KB
testcase_02 AC 123 ms
56,012 KB
testcase_03 AC 124 ms
55,776 KB
testcase_04 AC 122 ms
55,760 KB
testcase_05 AC 123 ms
55,724 KB
testcase_06 AC 122 ms
56,056 KB
testcase_07 AC 123 ms
55,884 KB
testcase_08 AC 122 ms
55,860 KB
testcase_09 AC 122 ms
55,728 KB
testcase_10 AC 120 ms
55,868 KB
testcase_11 RE -
testcase_12 AC 120 ms
55,864 KB
testcase_13 AC 119 ms
55,400 KB
testcase_14 AC 120 ms
56,188 KB
testcase_15 AC 120 ms
55,648 KB
testcase_16 AC 123 ms
55,676 KB
testcase_17 AC 122 ms
55,916 KB
testcase_18 AC 119 ms
54,068 KB
testcase_19 AC 118 ms
55,772 KB
testcase_20 RE -
testcase_21 AC 119 ms
55,672 KB
testcase_22 RE -
testcase_23 AC 120 ms
55,740 KB
testcase_24 RE -
testcase_25 AC 122 ms
55,948 KB
testcase_26 AC 121 ms
55,952 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)]);
	}
}
0