提交记录 29024
| 用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
|---|---|---|---|---|---|---|---|
| xiaoyiming12 | 1000i. 【传统题】 A+B Problem | Compile Error | 0 | 0 ns | 0 KB | C++17 | 946 B |
| 提交时间 | 评测时间 |
|---|---|
| 2026-06-19 19:04:24 | 2026-06-19 19:04:30 |
// #include <bits/stdc++.h>
// using namespace std;
// template <typename T>
// void bomb(T a) {
// if constexpr (is_same_v<T, vector<vector<vector<vector<int>>>>>) {
// return;
// } else bomb(vector<T>({a}));
// }
// int main() {
// bomb(0);
// }
#include <bits/stdc++.h>
using namespace std;
// 定义一个巨大的类型别名,或者通过递归嵌套生成极长的类型名
template <typename T, int N>
struct BigType {
using type = vector<BigType<T, N-1>>;
};
template <typename T>
struct BigType<T, 0> {
using type = T;
};
template <typename T, int Depth>
void bomb(T a) {
// 设置一个极大的深度,例如 100 或更多
// 注意:许多编译器有默认的最大模板实例化深度限制(如 GCC 默认为 900)
if constexpr (Depth <= 0) {
return;
} else {
// 每次递归不仅增加深度,还增加类型的嵌套复杂度
// 这里可以构造更复杂的类型,比如 pair, tuple 等混合嵌套
using NextType = typename BigType<T, 10>::type;
bomb<NextType, Depth - 1>(a);
}
}
int main() {
// 初始深度设得足够大,且每次展开的类型体积巨大
bomb<int, 50>(0);
}
| Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-06-28 06:16:29 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