結果

問題 No.405 ローマ数字の腕時計
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-18 20:35:02
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 576 bytes
コンパイル時間 2,172 ms
コンパイル使用メモリ 74,500 KB
実行使用メモリ 56,016 KB
最終ジャッジ日時 2024-04-09 20:15:14
合計ジャッジ時間 6,728 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
54,036 KB
testcase_01 AC 131 ms
54,248 KB
testcase_02 RE -
testcase_03 AC 130 ms
54,052 KB
testcase_04 AC 129 ms
54,228 KB
testcase_05 AC 131 ms
54,096 KB
testcase_06 AC 133 ms
54,104 KB
testcase_07 AC 130 ms
54,092 KB
testcase_08 AC 130 ms
53,824 KB
testcase_09 AC 131 ms
54,132 KB
testcase_10 AC 133 ms
54,224 KB
testcase_11 AC 131 ms
54,396 KB
testcase_12 AC 131 ms
56,016 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 132 ms
54,240 KB
testcase_18 RE -
testcase_19 AC 133 ms
54,312 KB
testcase_20 RE -
testcase_21 AC 127 ms
54,104 KB
testcase_22 RE -
testcase_23 AC 136 ms
54,116 KB
testcase_24 AC 132 ms
54,376 KB
testcase_25 AC 130 ms
54,116 KB
testcase_26 AC 132 ms
54,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s1 = sc.next();
    int T = sc.nextInt();
    String[] time = {"XII", "I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"};
    int s = 0;
    if(s1.contains("V")) {
      s = s1.length() + 4;
    } else if(s1.contains("X")) {
      if(s1.charAt(0) == 'I') {
        s = 9;
      } else {
        s = s1.length() + 9;
      }
    } else {
      s = s1.length();
    }
    s += T;
    s = s % 12;
    System.out.println(time[s]);
  }
}
0