結果

問題 No.587 七対子
ユーザー masakt
提出日時 2017-11-04 00:07:48
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 940 bytes
コンパイル時間 1,640 ms
コンパイル使用メモリ 170,628 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-23 15:25:50
合計ジャッジ時間 3,122 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define all(r) r.begin(),r.end()
using namespace std;
struct Solution {
    void solve(std::istream& in, std::ostream& out) {
        string s, t;
        in >> s;
        sort(all(s));
        t = s;
        t.erase(unique(all(t)), t.end());
        if (t.size() == 7) {
            string ans = "";
            for (int i = 0; i < 13; i++) {
                if (s[i] != t[i / 2]) {
                    ans =s[i];
                    break;
                }
            }
            out << ans << '\n';
        }
        else {
            out << "Impossible" << '\n';
        }
    }
};
void solve(std::istream& in, std::ostream& out) {
    out << std::setprecision(12);
    Solution solution;
    solution.solve(in, out);
}
#include <fstream>
#include <iostream>
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    istream& in = cin;
    ostream& out = cout;
    solve(in, out);
    return 0;
}
0