码迷,mamicode.com
首页 > 其他好文 > 详细

luogu_1199 三国游戏

时间:2017-10-07 20:54:16      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:printf   div   三国   cst   int   str   print   blog   class   

#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int n,m[510][510],ans;

int main(){
    scanf("%d",&n);
    for(int i=1;i<n;i++)
        for(int j=i+1;j<=n;j++){
            int x;
            scanf("%d",&x);
            m[i][j]=m[j][i]=x;
        }
    for(int i=1;i<=n;i++){
        sort(m[i]+1,m[i]+1+n);
        ans=max(ans,m[i][n-1]);
    }
    if(ans)printf("1\n%d\n",ans);
    else puts("0");
    return 0;
}

  

luogu_1199 三国游戏

标签:printf   div   三国   cst   int   str   print   blog   class   

原文地址:http://www.cnblogs.com/codetogether/p/7635493.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!