結果
問題 | No.548 国士無双 |
ユーザー |
![]() |
提出日時 | 2019-12-11 09:58:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 681 bytes |
コンパイル時間 | 1,899 ms |
コンパイル使用メモリ | 174,132 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 07:36:23 |
合計ジャッジ時間 | 2,503 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);++i) #define all(a) (a).begin(),(a).end() using namespace std; typedef long long ll; int main(){ ios::sync_with_stdio(false); cin.tie(0); string S; cin >> S; sort(all(S)); string T = S; auto result = unique(all(S)); S.erase(result, S.end()); vector<char> ans = {'a','b','c','d','e','f','g','h','i','j','k','l','m'}; if(T.size() == S.size() + 1){ rep(i,13){ if(count(all(S),ans[i]) == 0){ cout << ans[i] << endl; return 0; } } } else if(T.size() == S.size()){ rep(i,13){ cout << ans[i] << endl; } } else cout << "Impossible" << endl; return 0; }