結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-02 18:33:52 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 363µs | |
| コード長 | 455 bytes |
| 記録 | |
| コンパイル時間 | 420 ms |
| コンパイル使用メモリ | 92,928 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-19 00:10:12 |
| 合計ジャッジ時間 | 2,380 ms |
|
ジャッジサーバーID (参考情報) |
judge3_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;
}
}