結果
問題 | No.548 国士無双 |
ユーザー |
![]() |
提出日時 | 2018-04-15 13:00:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 758 bytes |
コンパイル時間 | 485 ms |
コンパイル使用メモリ | 73,220 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-17 14:47:42 |
合計ジャッジ時間 | 1,127 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 WA * 1 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <math.h> #include <map> #include <set> #define ALL(x) (x).begin(),(x).end() #define RALL(x) (x).rbegin(),(x).rend() #define REP(i,a,n) for(int i = (a);i < (n);i++) #define PI 3.14159265359 #define MOD 1000000007 using namespace std; int main(){ string s,b = "abcdefghijklm"; cin >> s; vector<int> a(13); int m = 0; REP(i, 0, s.length()){ int index = s[i]-'a'; a[index]++; m = max(m,a[index]); } if(m > 2)cout << "Impossible\n"; else if(m == 2){ REP(i, 0, 13){ if(a[i] == 0)cout << b[i] << endl; } } else { REP(i, 0, 13){ cout << b[i] << endl; } } return 0; }