結果

問題 No.587 七対子
ユーザー kazuppakazuppa
提出日時 2024-08-14 08:41:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,146 bytes
コンパイル時間 3,996 ms
コンパイル使用メモリ 236,468 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-08-14 08:41:38
合計ジャッジ時間 4,691 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 WA -
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 WA -
testcase_20 AC 1 ms
5,376 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
5,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 1 ms
5,376 KB
testcase_28 AC 2 ms
5,376 KB
testcase_29 AC 1 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 WA -
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
#pragma GCC target ("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using namespace atcoder;
using ll=long long;
#define endl "\n"
#define rep(i,a,b) for(it i=(it)(a);i<=(it)b;i++)
#define nrep(i,a,b) for(it i=(it)(a);i>=(it)b;i--)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define moda 998244353LL
#define modb 1000000007LL
#define dai 2500000000000000000LL
#define tyu 2500000000
#define giri 1000000000
#define en 3.14159265358979
#define sho -dai
#define eps 1e-14
#define yn(x) cout<<(x ? "Yes\n":"No\n");
#define YN(x) cout<<(x ? "YES\n":"NO\n");
using it=long long;
using un=unsigned long long;
using db=long double;
using st=string;
using ch=char;
using bo=bool;
using P=pair<it,it>;
using ip=pair<int,int>;
using mint=modint;
using mints=modint998244353;
using vi=vector<it>;
using ivi=vector<int>;
using vd=vector<db>;
using vs=vector<st>;
using vc=vector<ch>;
using vb=vector<bo>;
using vp=vector<P>;
using ivp=vector<ip>;
using vm=vector<mint>;
using sp=set<P>;
using isp=set<ip>;
using ss=set<st>;
using sc=set<ch>;
using si=set<it>;
using isi=set<int>;
using svi=set<vi>;
using vvi=vector<vi>;
using ivvi=vector<ivi>;
using vvd=vector<vd>;
using vvs=vector<vs>;
using vvb=vector<vb>;
using vvc=vector<vc>;
using vvp=vector<vp>;
using ivvp=vector<ivp>;
using vvm=vector<vm>;
using vsi=vector<si>;
using ivsi=vector<isi>;
using vsp=vector<sp>;
using ivsp=vector<isp>;
using vvsi=vector<vsi>;
using ivvsi=vector<ivsi>;
using vvsp=vector<vsp>;
using ivvsp=vector<ivsp>;
using vvvi=vector<vvi>;
using ivvvi=vector<ivvi>;
using vvvd=vector<vvd>;
using vvvm=vector<vvm>;
using vvvvi=vector<vvvi>;
using ivvvvi=vector<ivvvi>;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  st s;cin>>s;
  map<ch,int> cnt;
  for(ch c:s)cnt[c]++;
  for(auto i:cnt)
    if(i.second>2||i.second==0){
      cout<<"Impossible\n";
      return 0;
    }
  for(auto i:cnt)
    if(cnt[i.first]==1){
      cout<<i.first<<endl;
      return 0;
    }
}
0