結果

問題 No.405 ローマ数字の腕時計
ユーザー swdamdrswdamdr
提出日時 2017-01-26 15:33:48
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 650 bytes
コンパイル時間 1,906 ms
コンパイル使用メモリ 106,240 KB
実行使用メモリ 22,796 KB
最終ジャッジ日時 2023-08-25 18:25:32
合計ジャッジ時間 4,627 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 51 ms
20,776 KB
testcase_03 AC 50 ms
20,680 KB
testcase_04 AC 51 ms
20,660 KB
testcase_05 AC 52 ms
20,740 KB
testcase_06 AC 52 ms
20,700 KB
testcase_07 AC 50 ms
18,732 KB
testcase_08 AC 49 ms
20,636 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 51 ms
20,656 KB
testcase_13 AC 50 ms
22,796 KB
testcase_14 AC 48 ms
20,648 KB
testcase_15 AC 48 ms
20,700 KB
testcase_16 AC 49 ms
20,632 KB
testcase_17 AC 51 ms
20,688 KB
testcase_18 AC 49 ms
20,640 KB
testcase_19 AC 51 ms
20,648 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 50 ms
20,676 KB
testcase_24 AC 50 ms
20,716 KB
testcase_25 AC 51 ms
20,668 KB
testcase_26 AC 49 ms
20,728 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        string[] s = Console.ReadLine().Split();
        int n = int.Parse(s[1]);
        string[] su = new string[] { "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII" };
        int m = Array.IndexOf(su, s[0]);

        if (n < 0)
        {
            while (n < 0)
            {
                n += su.Length;
            }
        }

        m += n;

        if (su.Length < m)
        {
            m -= su.Length;
        }


        Console.WriteLine(su[m]);
        Console.Read();
    }
}
0