結果

問題 No.587 七対子
ユーザー Noiri
提出日時 2017-12-11 01:20:43
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 492 bytes
コンパイル時間 526 ms
コンパイル使用メモリ 56,396 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-30 11:31:27
合計ジャッジ時間 1,723 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <iostream>
using namespace std;

int main(){
    char s[13];
    for(int i = 0; i < 13; i++) cin >> s[i];
    int flag = 0;
    for(int i = 0; i < 13; i++){
        int count = 0;
        for(int j = 0; j < 13; j++){
            if(s[i] == s[j]) count += 1;
        }
        if(count == 1) cout << s[i] << endl;
        else if(count != 2) {
            flag = 1;
            cout << "Impossible" << endl;
        }
        if(flag) break; 
    }

    return 0;
}
0