RT,我刚刚干的事,现在想问,为什么错误初始化后,访问map会导致程序终止运行,且返回错误的数值?
错误代码:(...的地方确定没有任何问题)
#include <bits/stdc++.h>
using namespace std;
int b[20],cnt;
map<long long,long long> f[20];
long long dfs(int n,long long l,int e1,int e2)
{
if(n > cnt)
{
return 1;
}
if(f[n][l] != -1 && e2 == 0)
{
printf("#");
return f[n][l];
}
printf("#");
...
}
long long fun(long long a)
{
memset(f,-1,sizeof(f));
...
}
int main()
{
...
return 0;
}
按理说应该输出一个#对吧,但实际是这样的:
1
1 9
--------------------------------
Process exited with return value 3221225477
Press any key to continue . . .
所以我就很疑惑,虽然初始化不对,但能运行,那么什么访问时会不继续运行,且返回3221225477呢?