結果

問題 No.405 ローマ数字の腕時計
ユーザー soupesuteaka
提出日時 2017-05-01 15:50:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 902 bytes
コンパイル時間 747 ms
コンパイル使用メモリ 71,240 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 19:10:41
合計ジャッジ時間 1,531 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

// macros
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <map>

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

#define LLINF 1000000000000000000LL
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define debug(a) cout << "L(" << __LINE__ << "):" << #a << ":" << a << endl;

// problems limits
#define MAX_N 10000

// Variables
string S;
int T;

string R[12] = {"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"};

// problems input
void input()
{
    cin >> S >> T;
}

// problems main
void solve()
{
    int n = 0;
    FOR(i,0,12) {
        if (R[i]==S) {
            n = i;
            break;
        }
    }
    n = (n + T + 12*1000) % 12;
    cout << R[n] << endl;
}

int main()
{
    ios::sync_with_stdio(false);

    input();

    solve();
}
0