Submission #4282069


Source Code Expand

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	    int n = sc.nextInt();
		int m = sc.nextInt();

		int[] l = new int[m];
		for (int i = 0; i < n; ++i) {
			int c = sc.nextInt();
			for (int j = 0; j < c; ++j) {
				int x = sc.nextInt();
				l[x - 1] += 1;
			}
		}
		int r = 0;
		for (int i = 0; i < m; ++i) {
			if(l[i] == n) {
				r++;
			}
		}
		System.out.println(r);
	}
}

Submission Info

Submission Time
Task B - Foods Loved by Everyone
User mdstoy
Language Java8 (OpenJDK 1.8.0)
Score 200
Code Size 474 Byte
Status AC
Exec Time 126 ms
Memory 23500 KiB

Judge Result

Set Name All Sample
Score / Max Score 200 / 200 0 / 0
Status
AC × 15
AC × 3
Set Name Test Cases
All 0_random_1, 0_random_2, 1_max_1, 1_max_2, 2_nmin_1, 3_mmin_1, 4_corner_1, 4_corner_2, 4_corner_3, 5_hand_1, 5_hand_2, 5_hand_3, sample_01, sample_02, sample_03
Sample sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_random_1 AC 93 ms 21076 KiB
0_random_2 AC 110 ms 21716 KiB
1_max_1 AC 121 ms 18132 KiB
1_max_2 AC 121 ms 19540 KiB
2_nmin_1 AC 107 ms 21844 KiB
3_mmin_1 AC 109 ms 21332 KiB
4_corner_1 AC 122 ms 21072 KiB
4_corner_2 AC 122 ms 21200 KiB
4_corner_3 AC 117 ms 19796 KiB
5_hand_1 AC 126 ms 23500 KiB
5_hand_2 AC 96 ms 21204 KiB
5_hand_3 AC 95 ms 19148 KiB
sample_01 AC 94 ms 20564 KiB
sample_02 AC 92 ms 19284 KiB
sample_03 AC 92 ms 21204 KiB