結果

問題 No.587 七対子
ユーザー focus
提出日時 2018-02-13 19:07:42
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 486 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 59,996 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 19:50:39
合計ジャッジ時間 1,453 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
    int table[26]={},count=-1;
    char out;
    string str;
    cin >> str;
    for(int i=0;str[i]!='\0';i++){
        table[str[i]-'a']++;
    }
    for(int i=0;i<26;i++){
        if(!(table[i]==2||table[i]==0)){
            if(table[i]>2)  count++;
            out = 'a' + i;
            count++;
        }
    }
    if(count)   cout << "Impossible" << endl;
    else    cout << out << endl;
}
0