Page 4 of 4

Re: 10125 - Sumsets

Posted: Sun Nov 03, 2013 10:07 am
by Samleo
brianfry713 wrote:That code won't compile
Huh? Why?
It works perfectly on my c++ compiler and uva is returning me WA, not CE

Re: 10125 - Sumsets

Posted: Tue Nov 05, 2013 1:09 am
by brianfry713
Input:

Code: Select all

5
21
31
36
37
39
8
0
1
2
3
21
31
36
38
16
0
3
8
12
13
14
16
18
23
24
25
26
27
28
31
32
15
2
3
5
7
10
11
13
14
15
19
22
36
37
38
39
15
0
1
3
5
10
12
14
18
21
23
26
28
30
37
38
14
9
10
12
13
16
19
23
25
27
28
29
30
31
34
13
1
4
8
10
12
16
18
21
24
31
34
36
38
8
6
9
16
29
31
33
34
38
11
2
4
5
10
12
14
16
18
24
25
36
3
3
5
36
0
AC output:

Code: Select all

no solution
38
32
39
38
34
38
31
36
no solution

Re: 10125 - Sumsets

Posted: Sun Jan 19, 2014 2:03 am
by Ty4
/Removed after AC

Re: 10125 - Sumsets

Posted: Mon Jan 20, 2014 11:34 pm
by brianfry713
Input:

Code: Select all

4
1
2
-3
0
0
AC output: 0

Re: 10125 - Sumsets

Posted: Tue Jan 21, 2014 3:43 am
by Ty4
Awesome, that did it. Thank you!

Re: 10125 - Sumsets

Posted: Thu Oct 29, 2015 10:36 pm
by carofe82
The brute force algo won't pass in Java. The O(n^2 log(n)) does and it is the best algorithm.