結果
| 問題 | No.405 ローマ数字の腕時計 |
| コンテスト | |
| ユーザー |
okayunonaha
|
| 提出日時 | 2016-08-05 22:47:16 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,345 bytes |
| 記録 | |
| コンパイル時間 | 546 ms |
| コンパイル使用メモリ | 56,116 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-24 04:06:14 |
| 合計ジャッジ時間 | 1,306 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 20 |
ソースコード
#include <iostream>
using namespace std;
int solve(char *str, int t);
int main(void) {
int t,n=0;
char s[5];
cin >> s >> t;
n = solve(s, t);
if(n == 0) {
cout << "XII"<< endl;
} else if(n == 1) {
cout << "I"<<endl;
} else if(n == 2) {
cout << "II"<<endl;
} else if(n == 3) {
cout << "III"<<endl;
} else if(n == 4) {
cout << "IIII"<<endl;
} else if(n == 5) {
cout<< "IV"<<endl;
} else if(n == 6) {
cout<< "V"<<endl;
} else if(n == 7) {
cout<< "VI"<<endl;
} else if(n == 8) {
cout<< "VII"<<endl;
} else if(n == 9) {
cout<< "IX"<<endl;
} else if(n == 10) {
cout<< "X"<<endl;
}else if(n == 11) {
cout << "XI"<< endl;
}
return 0;
}
int solve(char *str, int t) {
int n = 0;
if (str[0] == 'I'&&str[1]=='\0') {
n = 1+t;
}else if(str == "II") {
n = 2+t;
}else if(str == "III") {
n = 3+t;
}else if (str == "IIII") {
n = 4+t;
}else if(str[0] == 'V'&&str[1]=='\0') {
n = 5+t;
}else if(str == "VI") {
n = 6+t;
}else if(str == "VII") {
n = 7+t;
}else if(str == "VIII") {
n = 8+t;
}else if(str == "IX") {
n = 9+t;
}else if(str[0] == 'X'&& str[1] =='\0') {
n = 10+t;
}else if(str == "XI") {
n = 11+t;
}else if(str == "XII") {
n = 12+t;
cout << "1" << endl;
}
n %= 12;
return n;
}
okayunonaha