結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-12 07:37:15 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 484 bytes |
| 記録 | |
| コンパイル時間 | 2,520 ms |
| コンパイル使用メモリ | 192,380 KB |
| 最終ジャッジ日時 | 2025-01-11 01:39:19 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
int cnt[128] = {};
for (char c: s)
cnt[c]++;
char c = ' ';
for (char x = 'a'; x <= 'z'; x++) {
if (cnt[x] == 0 || cnt[x] == 2) continue;
else if (cnt[x] == 1 && c == ' ') c = x;
else c = '!';
}
cout << (c == '!' ? "Impossible" : string(1, c)) << endl;
return 0;
}