結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-02 05:08:37 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 389 bytes |
| 記録 | |
| コンパイル時間 | 150 ms |
| コンパイル使用メモリ | 41,236 KB |
| 実行使用メモリ | 49,104 KB |
| 最終ジャッジ日時 | 2026-04-02 18:13:54 |
| 合計ジャッジ時間 | 969 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge5_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include <cstdio>
int main(){
int cnt1=0,cnt2=0;
char str[14],alfa[26]={0},key;
scanf("%s",str);
for(int i=0;i<13;i++){
alfa[str[i]-'a']++;
}
for(int i=0;i<13;i++){
if(alfa[str[i]-'a']==1){cnt1++;key=str[i];}
if(alfa[str[i]-'a']==2)cnt2++;
}
if(cnt1==1 && cnt2==12)printf("%c\n",key);
else printf("Impossible\n");
return 0;
}