結果
| 問題 | No.405 ローマ数字の腕時計 |
| コンテスト | |
| ユーザー |
btk
|
| 提出日時 | 2016-08-04 10:54:53 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 529 bytes |
| 記録 | |
| コンパイル時間 | 1,833 ms |
| コンパイル使用メモリ | 168,796 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-24 04:03:55 |
| 合計ジャッジ時間 | 2,748 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 WA * 6 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int convert(string s){
if(s=="IX")return 9;
int res=0;
for(auto &it:s){
if(it=='I')res++;
if(it=='V')res+=5;
if(it=='X')res+=10;
}
return (res+11)%12;
}
string convert(int x){
x++;
if(x==9)return "IX";
string res;
if(x>=10)res+="X",x-=10;
if(x>=5)res+="V",x-=5;
while(x--)res+="I";
return res;
}
int main(){
string s;int T;
cin>>s>>T;
cout<<convert((convert(s)+T%12+12)%12)<<endl;
return 0;
}
btk