結果

問題 No.405 ローマ数字の腕時計
ユーザー SyuutaroSyuutaro
提出日時 2018-03-18 23:38:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 921 bytes
コンパイル時間 521 ms
コンパイル使用メモリ 65,220 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 00:32:52
合計ジャッジ時間 1,545 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <map>
#include <string>
int main(){
    //input
    char S1[5];
    int T;
    scanf("%s %d",S1,&T);
    std::string s1(S1);

    std::map<int,std::string> table1;
    table1[0] = "I";
    table1[1] = "II";
    table1[2] = "III";
    table1[3] = "IIII";
    table1[4] = "V";
    table1[5] = "VI";
    table1[6] = "VII";
    table1[7] = "VIII";
    table1[8] = "IX";
    table1[9] = "X";
    table1[10] = "XI";
    table1[11] = "XII";

    std::map<std::string,int> table2;
    table2[table1[0]] = 0;
    table2[table1[1]] = 1;
    table2[table1[2]] = 2;
    table2[table1[3]] = 3;
    table2[table1[4]] = 4;
    table2[table1[5]] = 5;
    table2[table1[6]] = 6;
    table2[table1[7]] = 7;
    table2[table1[8]] = 8;
    table2[table1[9]] = 9;
    table2[table1[10]] = 10;
    table2[table1[11]] = 11;

    //output
    printf("%s\n",table1[(table2[s1]+T+12*1000)%12].c_str());
    return 0;
}
0