Manthan、Codefest 19(皆のためのオープン、定格、本部1 +本部2)B(SET)

#define HAVE_STRUCT_TIMESPEC
する#include <ビット/ STDC ++ H>
使用して名前空間std。
[2007] int型。
<整数>の設定。
メインINT(){
int型のn;
cinを>> N;
INT IEND = N + 1。
(I 1 = int型、iが<= N; I ++)ため
CIN >> [I]。
一方、(IEND> 1 && s.count([IEND-1])!)
s.insert([ - IEND])。
int型ANS = 9999;
以下のために(INT I = 1; IEND <= N + 1; ++ IEND){
ながら(!I <IEND && s.count([I]))
s.insert([I ++])。
ANS =分(ANS、IEND-I)。
s.erase([IEND])。
}
COUT << ANS。
0を返します。
}

おすすめ

転載: www.cnblogs.com/ldudxy/p/11415668.html