Submission #33445


Source Code Expand

Copy
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner s = new Scanner(System.in);
		boolean[] e = new boolean[10];
		int b;
		boolean[] l = new boolean[10];
		String[] str;
		str = s.nextLine().split(" ");
		for(String tok : str) e[Integer.parseInt(tok)] = true;
		b = Integer.parseInt(s.nextLine());
		str = s.nextLine().split(" ");
		for(String tok : str) l[Integer.parseInt(tok)] = true;
		System.out.println(judge(e, b, l));
	}
	private static int judge(boolean[] e, int b, boolean[] l)
	{
		int ct = 0;
		boolean bonus = false;
		for(int i=0;i<10;i++)
		{
			if(e[i] && l[i]) ct++;
			else if(l[b]) bonus = true;
		}
		if(ct==6) return 1;
		else if(ct==5 && bonus) return 2;
		else if(ct==5) return 3;
		else if(ct==4) return 4;
		else if(ct==3) return 5;
		else return 0;
	}
}

Submission Info

Submission Time
Task A - 宝くじ
User flour4445
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 862 Byte
Status AC
Exec Time 670 ms
Memory 20788 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 51
Set Name Test Cases
All 00_1_01.txt, 00_1_02.txt, 00_2_01.txt, 00_2_02.txt, 00_3_01.txt, 00_3_02.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rand_00.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 01_rand_11.txt, 01_rand_12.txt, 01_rand_13.txt, 01_rand_14.txt, 01_rand_15.txt, 01_rand_16.txt, 01_rand_17.txt, 01_rand_18.txt, 01_rand_19.txt, 01_rand_20.txt, 01_rand_21.txt, 01_rand_22.txt, 01_rand_23.txt, 01_rand_24.txt, 01_rand_25.txt, 01_rand_26.txt, 01_rand_27.txt, 01_rand_28.txt, 01_rand_29.txt, 01_rand_30.txt, 01_rand_31.txt, 01_rand_32.txt, 01_rand_33.txt, 01_rand_34.txt, 01_rand_35.txt, 01_rand_36.txt, 01_rand_37.txt, 01_rand_38.txt, 01_rand_39.txt
Case Name Status Exec Time Memory
00_1_01.txt AC 418 ms 20788 KB
00_1_02.txt AC 409 ms 20588 KB
00_2_01.txt AC 412 ms 20452 KB
00_2_02.txt AC 643 ms 20532 KB
00_3_01.txt AC 412 ms 20588 KB
00_3_02.txt AC 406 ms 20588 KB
00_sample_01.txt AC 407 ms 20396 KB
00_sample_02.txt AC 407 ms 20528 KB
00_sample_03.txt AC 401 ms 20480 KB
00_sample_04.txt AC 404 ms 20524 KB
00_sample_05.txt AC 401 ms 20404 KB
01_rand_00.txt AC 402 ms 20528 KB
01_rand_01.txt AC 411 ms 20472 KB
01_rand_02.txt AC 416 ms 20452 KB
01_rand_03.txt AC 416 ms 20528 KB
01_rand_04.txt AC 424 ms 20468 KB
01_rand_05.txt AC 414 ms 20532 KB
01_rand_06.txt AC 404 ms 20452 KB
01_rand_07.txt AC 417 ms 20468 KB
01_rand_08.txt AC 423 ms 20552 KB
01_rand_09.txt AC 413 ms 20464 KB
01_rand_10.txt AC 417 ms 20476 KB
01_rand_11.txt AC 408 ms 20532 KB
01_rand_12.txt AC 399 ms 20472 KB
01_rand_13.txt AC 415 ms 20484 KB
01_rand_14.txt AC 413 ms 20472 KB
01_rand_15.txt AC 402 ms 20544 KB
01_rand_16.txt AC 409 ms 20464 KB
01_rand_17.txt AC 414 ms 20404 KB
01_rand_18.txt AC 406 ms 20476 KB
01_rand_19.txt AC 411 ms 20464 KB
01_rand_20.txt AC 404 ms 20460 KB
01_rand_21.txt AC 406 ms 20472 KB
01_rand_22.txt AC 411 ms 20472 KB
01_rand_23.txt AC 407 ms 20464 KB
01_rand_24.txt AC 408 ms 20476 KB
01_rand_25.txt AC 419 ms 20468 KB
01_rand_26.txt AC 409 ms 20580 KB
01_rand_27.txt AC 422 ms 20464 KB
01_rand_28.txt AC 415 ms 20580 KB
01_rand_29.txt AC 450 ms 20504 KB
01_rand_30.txt AC 404 ms 20472 KB
01_rand_31.txt AC 411 ms 20468 KB
01_rand_32.txt AC 670 ms 20476 KB
01_rand_33.txt AC 411 ms 20472 KB
01_rand_34.txt AC 411 ms 20464 KB
01_rand_35.txt AC 415 ms 20448 KB
01_rand_36.txt AC 433 ms 20524 KB
01_rand_37.txt AC 427 ms 20468 KB
01_rand_38.txt AC 461 ms 20456 KB
01_rand_39.txt AC 407 ms 20472 KB