| ||||||||||
| 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 | |||||||||
why wa#include <stdio.h>
int main ()
{
int testCase = 0;
int num = 0;
int i = 0, j = 0, k = 0;
int differ[89704];
int sin[320];
scanf ("%d", &testCase);
while (testCase--)
{
scanf ("%d", &num);
for (i = 0; i < num; i++)
scanf ("%d", &sin[i]);
/*if (num==1)
{
printf ("1\n");
continue;
}*/
k = 0;
for (i = 0; i < num; i++)
for (j = i+1; j < num; j++)
{
differ[k] = sin[i] - sin[j];
if (differ[k] < 0)
differ[k] = 0 - differ[k];
k ++;
}
j = num;
for (i = 0; i < k; i ++)
{
while (differ[i] % j == 0)
j ++;
}
printf ("%d\n", j);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator