| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
怎么会RE啊哪个大牛能给点指点啊!谢谢了,最好是给些数据!!!runtime error!
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
int n, m, tail, num, deq[11000000];
int main()
{
int front, end, tmp, ends, i, j, k;
while (scanf("%d %d", &n, &m) != EOF)
{
if (m < n)
{
printf("0\n");
continue;
}
front = 0;
end = 0;
scanf("%d", &tail);
for (j = 1; j <= tail; j++)
{
scanf("%d", &num);
tmp = int(pow(double(2), double(num)));
deq[end++] = tmp;
}
for (i = 2; i <= n; i++)
{
scanf("%d", &tail);
ends = end;
for (j = 1; j <= tail; j++)
{
scanf("%d", &num);
tmp = int(pow(double(2), double(num)));
for (k = front; k < end; k++)
{
if ((tmp&deq[k]) == 0)
{
deq[ends++] = deq[k]+tmp;
}
}
}
front = end;
end = ends;
}
printf("%d\n", end-front);
}
// system("pause");
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator