結果
| 問題 |
No.548 国士無双
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-23 12:24:19 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 528 bytes |
| コンパイル時間 | 1,947 ms |
| コンパイル使用メモリ | 173,912 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-23 01:01:32 |
| 合計ジャッジ時間 | 2,960 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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) {
| ^
ソースコード
#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;
}
}