已删除

Anna edited 4 年,9 月前

.

#include <stdio.h>
#include <stdlib.h>
#define N 10000

int main(){
    int n;
    int num;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%d",&num);
        int p[N];
        for(int i = 0; i < num; ++i)
        {    scanf("%d",&p[i]);        }
        if(num == 1)
        {   printf("1");      }
        else
        {
            int j;

            for(int i = 2; ; ++i)
             {
                 int visit[N];
                 for(int k = 0; k < i; ++k)
                 {       visit[k] = 0;                }
                 for(j = 0; j < num; ++j)
                 {      int m = p[j] % i;
                 if(visit[m] == 1)
                 {  break;      }
                 else
                 {
                     visit[m] = 1;
                     }
                     }
                     if(j == num)
                     {
                         printf("%d",i);
                         break;

                     }

                     }

        }        }
           return 0;}

Comments

Fifnmar

啊,这令人窒息的格式