結果

問題 No.587 七対子
ユーザー yicode
提出日時 2023-06-14 16:21:50
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 463 bytes
コンパイル時間 1,692 ms
コンパイル使用メモリ 173,232 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 00:32:58
合計ジャッジ時間 2,938 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:13:20: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   13 |   for (const auto& [key, value] : dic) {
      |                    ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
int main() {
  string S; cin >> S;
  map<char,int> dic;
  for(int i =0; i < S.size(); i++) {
    dic[S[i]]++;
  }
  int count = 0;
  char ans = 'e';
  for (const auto& [key, value] : dic) {
    if(value == 2) {
      count++;
    }else {
      ans = key;
    }
  }
  if(count == 6) {
    cout << ans << endl;
  }else {
    cout << "Impossible" << endl;
  }
}

0