And Hangzhou electric that the same problem, but g++ can not pass, C + + could
WA has been so many many times-----------------------------------------
1#include <iostream>2#include <cstdio>3#include <cstring>4#include <cmath>5#include <stack>6#include <vector>7#include <map>8#include <Set>9#include <queue>Ten#include <algorithm> One using namespacestd; A -typedefLong LongLL; - Const intINF = (1<< -)-1; the Const intMod=1000000007; - Const intmaxn=10005; - Const intexp=1e-6; - + DoubleA[MAXN]; - intn,k; + A BOOLOkDoublex) { at intans=0; - for(intI=0; i<n;i++){ -ans+= (int) (a[i]/x); - } - returnans>=K; - } in - intMain () { toscanf"%d%d",&n,&k); + for(intI=0; i<n;i++) scanf ("%LF",&a[i]); - the Doublelb=0, ub=Inf,mid; * for(intI=0; I < -; i++){ $mid= (lb + ub)/2;Panax Notoginseng if(OK (mid)) lb=mid; - Elseub=mid; the + //printf ("lb=%lf\n", lb); A //printf ("ub=%lf\n", UB); the //printf ("mid=%lf\n", mid); + } -printf"%.2lf\n", (floor) (mid* -)/ -); $ $ return 0; -}
View Code
POJ 1064 Cable Master "Two-point answer"