QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#352281#7995. 图Kevin5307WA 0ms3668kbC++20575b2024-03-13 07:53:142024-03-13 07:53:15

Judging History

你现在查看的是最新测评结果

  • [2024-03-13 07:53:15]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3668kb
  • [2024-03-13 07:53:14]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int a[505][505];
bool vis[505][505];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			cin>>a[i][j];
	for(int k=1;k<=n;k++)
		for(int i=1;i<=n;i++)
			for(int j=1;j<=n;j++)
				if(a[i][k]+a[k][j]<=a[i][j])
				{
					a[i][j]=a[i][k]+a[k][j];
					vis[i][j]=1;
				}
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
			if(i==j||vis[i][j])
				putchar(48);
			else
				putchar(49);
		putchar(10);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3668kb

input:

4
0 3 2 100
3 0 8 100
2 8 0 10
100 100 10 0

output:

0000
0000
0000
0000

result:

wrong answer 1st lines differ - expected: '0110', found: '0000'