結果
問題 |
No.548 国士無双
|
ユーザー |
![]() |
提出日時 | 2017-07-28 22:25:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 479 bytes |
コンパイル時間 | 1,554 ms |
コンパイル使用メモリ | 169,492 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-17 12:56:33 |
合計ジャッジ時間 | 2,407 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include<bits/stdc++.h> using namespace std; string S;int p[26],q[26];bool R=false; int main(){ cin>>S;for(int i=0;i<S.size();i++){p[S[i]-'a']++;} for(int i=0;i<26;i++){ for(int j=0;j<26;j++)q[j]=p[j]; q[i]++; sort(q,q+13); bool OK=true; for(int j=0;j<12;j++){if(q[j]!=1)OK=false;} if(q[12]!=2)OK=false; if(OK==true){cout<<(char)('a'+i)<<endl;R=true;} } if(R==false)cout<<"Impossible"<<endl; return 0; }