讨论 / AC20纪念
我为数学狂 2011-10-21 21:54:00
点我顶贴 收藏 删除
查看状态 Show Status

题目:[NOIP2010普及组]三国游戏

状态: Accepted

测评机: Xeost[5]

得分: 100分 [我要评价一下题目~]

提交日期: 2011-10-22 12:50:00

有效耗时: 1938毫秒

RQNOJ近期在线比赛列表

RQNOJ十月份月赛 时间:2011-10-22 19:00:00 [报名]

测试结果1: 通过本测试点|有效耗时63ms

测试结果2: 通过本测试点|有效耗时62ms

测试结果3: 通过本测试点|有效耗时63ms

测试结果4: 通过本测试点|有效耗时62ms

测试结果5: 通过本测试点|有效耗时63ms

测试结果6: 通过本测试点|有效耗时62ms

测试结果7: 通过本测试点|有效耗时63ms

测试结果8: 通过本测试点|有效耗时93ms

测试结果9: 通过本测试点|有效耗时453ms

测试结果10: 通过本测试点|有效耗时954ms

提交代码: view sourceprint?

01.#include<iostream>

02.using namespace std;

03.long int a[501][501],n,m1,m2,s;

04.int main()

05.{

06.

cin>>n;

07.

for(int i=1;i<n;i++)

08.

for(int j=i+1;j<=n;j++)

09.

{

10.

cin>>a[i][j];

11.

a[j][i]=a[i][j];

12.

}

13.

for(int i=1;i<=n;i++)

14.

{

15.

m1=m2=0;

16.

for(int j=1;j<=n;j++)

17.

if(j!=i)

18.

{

19.

if(a[i][j]>m1)

20.

{

21.

m2=m1;

22.

m1=a[i][j];

23.

}

24.

if(a[i][j]>m2 && a[i][j]<m1)

25.

m2=a[i][j];

26.

}

27.

if(m2>s)

28.

s=m2;

29.

}

30.

cout<<"1\n"<<s;

31.

return 0;

32.}

查看更多回复
提交回复