結果
問題 | No.587 七対子 |
ユーザー |
![]() |
提出日時 | 2017-11-03 22:35:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 380 bytes |
コンパイル時間 | 1,669 ms |
コンパイル使用メモリ | 166,988 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 19:42:41 |
合計ジャッジ時間 | 2,602 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 35 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int a[26]{}; for (auto c : s) { a[c - 'a']++; } int one = count(a, a + 26, 1), two = count(a, a + 26, 2); if (two == 6 && one == 1) { for (int i = 0; i < 26; i++) { if (a[i] == 1) { cout << char('a' + i) << endl; return 0; } } } cout << "Impossible" << endl; return 0; }