J - Scarily interesting! ( Team Contest 3rd)

 

为了让观众猜不透结局 输出 让最终赢得人示弱。

 

monsters(怪兽)

#include
using namespace std;
#define maxn 1555
struct node
{
    int order, num;
} x[maxn],y[maxn];
bool cmp1(node a,node b)
{
    return a.numb.num;
}
int main()
{
    int n,sum1=0,sum2=0;
    cin>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>x[i].num;
        sum1+=x[i].num;
        x[i].order=i;
    }
    for(int i=1; i<=n; i++)
    {
        cin>>y[i].num;
        sum2+=y[i].num;
        y[i].order=i;
    }
    if(sum1>sum2)
    {
        sort(x+1,x+n+1,cmp1);
        sort(y+1,y+n+1,cmp2);
    }
    else
    {
        sort(x+1,x+1+n,cmp2);
        sort(y+1,y+1+n,cmp1);
    }
    for(int i=1; i<=n; i++)
        cout< 
 

你可能感兴趣的:(思维-模拟)