結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
![]() |
提出日時 | 2016-08-27 14:11:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 594 bytes |
コンパイル時間 | 617 ms |
コンパイル使用メモリ | 71,644 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-06 19:03:28 |
合計ジャッジ時間 | 1,412 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include<stdio.h> #include <vector> #include <list> #include <map> #include <set> #include <queue> #include <stack> #include <algorithm> #include <sstream> #include <iostream> #include <string> using namespace std; int main() { string S1,S[12] = { "I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; int T; cin >> S1 >> T; int i; for (i = 0; i < 12; i++) { if (S1 == S[i]) { break; } } if (T < 0) { for (int j = 0; j < (-1)*T; j++) { i--; if (i == -1) i = 11; } cout << S[i] << endl; } else { cout << S[(i + T) % 12] << endl; } return 0; }