結果

問題 No.405 ローマ数字の腕時計
ユーザー RinRin
提出日時 2016-09-09 10:09:52
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 453 bytes
コンパイル時間 2,699 ms
コンパイル使用メモリ 72,284 KB
実行使用メモリ 56,788 KB
最終ジャッジ日時 2023-08-25 18:23:13
合計ジャッジ時間 6,950 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
56,644 KB
testcase_01 AC 112 ms
56,424 KB
testcase_02 AC 113 ms
56,488 KB
testcase_03 AC 115 ms
56,116 KB
testcase_04 AC 115 ms
56,488 KB
testcase_05 AC 113 ms
56,004 KB
testcase_06 AC 111 ms
56,552 KB
testcase_07 AC 109 ms
56,320 KB
testcase_08 AC 109 ms
56,788 KB
testcase_09 AC 110 ms
56,296 KB
testcase_10 AC 108 ms
56,156 KB
testcase_11 RE -
testcase_12 AC 109 ms
56,528 KB
testcase_13 AC 116 ms
56,348 KB
testcase_14 AC 112 ms
56,448 KB
testcase_15 AC 119 ms
55,812 KB
testcase_16 AC 117 ms
55,820 KB
testcase_17 AC 118 ms
56,208 KB
testcase_18 AC 121 ms
56,048 KB
testcase_19 AC 121 ms
55,952 KB
testcase_20 RE -
testcase_21 AC 120 ms
55,792 KB
testcase_22 RE -
testcase_23 AC 118 ms
56,164 KB
testcase_24 RE -
testcase_25 AC 105 ms
56,296 KB
testcase_26 AC 111 ms
56,364 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