結果

問題 No.405 ローマ数字の腕時計
ユーザー RCCWRCCW
提出日時 2017-02-09 10:53:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 1,912 ms
コンパイル使用メモリ 165,836 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-26 17:47:12
合計ジャッジ時間 3,293 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 WA -
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 WA -
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

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