QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#727012#7986. 游戏_fcy_#WA 0ms5764kbC++14939b2024-11-09 10:56:322024-11-09 10:56:33

Judging History

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

  • [2024-11-09 10:56:33]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:5764kb
  • [2024-11-09 10:56:32]
  • 提交

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'