0_0_23318334_9347.cpp:1:1923: fatal error: GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stdc++.h>usin: Invalid argument
#include<bits/stdc++.h>using namespace std;typedef long long ll;struct Point {ll x, y, w;double k;Point() {}Point(ll x, ll y, ll w, double k) : x(x), y(y), w(w), k(k) {}bool operator<(const Point&p) const {return k < p.k;}};vector<Point> p1, p2;int main() {int T;scanf("%d", &T);while(T--) {int n;scanf("%d", &n);ll wei[4]; // 处于坐标轴上的点memset(wei, 0, sizeof wei);p1.clear(); p2.clear();ll xian1 = 0, xian2 = 0, xian3 = 0, xian4 = 0; // 每个象限点的权值之和for(int i = 0; i < n; i++) {ll x, y, w;scanf("%lld%lld%lld", &x, &y, &w);if(x == 0 && y > 0) wei[1] = w;else if(x == 0 && y < 0) wei[3] = w;else if(x > 0 && y == 0) wei[0] = w;else if(x < 0 && y == 0) wei[2] = w;else {double k = y * 1.0 / x;if(k > 0) {p1.push_back(Point(x, y, w, k));if(x > 0) xian1 += w;else xian3 += w;} else {p2.push_back(Point(x, y, w, k));if(x > 0) xian4 += w;else xian2 += w;}}}ll ans = 0;// 一、三象限int up1 = xian1, down1 = 0, up3 = 0, down3 = xian3;sort(p1.begin(), p1.end());ans = max(ans, (wei[1] + wei[2] + xian2 + xian1) * (wei[0] + wei[3] + xian3 + xian4));ans = max(ans, (wei[1] + wei[2] + xian2 + xian3) * (wei[0] + wei[3] + xian1 + xian4));for(int i = 0; i < p1.size(); i++) {if(p1[i].x > 0) { up1 -= p1[i].w; down1 += p1[i].w; }else { down3 -= p1[i].w; up3 += p1[i].w; }ans = max(ans, (wei[1] + wei[2] + xian2 + up1 + up3) * (wei[0] + wei[3] + xian4 + down1 + down3));}// 二、四象限int up2 = 0, down2 = xian2, up4 = xian4, down4 = 0;sort(p2.begin(), p2.end());ans = max(ans, (wei[0] + wei[1] + xian1 + xian4) * (wei[2] + wei[3] + xian2 + xian3));ans = max(ans, (wei[0] + wei[1] + xian1 + xian2) * (wei[2] + wei[3] + xian4 + xian3));for(int i = 0; i < p2.size(); i++) {if(p2[i].x > 0) { up4 -= p2[i].w; down4 += p2[i].w; }else { down2 -= p2[i].w; up2 += p2[i].w; }ans = max(ans, (wei[0] + wei[1] + xian1 + up2 + up4) * (wei[2] + wei[3] + xian3 + down2 + down4));}printf("%lld\n", ans);}return 0;}
^
compilation terminated.
|