結果

問題 No.647 明太子
ユーザー tailstails
提出日時 2018-02-09 22:39:59
言語 C
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 363 bytes
コンパイル時間 799 ms
コンパイル使用メモリ 28,160 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-07 21:53:02
合計ジャッジ時間 3,284 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 3 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 3 ms
5,376 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 2 ms
5,376 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | n;m;
      | ^
main.c:1:1: warning: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: warning: data definition has no type or storage class
    1 | n;m;
      |   ^
main.c:1:3: warning: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:2:1: warning: data definition has no type or storage class
    2 | a[1111];
      | ^
main.c:2:1: warning: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:3:1: warning: data definition has no type or storage class
    3 | b[1111];
      | ^
main.c:3:1: warning: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
main.c:4:1: warning: data definition has no type or storage class
    4 | c[11111];
      | ^
main.c:4:1: warning: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
main.c:5:1: warning: data definition has no type or storage class
    5 | d;
      | ^
main.c:5:1: warning: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
main.c:6:1: warning: data definition has no type or storage class
    6 | x;y;
      | ^
main.c:6:1: warning: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
main.c:6:3: warning: data definition has no type or storage class
    6 | x;y;
      |   ^
main.c:6:3: warning: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
main.c:8:1: warning: return type defaults to 'int' [-Wimplicit-int]
    8 | main(i,j){
      | ^~~~
main.c: In function 'main':
main.c:8:1: warning: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:8:1: warning: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:10:1: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   10 | scanf("%d",&n);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | n;m;
main.c:10:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-

ソースコード

diff #

n;m;
a[1111];
b[1111];
c[11111];
d;
x;y;

main(i,j){

scanf("%d",&n);
for(i=1;i<=n;++i){
	scanf("%d%d",&a[i],&b[i]);
}
scanf("%d",&m);
for(j=1;j<=m;++j){
	scanf("%d%d",&x,&y);
	for(i=1;i<=n;++i){
		if(x<=a[i]&&y>=b[i]){
			++c[j];
		}
	}
	if(d<c[j]){
		d=c[j];
	}
}
if(d==0){
	puts("0");
}else{
	for(j=1;j<=m;++j){
		if(c[j]==d){
			printf("%d\n",j);
		}
	}
}

}
0