結果
| 問題 |
No.587 七対子
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-11-13 21:31:53 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 822 bytes |
| コンパイル時間 | 1,125 ms |
| コンパイル使用メモリ | 108,264 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 19:47:02 |
| 合計ジャッジ時間 | 2,153 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;
int main()
{
string s;
cin >> s;
vector<pair<int, char> > v(26);
for(int i=0; i<26; ++i)
v[i].second = 'a' + i;
for(int i=0; i<13; ++i)
++ v[s[i]-'a'].first;
sort(v.rbegin(), v.rend());
if(v[5].first == 2 && v[6].first == 1)
cout << v[6].second << endl;
else
cout << "Impossible" << endl;
return 0;
}