結果

問題 No.647 明太子
ユーザー ほっしいーほっしいー
提出日時 2018-02-10 16:24:26
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 695 bytes
コンパイル時間 3,350 ms
コンパイル使用メモリ 74,288 KB
実行使用メモリ 60,784 KB
最終ジャッジ日時 2023-08-27 02:21:10
合計ジャッジ時間 10,387 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,628 KB
testcase_01 AC 127 ms
55,712 KB
testcase_02 WA -
testcase_03 AC 126 ms
55,644 KB
testcase_04 AC 131 ms
55,600 KB
testcase_05 AC 131 ms
55,884 KB
testcase_06 AC 130 ms
55,700 KB
testcase_07 AC 144 ms
55,444 KB
testcase_08 AC 143 ms
55,760 KB
testcase_09 AC 202 ms
58,368 KB
testcase_10 AC 206 ms
58,680 KB
testcase_11 AC 185 ms
56,544 KB
testcase_12 AC 208 ms
58,836 KB
testcase_13 AC 221 ms
59,232 KB
testcase_14 AC 425 ms
60,520 KB
testcase_15 AC 241 ms
59,592 KB
testcase_16 AC 206 ms
59,236 KB
testcase_17 AC 431 ms
60,480 KB
testcase_18 AC 433 ms
60,232 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 450 ms
60,692 KB
testcase_23 AC 183 ms
55,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class 明太子 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[][] x=new int[n][2];
		for(int i=0;i<n;i++) {
			x[i][0]=sc.nextInt();
			x[i][1]=sc.nextInt();
		}
		int m= sc.nextInt();
		int[][] y=new int[m][2];
		for(int i=0;i<m;i++) {
			y[i][0]=sc.nextInt();
			y[i][1]=sc.nextInt();
		}
		
		int[] z=new int[m];
		for(int i=0;i<m;i++) {
			z[i]=0;
			for(int j=0;j<n;j++) 
				if((x[j][0]>=y[i][0])&&(x[j][1]<=y[i][1]))
					z[i]++;
		}
		int max=0;
		for(int i=0;i<m;i++) {
			if(max<z[i])
				max=z[i];
		}
		for(int i=0;i<m;i++) {
			if(max==z[i])
				System.out.println(i+1);
		}
	}

}
0