結果
問題 |
No.548 国士無双
|
ユーザー |
|
提出日時 | 2019-09-02 22:39:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 553 bytes |
コンパイル時間 | 1,772 ms |
コンパイル使用メモリ | 173,652 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-17 19:07:39 |
合計ジャッジ時間 | 2,721 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; bool check(string s) { map<char, int> m; for (int i = 0; i < s.size(); i++) { m[s[i]] += 1; } for (char c = 'a'; c <= 'm'; c++) { if (m[c] == 0) return false; } return true; } int main() { string S; cin >> S; bool isImpossible = true; for (char c = 'a'; c <= 'm'; c++) { if (check(S + c)) { cout << c << endl; isImpossible = false; } } if (isImpossible) { cout << "Impossible" << endl; } }