結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
Ronlynes
|
| 提出日時 | 2017-11-05 15:28:49 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 228µs | |
| コード長 | 537 bytes |
| 記録 | |
| コンパイル時間 | 290 ms |
| コンパイル使用メモリ | 71,780 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-18 23:36:47 |
| 合計ジャッジ時間 | 1,811 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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