用户输出
12
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#49018 | #1261. 数字删除 | Accepted | 100 | 455 ms | 416 K | C++ 17 / 888 B | 计试001-顾真榕 | 2021-05-20 9:47:20 |
#include <bits/stdc++.h>
typedef unsigned long long ull;
using namespace std;
ull ans = 0;
map<ull, ull> factors;
void decompose(ull a, ull times) {
if (a == 1)
return;
ull orig = a;
for (int i = 2; i * i <= a; i++) {
if (a % i == 0) {
factors[i] += orig * times;
if (factors[i] > ans)
ans = factors[i];
}
while (a % i == 0) {
a /= i;
}
}
if (a != 1) {
factors[a] += orig * times;
if (factors[a] > ans)
ans = factors[a];
}
}
int main() {
int n;
scanf("%d", &n);
map<ull, ull> digits;
for (int i = 0; i < n; i++) {
ull temp;
scanf("%lld", &temp);
digits[temp]++;
}
for (auto i : digits) {
decompose(i.first, i.second);
}
printf("%lld", ans);
}
10
999999999
999999999
999999999
999999999
999999999
999999999
999999999
999999999
999999999
9999999
<3 bytes omitted>
用户输出
9999999990
系统信息
Exited with return code 0
用户输出
56898
系统信息
Exited with return code 0
957
522627804
400792198
220572477
772420713
949106732
867088911
850851737
541599109
310148807
481974
<9352 bytes omitted>
用户输出
247048725634
系统信息
Exited with return code 0
248
833462177
832360338
331481268
949654765
60211903
733156083
686736689
637046496
462060457
5858836
<2361 bytes omitted>
用户输出
67252731850
系统信息
Exited with return code 0
487
94076248
879311282
41528500
766221230
119283462
763277566
363751168
567423114
570994040
99159334
<4721 bytes omitted>
用户输出
133032997690
系统信息
Exited with return code 0
586
448499010
455964638
739627577
182129295
503908902
692114260
404913440
742125008
803425426
149995
<5716 bytes omitted>
用户输出
152932375346
系统信息
Exited with return code 0
803
887827636
485158477
672450671
26581057
943349778
866307211
834230089
380252787
658518626
5468859
<7838 bytes omitted>
用户输出
204028435234
系统信息
Exited with return code 0
297
373250397
442094344
450753516
451859082
88082845
241368893
158976836
233504878
922528460
4483719
<2835 bytes omitted>
用户输出
78104160660
系统信息
Exited with return code 0
203
590924798
827866650
811940664
186640469
382831288
259716737
129158960
319546863
281612866
490756
<1918 bytes omitted>
用户输出
57670921422
系统信息
Exited with return code 0
778
65697236
154196615
420824653
262431245
876954209
981184655
733651569
389218337
783527042
6126218
<7592 bytes omitted>
用户输出
187671706090
系统信息
Exited with return code 0
310
402947561
776186710
239837125
97164069
899443944
223227689
590571426
130392722
841663206
9659663
<2970 bytes omitted>
用户输出
70850156656
系统信息
Exited with return code 0
173
44335202
624245067
232116255
64066024
754495793
839942658
365425758
471005472
752804898
19271533
<1619 bytes omitted>
用户输出
48718840966
系统信息
Exited with return code 0
用户输出
1499999979
系统信息
Exited with return code 0
1000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000
<10905 bytes omitted>
用户输出
1000000000000
系统信息
Exited with return code 0
1000
1000000000
999999998
999999996
999999994
999999992
999999990
999999988
999999986
999999984
9999
<9906 bytes omitted>
用户输出
999999001000
系统信息
Exited with return code 0