跳到正文

题解

满级题解(P1085)

Ethan_1约 1 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年5月16日
篇幅
约 1 分钟
获赞
1
题目
P1085

版本

  1. v1当前

管理员千万不要来看,看了也别封号。这篇题解纯属是为了娱乐。

以下是内容。


C++
#include<iostream>
#include<algorithm>
using namespace std;
struct luogu_team
{
    int kkksc03,noip,lin_toto,chen_zhe;
}a[7];
bool y(luogu_team x,luogu_team z)
{
    if(x.lin_toto==z.lin_toto) return x.chen_zhe<z.chen_zhe;
    return x.lin_toto>z.lin_toto;
}
int main()
{
    for(int i=0;i<7;i++)
    {
        cin>>a[i].kkksc03>>a[i].noip;
        a[i].lin_toto=a[i].kkksc03+a[i].noip;
        a[i].chen_zhe=i+1;
    }
    sort(a,a+7,y);
    if(a[0].lin_toto>8) cout<<a[0].chen_zhe;
    else cout<<0;
    return 0;
}

原文