CSES - Datatähti 2017 loppu - Results
Submission details
Task:Mex-luku
Sender:Senpai
Submission time:2017-01-19 14:35:44 +0200
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:21:1: error: expected '}' at end of input
 }
 ^

Code

#include <bits/stdc++.h>
using namespace std;
int n,k,x,d;
vector<int>v;
multiset<int>s;
int main(){
cin>>n>>k;
d=1000000001;
for(int i=0; i<k-1; i++){
v.push_back(x);
s.insert(x+1);
for(int i=k-1; i<n; i++){
cin>>x;
v.push_back(x);
s.insert(x+1);
if(s.count(1)==1)cout<<*s.begin()<<" ";
else cout<<0<<" ";
s.erase(s.find(v[i-k+1]));
}

}