結果

問題 No.405 ローマ数字の腕時計
ユーザー takeya_okino
提出日時 2017-06-18 20:35:02
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 576 bytes
コンパイル時間 1,868 ms
コンパイル使用メモリ 73,984 KB
実行使用メモリ 41,456 KB
最終ジャッジ日時 2024-10-01 20:30:45
合計ジャッジ時間 5,950 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 RE * 8
権限があれば一括ダウンロードができます

ソースコード

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