Codeforces Round #579 DIV3 E問題
Problem description
省略
省略
C++に変換後のコードはこちら
//no-unlocked
int N, cnt[150002];
{
int i, res = 0;
rd(N);
rep(N){
rd(i--);
cnt[i]++;
}
rep(i,150001){
if(i && cnt[i-1]){
res++;
} else if(cnt[i]){
cnt[i]--;
res++;
} else if(cnt[i+1]){
cnt[i+1]--;
res++;
}
}
wt(res);
}
Current time: 2024年03月29日18時13分06秒
Last modified: 2019年08月21日05時22分07秒 (by laycrs)
Tags: Competitive_Programming_Incomplete Codeforces CF579 CF_Div3_E
トップページに戻る
Logged in as: unknown user (not login)