結果

問題 No.405 ローマ数字の腕時計
ユーザー RCCW
提出日時 2017-02-09 10:53:40
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 3,127 ms
コンパイル使用メモリ 178,776 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-25 17:14:53
合計ジャッジ時間 2,993 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;

int main() {
map<string,int> m={{"I",1},{"II",2},{"III",3},{"IIII",4},{"V",5},{"VI",6},{"VII",7},{"VIII",8},{"IX",9},{"X",10},{"XI",11},{"XII",12}};
map<int,string> mm={{1,"I"},{2,"II"},{3,"III"},{4,"IIII"},{5,"V"},{6,"VI"},{7,"VII"},{8,"VIII"},{9,"IX"},{10,"X"},{11,"XI"},{12,"XII"}};
string s;
cin>>s;
int k,l;
cin>>k;

l=(m[s]+k)%12;
if(l>=0){
cout<<mm[l]<<endl;
}else{
cout<<mm[12+l]<<endl;
}

}

0