結果

問題 No.548 国士無双
ユーザー hedwig100hedwig100
提出日時 2020-05-22 21:18:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 898 bytes
コンパイル時間 1,702 ms
コンパイル使用メモリ 166,096 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 15:28:39
合計ジャッジ時間 2,730 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 2 ms
6,940 KB
testcase_20 WA -
testcase_21 AC 2 ms
6,944 KB
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i ++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PL;
typedef pair<int,int> P;
const int INF = 1e9;
const ll MOD = 1e9 + 7;

int main() {
    string S; cin >> S;
    vector<int> alpha(13,0);
    for (char s:S){
        alpha[(int)(s - 'a')] ++;
    }
    vector<int> cnt(3,0);
    bool flag = true;
    for (int p: alpha){
        if (p >= 3){
            flag = false;
            break;
        }
        else{
            cnt[p]++;
        }
    }
    if (!flag){
        printf("Impossible\n");
        return 0;
    }
    if (cnt[2] == 1 && cnt[0] == 1){
        for (int i = 0;i < 13;i++){
            if (alpha[i] == 0){
                cout << (char)(i + 97) << endl;
            }
        }
    }
    else{
        for (int i = 97;i < 97 + 13;i++){
            cout << (char)i << endl;
        }
    }
}
0