結果
問題 | No.587 七対子 |
ユーザー |
![]() |
提出日時 | 2017-11-03 22:49:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 829 bytes |
コンパイル時間 | 1,835 ms |
コンパイル使用メモリ | 173,844 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 19:43:45 |
合計ジャッジ時間 | 2,703 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include <bits/stdc++.h>using namespace std;long long gcd(long long x, long long y){if (y == 0)return x;return gcd(y, x % y);}long long lcm(long long x, long long y){if (x == 0 || y == 0)return 0;return x / gcd(x, y) * y;}int main(){string s;cin >> s;map<char, int> mp;for (int i = 0; i < 13; i++){mp[s[i]]++;}string ans = "";for (int i = 0; i < 13; i++){if (mp[s[i]] > 2){ans = "Impossible";break;}else if (mp[s[i]] == 1){if (ans != ""){ans = "Impossible";break;}else{ans = s[i];}}}cout << ans << endl;}