結果
| 問題 |
No.548 国士無双
|
| コンテスト | |
| ユーザー |
lll
|
| 提出日時 | 2017-07-29 06:12:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 692 bytes |
| コンパイル時間 | 1,558 ms |
| コンパイル使用メモリ | 174,704 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-17 13:40:39 |
| 合計ジャッジ時間 | 2,252 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
string alpha = "abcdefghijklm";
vector<string> vec;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
string S;
cin >> S;
for (char c = 'a'; c <= 'm'; c++) {
string t = alpha + c;
sort(t.begin(), t.end());
vec.push_back(t);
}
bool f = false;
for (char c = 'a'; c <= 'm'; c++) {
string t = S + c;
sort(t.begin(), t.end());
for (auto v : vec) {
if (v == t) {
cout << c << endl;
f = true;
}
}
}
if (!f) {
cout << "Impossible" << endl;
}
return 0;
}
lll