果然比二分要快将近一倍。63MS。二分94MS。
#include#include #include #include #include #include using namespace std;const int maxn=1005;double a[maxn],b[maxn];const double eps=1e-6;int n,k;struct dnode{ double x; int index;}d[maxn];bool cmp(dnode a,dnode b){ return a.x>b.x;}int main(){ while(scanf("%d%d", &n, &k) != EOF) { if(n+k==0)break; for(int i=0;i =eps); printf("%.0f\n", l * 100); } return 0;}