Language: C++

import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] hon = new int[n + 1][n + 1];
        for(int i = 1; i <= n; i++){
            for(int j = 1; j <= n; j++){
                hon[i][j] = -1;
            }
        }

        for(int i = 1; i <= n; i++){
            int num = sc.nextInt();
            for(int j = 0; j < num; j++){
                hon[i][sc.nextInt()] = sc.nextInt();
            }
        }

        int max = 0;
        for(int i = 0; i < (1 << n); i++){
            boolean bl = true;
            for(int j = 0; j < n; j++){
                if((i >> j & 1) == 1){
                    for(int k = 1; k <= n; k++){
                        if(hon[j + 1][k] != -1 && hon[j + 1][k] != (i >> k - 1 & 1)){
                            bl = false;
                            break;
                        }
                    }
                }
                if(!bl){
                    break;
                }
            }
            if(bl){
                max = Math.max(max, Integer.bitCount(i));
            }
        }

        System.out.println(max);
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:11: error: expected ':' before 'static'
    3 |     public static void main(String[] args){
      |           ^~~~~~~
      |           :
a.cc:3:29: error: 'String' has not been declared
    3 |     public static void main(String[] args){
      |                             ^~~~~~
a.cc:3:38: error: expected ',' or '...' before 'args'
    3 |     public static void main(String[] args){
      |                                      ^~~~
a.cc:43:2: error: expected ';' after class definition
   43 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:4:9: error: 'Scanner' was not declared in this scope
    4 |         Scanner sc = new Scanner(System.in);
      |         ^~~~~~~
a.cc:5:17: error: 'sc' was not declared in this scope
    5 |         int n = sc.nextInt();
      |                 ^~
a.cc:6:12: error: structured binding declaration cannot have type 'int'
    6 |         int[][] hon = new int[n + 1][n + 1];
      |            ^~
a.cc:6:12: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:12: error: empty structured binding declaration
a.cc:6:14: error: expected initializer before '[' token
    6 |         int[][] hon = new int[n + 1][n + 1];
      |              ^
a.cc:9:17: error: 'hon' was not declared in this scope
    9 |                 hon[i][j] = -1;
      |                 ^~~
a.cc:16:17: error: 'hon' was not declared in this scope
   16 |                 hon[i][sc.nextInt()] = sc.nextInt();
      |                 ^~~
a.cc:22:13: error: 'boolean' was not declared in this scope; did you mean 'bool'?
   22 |             boolean bl = true;
      |             ^~~~~~~
      |             bool
a.cc:26:28: error: 'hon' was not declared in this scope
   26 |                         if(hon[j + 1][k] != -1 && hon[j + 1][k] != (i >> k - 1 & 1)){
      |                            ^~~
a.cc:27:29: error: 'bl' was not declared in this scope; did you mean 'bool'?
   27 |                             bl = false;
      |                             ^~
      |                             bool
a.cc:32:21: error: 'bl' was not declared in this scope; did you mean 'bool'?
   32 |                 if(!bl){
      |                     ^~
      |                     bool
a.cc:36:16: error: 'bl' was not declared in this scope; did you mean 'bool'?
   36 |             if(bl){
      |                ^~
      |                bool
a.cc:37:23: error: 'Math' was not declared in this scope
   37 |                 max = Math.max(max, Integer.bitCount(i));
      |                       ^~~~
a.cc:37:37: error: 'Integer' was not declared in this scope
   37 |                 max = Math.max(max, Integer.bitCount(i));
      |                                     ^~~~~~~
a.cc:41:9: error: 'System' was not declared in this scope
   41 |         System.out.println(max);
      |         ^~~~~~