結果
問題 |
No.548 国士無双
|
ユーザー |
|
提出日時 | 2020-04-02 18:44:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 529 bytes |
コンパイル時間 | 987 ms |
コンパイル使用メモリ | 22,656 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 15:16:07 |
合計ジャッジ時間 | 1,769 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%s",str); | ~~~~~^~~~~~~~~~
ソースコード
#include <cstdio> int main(){ int cnt1=0,alfa[13]={0}; char str[14]; scanf("%s",str); for(int p=0;p<13;p++){ alfa[str[p]-'a']++; switch(alfa[str[p]-'a']){ case 1:cnt1++;break; case 2:cnt1--;break; } } if(cnt1==13){ for(int i=0;i<13;i++){ printf("%c\n",'a'+i); } }else if(cnt1==11){ for(int i=0;i<13;i++){ if(alfa[i]==0)printf("%c\n",'a'+i); } }else printf("Impossible\n"); return 0; }