結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
![]() |
提出日時 | 2022-05-15 00:02:18 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 114 ms / 2,000 ms |
コード長 | 504 bytes |
コンパイル時間 | 2,987 ms |
コンパイル使用メモリ | 75,284 KB |
実行使用メモリ | 54,256 KB |
最終ジャッジ日時 | 2024-07-06 19:35:25 |
合計ジャッジ時間 | 6,568 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
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]); } }