Submission #71835160


Source Code Expand

import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		new Main().B();
		//new C().go();
	}
	
	void A() {
		Scanner in = new Scanner(System.in);
		int A = in.nextInt();
		int B = in.nextInt();
		
		System.out.println( A*12+B );
		
	}


	
	void B() {
		Scanner in = new Scanner(System.in);

		int H = in.nextInt();
		int W = in.nextInt();
		int N = in.nextInt();
		int[][] A = new int[H][W];
		int[] B = new int[N];
		int[] C = new int[N];
		
		for (int y=0;y<H;y++) {
			for (int x=0;x<W;x++) {
				A[y][x] = in.nextInt();
			}
		}

		for (int i=0;i<N;i++) {
			B[i] = in.nextInt();
			
			for (int y=0;y<H;y++) {
				for (int x=0;x<W;x++) {
					if ( B[i]==A[y][x] ) C[y]++;
				}
			}
		}

		int ans = 0;
		for (int i=0;i<N;i++) {
			if ( C[i]>ans ) ans=C[i];
		}

		System.out.println(ans);

	}

	void C() {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int M = in.nextInt();
		

		System.out.println("");
		
	}


}

Submission Info

Submission Time
Task B - Tombola
User yellowsubmarine
Language Java24 (OpenJDK 24.0.2)
Score 200
Code Size 1042 Byte
Status AC
Exec Time 82 ms
Memory 41216 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 20
Set Name Test Cases
Sample 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt
All 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt
Case Name Status Exec Time Memory
00-sample-01.txt AC 82 ms 40152 KiB
00-sample-02.txt AC 75 ms 40844 KiB
00-sample-03.txt AC 74 ms 40536 KiB
01-01.txt AC 73 ms 40788 KiB
01-02.txt AC 72 ms 40220 KiB
01-03.txt AC 79 ms 40740 KiB
01-04.txt AC 80 ms 40728 KiB
01-05.txt AC 78 ms 40412 KiB
01-06.txt AC 75 ms 40792 KiB
01-07.txt AC 75 ms 40692 KiB
01-08.txt AC 73 ms 40180 KiB
01-09.txt AC 76 ms 40284 KiB
01-10.txt AC 75 ms 40972 KiB
01-11.txt AC 73 ms 40004 KiB
01-12.txt AC 77 ms 40680 KiB
01-13.txt AC 73 ms 40140 KiB
01-14.txt AC 79 ms 41216 KiB
01-15.txt AC 79 ms 41016 KiB
01-16.txt AC 75 ms 40408 KiB
01-17.txt AC 81 ms 40924 KiB