``````#include<algorithm>
#define NN 1005
#define INF 0x3f3f3f3f
using namespace std;
int n,k,m,i,j,a,b,c,d[NN][NN],w[NN][NN],u,flag,sum;
struct edge
{
int u;
int v;
int id;
} ed[NN];

int main()
{

while(scanf("%d%d",&n,&m)!=EOF)
{

for(i=1; i<=m; i++)
{
scanf("%d%d",&a,&b);
ed[i].u=a;
ed[i].v=b;
ed[i].id=i;

}//输入完毕

for(i=1; i<=m; i++)
{
flag=0;
sum=0;
for(k=1; k<=n; k++)
{
for(j=1; j<=n; j++)
{
w[k][j]=INF;
d[k][j]=INF;
}
}
for(j=1; j<=m; j++)
{
if(j!=i)
{
a=ed[j].u;
b=ed[j].v;
w[a][b]=w[b][a]=1;//第x条路被封

}
}
d[1][1]=0;
for(u=1; u<=n; u++)
for(k=1; k<=n; k++)
for(j=1; j<=n; j++)
{

d[k][j]=min(d[k][j],d[k][u]+w[u][j]);

if(k==j)
d[k][j]=0;

}
for(k=1; k<=n; k++)
for(j=1; j<=n; j++)
if((d[k][j]!=INF)&&(!flag))
{
sum+=d[k][j];

}
else
{

flag=1;
}
if(!flag)
printf("%d\n",sum);
else
printf("INF\n");
}
}
}

``````

hdu 2433
http://acm.hdu.edu.cn/showproblem.php?pid=2433

Runtime Error (ACCESS_VIOLATION)
qiu'jie'da

OJ Runtime Error (ACCESS_VIOLATION)
HDUOJ 1536的rn找不出原因啊，请各位查看一下我的代码吧，错在哪里了？rnrn[code=c]#includern#includern#includern#includernusing namespace std;rnrnint k, m, l;rnint s[1000+5], sg[1000+5], h[1000+5];rnint sum;rnvoid solution(int n)rnrn for(int i=1; i<=n; i++)rn rn for(int j=1; s[j]<=i && j<=k; j++)rn rn if(sg[i-s[j]]==0)rn rn sg[i] = s[j];rn break;rn rn rn rn sum ^= sg[n];rnrnint main()rnrn// freopen("hdu1536.txt", "r", stdin);rn while(cin >> k && k)rn rn for(int i=1; i<=k; i++)rn cin >> s[i];rn cin >> m;rn while(m--)rn rn sum = 0;rn cin >> l;rn for(int i=0; i> h[i];rn solution(h[i]);rn rn if(sum)rn rn cout << "W";rn elsern cout << "L";rn rn cout << endl;rn rn return 0;rn[/code]

