結果
問題 |
No.548 国士無双
|
ユーザー |
![]() |
提出日時 | 2017-07-28 22:34:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 999 bytes |
コンパイル時間 | 724 ms |
コンパイル使用メモリ | 90,000 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-17 13:00:11 |
合計ジャッジ時間 | 1,545 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> #include <bitset> using namespace std; #define FOR(I,A,B) for(int I = (A); I < (B); ++I) typedef long long ll; int main() { string abc = "abcdefghijklm"; int cnt[13]; FOR(i,0,13) cnt[i] = 0; string s; cin >> s; bool two = false; bool no = false; FOR(i,0,13) { if(s[i]>='a' && s[i]<='m') { cnt[s[i]-'a']++; if(cnt[s[i]-'a'] >= 2 && !two) two = true; else if(cnt[s[i]-'a'] >= 2 && two) { cout << "Impossible" << endl; return 0; } } else { cout << "Impossible" << endl; return 0; } } if(two) { FOR(i,0,13) { if(cnt[i]==0) { cout << abc[i] << endl; return 0; } } } else { FOR(i,0,13) { cout << abc[i] << endl; } } return 0; }