TAG 暴搜 模除
0.2 sec
1232 KB
我不知道第一名那个 0.03 sec
424 KB是怎么办到的。。
注意memset那个不必重置整个数组,重置需要那部分就可以。
/* source code of submission 426449, Zhongshan University Online Judge System */
#include <stdio.h>
#include <memory.h>
int t,n;
int id[300];
bool used[1000000];
int ans;
bool check(int x)
{
memset(used, false, sizeof(bool)*ans );
for (int i=0; i<n; ++i)
{
int tmp=id[i]%x;
if ( used[tmp] )
......
阅读全文