本文主要是介绍Codeforces Round #408 (Div. 2) A Buying A House,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
传送门
#include<stdio.h>#define MAX_N 110int house[MAX_N];int main(){int n,m,k;scanf("%d%d%d",&n,&m,&k);for(int i=1;i<=n;i++){scanf("%d",&house[i]);if(house[i]==0)house[i]=k+2;}int i=1;while(1){if(m-i>=1){if(house[m-i]<=k)break;}if(m+i<=n)if(house[m+i]<=k)break;i++; }printf("%d",i*10);
}
这篇关于Codeforces Round #408 (Div. 2) A Buying A House的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!