用户输出
12
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#47983 | #1261. 数字删除 | Accepted | 100 | 3521 ms | 1516 K | C++ 17 / 657 B | Komeiji Koishi | 2021-05-10 13:10:31 |
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for (i = 0; i < n; i++)
#define int long long
using namespace std;
int n;
int a[1000];
signed main() {
int i, j;
cin >> n;
rep(i, n) cin >> a[i];
vector<int> vec;
rep(i, n) {
for (j = 1; j * j <= a[i]; j++) {
if (a[i] % j == 0) {
vec.push_back(j);
if (j != a[i] / j)
vec.push_back(a[i] / j);
}
}
}
int ans = 0;
rep(i, vec.size()) {
int k = vec[i];
if (k <= 1)
continue;
int ssum = 0;
rep(j, n) {
if (a[j] % k == 0)
ssum += a[j];
}
ans = max(ans, ssum);
}
cout << ans << endl;
return 0;
}
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