結果
| 問題 | No.405 ローマ数字の腕時計 |
| コンテスト | |
| ユーザー |
AQUA16573837
|
| 提出日時 | 2018-03-12 01:36:35 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 512 bytes |
| 記録 | |
| コンパイル時間 | 240 ms |
| コンパイル使用メモリ | 51,324 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-28 09:01:27 |
| 合計ジャッジ時間 | 957 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 |
ソースコード
#include <stdio.h>
#include <algorithm>
using namespace std;
using ll = long long;
//405
int main() {
char s[5], sample[][5] = {
"I", "II", "III", "IIII", "V", "VI",
"VII", "VIII", "IX", "X", "XI", "XII"
};
int time = 0, p;
scanf("%s %d", s, &time);
while (time < 0)
time += 12;
for (int i = 0; i < 12; i++) {
bool match = true; p = 0;
while (s[p] != 0)
match &= s[p] == sample[i][p], p++;
match &= s[p] == sample[i][p];
if (match)
time += i;
}
printf("%s\n", sample[time % 12]);
}
AQUA16573837