結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
![]() |
提出日時 | 2017-02-28 19:18:36 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 445 bytes |
コンパイル時間 | 576 ms |
コンパイル使用メモリ | 70,400 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-06 19:09:38 |
合計ジャッジ時間 | 1,455 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include <iostream> #include <string> #include <map> using namespace std; int main() { string s[12] = {"I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"}; string S1; int T; cin >> S1 >> T; int now = 0; for(int i=0; i<12; ++i) { if(s[i] == S1) { now = i; } } now += T; while(now < 0) { now += 12; } now %= 12; cout << s[now] << endl; }