結果
問題 | No.587 七対子 |
ユーザー |
|
提出日時 | 2020-11-07 15:25:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 728 bytes |
コンパイル時間 | 814 ms |
コンパイル使用メモリ | 84,916 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-22 14:30:35 |
合計ジャッジ時間 | 1,746 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include <algorithm>#include <cmath>#include <cstdio>#include <deque>#include <iostream>#include <map>#include <numeric>#include <queue>#include <set>#include <stack>#include <string>#include <vector>using namespace std;typedef long long ll;#define MOD 1000000007int main() {string s;cin >> s;int n = s.size();vector<int> cnt(26);for (int i = 0; i < n; ++i) {cnt[s[i] - 'a']++;}int one = 0, two = 0;int idx = -1;for (int i = 0; i < 26; ++i) {if (cnt[i] == 1) {one++;idx = i;}if (cnt[i] == 2) {two++;}}if (one == 1 && two == 6) {cout << (char)(idx + 'a') << endl;} else {cout << "Impossible" << endl;}return 0;}