結果
問題 |
No.2126 MEX Game
|
ユーザー |
👑 |
提出日時 | 2022-12-24 17:35:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 450 bytes |
コンパイル時間 | 767 ms |
コンパイル使用メモリ | 71,144 KB |
最終ジャッジ日時 | 2025-02-09 20:07:46 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 WA * 1 |
ソースコード
#include <iostream> #include <vector> using namespace std; int main(){ int n;cin>>n; vector<int> A(110000); for(int i = 0; n > i; i++){ int x;cin>>x; A[x]++; } bool am = false; bool lck = false; int i = 0; while(true){ if(A[i] == 1 && (i+1)*2 <= n && !lck){ lck = true; }else if(A[i] < 2){ cout << i << endl; return 0; } i++; } }