请注意枚举区间的写法
for(int j=0;j<=a[i].b-a[i].a;j++)
或
for(int j=a[i].a;j<=a[i].b;j++)
而不是
for(int j=1;j<=a[i].b-a[i].a;j++)