結果
問題 |
No.405 ローマ数字の腕時計
|
ユーザー |
![]() |
提出日時 | 2016-09-12 20:57:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 560 bytes |
コンパイル時間 | 686 ms |
コンパイル使用メモリ | 75,304 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 19:05:11 |
合計ジャッジ時間 | 1,377 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
# include <iostream> # include <cstring> # include <string> # include <vector> # include <cmath> # include <sstream> # include <iomanip> # include <algorithm> using namespace std; # define repl(i, a, b) for(int i=(int)(a);i<(int)(b);i++) # define rep(i, n) repl(i, 0, n) typedef long long ll; int main(){ int T; string str; string time[]={"I","II","III","IIII","V","VI","VII","VIII","IX","X","XI","XII"}; cin >> str >> T; rep(i, 12){ if(time[i] == str){ T += i+1 + 1200; } } T %= 12; if(!T) T = 12; T--; cout << time[T] << endl; return 0; }