oj新人求指点[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/2.gif][/img]rn在本机上的vc6.0跑了给的测试用例，能通过，但提交到oj上就runtime error，是在想不通哪里有问题[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/9.gif][/img]，请大佬们指点。rnrn下面是我runtime error的代码rn[code=c]#includern#includern#includernrnint main()rnrn int day,m;rn scanf("%d",&day);rn if(day==0) return 0;rn while(day)rn rn scanf("%d",&m);rnrn int on,on1,on2,on3;rn int off,off1,off2,off3;rn int first=1;rn char num[15],ear_num[15],late_num[15];rn int ear=86399,late=0;rnrn while(m)rn rn scanf("%s",num);rn scanf("%d:%d:%d",&on1,&on2,&on3);rn scanf("%d:%d:%d",&off1,&off2,&off3);rnrn if(m==1 && first==1)rn strcpy(ear_num,num);rn strcpy(late_num,num);rn break;rn rn rn on=on1*3600+on2*60+on3;rn off=off1*3600+off2*60+off3;rn rn if(on<=ear)rn ear=on;rn strcpy(ear_num,num); rn rnrn if(off>=late)rn late=off;rn strcpy(late_num,num);rn rnrn first=0;rn m--;rn rn printf("%s %s\n",ear_num,late_num);rn day--;rn rn return 0;rn[/code]rnrn原题是：rnrn题目描述：rn 每天第一个到机房的人要把门打开，最后一个离开的人要把门关好。现有一堆杂乱的机房签到、签离记录，请根据记录找出当天开门和关门的人。rnrn输入：rnrn 测试输入的第一行给出记录的总天数N ( N> 0 )，下面列出了N天的记录。rn 每天的记录在第一行给出记录的条目数M (M > 0 )，下面是M行，每行的格式为rnrn 证件号码 签到时间 签离时间rnrn 其中时间按“小时:分钟:秒钟”（各占2位）给出，证件号码是长度不超过15的字符串。rnrn输出：rnrn 对每一天的记录输出1行，即当天开门和关门人的证件号码，中间用1空格分隔。rn 注意：在裁判的标准测试输入中，所有记录保证完整，每个人的签到时间在签离时间之前，且没有多人同时签到或者签离的情况。rnrn样例输入：rnrn 3rn 1rn ME3021112225321 00:00:00 23:59:59rn 2rn EE301218 08:05:35 20:56:35rn MA301134 12:35:45 21:40:42rn 3rn CS301111 15:30:28 17:00:10rn SC3021234 08:00:00 11:25:25rn CS301133 21:45:00 21:58:40rnrn样例输出：rnrn ME3021112225321 ME3021112225321rn EE301218 MA301134rn SC3021234 CS301133rnrn
Runtime Error (ACCESS_VIOLATION)是什么错误啊？求大神帮助啊！
hdoj1107rnrn#includernusing namespace std;rnint a[13][13][1000],ma[3],jilu,n;rnstruct funrnrn char name;rn int x,y;rn int neili,wuyi,shengmingli;rn int direction;//0的话为最还是得方向rnt[1000];rnint fun1(int i)//参数为t结构体的下标rnrn float q;rn q=(0.5*t[i].neili+0.5*t[i].wuyi)*(t[i].shengmingli+10)*1.0/100;rn return static_cast(q);rnrnint fun2(int i)rnrn float q;rn q=(0.8*t[i].neili+0.2*t[i].wuyi)*(t[i].shengmingli+10)*1.0/100;rn return static_cast(q);rnrnint fun3(int i)rnrn float q;rn q=(0.2*t[i].neili+0.2*t[i].wuyi)*(t[i].shengmingli+10)*1.0/100;rn return static_cast(q);rnrnvoid zhandou()rn for(int i=1;i<=12;i++)rn rn for(int j=1;j<=12;j++)rn rn if((a[i][j][0]==2)&&(t[a[i][j][1]].name!=t[a[i][j][2]].name)&&t[a[i][j][1]].shengmingli>0&&t[a[i][j][2]].shengmingli>0)//判断是两个人并且是是不同派的rn rn for(int k=1;k<=2;k++)rn rn if(t[a[i][j][k]].name=='S')//分别算出攻击力rn ma[k]=fun1(a[i][j][k]);//返回的是攻击力rn if(t[a[i][j][k]].name=='W')rn ma[k]=fun2(a[i][j][k]);rn if(t[a[i][j][k]].name=='E')rn ma[k]=fun3(a[i][j][k]);rn rn t[a[i][j][1]].shengmingli-=ma[2];//算出战斗后的生命力的rn t[a[i][j][2]].shengmingli-=ma[1];rn rn rn rnrnvoid funs(int i)rnrn int m;rn m=t[i].x;rn if(t[i].direction==0)//判读向下走rn rn if(t[i].x<12)rn rn a[t[i].x][t[i].y][0]--;rn t[i].x++;rn a[t[i].x][t[i].y][0]++;rn rn elsern rn t[i].direction=1;rn a[t[i].x][t[i].y][0]--;rn t[i].x--;rn a[t[i].x][t[i].y][0]++;rn rn rn elsern rn if(t[i].x>1)rn rn a[t[i].x][t[i].y][0]--;rn t[i].x--;rn a[t[i].x][t[i].y][0]++;rn rn elsern rn t[i].direction=0;rn a[t[i].x][t[i].y][0]--;rn t[i].x++;rn a[t[i].x][t[i].y][0]++;rn rn rn int k=1;rn int w=1;rn while(a[t[i].x][t[i].y][w]!=0)rn w++;rn while(a[m][t[i].y][k]!=0)rn rn rn a[t[i].x][t[i].y][w]=a[m][t[i].y][k];rn a[m][t[i].y][k]=0;rn k++;rn w++;rn rnrnvoid funw(int i)rnrn int m=t[i].y;rn if(t[i].direction==0)rn rn if(t[i].y<12)rn rn a[t[i].x][t[i].y][0]--;rn t[i].y++;rn a[t[i].x][t[i].y][0]++;rn rn elsern rn t[i].direction=1;rn a[t[i].x][t[i].y][0]--;rn t[i].y--;rn a[t[i].x][t[i].y][0]++;rn rn rn elsern rn if(t[i].y>1)rn rn a[t[i].x][t[i].y][0]--;rn t[i].y--;rn a[t[i].x][t[i].y][0]++;rn rn elsern rn t[i].direction=0;rn a[t[i].x][t[i].y][0]--;rn t[i].y++;rn a[t[i].x][t[i].y][0]++;rn rn rn int k=1;rn int w=1;rn while(a[t[i].x][t[i].y][w]!=0)rn w++;rn while(a[t[i].x][m][k]!=0)rn rn a[t[i].x][t[i].y][w]=a[t[i].x][m][k];rn a[t[i].x][m][k]=0;rn k++;rn w++;rn rnrnvoid fune(int i)rnrn int m1=t[i].x,m2=t[i].y;rn if(t[i].direction==0)rn rn if((t[i].x<12)&&(t[i].y)<12)rn rn a[t[i].x][t[i].y][0]--;rn t[i].x++;rn t[i].y++;rn a[t[i].x][t[i].y][0]++;rn rn else if((t[i].x>1)&&(t[i].y>1))rn rn t[i].direction=1;rn a[t[i].x][t[i].y][0]--;rn t[i].x--;rn t[i].y--;rn a[t[i].x][t[i].y][0]++;rn rn rn elsern rn if((t[i].x>1)&&(t[i].y>1))rn rn a[t[i].x][t[i].y][0]--;rn t[i].x--;rn t[i].y--;rn a[t[i].x][t[i].y][0]++;rn rn else if((t[i].x<12)&&(t[i].y)<12)rn rn t[i].direction=0;rn a[t[i].x][t[i].y][0]--;rn t[i].x++;rn t[i].y++;rn a[t[i].x][t[i].y][0]++;rn rn rn int k=1;rn int w=1;rn while(a[t[i].x][t[i].y][w]!=0)rn w++;rn while(a[m1][m2][k]!=0)rn rn a[t[i].x][t[i].y][w]=a[m1][m2][k];rn a[m1][m2][k]=0;rn k++;rn w++;rn rnrnint main()rnrn int T;rn cin>>T;rn while(T--)rn rn jilu=0;//记录t结构体的下标rn cin>>n;rn memset(a,0,sizeof(a));rn int i=1;rn while(cin>>t[i].name)//对数据进行输入rn rn if(t[i].name=='0')rn break;rn jilu++;//记录人数的rn cin>>t[i].x>>t[i].y>>t[i].neili>>t[i].wuyi>>t[i].shengmingli;rn a[t[i].x][t[i].y][0]++;//记录所在的坐标rn t[i].direction=0;//记录方向rn int k=1;//记录本人的信息是在某个坐标记录的rn while(a[t[i].x][t[i].y][k]!=0)rn k++;rn a[t[i].x][t[i].y][k]=i;rn i++;rn rn rn for(int l=1;l<=n;l++)//每次走一步的rn rn zhandou();//将战斗进行一次rn for(i=1;i<=jilu;i++)//分别让他们走路的rn rn if(t[i].shengmingli<=0)rn continue;rn if(t[i].name=='S')//提供的是结构体的下标rn funs(i);//走路的函数 rn if(t[i].name=='W')rn funw(i);rn if(t[i].name=='E')rn fune(i); rn rn rn rn int max1=0,max2=0,max3=0,max4=0,max5=0,max6=0;rn for(i=1;i<=jilu;i++)rn rn if(t[i].name=='S'&&t[i].shengmingli>0)rn rn max1++;rn max2+=t[i].shengmingli;rn continue;rn rn if(t[i].name=='W'&&t[i].shengmingli>0)rn rn max3++;rn max4+=t[i].shengmingli;rn continue;rn rn if(t[i].name=='E'&&t[i].shengmingli>0)rn rn max5++;rn max6+=t[i].shengmingli;rn continue;rn rn rn cout<

