結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,588 KB
testcase_01 AC 118 ms
55,764 KB
testcase_02 WA -
testcase_03 AC 118 ms
56,040 KB
testcase_04 AC 121 ms
56,064 KB
testcase_05 AC 122 ms
55,960 KB
testcase_06 AC 120 ms
55,912 KB
testcase_07 AC 133 ms
55,968 KB
testcase_08 AC 130 ms
56,024 KB
testcase_09 AC 188 ms
58,680 KB
testcase_10 AC 197 ms
58,676 KB
testcase_11 AC 198 ms
56,348 KB
testcase_12 AC 198 ms
58,828 KB
testcase_13 AC 208 ms
58,916 KB
testcase_14 AC 378 ms
60,448 KB
testcase_15 AC 229 ms
59,544 KB
testcase_16 AC 195 ms
58,828 KB
testcase_17 AC 399 ms
60,412 KB
testcase_18 AC 436 ms
60,552 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 438 ms
60,468 KB
testcase_23 AC 175 ms
56,668 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