結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-01-28 20:40:51 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ac-library) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 414µs | |
| コード長 | 368 bytes |
| 記録 | |
| コンパイル時間 | 881 ms |
| コンパイル使用メモリ | 179,332 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-18 23:49:04 |
| 合計ジャッジ時間 | 2,697 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
int cnt[26];
int main(){
string s;cin>>s;
for(char c:s){
cnt[c-'a']++;
}
int id=-1;
rep(i,26){
if(cnt[i]==1){
if(id!=-1){
puts("Impossible");return 0;
}
id=i;
}
else if(cnt[i]!=0&&cnt[i]!=2){
puts("Impossible");return 0;
}
}
printf("%c\n",id+'a');
}