結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
|
提出日時 | 2021-06-15 00:42:59 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 72 ms / 2,000 ms |
コード長 | 418 bytes |
コンパイル時間 | 1,663 ms |
コンパイル使用メモリ | 194,712 KB |
最終ジャッジ日時 | 2025-01-22 08:19:16 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; string T[12] = {"XII","I","II","III","IIII","V","VI","VII","VIII","IX","X","XI"}; int main(void) { cin.tie(0); ios::sync_with_stdio(false); string s; int t; cin >> s >> t; for (int i = 0; i < 12; i++) { if (T[i] == s) { int idx = i + t; idx %= 12; if (idx < 0) { idx += 12; } cout << T[idx] << '\n'; return 0; } } return 0; }