【题目链接】:http://codeforces.com/contest/796/problem/A

【题意】



让你选一个最靠近女票的,且能买的房子;

输出你和你女票的距离;

【题解】



枚举



【Number Of WA】



0



【完整代码】

#include <bits/stdc++.h>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define ps push_back
#define fi first
#define se second
#define rei(x) scanf("%d",&x)
#define rel(x) scanf("%lld",&x)
#define ref(x) scanf("%lf",&x)
#define ms(x,y) memset(x,y,sizeof x) typedef pair<int,int> pii;
typedef pair<LL,LL> pll; const int dx[9] = {0,1,-1,0,0,-1,-1,1,1};
const int dy[9] = {0,0,0,-1,1,-1,1,-1,1};
const double pi = acos(-1.0);
const int N = 110; int n,m,k,mi = -1;
int a[N]; int main()
{
//freopen("F:\\rush.txt","r",stdin);
rei(n),rei(m),rei(k);
rep1(i,1,n)
rei(a[i]);
rep1(i,1,n)
if (a[i]>0 && k>=a[i])
{
if (mi==-1 || abs(m-i)*10<mi)
{
mi = abs(m-i)*10;
}
}
cout << mi << endl;
//printf("\n%.2lf sec \n", (double)clock() / CLOCKS_PER_SEC);
return 0;
}
05-11 22:33