hiho week 244 register

Ended

Participants:122

Verdict:Accepted
Score:100 / 100
Submitted:2019-03-07 02:04:23

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.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int t = sc.nextInt();
        for(int tt = 0tt < ttt++) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int[][] ans = new int[2][1024];
            for (int i = 1i < (1 << m); i++) {
                ans[0][i= -100000;
            }
            for(int i = 1i <= ni++) {
                int v = sc.nextInt();
                int s = sc.nextInt();
                int k = 0;          
                for (int j = 0j < sj++) {
                    int l = sc.nextInt();
                    k |= 1 << (l -1);
                }
                for(int j = 0j < (1 << m); j++) {
                    ans[i & 1][j= Math.max(ans[i & 1 ^ 1][j ^ k+ vans[i & 1 ^ 1][j]);
                }
            }
            System.out.println(ans[n & 1][(1 << m- 1]);
        }
        
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX