Submission #33664


Source Code Expand

Copy
import java.util.Scanner;
public class Main{
	    Scanner sc = new Scanner(System.in);
		public static void main(String[] args) {
				Main m = new Main();
				m.run();
		}
		public void run(){
				//main
				int[] atari = new int[6];
				int[] taka = new int[6];
				int bonus;
				for (int i = 0; i < 6; i++) {
					    atari[i] = sc.nextInt();
						//System.out.printf("test: %d%n",atari[i]);
				}
				bonus = sc.nextInt();
				//System.out.printf("bonus: %d%n", bonus);
				for (int i = 0; i < 6; i++) {
					    taka[i] = sc.nextInt();
						//System.out.printf("yamaca: %d%n",taka[i]);
				}
				int counter = 0;
				int fitNum = 0;
				boolean bonusFit = false;
				for (int tTarget : taka) {
						boolean thisfit = false;
						for (int j = counter; j < 6; j++) {
								int tmp = atari[j];
								//System.out.println(tmp);
								//System.out.println(tTarget);
								if (tmp == tTarget) {
										fitNum++;
										counter++;
										thisfit = true;
										break;
								}else if (tmp < tTarget) {
										counter++;
										if (j == 5) {
										}
								}else{
										//System.out.println("dame");
										break;
								}
						}
						if (!thisfit && !bonusFit) {
								//System.out.printf("cp :%d %d%n",bonus,tTarget);
								if (bonus == tTarget) {
										bonusFit = true;
								}
						}
				}
				switch(fitNum){
						case 6:
								System.out.println("1");
								break;
						case 5:
								if (bonusFit) {
										System.out.println("2");
								}else{
										System.out.println("3");
								}
								break;
						case 4:
								System.out.println("4");
								break;
						case 3:
								System.out.println("5");
								break;
						default:
								System.out.println("0");
								break;
				}
				//System.out.println(fitNum);



		}
}

Submission Info

Submission Time
Task A - 宝くじ
User tomoasleep
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 1891 Byte
Status AC
Exec Time 503 ms
Memory 20352 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 462 ms 20268 KB
00_1_02.txt AC 459 ms 20336 KB
00_2_01.txt AC 503 ms 20220 KB
00_2_02.txt AC 449 ms 20212 KB
00_3_01.txt AC 436 ms 20344 KB
00_3_02.txt AC 449 ms 20272 KB
00_sample_01.txt AC 439 ms 20332 KB
00_sample_02.txt AC 440 ms 20268 KB
00_sample_03.txt AC 447 ms 20316 KB
00_sample_04.txt AC 448 ms 20276 KB
00_sample_05.txt AC 451 ms 20344 KB
01_rand_00.txt AC 448 ms 20208 KB
01_rand_01.txt AC 454 ms 20216 KB
01_rand_02.txt AC 489 ms 20324 KB
01_rand_03.txt AC 446 ms 20272 KB
01_rand_04.txt AC 435 ms 20212 KB
01_rand_05.txt AC 446 ms 20296 KB
01_rand_06.txt AC 440 ms 20280 KB
01_rand_07.txt AC 448 ms 20272 KB
01_rand_08.txt AC 445 ms 20320 KB
01_rand_09.txt AC 453 ms 20200 KB
01_rand_10.txt AC 457 ms 20336 KB
01_rand_11.txt AC 476 ms 20276 KB
01_rand_12.txt AC 444 ms 20216 KB
01_rand_13.txt AC 456 ms 20272 KB
01_rand_14.txt AC 449 ms 20340 KB
01_rand_15.txt AC 462 ms 20352 KB
01_rand_16.txt AC 446 ms 20276 KB
01_rand_17.txt AC 447 ms 20212 KB
01_rand_18.txt AC 439 ms 20328 KB
01_rand_19.txt AC 450 ms 20212 KB
01_rand_20.txt AC 448 ms 20328 KB
01_rand_21.txt AC 438 ms 20352 KB
01_rand_22.txt AC 448 ms 20212 KB
01_rand_23.txt AC 453 ms 20212 KB
01_rand_24.txt AC 455 ms 20332 KB
01_rand_25.txt AC 461 ms 20208 KB
01_rand_26.txt AC 463 ms 20272 KB
01_rand_27.txt AC 474 ms 20320 KB
01_rand_28.txt AC 445 ms 20340 KB
01_rand_29.txt AC 439 ms 20216 KB
01_rand_30.txt AC 445 ms 20292 KB
01_rand_31.txt AC 447 ms 20212 KB
01_rand_32.txt AC 443 ms 20216 KB
01_rand_33.txt AC 449 ms 20316 KB
01_rand_34.txt AC 444 ms 20328 KB
01_rand_35.txt AC 437 ms 20276 KB
01_rand_36.txt AC 446 ms 20200 KB
01_rand_37.txt AC 443 ms 20340 KB
01_rand_38.txt AC 485 ms 20280 KB
01_rand_39.txt AC 441 ms 20216 KB