結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
SSRS
|
| 提出日時 | 2020-08-24 09:58:07 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ac-library) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 250µs | |
| コード長 | 465 bytes |
| 記録 | |
| コンパイル時間 | 416 ms |
| コンパイル使用メモリ | 94,104 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-19 00:32:17 |
| 合計ジャッジ時間 | 2,329 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
string S;
cin >> S;
char ans = '#';
for (int i = 0; i < 26; i++){
string T = S + (char) ('a' + i);
vector<int> cnt(26, 0);
for (int j = 0; j < 14; j++){
cnt[T[j] - 'a']++;
}
sort(cnt.rbegin(), cnt.rend());
if (cnt[6] == 2){
ans = 'a' + i;
}
}
if (ans == '#'){
cout << "Impossible" << endl;
} else {
cout << ans << endl;
}
}
SSRS