結果

問題 No.647 明太子
ユーザー Mcpu3Mcpu3
提出日時 2018-06-21 23:07:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 552 ms / 4,500 ms
コード長 623 bytes
コンパイル時間 2,087 ms
コンパイル使用メモリ 74,132 KB
実行使用メモリ 64,336 KB
最終ジャッジ日時 2023-09-13 07:42:41
合計ジャッジ時間 9,083 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,880 KB
testcase_01 AC 128 ms
56,196 KB
testcase_02 AC 125 ms
55,760 KB
testcase_03 AC 127 ms
53,620 KB
testcase_04 AC 132 ms
55,908 KB
testcase_05 AC 128 ms
56,072 KB
testcase_06 AC 131 ms
56,132 KB
testcase_07 AC 144 ms
55,800 KB
testcase_08 AC 147 ms
55,884 KB
testcase_09 AC 203 ms
58,356 KB
testcase_10 AC 207 ms
56,304 KB
testcase_11 AC 202 ms
56,904 KB
testcase_12 AC 199 ms
58,832 KB
testcase_13 AC 217 ms
59,048 KB
testcase_14 AC 425 ms
60,824 KB
testcase_15 AC 240 ms
59,448 KB
testcase_16 AC 209 ms
58,440 KB
testcase_17 AC 465 ms
63,160 KB
testcase_18 AC 472 ms
64,336 KB
testcase_19 AC 329 ms
59,820 KB
testcase_20 AC 315 ms
60,096 KB
testcase_21 AC 255 ms
59,420 KB
testcase_22 AC 552 ms
63,660 KB
testcase_23 AC 191 ms
55,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no647{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int n,m,a[]=new int[10000],b[]=new int[10000],c[]=new int[1000],x,y,i,j,max=1;
		n=stdIn.nextInt();
		for(i=0;i<n;i++) {
			a[i]=stdIn.nextInt();
			b[i]=stdIn.nextInt();
		}
		m=stdIn.nextInt();
		for(i=0;i<m;i++) {
			x=stdIn.nextInt();
			y=stdIn.nextInt();
			for(j=0;j<n;j++) if(a[j]>=x&&b[j]<=y) c[i]++;
			if(max<c[i]) max=c[i];
		}
		j=0;
		for(i=0;i<m;i++) {
			if(c[i]==max) {
				System.out.println(i+1);
				j++;
			}
		}
		if(j==0) System.out.print("0");
	}
}
0