Skip to content

Instantly share code, notes, and snippets.

@aqzlpm11
Last active December 18, 2017 06:55
Show Gist options
  • Save aqzlpm11/dbe3b034f9de412d475af47654ab6b8e to your computer and use it in GitHub Desktop.
Save aqzlpm11/dbe3b034f9de412d475af47654ab6b8e to your computer and use it in GitHub Desktop.
ACM 开栈黑魔法
// Reference:
// https://www.cnblogs.com/HarryGuo2012/p/4722784.html
// http://blog.csdn.net/fcxxzux/article/details/40053937
#include <cstring>
#include <cstdio>
#include <cstdlib>
int dfs(int i) {
int a[100];
if (i == 1000000) {
return 0;
}
return dfs(i+1);
}
void solve() {
/// Write your code here
/// ...
dfs(0);
}
int main() {
int size = 128 << 20; // 128MB
char *p = (char*)malloc(size) + size;
__asm__("movl %0, %%esp\n" :: "r"(p));
solve();
exit(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment