結果
| 問題 |
No.587 七対子
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-04-14 22:21:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,078 bytes |
| コンパイル時間 | 883 ms |
| コンパイル使用メモリ | 86,360 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 19:38:29 |
| 合計ジャッジ時間 | 2,055 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
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++)
#define EVEL 1
#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[30],H=0,EX=0;
bool fir=true;
int main(){
ios::sync_with_stdio(false);
cin>>S;
sort(S.begin(),S.end());
string as="Impossible\0";
REP(i,13){
A[((int)S[i]-'a')%26]++;
}
REP(i,26){
if(A[i]==0)continue;
DEB(as)DEB(A[i])TF(fir)END
if(A[i]>2){as="Impossible";break;}
if(A[i]==1){
if(!fir){as="Impossible";break;}
as=(char)(i+(int)'a');fir=false;
}
}
cout<<as<<endl;
return 0;
}