用户输出
12
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#69133 | #1261. 数字删除 | Wrong Answer | 59 | 4651 ms | 17048 K | Java / 1.1 K | 新媒体-雷广涵 | 2022-05-01 2:12:21 |
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Main {
public static void main(String[] args) {
// std input
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = in.nextInt();
}
// record the prime factor of those nums
Set<Integer> primeFactor = new HashSet<>();
for (int i = 0; i < n; i++) {
int temp = arr[i];
for (int j = 2; j * j <= temp; j++) {
if (temp % j == 0) {
primeFactor.add(j);
temp /= j;
}
}
if (temp > 1)
primeFactor.add(temp);
}
// choose the max choice
long ans = 0;
for (var factor : primeFactor) {
int temp = 0;
for (int i = 0; i < n; i++) {
if (arr[i] % factor == 0)
temp += arr[i];
}
ans = (temp > ans) ? temp : ans;
}
System.out.println(ans);
in.close();
}
}
10
999999999
999999999
999999999
999999999
999999999
999999999
999999999
999999999
999999999
9999999
<3 bytes omitted>
用户输出
1410065398
Special Judge 信息
Files user_out and answer differ
系统信息
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>
用户输出
2120458750
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
248
833462177
832360338
331481268
949654765
60211903
733156083
686736689
637046496
462060457
5858836
<2361 bytes omitted>
用户输出
2144567944
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
487
94076248
879311282
41528500
766221230
119283462
763277566
363751168
567423114
570994040
99159334
<4721 bytes omitted>
用户输出
2129553698
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
586
448499010
455964638
739627577
182129295
503908902
692114260
404913440
742125008
803425426
149995
<5716 bytes omitted>
用户输出
2142103134
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
803
887827636
485158477
672450671
26581057
943349778
866307211
834230089
380252787
658518626
5468859
<7838 bytes omitted>
用户输出
2088792773
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
297
373250397
442094344
450753516
451859082
88082845
241368893
158976836
233504878
922528460
4483719
<2835 bytes omitted>
用户输出
2028381977
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
203
590924798
827866650
811940664
186640469
382831288
259716737
129158960
319546863
281612866
490756
<1918 bytes omitted>
用户输出
2145355238
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
778
65697236
154196615
420824653
262431245
876954209
981184655
733651569
389218337
783527042
6126218
<7592 bytes omitted>
用户输出
2053595164
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
310
402947561
776186710
239837125
97164069
899443944
223227689
590571426
130392722
841663206
9659663
<2970 bytes omitted>
用户输出
2130679920
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
173
44335202
624245067
232116255
64066024
754495793
839942658
365425758
471005472
752804898
19271533
<1619 bytes omitted>
用户输出
2123936856
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
用户输出
1499999979
系统信息
Exited with return code 0
1000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1000000
<10905 bytes omitted>
用户输出
0
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
1000
1000000000
999999998
999999996
999999994
999999992
999999990
999999988
999999986
999999984
9999
<9906 bytes omitted>
用户输出
2115083112
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0