結果
| 問題 | No.405 ローマ数字の腕時計 |
| コンテスト | |
| ユーザー |
moyashi_senpai
|
| 提出日時 | 2016-08-05 22:40:04 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 937 bytes |
| 記録 | |
| コンパイル時間 | 1,122 ms |
| コンパイル使用メモリ | 110,088 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-28 08:33:57 |
| 合計ジャッジ時間 | 1,445 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <stack>
using namespace std;
#define Getsign(n) ((n > 0) - (n < 0))
#define QWERTYR(c) (c == 'y' || c == 'u' || (c >= 'h' && c <= 'p') ? true : false)
map<string, int> roma_time = { { "I",1 },{ "II",2 },{ "III",3 },{ "IIII",4 },{ "V",5 },{ "VI",6 },{ "VII",7 },{ "VIII",8 },{ "IX",9 },{ "X",10 },{ "XI",11 },{ "XII",12 } };
typedef vector<int> Ivec;
typedef pair<int, int> pii;
int main() {
char str[5];
int t;
scanf("%s %d", str,&t);
int time = (t + roma_time[(string) str]) % 12;
if (time < 0) time = 12 - abs(time);
if (time == 0) time = 12;
for (auto itr = roma_time.begin(); itr != roma_time.end(); itr++) {
if(itr->second == time)
printf("%s\n", itr->first.c_str());
}
return 0;
}
moyashi_senpai