Tag: problem: (A) Buying A House Solution in C

Codeforces Round #408 (Div. 2), problem: (A) Buying A House Solution in C

#include<stdio.h> #include<stdlib.h> #include<math.h> #define MAX 1000000009 int main() { int i,n,m,k,min=MAX,t,temp; scanf("%d %d %d",&n,&m,&k); for(i=1;i<=n;i++) { scanf("%d",&t); if(t>0 && t<=k) { temp=abs(m-i); if(temp<min) min=temp; } } printf("%dn",(min*10)); return 0; }

Want to stay up to date with the latest news?

We would love to hear from you! Please fill in your details and we will stay in touch. It's that simple!