結果

問題 No.647 明太子
ユーザー じゃがりこじゃがりこ
提出日時 2018-09-07 17:33:30
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 559 bytes
コンパイル時間 1,064 ms
コンパイル使用メモリ 28,948 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-18 18:21:12
合計ジャッジ時間 3,774 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 0 ms
4,380 KB
testcase_04 AC 0 ms
4,380 KB
testcase_05 AC 0 ms
4,380 KB
testcase_06 AC 0 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 0 ms
4,380 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 WA -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(){
 int N, M, A[1001], B[1001], X[101], Y[101];
 int i, j, T[101] = { 0 }, max = 0;

 scanf("%d", &N);
 for (i = 0; i < N; i++) {
	scanf("%d%d", &A[i], &B[i]);
 }
 scanf("%d", &M);
 for (i = 0; i < M; i++) {
	scanf("%d%d", &X[i], &Y[i]);
 }

for (i = 0; i < N; i++) {
	for (j = 0; j < M; j++) {
		if (A[i] >= X[j] && B[i] <= Y[j]) {
			T[j]++;
		}
	}
}

for (j = 0; j < M; j++) {
	if (max < T[j]) {
		max = T[j];
	}
}

for (j = 0; j < M; j++) {
	if (max == T[j]) {
		printf("%d\n", j+1);
	}
	if (max == 0) {
		printf("0");
	}
}

}
0