QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#727012 | #7986. 游戏 | _fcy_# | WA | 0ms | 5764kb | C++14 | 939b | 2024-11-09 10:56:32 | 2024-11-09 10:56:33 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int maxn = 500 + 10;
int inf = 1e9;
int n;
int a[maxn][maxn], dis[maxn][maxn];
void solve()
{
cin >> n;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
cin >> a[i][j];
dis[i][j] = 1e9;
}
}
for (int k = 1; k <= n; k++)
for (int i = 1; i <= n; i++)
for (int j = 1; j <= n; j++)
dis[i][j] = min(dis[i][j], min(dis[i][k], a[i][k])+min(dis[k][j], a[k][j]));
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
cout << ((a[i][j]<=dis[i][j])&(i!=j));
// cout << dis[i][j] << " ";
cout << "\n";
}
cout << flush;
}
signed main()
{
// ios::sync_with_stdio(0); cin.tie(0);
int TT = 1;
while (TT--)
{
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 5764kb
input:
6 1 2 2 3 2 4 1 5 5 6
output:
011010 000011 110111 111011 111101 111110
result:
wrong answer 1st lines differ - expected: 'Wasted.', found: '011010'