結果
問題 | No.587 七対子 |
ユーザー |
|
提出日時 | 2017-04-14 21:49:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,074 bytes |
コンパイル時間 | 786 ms |
コンパイル使用メモリ | 85,996 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-18 15:19:27 |
合計ジャッジ時間 | 4,795 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 RE * 29 |
ソースコード
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<string> #include<stack> #include<queue> #include<vector> #include<algorithm> #include<iomanip> #include<cassert> typedef long long int ll; using namespace std; #define FOR(i,a,b) for (int i=(a);i<(b);i++) #define REP(i,n) for (int i=0;i<(n);i++) #define EREP(i,n) for (int i=1;i<=(n);i++) const int MOD = 1000000007; const int INF = 1000000; #ifndef EVEL #define DEB(X) cout << #X << ":" <<X<<" " ; #define TF(f) f ? cout<<"true " : cout<<"false "; #define END cout<<"\n"; #else #define DEB(X) {X=X;} #define TF(f) {f=f;} #define END {} #endif string S; int Y=0,E=0,A[15],H=0,EX=0; bool fir=true; int main(){ ios::sync_with_stdio(false); cin>>S; sort(S.begin(),S.end()); char a=S[0]; string as="Impossible"; REP(i,13){ A[((int)S[i]-'a')]++; } REP(i,26){ if(A[i]==0)continue; if(A[i]==1){ if(!fir){as="Impossible";break;} as=(char)(i+'a');fir=false; } } cout<<as<<endl; }