rn这是题目 http://acm.tzc.edu.cn/acmhome/problemdetail.do?&method=showdetail&id=1055rn#include rnusing namespace std;rnint main()rnrn char a[101];rn int i,j=0;rn while(cin>>a[j])rn rn j++;rn rn cout<=65 && a[i]<90) a[i]+=33;rn if(a[i]==90) a[i]='a';rn rn a[j]='\0';rn cout<

ACM hdu1558 Runtime Error (ACCESS_VIOLATION) 不明白哪里导致这个错误

#include rnint main()rnrn int m,n;rn while(scanf("%d%d",&n,&m)!=EOF)rn rn if(n>0&&n<=100&&m>0&&m<=100)rn rn int i,j,a[100],b[100],count=0;rn for(i=0;i
OJ上的题目Runtime error(SIGSEGV)
[code=c]#includern#includern#includernint main()rnrn char a[10000];rn int i,j,n,l,u,b[100]=0;rn for(i=0,n=0;(fgets(a,100000,stdin))!=NULL;i++)rn rn if(a[strlen(a)-1]=='\n')rn a[strlen(a)-1]='\0';rn l=0;rn u=0;rn for(j=0;j0&&u==-1)rn b[n++]=l;rn else if(u>0&&l==-1)rn b[n++]=u;rn elsern b[n++]=-1;rn rn for(i=0;i

