求助初始化
  • 板块学术版
  • 楼主VectorLi
  • 当前回复2
  • 已保存回复2
  • 发布时间2023/11/25 11:04
  • 上次更新2023/11/25 13:04:51
查看原帖
求助初始化
609972
VectorLi楼主2023/11/25 11:04

如题。

这段代码在 Luogu IDE 上会返回 output limit exceeded,而在 Codeforces custom test 没有问题。

#include <bits/stdc++.h>

const int N = (int) 1E7;

struct Node {
    int x = 1;
};

Node a[N];

int main() {
    return 0;
}

而如果将 Node 的定义改成这样:

struct Node {
	int x;
	Node() {
		x = 1;
	}
};

就也不会出问题了。请问是什么原因导致的呢?

2023/11/25 11:04
加载中...