結果

問題 No.548 国士無双
ユーザー Bantako
提出日時 2017-08-22 19:22:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 567 bytes
コンパイル時間 1,540 ms
コンパイル使用メモリ 167,708 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-17 13:44:20
合計ジャッジ時間 2,310 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
int cnt[13];
main(){
    string s;
    cin >> s;
    for(char c:s)if(c <= 'm')cnt[c-'a']++;
    int maxe = *max_element(cnt,cnt+13);
    if(maxe > 2){
        cout << "Impossible" << endl;
    }else if(maxe == 2){
        printf("%c\n",distance(cnt,min_element(cnt,cnt+13))+'a');
    }else{
        if(accumulate(cnt,cnt+13,0) != 13){
            cout << "Impossible" << endl;
        }else{
            for(int i = 0;i < 13;i++)printf("%c\n",i+'a');
        }
    }
}
0