답안 #7294

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
7294 2014-07-30T05:29:08 Z gs13068 경비원 (GA8_guard) C++
37 / 100
2000 ms 1112 KB
#include<cstdio>

int a[2223];
int d[2223];
int p[2223];

int dfs(int x)
{
	if(x>2222)return 1;
	int i,t,r=0;
	if(a[x])
	{
		t=x;
		for(i=2;i*i<=t;i++)
		{
			if(t%i==0&&d[i])break;
			while(t%i==0)t/=i;
		}
		if(i*i>t&&!d[t])
		{
			t=x;
			for(i=2;i*i<=t;i++)if(t%i==0)
			{
				d[i]=1;
				while(t%i==0)t/=i;
			}
			if(t>1)d[t]=1;

			r=1LL*dfs(p[x])*a[x]%1000000007;

			t=x;
			for(i=2;i*i<=t;i++)if(t%i==0)
			{
				d[i]=0;
				while(t%i==0)t/=i;
			}
			if(t>1)d[t]=0;
		}
	}
	return (r+dfs(p[x]))%1000000007;
}

int main()
{
	int i,n,t;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
	{
		scanf("%d",&t);
		a[t]++;
	}
	t=2223;
	for(i=2222;i>=2;i--)
	{
		p[i]=t;
        if(a[i])t=i;
	}
	t=dfs(2);
	for(i=1;i<=a[1];i++)t=(t<<1)%1000000007;
	printf("%d",t-n-1);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1112 KB Output is correct
2 Correct 0 ms 1112 KB Output is correct
3 Correct 0 ms 1112 KB Output is correct
4 Correct 0 ms 1112 KB Output is correct
5 Correct 0 ms 1112 KB Output is correct
6 Correct 0 ms 1112 KB Output is correct
7 Correct 0 ms 1112 KB Output is correct
8 Correct 0 ms 1112 KB Output is correct
9 Correct 0 ms 1112 KB Output is correct
10 Correct 0 ms 1112 KB Output is correct
11 Correct 0 ms 1112 KB Output is correct
12 Correct 0 ms 1112 KB Output is correct
13 Correct 0 ms 1112 KB Output is correct
14 Correct 0 ms 1112 KB Output is correct
15 Correct 0 ms 1112 KB Output is correct
16 Correct 0 ms 1112 KB Output is correct
17 Correct 0 ms 1112 KB Output is correct
18 Correct 0 ms 1112 KB Output is correct
19 Correct 0 ms 1112 KB Output is correct
20 Correct 0 ms 1112 KB Output is correct
21 Correct 0 ms 1112 KB Output is correct
22 Correct 0 ms 1112 KB Output is correct
23 Correct 0 ms 1112 KB Output is correct
24 Correct 0 ms 1112 KB Output is correct
25 Correct 0 ms 1112 KB Output is correct
26 Correct 0 ms 1112 KB Output is correct
27 Correct 0 ms 1112 KB Output is correct
28 Correct 0 ms 1112 KB Output is correct
29 Correct 0 ms 1112 KB Output is correct
30 Correct 0 ms 1112 KB Output is correct
31 Correct 0 ms 1112 KB Output is correct
32 Correct 0 ms 1112 KB Output is correct
33 Correct 0 ms 1112 KB Output is correct
34 Correct 0 ms 1112 KB Output is correct
35 Correct 0 ms 1112 KB Output is correct
36 Correct 0 ms 1112 KB Output is correct
37 Correct 0 ms 1112 KB Output is correct
38 Correct 0 ms 1112 KB Output is correct
39 Correct 0 ms 1112 KB Output is correct
40 Correct 0 ms 1112 KB Output is correct
41 Correct 0 ms 1112 KB Output is correct
42 Correct 0 ms 1112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1112 KB Output is correct
2 Correct 0 ms 1112 KB Output is correct
3 Correct 0 ms 1112 KB Output is correct
4 Correct 0 ms 1112 KB Output is correct
5 Correct 0 ms 1112 KB Output is correct
6 Correct 0 ms 1112 KB Output is correct
7 Correct 0 ms 1112 KB Output is correct
8 Correct 0 ms 1112 KB Output is correct
9 Correct 0 ms 1112 KB Output is correct
10 Correct 0 ms 1112 KB Output is correct
11 Correct 0 ms 1112 KB Output is correct
12 Correct 0 ms 1112 KB Output is correct
13 Correct 0 ms 1112 KB Output is correct
14 Correct 0 ms 1112 KB Output is correct
15 Correct 0 ms 1112 KB Output is correct
16 Correct 0 ms 1112 KB Output is correct
17 Correct 0 ms 1112 KB Output is correct
18 Correct 0 ms 1112 KB Output is correct
19 Correct 0 ms 1112 KB Output is correct
20 Correct 0 ms 1112 KB Output is correct
21 Correct 0 ms 1112 KB Output is correct
22 Correct 0 ms 1112 KB Output is correct
23 Correct 0 ms 1112 KB Output is correct
24 Correct 0 ms 1112 KB Output is correct
25 Correct 0 ms 1112 KB Output is correct
26 Correct 0 ms 1112 KB Output is correct
27 Correct 0 ms 1112 KB Output is correct
28 Correct 0 ms 1112 KB Output is correct
29 Correct 0 ms 1112 KB Output is correct
30 Correct 0 ms 1112 KB Output is correct
31 Correct 4 ms 1112 KB Output is correct
32 Correct 0 ms 1112 KB Output is correct
33 Correct 4 ms 1112 KB Output is correct
34 Correct 8 ms 1112 KB Output is correct
35 Correct 8 ms 1112 KB Output is correct
36 Correct 12 ms 1112 KB Output is correct
37 Correct 12 ms 1112 KB Output is correct
38 Correct 16 ms 1112 KB Output is correct
39 Correct 16 ms 1112 KB Output is correct
40 Correct 28 ms 1112 KB Output is correct
41 Correct 32 ms 1112 KB Output is correct
42 Correct 52 ms 1112 KB Output is correct
43 Correct 60 ms 1112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 60 ms 1112 KB Output is correct
2 Correct 60 ms 1112 KB Output is correct
3 Correct 48 ms 1112 KB Output is correct
4 Correct 0 ms 1112 KB Output is correct
5 Correct 0 ms 1112 KB Output is correct
6 Correct 0 ms 1112 KB Output is correct
7 Correct 0 ms 1112 KB Output is correct
8 Correct 0 ms 1112 KB Output is correct
9 Correct 60 ms 1112 KB Output is correct
10 Correct 56 ms 1112 KB Output is correct
11 Correct 56 ms 1112 KB Output is correct
12 Correct 0 ms 1112 KB Output is correct
13 Correct 0 ms 1112 KB Output is correct
14 Correct 0 ms 1112 KB Output is correct
15 Correct 0 ms 1112 KB Output is correct
16 Correct 0 ms 1112 KB Output is correct
17 Correct 60 ms 1112 KB Output is correct
18 Correct 60 ms 1112 KB Output is correct
19 Correct 60 ms 1112 KB Output is correct
20 Correct 0 ms 1112 KB Output is correct
21 Correct 0 ms 1112 KB Output is correct
22 Correct 0 ms 1112 KB Output is correct
23 Correct 0 ms 1112 KB Output is correct
24 Correct 0 ms 1112 KB Output is correct
25 Correct 64 ms 1112 KB Output is correct
26 Correct 60 ms 1112 KB Output is correct
27 Correct 60 ms 1112 KB Output is correct
28 Correct 0 ms 1112 KB Output is correct
29 Correct 0 ms 1112 KB Output is correct
30 Correct 0 ms 1112 KB Output is correct
31 Correct 0 ms 1112 KB Output is correct
32 Correct 0 ms 1112 KB Output is correct
33 Correct 60 ms 1112 KB Output is correct
34 Correct 60 ms 1112 KB Output is correct
35 Correct 60 ms 1112 KB Output is correct
36 Correct 0 ms 1112 KB Output is correct
37 Correct 0 ms 1112 KB Output is correct
38 Correct 0 ms 1112 KB Output is correct
39 Correct 0 ms 1112 KB Output is correct
40 Correct 0 ms 1112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2000 ms 1108 KB Program timed out
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2000 ms 1108 KB Program timed out
2 Halted 0 ms 0 KB -