Task: | organizator |
Sender: | Hansuzu |
Submission time: | 2016-07-27 16:05:32 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.07 s | details |
#2 | ACCEPTED | 0.07 s | details |
#3 | ACCEPTED | 0.08 s | details |
#4 | ACCEPTED | 0.07 s | details |
#5 | ACCEPTED | 0.07 s | details |
#6 | ACCEPTED | 0.09 s | details |
#7 | TIME LIMIT EXCEEDED | -- | details |
#8 | TIME LIMIT EXCEEDED | -- | details |
#9 | TIME LIMIT EXCEEDED | -- | details |
#10 | TIME LIMIT EXCEEDED | -- | details |
#11 | TIME LIMIT EXCEEDED | -- | details |
#12 | TIME LIMIT EXCEEDED | -- | details |
#13 | TIME LIMIT EXCEEDED | -- | details |
#14 | TIME LIMIT EXCEEDED | -- | details |
#15 | TIME LIMIT EXCEEDED | -- | details |
#16 | TIME LIMIT EXCEEDED | -- | details |
#17 | TIME LIMIT EXCEEDED | -- | details |
#18 | TIME LIMIT EXCEEDED | -- | details |
#19 | TIME LIMIT EXCEEDED | -- | details |
Code
#include <iostream> #include <set> #include <map> #define S second #define F first using namespace std; int N; int a[2111333]; int p[2111333]; map<int, int> tkj; set<int> ctkj; void h(int c){ ctkj.clear(); ctkj.insert(c); int w=c; while (p[w]!=w){ for (int i=p[w]; i<c; i+=p[w]){ if (c%i==0)ctkj.insert(i); } w/=p[w]; } for (auto a:ctkj){ ++tkj[a]; } } long long ans=2; int main(){ p[0]=p[1]=1; for (int i=2; i<2111333; ++i){ if (p[i]) continue; p[i]=i; for (int j=i+i; j<2111333; j+=i){ p[j]=i; } } cin >> N; for (int i=0; i<N; ++i){ int w; cin >> w; h(w); } for (auto a:tkj){ if (a.S>1) ans=max(ans, (long long)a.F*a.S); } cout << ans << "\n"; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
3
1 2 4 |
correct output |
---|
4 |
user output |
---|
4 |
Test 2
Verdict: ACCEPTED
input |
---|
2
1 5 |
correct output |
---|
2 |
user output |
---|
2 |
Test 3
Verdict: ACCEPTED
input |
---|
5
4 6 3 8 9 |
correct output |
---|
9 |
user output |
---|
9 |
Test 4
Verdict: ACCEPTED
input |
---|
100
988 6833 9309 8541 1265 9449 5... |
correct output |
---|
14432 |
user output |
---|
14432 |
Test 5
Verdict: ACCEPTED
input |
---|
1000
167 60 170 502 971 2759 1790 1... |
correct output |
---|
12963 |
user output |
---|
12963 |
Test 6
Verdict: ACCEPTED
input |
---|
20
53 76 25 71 43 40 97 17 46 26 ... |
correct output |
---|
55440 |
user output |
---|
55440 |
Test 7
Verdict: TIME LIMIT EXCEEDED
input |
---|
10000
2000000 2973 1884960 1965600 1... |
correct output |
---|
998000000 |
user output |
---|
(empty) |
Test 8
Verdict: TIME LIMIT EXCEEDED
input |
---|
20000
1867320 1801800 2000000 3516 4... |
correct output |
---|
2039360400 |
user output |
---|
(empty) |
Test 9
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000
321799 200309 451017 114778 35... |
correct output |
---|
8436000 |
user output |
---|
(empty) |
Test 10
Verdict: TIME LIMIT EXCEEDED
input |
---|
50000
1542240 87374 1729728 1113840 ... |
correct output |
---|
522849600 |
user output |
---|
(empty) |
Test 11
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000
570304 521109 689931 17250 990... |
correct output |
---|
149985000 |
user output |
---|
(empty) |
Test 12
Verdict: TIME LIMIT EXCEEDED
input |
---|
50000
1834560 1544400 1912680 111384... |
correct output |
---|
1056000000 |
user output |
---|
(empty) |
Test 13
Verdict: TIME LIMIT EXCEEDED
input |
---|
100001
104442 560941 1492871 1412995 ... |
correct output |
---|
2104046616 |
user output |
---|
(empty) |
Test 14
Verdict: TIME LIMIT EXCEEDED
input |
---|
140000
396519 779335 1220726 633419 1... |
correct output |
---|
2666109600 |
user output |
---|
(empty) |
Test 15
Verdict: TIME LIMIT EXCEEDED
input |
---|
150000
199004 279001 1791639 1789810 ... |
correct output |
---|
1283381061 |
user output |
---|
(empty) |
Test 16
Verdict: TIME LIMIT EXCEEDED
input |
---|
150000
1940400 1867320 1965600 141372... |
correct output |
---|
27926000000 |
user output |
---|
(empty) |
Test 17
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000
634553 1387738 1923797 748376 ... |
correct output |
---|
41201433 |
user output |
---|
(empty) |
Test 18
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000
1663200 1995840 1289302 136634... |
correct output |
---|
37890000000 |
user output |
---|
(empty) |
Test 19
Verdict: TIME LIMIT EXCEEDED
input |
---|
200000
1079365 1094819 909761 1877190... |
correct output |
---|
179428140 |
user output |
---|
(empty) |