注意数据范围
若定义const int N=1e6+10;
-
a是一个大小为(1e6+10) × (1e6+10)的二维整型数组; -
每个
int通常占 4字节; -
因此内存需求约为:
(106)2×4≈4×1012 bytes =4TB(10^6)^2 \times 4 \approx 4 \times 10^{12} \text{ bytes } = 4TB(106)2×4≈4×1012 bytes =4TB
这远远超出了电脑的内存容量。

注意数据范围
若定义const int N=1e6+10;
a 是一个大小为 (1e6+10) × (1e6+10) 的二维整型数组;
每个 int 通常占 4字节;
因此内存需求约为:
(106)2×4≈4×1012 bytes =4TB(10^6)^2 \times 4 \approx 4 \times 10^{12} \text{ bytes } = 4TB(106)2×4≈4×1012 bytes =4TB
这远远超出了电脑的内存容量。

65
1181
1081
979

被折叠的 条评论
为什么被折叠?