Skip to content

请教下[1020. 飞地的数量]这道题的空间占用问题 #542

Description

@SaraadKun

1020. 飞地的数量题目的并查集题解中, 有下面这段代码

    int N = 550;
    int[] p = new int[N * N];

而题目限定的m,n范围是1 <= m, n <= 500,我测试下来,当N的取值范围在[540, 580]时,使用Java提交后占用空间较少,超出这个范围,空间占用都会上升,想请教下三叶姐这是什么原因呢?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions