結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
littlegirl820
|
| 提出日時 | 2017-12-23 08:31:46 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 503 bytes |
| 記録 | |
| コンパイル時間 | 444 ms |
| コンパイル使用メモリ | 87,748 KB |
| 実行使用メモリ | 95,712 KB |
| 最終ジャッジ日時 | 2026-04-02 18:09:05 |
| 合計ジャッジ時間 | 1,178 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
int main() {
string s;
cin >> s;
ll cnt[27] = {}, a, A = 0, B = 0;
char ans;
for (int i = 0; i < 13; i++) {
a = s[i] - 'a' + 1;
cnt[a]++;
}
for (int i = 1; i <= 26; i++) {
if (cnt[i] == 2)A++;
if (cnt[i] == 1) {
B++;
ans = 'a' + i - 1;
}
}
if (A == 6 && B == 1)cout << ans << endl;
else cout << "Impossible" << endl;
return 0;
}
littlegirl820