結果
問題 | No.405 ローマ数字の腕時計 |
ユーザー | Grenache |
提出日時 | 2016-08-05 22:23:23 |
言語 | Java19 (openjdk 21) |
結果 |
AC
|
実行時間 | 64 ms / 2,000 ms |
コード長 | 1,660 bytes |
コンパイル時間 | 3,828 ms |
コンパイル使用メモリ | 75,684 KB |
実行使用メモリ | 50,860 KB |
最終ジャッジ日時 | 2023-09-21 00:11:22 |
合計ジャッジ時間 | 6,741 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 61 ms
50,472 KB |
testcase_01 | AC | 62 ms
50,360 KB |
testcase_02 | AC | 62 ms
50,484 KB |
testcase_03 | AC | 60 ms
50,452 KB |
testcase_04 | AC | 61 ms
50,392 KB |
testcase_05 | AC | 59 ms
50,456 KB |
testcase_06 | AC | 61 ms
50,860 KB |
testcase_07 | AC | 61 ms
50,500 KB |
testcase_08 | AC | 59 ms
50,472 KB |
testcase_09 | AC | 61 ms
50,836 KB |
testcase_10 | AC | 62 ms
50,652 KB |
testcase_11 | AC | 63 ms
50,720 KB |
testcase_12 | AC | 61 ms
50,840 KB |
testcase_13 | AC | 61 ms
50,632 KB |
testcase_14 | AC | 62 ms
50,616 KB |
testcase_15 | AC | 61 ms
50,724 KB |
testcase_16 | AC | 63 ms
50,444 KB |
testcase_17 | AC | 62 ms
50,568 KB |
testcase_18 | AC | 62 ms
50,320 KB |
testcase_19 | AC | 60 ms
50,628 KB |
testcase_20 | AC | 63 ms
50,536 KB |
testcase_21 | AC | 63 ms
50,324 KB |
testcase_22 | AC | 62 ms
50,740 KB |
testcase_23 | AC | 60 ms
50,484 KB |
testcase_24 | AC | 62 ms
50,440 KB |
testcase_25 | AC | 64 ms
50,460 KB |
testcase_26 | AC | 61 ms
50,464 KB |
ソースコード
import java.io.*; import java.util.*; public class Main_yukicoder405 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Printer pr = new Printer(System.out); String[] r = {"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; String s1 = sc.next(); int t = sc.nextInt(); int i; for (i = 0; i < r.length; i++) { if (s1.equals(r[i])) { break; } } pr.printf(r[((i + t) % 12 + 12) % 12]); pr.close(); sc.close(); } @SuppressWarnings("unused") private static class Scanner { BufferedReader br; Iterator<String> it; Scanner (InputStream in) { br = new BufferedReader(new InputStreamReader(in)); } String next() throws RuntimeException { try { if (it == null || !it.hasNext()) { // it = Arrays.asList(br.readLine().split(" ")).iterator(); it = Arrays.asList(br.readLine().split("\\p{javaWhitespace}+")).iterator(); } return it.next(); } catch (IOException e) { throw new IllegalStateException(); } } int nextInt() throws RuntimeException { return Integer.parseInt(next()); } long nextLong() throws RuntimeException { return Long.parseLong(next()); } float nextFloat() throws RuntimeException { return Float.parseFloat(next()); } double nextDouble() throws RuntimeException { return Double.parseDouble(next()); } void close() { try { br.close(); } catch (IOException e) { // throw new IllegalStateException(); } } } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }