結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-12 07:37:15 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 484 bytes |
| 記録 | |
| コンパイル時間 | 1,188 ms |
| コンパイル使用メモリ | 211,076 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-10 15:41:31 |
| 合計ジャッジ時間 | 2,697 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}