結果

問題 No.405 ローマ数字の腕時計
ユーザー alcheminalchemin
提出日時 2019-09-16 21:29:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,392 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 63,788 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 00:41:39
合計ジャッジ時間 1,455 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>

using namespace std;

int main() {
    string s;
    int t;
    
    cin >> s >> t;
    
    int tm = 1200;
    if (s == "I") {
        tm += 1;
    } else if (s == "II") {
        tm += 2;
    } else if (s == "III") {
        tm += 3;
    } else if (s == "IIII") {
        tm += 4;
    } else if (s == "V") {
        tm += 5;
    } else if (s == "VI") {
        tm += 6;
    } else if (s == "VII") {
        tm += 7;
    } else if (s == "VIII") {
        tm += 8;
    } else if (s == "IX") {
        tm += 9;
    } else if (s == "X") {
        tm += 10;
    } else if (s == "XI") {
        tm += 11;
    } else if (s == "XII") {
        tm += 12;
    }
    
    tm = (t + tm) % 12;
    
    if (tm == 0) {
        cout << "XII" << endl;
    } else if (tm == 1) {
        cout << "I" << endl;
    } else if (tm == 2) {
        cout << "II" << endl;
    } else if (tm == 3) {
        cout << "III" << endl;
    } else if (tm == 4) {
        cout << "IIII" << endl;
    } else if (tm == 5) {
        cout << "V" << endl;
    } else if (tm == 6) {
        cout << "VI" << endl;
    } else if (tm == 7) {
        cout << "VII" << endl;
    } else if (tm == 8) {
        cout << "VIII" << endl;
    } else if (tm == 9) {
        cout << "IX" << endl;
    } else if (tm == 10) {
        cout << "X" << endl;
    } else {
        cout << "XI" << endl;
    }
    
    return 0;
}
0