|
|
back to boardwa10 I can't understand why... Please, help! My algo : sort(x, x + n);
int fp = 0; while (x[fp] < 0) ++fp;
int fn = fp - 1;
if (!(x[fn] <= p && p <= x[fp])) { printf("Impossible\n"); return 0; }
if (p > 0) { if (x[fp] > p) { printf("%d ", p); } else { printf("Impossible\n"); return 0; } } else { if (x[fn] > p) { printf("Impossible\n"); return 0; } else { printf("%d ", (2 * x[fp] - p)); } }
if (p < 0) { if (x[fn] > p) { printf("Impossible\n"); return 0; } else { printf("%d\n", (-p)); } } else { if (x[fp] < p) { printf("Impossible\n"); return 0; } else { printf("%d\n", (p - 2 * x[fn])); } } Re: wa10 Posted by Elmurod 27 Oct 2008 20:06 give your mail i show you 2 variants ... Re: wa10 mikroz@gmail.com thanks =) Re: wa10 Posted by Elmurod 31 Oct 2008 20:43 mikroz@gmail.com thanks =) Sended Re: wa10 so do u understand? ;-) |
|
|