結果

問題 No.405 ローマ数字の腕時計
ユーザー キョウチクキョウチク
提出日時 2022-05-15 00:02:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 504 bytes
コンパイル時間 3,063 ms
コンパイル使用メモリ 72,572 KB
実行使用メモリ 56,220 KB
最終ジャッジ日時 2023-09-21 00:51:56
合計ジャッジ時間 7,460 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,704 KB
testcase_01 AC 120 ms
56,056 KB
testcase_02 AC 121 ms
56,204 KB
testcase_03 AC 118 ms
55,932 KB
testcase_04 AC 120 ms
55,744 KB
testcase_05 AC 120 ms
56,168 KB
testcase_06 AC 121 ms
56,064 KB
testcase_07 AC 120 ms
55,800 KB
testcase_08 AC 121 ms
56,056 KB
testcase_09 AC 120 ms
55,716 KB
testcase_10 AC 120 ms
55,760 KB
testcase_11 AC 120 ms
56,220 KB
testcase_12 AC 122 ms
55,632 KB
testcase_13 AC 122 ms
55,808 KB
testcase_14 AC 121 ms
55,776 KB
testcase_15 AC 122 ms
56,012 KB
testcase_16 AC 122 ms
56,040 KB
testcase_17 AC 120 ms
56,124 KB
testcase_18 AC 121 ms
55,844 KB
testcase_19 AC 122 ms
55,960 KB
testcase_20 AC 121 ms
55,496 KB
testcase_21 AC 121 ms
55,868 KB
testcase_22 AC 121 ms
55,532 KB
testcase_23 AC 122 ms
55,524 KB
testcase_24 AC 122 ms
55,860 KB
testcase_25 AC 120 ms
56,124 KB
testcase_26 AC 121 ms
55,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test10 {
  public static void main(String[] args){
    String[] exchange={
      "XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"
    };
    Scanner sc=new Scanner(System.in);
    String[] line;
    line=sc.nextLine().split(" ");
    int h=-1;
    for(int i=0;i<12;i++){
      if(line[0].equals(exchange[i])){
        h=(i+Integer.parseInt(line[1]))%12;
        break;
      }
    }
    if(h<0) h+=(h-11)/-12*12;
    System.out.println(exchange[h]);
  }
}
0