QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#727001#7995. 图_fcy_#WA 4ms5992kbC++14943b2024-11-09 10:54:282024-11-09 10:54:29

Judging History

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

  • [2024-11-09 10:54:29]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:5992kb
  • [2024-11-09 10:54:28]
  • 提交

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] = 2000000;
        }
    }
    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: 100
Accepted
time: 1ms
memory: 5672kb

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: 5756kb

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: 4ms
memory: 5992kb

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'