結果
| 問題 |
No.548 国士無双
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-07-28 22:37:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,045 bytes |
| コンパイル時間 | 1,072 ms |
| コンパイル使用メモリ | 117,424 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-17 13:28:25 |
| 合計ジャッジ時間 | 1,887 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"
using namespace std;
const long long int MOD = 1000000007;
long long int power(long long int x, long long int n, long long int M) {
long long int tmp = 1;
if (n > 0) {
tmp = power(x, n / 2, M);
if (n % 2 == 0) tmp = (tmp*tmp) % M;
else tmp = (((tmp*tmp) % M)*x) % M;
}
return tmp;
}
long long int N, M, K, Q, W, H, L, R;
long long int ans;
int main() {
ios::sync_with_stdio(false);
string s;
cin >> s;
map<char, int>m;
for (auto i : s) {
m[i]++;
}
int cnt = 0;
char box = 0;
for (char i = 'a'; i <= 'm'; i++) {
if (!m[i]) {
cnt++;
box = i;
}
}
if (cnt == 1) {
cout << box << endl;
return 0;
}
if (!cnt) {
for (char i = 'a'; i <= 'm'; i++) {
cout << i << endl;
}
return 0;
}
cout << "Impossible\n";
return 0;
}