結果
| 問題 |
No.405 ローマ数字の腕時計
|
| コンテスト | |
| ユーザー |
Kura
|
| 提出日時 | 2019-02-19 22:27:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,307 bytes |
| コンパイル時間 | 454 ms |
| コンパイル使用メモリ | 58,104 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 19:21:29 |
| 合計ジャッジ時間 | 1,178 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
ソースコード
#include<iostream>
#include<string>
using namespace std;
int main() {
string s; int n;
cin >> s >> n;
if (s == "I") {
n = ((1 + n) % 12+12)%12;
}else if (s == "II") {
n = ((2 + n) % 12 + 12) % 12;
}
else if(s == "III") {
n = ((3 + n) % 12 + 12) % 12;
}
else if (s == "IIII") {
n = ((4 + n) % 12 + 12) % 12;
}
else if (s == "V") {
n = ((5 + n) % 12 + 12) % 12;
}
else if (s == "VI") {
n = ((6 + n) % 12 + 12) % 12;
}
else if (s == "VII") {
n = ((7 + n) % 12 + 12) % 12;
}
else if (s == "VIII") {
n = ((8 + n) % 12 + 12) % 12;
}
else if (s == "IX") {
n = ((9 + n) % 12 + 12) % 12;
}
else if (s == "X") {
n = ((10 + n) % 12 + 12) % 12;
}
else if (s == "XI") {
n = ((11 + n) % 12 + 12) % 12;
}
else{
n = ((12 + n) % 12 + 12) % 12;
}
switch (n)
{
case 0:
cout << "XII" << endl;
break;
case 1:
cout << "I" << endl;
break;
case 2:
cout << "II" << endl;
break;
case 3:
cout << "III" << endl;
break;
case 4:
cout << "IIII" << endl;
break;
case 5:
cout << "V" << endl;
break;
case 6:
cout << "VI" << endl;
break;
case 7:
cout << "VII" << endl;
break;
case 8:
cout << "VIII" << endl;
break;
case 9:
cout << "IX" << endl;
break;
case 10:
cout << "X" << endl;
break;
case 11:
cout << "XI" << endl;
break;
}
}
Kura