結果
| 問題 | No.587 七対子 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-01-28 20:40:51 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 368 bytes | 
| コンパイル時間 | 1,553 ms | 
| コンパイル使用メモリ | 166,144 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-19 19:50:30 | 
| 合計ジャッジ時間 | 2,480 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 35 | 
ソースコード
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
int cnt[26];
int main(){
	string s;cin>>s;
	for(char c:s){
		cnt[c-'a']++;
	}
	int id=-1;
	rep(i,26){
		if(cnt[i]==1){
			if(id!=-1){
				puts("Impossible");return 0;
			}
			id=i;
		}
		else if(cnt[i]!=0&&cnt[i]!=2){
			puts("Impossible");return 0;
		}
	}
	printf("%c\n",id+'a');
}
            
            
            
        