Heim >Web-Frontend >HTML-Tutorial >Codeforces Round #245 (Div. 1)??Tricky Function_html/css_WEB-ITnose
题目链接
const double EPS = 1e-10;const int MAXN = 100100;inline int dcmp(double x){ if(fabs(x) > 1; double d1 = Closest_Pair(left, mid); double d2 = Closest_Pair(mid + 1, right); d = min(d1, d2); int k = 0; //分离出宽度为d的区间 FE(i, left, right) { if(sqr(point[mid].x - point[i].x) d3) d = d3; } return d;}LL ipt[MAXN];int main(){ //freopen("input.txt", "r", stdin); int n; while (~RI(n) && n) { FE(i, 1, n) { cin >> ipt[i]; ipt[i] = ipt[i - 1] + ipt[i]; } FE(i, 1, n) { point[i - 1].x = i; point[i - 1].y = ipt[i]; } sort(point, point + n, cmpxy); LL ans = Closest_Pair(0, n - 1); cout <br> <p></p>