QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#402734#7995. 图zzzwsndWA 0ms4068kbC++14545b2024-05-01 11:51:392024-05-01 11:53:01

Judging History

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

  • [2024-05-01 11:53:01]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4068kb
  • [2024-05-01 11:51:39]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int a[505][505];
int b[505][505];
int n;
void floy()
{
	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])
				{
					b[i][j]=1;
				}
			}
		}
	}
}
 int main()
 {
 	cin>>n;
 	for(int i=1;i<=n;i++)
 	{
 		for(int j=1;j<=n;j++)
 		{
 			cin>>a[i][j];
		}
	}
	floy();
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			if(i==j) cout<<0;
			else
			cout<<(b[i][j]^1);
		}
		cout<<endl;
	}
 }

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3572kb

input:

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

output:

0110
1000
1001
0010

result:

ok 4 lines

Test #2:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

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

output:

0110
1000
1001
0010

result:

ok 4 lines

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 4068kb

input:

100
0 41659 61282 49636 67326 48035 29694 46438 87384 82143 38685 66540 48746 29800 91786 54931 56232 61941 53423 75707 45135 69244 53802 89998 64199 63778 75825 31745 66975 44537 35793 55663 72647 60768 80884 46657 54066 84568 6266 48213 78216 50369 66761 54861 67607 38509 52250 54210 71135 56840 5...

output:

0001000000000000000001000000000000000010010110000000100001001100101000000001010000000000000000010010
0011000000100000000001001000100000000000001000000000000000100000000001001000000001000000010000000100
01001000011000001000000001001000000000000000000000001000001011000010010010000000010000000101001001...

result:

wrong answer 1st lines differ - expected: '000000000000000000000000000000...0000001000000000000000000000010', found: '000100000000000000000100000000...0000001010000000000000000010010'