首页 > 其他 > 详细

三国游戏

时间:2019-04-12 17:12:38      阅读:110      评论:0      收藏:0      [点我收藏+]

传送门:

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define re register
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define P pair<int,int>
const int N=1e4;
const int mod=1e9+7;
void read(int &a)
{
    a=0;
    int d=1;
    char ch;
    while(ch=getchar(),ch>9||ch<0)
        if(ch==-)
            d=-1;
    a=ch-0;
    while(ch=getchar(),ch>=0&&ch<=9)
        a=a*10+ch-0;
    a*=d;
}
void write(int x)
{
    if(x<0)
        putchar(45),x=-x;
    if(x>9)
        write(x/10);
    putchar(x%10+0);
}
int a[505][505];
int main()
{
    int n;
    read(n);
    for(re int i=1;i<=n;i++)
        for(re int j=i+1;j<=n;j++)
        {
            read(a[i][j]);
            a[j][i]=a[i][j];
        }
    int ans=0;
    for(re int i=1;i<=n;i++)
    {
        sort(a[i]+1,a[i]+n+1);
        ans=a[i][n-1]>ans?a[i][n-1]:ans;
    }
    puts("1");
    write(ans);
    return 0;
}

 

三国游戏

原文:https://www.cnblogs.com/acm1ruoji/p/10697087.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!