結果
問題 |
No.548 国士無双
|
ユーザー |
|
提出日時 | 2021-11-15 21:26:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 768 bytes |
コンパイル時間 | 2,208 ms |
コンパイル使用メモリ | 197,196 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-15 05:39:56 |
合計ジャッジ時間 | 3,309 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#define _GLIBCXX_DEBUG #define ll long long #include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; int main(){ string R = "abcdefghijklm"; string S; cin >> S; vector<bool> T((int)R.size(), false); for(int i = 0; i < (int)S.size(); i++){ for(int j = 0; j < (int)R.size(); j++){ if(S[i] == R[j]){ T[j] = true; break; } } } bool flag = true; for(auto t: T){ if(!t){ if(flag) flag = false; else{ cout << "Impossible" << endl; return 0; } } } if(flag){ for(int i = 0; i < (int)R.size(); i++){ cout << R[i] << endl; } }else{ for(int i = 0; i < (int)R.size(); i++){ if(!T[i]){ cout << R[i] << endl; } } } }