QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#352281 | #7995. 图 | Kevin5307 | WA | 0ms | 3668kb | C++20 | 575b | 2024-03-13 07:53:14 | 2024-03-13 07:53:15 |
Judging History
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'