結果

問題 No.461 三角形はいくつ?
ユーザー tailstails
提出日時 2016-12-12 01:48:32
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 774 bytes
コンパイル時間 505 ms
コンパイル使用メモリ 23,296 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-07 00:48:26
合計ジャッジ時間 55,123 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 0 ms
5,376 KB
testcase_02 AC 0 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 3,012 ms
5,376 KB
testcase_06 AC 1,298 ms
5,376 KB
testcase_07 AC 1,546 ms
5,376 KB
testcase_08 AC 850 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 136 ms
5,376 KB
testcase_11 AC 1,992 ms
5,376 KB
testcase_12 AC 515 ms
5,376 KB
testcase_13 AC 3,809 ms
5,376 KB
testcase_14 AC 3,595 ms
5,376 KB
testcase_15 AC 3,814 ms
5,376 KB
testcase_16 AC 11 ms
5,376 KB
testcase_17 AC 11 ms
5,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 3,780 ms
5,376 KB
testcase_21 AC 3,705 ms
5,376 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 17 ms
5,376 KB
testcase_26 AC 17 ms
5,376 KB
testcase_27 AC 5 ms
5,376 KB
testcase_28 AC 5 ms
5,376 KB
testcase_29 AC 923 ms
5,376 KB
testcase_30 AC 460 ms
5,376 KB
testcase_31 AC 1,636 ms
5,376 KB
testcase_32 AC 2,065 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 AC 2 ms
5,376 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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:3:1: warning: data definition has no type or storage class
    3 | i;j;k;p;
      | ^
main.c:3:1: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
main.c:3:3: warning: data definition has no type or storage class
    3 | i;j;k;p;
      |   ^
main.c:3:3: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
main.c:3:5: warning: data definition has no type or storage class
    3 | i;j;k;p;
      |     ^
main.c:3:5: warning: type defaults to ‘int’ in declaration of ‘k’ [-Wimplicit-int]
main.c:3:7: warning: data definition has no type or storage class
    3 | i;j;k;p;
      |       ^
main.c:3:7: warning: type defaults to ‘int’ in declaration of ‘p’ [-Wimplicit-int]
main.c:4:1: warning: data definition has no type or storage class
    4 | r;
      | ^
main.c:4:1: warning: type defaults to ‘int’ in declaration of ‘r’ [-Wimplicit-int]
main.c:7:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    7 | main(){
      | ^~~~
main.c: In function ‘main’:
main.c:8:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    8 |         scanf("%d",&n);
      |         ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | n;c[3];
main.c:8:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    8 |         scanf("%d",&n);
      |         ^~~~~
main.c:8:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:44:61: warning: implicit decla

ソースコード

diff #

n;c[3];
double d[3][5000],a,b;
i;j;k;p;
r;
double e=1e-17;

main(){
	scanf("%d",&n);
	r=n+1;
	for(i=0;i<n;++i){
		scanf("%d%lf%lf",&p,&a,&b);
		d[p][c[p]++]=a/(a+b);
	}
	for(i=0;i<c[0];++i){
		for(j=0;j<c[1];++j){
			if(d[0][i]+d[1][j]>1+e){
				++r;
			}
		}
	}
	for(i=0;i<c[0];++i){
		for(j=0;j<c[2];++j){
			if(d[0][i]+d[2][j]>1+e){
				++r;
			}
		}
	}
	for(i=0;i<c[1];++i){
		for(j=0;j<c[2];++j){
			if(d[1][i]+d[2][j]>1+e){
				++r;
			}
		}
	}
	for(i=0;i<c[0];++i){
		double d0=d[0][i];
		for(j=0;j<c[1];++j){
			double d1=d[1][j];
			if(d0+d1>1-e){
				double d01min = d0<d1?d0:d1;
				double d022 = d0+d1-2;
				for(k=0;k<c[2];++k){
					double d2=d[2][k];
					if(d01min+d2>1-e && fabs(d022+d2)>e){
						++r;
					}
				}
			}
		}
	}
	printf("%d",r);
	return 0;
}
0