結果
| 問題 |
No.405 ローマ数字の腕時計
|
| コンテスト | |
| ユーザー |
kichirb3
|
| 提出日時 | 2018-02-27 13:56:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 839 bytes |
| コンパイル時間 | 773 ms |
| コンパイル使用メモリ | 75,184 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-28 08:16:08 |
| 合計ジャッジ時間 | 1,383 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 WA * 1 |
ソースコード
// No.405 ローマ数字の腕時計
// https://yukicoder.me/problems/no/405
//
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
string solve(string &S1, int T);
int main() {
string S1;
int T;
cin >> S1 >> T;
string ans = solve(S1, T);
cout << ans << endl;
}
string solve(string &S1, int T) {
vector<string> clock {"I", "II", "III", "IIII", "V", "VI", "VI", "VIII", "IX", "X", "XI", "XII"};
while (clock[0] != S1) {
rotate(clock.begin(), clock.begin()+1, clock.end());
}
while (T < 0) // マイナス方向にはrotate()できない
T += clock.size();
T %= clock.size(); // 配列のサイズ以上にはrotate()できない
rotate(clock.begin(), clock.begin()+T, clock.end());
return clock[0];
}
kichirb3