結果

問題 No.587 七対子
ユーザー Yut176
提出日時 2019-05-18 03:10:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 568 bytes
コンパイル時間 858 ms
コンパイル使用メモリ 89,844 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-17 06:05:07
合計ジャッジ時間 1,867 ms
ジャッジサーバーID
(参考情報)
judge1 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
using namespace std;
int main(void) {
  string s; cin >> s;
  map<char, int> m;
  for(int i=0; i<s.size(); i++) {
    m[s[i]]++;
  }

  int x = 0;
  char c;
  for(auto i=m.begin(); i!=m.end(); i++) {
    if(i->second == 1) {
      x++;
      c = i->first;
    }
  }
  if(x == 1) cout << c << endl;
  else cout << "Impossible" << endl;
  return 0;
}






// EOF
0