結果
| 問題 | No.548 国士無双 |
| コンテスト | |
| ユーザー |
AQUA16573837
|
| 提出日時 | 2018-04-05 01:00:36 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 357µs | |
| コード長 | 710 bytes |
| 記録 | |
| コンパイル時間 | 299 ms |
| コンパイル使用メモリ | 74,928 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-29 15:37:31 |
| 合計ジャッジ時間 | 1,653 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include <stdio.h>
#include <algorithm>
#include <deque>
#include <string>
#include <iostream>
using namespace std;
using ll = long long;
void solve();
int main() {
solve();
#ifdef DBG
while (true);
#endif
}
//548
void solve() {
char s[14], c[13] = { 0 };
int oc = 0, tc = 0;
scanf("%s", s);
for (int i = 0; i < 13; i++) {
if ('m' < s[i])
break;
c[s[i] - 'a']++;
if (c[s[i] - 'a'] == 1)
oc++;
else if (c[s[i] - 'a'] == 2)
oc--, tc++;
else
tc--;
}
if (oc == 13) {
for (int i = 0; i < 13; i++)
printf("%c\n", 'a' + i);
} else if (tc == 1 && oc == 11) {
for (int i = 0; i < 13; i++)
if (c[i] == 0)
printf("%c\n", 'a' + i);
} else {
printf("Impossible\n");
}
}
AQUA16573837