记录编号 |
41091 |
评测结果 |
AAWAAAAAAA |
题目名称 |
[河南省队2012] 阻击补给线 |
最终得分 |
90 |
用户昵称 |
Makazeu |
是否通过 |
未通过 |
代码语言 |
C++ |
运行时间 |
0.092 s |
提交时间 |
2012-07-20 15:44:54 |
内存使用 |
1.46 MiB |
显示代码纯文本
- #include <cstdlib>
- #include <cstdio>
- using namespace std;
- const int MAXN=555;
- int mat[MAXN][MAXN];
- int N,M,x,y,z,ans=911111111;
-
- inline int Min(int a,int b)
- {
- return a<b?a:b;
- }
-
- inline void init()
- {
- scanf("%d %d\n",&N,&M);
- for(int i=1;i<=M;i++)
- {
- scanf("%d %d %d\n",&x,&y,&z);
- x++,y++;
- mat[x][y]=z,mat[y][x]=z;
- }
- }
-
- inline void cheat()
- {
- int res=0;
- for(int i=1;i<=N;i++)
- {
- res=0;
- for(int j=1;j<=N;j++)
- res+=mat[i][j];
- if(res<ans) ans=res;
- }
- printf("%d\n",ans);
- }
-
- int main()
- {
- freopen("t2bb.in","r",stdin);
- freopen("t2bb.out","w",stdout);
- init();
- cheat();
- return 0;
- }