結果
問題 | No.461 三角形はいくつ? |
ユーザー | tails |
提出日時 | 2016-12-12 02:24:39 |
言語 | C90 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,146 bytes |
コンパイル時間 | 718 ms |
コンパイル使用メモリ | 22,144 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-29 12:51:52 |
合計ジャッジ時間 | 62,560 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
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 | 1 ms
5,248 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
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 | 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: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;r; | ^ 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;r; | ^ main.c:3:5: warning: data definition has no type or storage class 3 | a,b;i;j;k;p;r; | ^ 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;r; | ^ 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;r; | ^ 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;r; | ^ main.c:3:11: warning: type defaults to ‘int’ in declaration of ‘p’ [-Wimplicit-int] main.c:3:13: warning: data definition has no type or storage class 3 | a,b;i;j;k;p;r; | ^ main.c:3:13: warning: type defaults to ‘int’ in declaration
ソースコード
n;c[3]; da[3][5000],dd[3][5000]; a,b;i;j;k;p;r; main(){ scanf("%d",&n); r=n+1; for(i=0;i<n;++i){ scanf("%d%d%d",&p,&a,&b); //d[p][c[p]]=(double)a/(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(da[0][i]*dd[1][j]+dd[0][i]*da[1][j]>dd[0][i]*dd[1][j]){ ++r; } } } for(i=0;i<c[0];++i){ for(j=0;j<c[2];++j){ if(da[0][i]*dd[2][j]+dd[0][i]*da[2][j]>dd[0][i]*dd[2][j]){ ++r; } } } for(i=0;i<c[1];++i){ for(j=0;j<c[2];++j){ if(da[1][i]*dd[2][j]+dd[1][i]*da[2][j]>dd[1][i]*dd[2][j]){ ++r; } } } for(i=0;i<c[0];++i){ int da0=da[0][i]; int dd0=dd[0][i]; for(j=0;j<c[1];++j){ int da1=da[1][j]; int 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){ int da2=da[2][k]; int dd2=dd[2][k]; if(dam*dd2+da2*ddm>=ddm*dd2 && das*dd2+da2*dds!=0){ ++r; } } } } } printf("%d",r); return 0; }