結果
| 問題 |
No.405 ローマ数字の腕時計
|
| コンテスト | |
| ユーザー |
nenuon
|
| 提出日時 | 2017-07-31 22:43:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 922 bytes |
| コンパイル時間 | 897 ms |
| コンパイル使用メモリ | 99,400 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-11 05:42:38 |
| 合計ジャッジ時間 | 1,791 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 WA * 6 |
ソースコード
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
typedef long long ll;
int main()
{
map<int, string> MAP;
MAP[1] = "I";
MAP[2] = "II";
MAP[3] = "III";
MAP[4] = "IIII";
MAP[5] = "V";
MAP[6] = "VI";
MAP[7] = "VII";
MAP[8] = "VIII";
MAP[9] = "IX";
MAP[10] = "X";
MAP[11] = "XI";
MAP[0] = "XII";
string s1;
int T;
cin >> s1 >> T;
int h = 0;
bool minus = false;
for(int i = s1.length() - 1; i >= 0; i--) {
if(s1[i]=='I') {
if(minus) h--;
else h++;
} else if(s1[i] == 'V') {
h += 5;
} else {
h += 10;
}
}
h += T + 1200;
h %= 12;
cout << MAP[h] << endl;
return 0;
}
nenuon