Symmetry (UVA - 1595)

#include 
#include 
using namespace std;

struct Node
{
    int x;
    int y;
    Node(int a,int b)
    {
        x = a;y = b;
    }
    bool operator < (const Node &a) const
    {
        if(a.y == y)
            return a.x>x;
        else
            return a.y>y;
    }
};
vectorn1;
vectorn2;



int main()
{
    int c,n;
    int x,y;
    cin>>c;
    while(c--)
    {
        n1.clear();
        n2.clear();
        int sum = 0;
        cin>>n;
        for(int i = 0;i>x>>y;
            sum+=x;
            n1.push_back(Node(n*x,y));
            n2.push_back(Node(n*x,y));
        }
        sort(n1.begin(),n1.end());
        for(int i = 0;i

 

你可能感兴趣的:(UVa)