結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
![]() |
提出日時 | 2017-05-03 13:34:46 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 929 bytes |
コンパイル時間 | 2,230 ms |
コンパイル使用メモリ | 75,640 KB |
実行使用メモリ | 50,428 KB |
最終ジャッジ日時 | 2024-07-06 19:11:07 |
合計ジャッジ時間 | 3,975 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { String[] table = new String[]{"XII", "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI"}; Map<String, Integer> map1 = new HashMap<>(); Map<Integer, String> map2 = new HashMap<>(); for (int i = 0; i < table.length; i++) { map1.put(table[i], i); map2.put(i, table[i]); } BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String[] inputs = reader.readLine().split(" "); String S1 = inputs[0]; int T = Integer.parseInt(inputs[1]); System.out.println(map2.get((map1.get(S1) + T + 1200) % 12)); } }