[Offer收割]编程练习赛50 register

Ended

Participants:326

Verdict:Time Limit Exceeded
Score:20 / 100
Submitted:2018-03-11 14:01:16

Lang:Java

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.Scanner;
public class Main {
    static final int ZZ = 1000;
    static int nmans;
    static int[] arr = new int[110];
    static int[] arr2 = new int[110];
    static int[] arr5 = new int[110];
    static int[] book = new int[110];
    
    static void dfs(int step) {
        if(step == m) {
            int sum2 = 0;
            int sum5 = 0;
            for(int i = 1i <= ni++) {
                if(book[i== 1) {
                    sum2 += arr2[i];
                    sum5 += arr5[i];
                }
            }
            ans = Math.max(ansMath.min(sum2sum5));
        }
        for(int i = 1i <= ni++) {
            if(book[i== 0) {
                book[i= 1;
                dfs(step+1);
                book[i= 0;
            }
        }
    }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX