結果
問題 | No.587 七対子 |
ユーザー |
![]() |
提出日時 | 2021-01-24 14:14:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 23 ms / 2,000 ms |
コード長 | 420 bytes |
コンパイル時間 | 1,992 ms |
コンパイル使用メモリ | 198,928 KB |
最終ジャッジ日時 | 2025-01-18 07:47:53 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) signed main(){ string s; cin>>s; map<char,int>mp; rep(i,13){ mp[s.at(i)]++; } int a=0; int b=0; char pai; for(auto e:mp){ if(e.second==2) a++; if(e.second==1){ b++; pai=e.first; } } if(a==6 && b==1){ cout<<pai<<endl; } else{ cout<<"Impossible"<<endl; } return 0; }