http://acm.hdu.edu.cn/showproblem.php?pid=2071rn水题。还有另外一道，也是提示那个。rn代码rn[code=C/C++]rn#includernint main()rnrn int cnt;rn scanf("%d",&cnt);rn for(int i=0;in?m:n;rn rn printf("%.2lf\n",m);rn rnrnrn[/code]

Problem Title 2  Pro. ID 1001 Sum Problem #include&amp;lt;stdio.h&amp;gt; int main() { int i,n,sum=0; while(scanf(&quot;%d&quot;,&amp;amp;n)!=EOF){ sum=0; for(i=1;i&amp;lt;=n;i++){ sum = ...
ACCESS_VIOLATION
#includernint a[5000000];rnint main()rnrn int i,j,t,n,x;rn while(scanf("%d",&n)!=EOF)rn rn getchar();rn for(i=0;i
Runtime error

runtime error

Runtime error!
VC++ 程序运行后，用了很长时间也没发现问题。最近有时会突然出现一个错误的提示框（极少出现）。rnrnRuntime Error!rnrnprogram: c:\documents and settings\.....rnrnThis application has requested the Runtime to terminate it in an unusual way. Pleasse contact the application'support team for more information.rnrnrn感觉好像是本生操作系统的问题导致的。。请教各位，帮忙分析下。谢谢！rn
Runtime Error

runtime error?

RunTime Error!

Runtime Error!