結果

問題 No.548 国士無双
コンテスト
ユーザー yicode
提出日時 2023-05-23 12:24:19
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 528 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,220 ms
コンパイル使用メモリ 188,604 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-29 03:56:06
合計ジャッジ時間 2,264 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:15:20: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   15 |   for (const auto& [key, value] : dic) {
      |                    ^

ソースコード

diff #
raw source code

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