結果

問題 No.461 三角形はいくつ?
ユーザー tailstails
提出日時 2016-12-12 02:49:54
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,260 bytes
コンパイル時間 951 ms
コンパイル使用メモリ 22,508 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-29 13:31:59
合計ジャッジ時間 66,587 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 1 ms
5,248 KB
testcase_03 AC 0 ms
5,248 KB
testcase_04 AC 1 ms
5,248 KB
testcase_05 AC 3,263 ms
5,248 KB
testcase_06 AC 1,377 ms
5,248 KB
testcase_07 AC 1,651 ms
5,248 KB
testcase_08 AC 912 ms
5,248 KB
testcase_09 AC 1 ms
5,248 KB
testcase_10 AC 152 ms
5,248 KB
testcase_11 AC 2,139 ms
5,248 KB
testcase_12 AC 589 ms
5,248 KB
testcase_13 AC 4,083 ms
5,248 KB
testcase_14 AC 3,936 ms
5,248 KB
testcase_15 AC 4,165 ms
5,248 KB
testcase_16 AC 10 ms
5,248 KB
testcase_17 AC 10 ms
5,248 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 4,128 ms
5,248 KB
testcase_21 AC 4,078 ms
5,248 KB
testcase_22 AC 3,964 ms
5,248 KB
testcase_23 AC 376 ms
5,248 KB
testcase_24 AC 308 ms
5,248 KB
testcase_25 AC 17 ms
5,248 KB
testcase_26 AC 17 ms
5,248 KB
testcase_27 AC 5 ms
5,248 KB
testcase_28 AC 6 ms
5,248 KB
testcase_29 AC 1,510 ms
5,248 KB
testcase_30 AC 739 ms
5,248 KB
testcase_31 AC 2,679 ms
5,248 KB
testcase_32 AC 3,404 ms
5,248 KB
testcase_33 AC 2 ms
5,248 KB
testcase_34 AC 1 ms
5,248 KB
testcase_35 AC 2 ms
5,248 KB
testcase_36 AC 892 ms
5,248 KB
testcase_37 AC 779 ms
5,248 KB
testcase_38 AC 823 ms
5,248 KB
testcase_39 AC 652 ms
5,248 KB
testcase_40 AC 813 ms
5,248 KB
testcase_41 AC 810 ms
5,248 KB
testcase_42 AC 2,335 ms
5,248 KB
testcase_43 AC 2,513 ms
5,248 KB
testcase_44 AC 2,190 ms
5,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | n;c[3];
      | ^
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;c[3];
      |   ^
main.c:1:3: warning: type defaults to ‘int’ in declaration of ‘c’ [-Wimplicit-int]
main.c:2:1: warning: data definition has no type or storage class
    2 | da[3][5000],dd[3][5000];
      | ^~
main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘da’ [-Wimplicit-int]
main.c:2:13: warning: type defaults to ‘int’ in declaration of ‘dd’ [-Wimplicit-int]
    2 | da[3][5000],dd[3][5000];
      |             ^~
main.c:3:1: warning: data definition has no type or storage class
    3 | a,b;i;j;k;p;
      | ^
main.c:3:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
main.c:3:3: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int]
    3 | a,b;i;j;k;p;
      |   ^
main.c:3:5: warning: data definition has no type or storage class
    3 | a,b;i;j;k;p;
      |     ^
main.c:3:5: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
main.c:3:7: warning: data definition has no type or storage class
    3 | a,b;i;j;k;p;
      |       ^
main.c:3:7: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
main.c:3:9: warning: data definition has no type or storage class
    3 | a,b;i;j;k;p;
      |         ^
main.c:3:9: warning: type defaults to ‘int’ in declaration of ‘k’ [-Wimplicit-int]
main.c:3:11: warning: data definition has no type or storage class
    3 | a,b;i;j;k;p;
      |           ^
main.c:3:11: warning: type defaults to ‘int’ in declaration of ‘p’ [-Wimplicit-int]
main.c:6:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    6 | main(){
      | ^~~~
main.c: In function ‘main’:
main.c:7:9: warning: implicit declaration of function 

ソースコード

diff #

n;c[3];
da[3][5000],dd[3][5000];
a,b;i;j;k;p;
long long r;

main(){
	scanf("%d",&n);
	r=n+1;
	for(i=0;i<n;++i){
		scanf("%d%d%d",&p,&a,&b);
		da[p][c[p]]=a;
		dd[p][c[p]]=a+b;
		++c[p];
	}
	for(i=0;i<c[0];++i){
		for(j=0;j<c[1];++j){
			if((long long)da[0][i]*dd[1][j]+(long long)dd[0][i]*da[1][j]>(long long)dd[0][i]*dd[1][j]){
				++r;
			}
		}
	}
	for(i=0;i<c[0];++i){
		for(j=0;j<c[2];++j){
			if((long long)da[0][i]*dd[2][j]+(long long)dd[0][i]*da[2][j]>(long long)dd[0][i]*dd[2][j]){
				++r;
			}
		}
	}
	for(i=0;i<c[1];++i){
		for(j=0;j<c[2];++j){
			if((long long)da[1][i]*dd[2][j]+(long long)dd[1][i]*da[2][j]>(long long)dd[1][i]*dd[2][j]){
				++r;
			}
		}
	}
	for(i=0;i<c[0];++i){
		long long da0=da[0][i];
		long long dd0=dd[0][i];
		for(j=0;j<c[1];++j){
			long long da1=da[1][j];
			long long dd1=dd[1][j];
			if(da0*dd1+dd0*da1>=dd0*dd1){
				long long dam,ddm;
				if(da0*dd1<dd0*da1){
					dam=da0;
					ddm=dd0;
				}else{
					dam=da1;
					ddm=dd1;
				}
				long long das=da0*dd1+dd0*da1;
				long long dds=dd0*dd1;
				das-=2*dds;
				for(k=0;k<c[2];++k){
					long long da2=da[2][k];
					long long dd2=dd[2][k];
					if(dam*dd2+da2*ddm>=ddm*dd2 && das*dd2+da2*dds!=0){
						++r;
					}
				}
			}
		}
	}
	printf("%d",r);
	return 0;
}
0