-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOVGDEL.cpp
More file actions
50 lines (42 loc) · 914 Bytes
/
OVGDEL.cpp
File metadata and controls
50 lines (42 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
int m = 1000001;
cin>>t;
for(int _it = 1; _it <=t; ++_it)
{
int n;
cin>>n;
vector<int> fre(m,0),a(n);
for(int i = 0; i < n; ++i)
{
cin>>a[i];
fre[a[i]]++;
}
int ans = 0;
for(int i = 0; i < n; ++i)
{
for(long long j = 1; j < m; j*=a[i])
{
if(j == a[i])
{
if(fre[j] > 1)
{
ans++;
break;
}
}
else if(fre[j] > 0)
{
ans++;
break;
}
if(a[i] == 1)
break;
}
}
cout<<"Case "<<_it<<": "<<ans<<endl;
}
}