QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#410166 | #7995. 图 | EDGE | WA | 0ms | 3904kb | C++14 | 944b | 2024-05-13 17:27:28 | 2024-05-13 17:27:29 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
#define mp(x,y) make_pair(x,y)
#define p first
#define v second
const int maxn=5e2+10;
const int maxm = 1e6+10;
int n,x,y;
int dis[maxn][maxn],diss[maxn][maxn];
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++){
scanf("%d",&x);
diss[i][j]=dis[i][j]=x;
}
for(int k=1;k<=n;k++)
for(int i=1;i<=n;i++)
for(int j=1;j<=n;j++){
if(dis[i][j]>dis[i][k]+dis[k][j]){
dis[i][j]=dis[i][k]+dis[k][j];
}
}
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(i==j)
printf("0 ");
else if(dis[i][j]==diss[i][j])
printf("1 ");
else
printf("0 ");
}
puts("");
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3904kb
input:
4 0 3 2 100 3 0 8 100 2 8 0 10 100 100 10 0
output:
0 1 1 0 1 0 0 0 1 0 0 1 0 0 1 0
result:
wrong answer 1st lines differ - expected: '0110', found: '0 1 1 0 '