結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-01 01:31:58 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 448 bytes |
| 記録 | |
| コンパイル時間 | 1,089 ms |
| コンパイル使用メモリ | 190,112 KB |
| 実行使用メモリ | 197,608 KB |
| 最終ジャッジ日時 | 2026-04-02 18:11:45 |
| 合計ジャッジ時間 | 1,940 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
map<char, int> mp;
for(int i = 0; i < s.size(); i++) {
mp[s[i]]++;
}
int one = 0, two = 0;
char ans;
for(auto i : mp) {
if(i.second == 2) two++;
if(i.second == 1) {
one++;
ans = i.first;
}
}
if(one == 1 && two == 6) {
cout << ans << endl;
} else {
cout << "Impossible" << endl;
}
return 0;
}