fork(1) download
  1. #include <stdio.h>
  2.  
  3. int min(int a, int b){ return a < b ? a : b; }
  4. int abs(int x){ return x < 0 ? -x : x; }
  5.  
  6. int main(){
  7. int n, m, k;
  8. scanf("%d%d%d", &n, &m, &k);
  9. int res = 1e9;
  10. for(int i=1; i<=n; i++){
  11. int a;
  12. scanf("%d", &a);
  13. if(a != 0 && a <= k) res = min(res, abs(i-m));
  14. }
  15. printf("%d", 10*res);
  16. return 0;
  17. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
1410065408