Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

例题/0x60 图论/0x61 最短路/Sorting It All Out/POJ1094 Sorting It All Out.cpp 一处有误 #75

Open
MicroMilo opened this issue Sep 14, 2022 · 0 comments

Comments

@MicroMilo
Copy link

MicroMilo commented Sep 14, 2022

在本仓库的 std 中,没有考虑输入本身带有矛盾的情况

  • acwing 过不去了

  • poj 还是能过去的

int floyd()
{
    memcpy(e, d, sizeof(e));
    for (int k = 0; k < n; k++)
        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
            {
                e[i][j] |= e[i][k] & e[k][j]; 
                if (e[i][j] == e[j][i] && e[i][j] && i != j) // 此处 i != j
                    return -1;
            }
        
    for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
            if (e[i][j] == e[j][i] && !e[i][j] && i != j)
                return 0;
    return 1;
}

hack 数据

4 6
C<D
C<B
B<A
C<D
D<A
A<A
0 0
@MicroMilo MicroMilo changed the title 配套光盘/例题/0x60 图论/0x61 最短路/Sorting It All Out/POJ1094 Sorting It All Out.cpp 一处有误 例题/0x60 图论/0x61 最短路/Sorting It All Out/POJ1094 Sorting It All Out.cpp 一处有误 Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant