結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-02 18:33:52 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 455 bytes |
| 記録 | |
| コンパイル時間 | 465 ms |
| コンパイル使用メモリ | 95,080 KB |
| 実行使用メモリ | 103,052 KB |
| 最終ジャッジ日時 | 2026-04-02 18:12:28 |
| 合計ジャッジ時間 | 1,321 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main() {
string s;
cin >> s;
map<char,int> mp;
for(int i=0; i<s.size(); i++) {
mp[s[i]]++;
}
int a=0, b=0;
char ans;
for(auto p:mp) {
if(p.second==2) {
b++;
}
if(p.second==1) {
a++;
ans=p.first;
}
}
if(b==6&&a==1) {
cout << ans << endl;
}
else {
cout << "Impossible" << endl;
}
}