QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#301468 | #7995. 图 | 111445# | WA | 2ms | 4016kb | C++23 | 448b | 2024-01-09 22:39:11 | 2024-01-09 22:39:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int i,j,k,n,m,t,a[505][505],f[505][505];
int main(){
ios::sync_with_stdio(0); cin.tie(0);
cin>>n;
for(i=1;i<=n;i++)for(j=1;j<=n;j++){
cin>>a[i][j]; f[i][j]=a[i][j];
}
for(i=1;i<=n;i++)for(j=1;j<=n;j++)for(k=1;k<=n;k++){
f[j][k]=min(f[j][k],f[j][i]+f[i][k]);
}
for(i=1;i<=n;i++){
for(j=1;j<=n;j++)cout<<(i!=j&&a[i][j]==f[i][j]);
cout<<'\n';
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3588kb
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: 1ms
memory: 3680kb
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: 2ms
memory: 4016kb
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:
0001000000000000000000000000000000000010010100000000100001001100101000000001000000000000000000010010 0011000000100000000001000000100000000000000000000000000000100000000001001000000001000000010000000100 01001000011000000000000000001000000000000000000000001000001011000010010010000000010000000100000001...
result:
wrong answer 1st lines differ - expected: '000000000000000000000000000000...0000001000000000000000000000010', found: '000100000000000000000000000000...0000001000000000000000000010010'