結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
Ronlynes
|
| 提出日時 | 2017-11-05 15:28:49 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 537 bytes |
| 記録 | |
| コンパイル時間 | 489 ms |
| コンパイル使用メモリ | 74,824 KB |
| 実行使用メモリ | 82,728 KB |
| 最終ジャッジ日時 | 2026-04-02 18:07:51 |
| 合計ジャッジ時間 | 1,281 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main(void){
int c[27];
string s;
cin >> s;
fill(c, c+27, 0);
for(int i=0; i<s.length(); i++){
c[s[i]-'a']++;
}
int cnt2=0,cnt1=0, ans;
for(int i=0; i<27; i++){
if(c[i] == 2){
cnt2++;
}else if(c[i] == 1){
cnt1++;
ans = i;
}
}
if(cnt2 == 6 && cnt1 == 1){
cout << char(ans + 'a') << endl;
}else{
cout << "Impossible" << endl;
}
return 0;
}
Ronlynes