結果
問題 | No.132 点と平面との距離 |
ユーザー | testestest |
提出日時 | 2015-12-02 21:45:50 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 370 bytes |
コンパイル時間 | 844 ms |
コンパイル使用メモリ | 22,016 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 08:03:08 |
合計ジャッジ時間 | 1,338 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | AC | 9 ms
6,944 KB |
testcase_02 | AC | 30 ms
6,944 KB |
コンパイルメッセージ
main.c:1:37: warning: data definition has no type or storage class 1 | double x[301],y[301],z[301],p,q,r,s;n,i,j;main(k){for(gets(&k);~scanf("%lf%lf%lf",x+n,y+n,z+n);n++);for(;++i<n;)for(j=i;++j<n;)for(k=j;++k<n;s+=fabs(p*(*x-x[i])+q*(*y-y[i])+r*(*z-z[i]))/sqrt(p*p+q*q+r*r))p=(y[j]-y[i])*(z[k]-z[i])-(z[j]-z[i])*(y[k]-y[i]),q=(z[j]-z[i])*(x[k]-x[i])-(x[j]-x[i])*(z[k]-z[i]),r=(x[j]-x[i])*(y[k]-y[i])-(y[j]-y[i])*(x[k]-x[i]);printf("%f",s);} | ^ main.c:1:37: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] main.c:1:39: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] 1 | double x[301],y[301],z[301],p,q,r,s;n,i,j;main(k){for(gets(&k);~scanf("%lf%lf%lf",x+n,y+n,z+n);n++);for(;++i<n;)for(j=i;++j<n;)for(k=j;++k<n;s+=fabs(p*(*x-x[i])+q*(*y-y[i])+r*(*z-z[i]))/sqrt(p*p+q*q+r*r))p=(y[j]-y[i])*(z[k]-z[i])-(z[j]-z[i])*(y[k]-y[i]),q=(z[j]-z[i])*(x[k]-x[i])-(x[j]-x[i])*(z[k]-z[i]),r=(x[j]-x[i])*(y[k]-y[i])-(y[j]-y[i])*(x[k]-x[i]);printf("%f",s);} | ^ main.c:1:41: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int] 1 | double x[301],y[301],z[301],p,q,r,s;n,i,j;main(k){for(gets(&k);~scanf("%lf%lf%lf",x+n,y+n,z+n);n++);for(;++i<n;)for(j=i;++j<n;)for(k=j;++k<n;s+=fabs(p*(*x-x[i])+q*(*y-y[i])+r*(*z-z[i]))/sqrt(p*p+q*q+r*r))p=(y[j]-y[i])*(z[k]-z[i])-(z[j]-z[i])*(y[k]-y[i]),q=(z[j]-z[i])*(x[k]-x[i])-(x[j]-x[i])*(z[k]-z[i]),r=(x[j]-x[i])*(y[k]-y[i])-(y[j]-y[i])*(x[k]-x[i]);printf("%f",s);} | ^ main.c:1:43: warning: return type defaults to ‘int’ [-Wimplicit-int] 1 | double x[301],y[301],z[301],p,q,r,s;n,i,j;main(k){for(gets(&k);~scanf("%lf%lf%lf",x+n,y+n,z+n);n++);for(;++i<n;)for(j=i;++j<n;)for(k=j;++k<n;s+=fabs(p*(*x-x[i])+q*(*y-y[i])+r*(*z-z[i]))/sqrt(p*p+q*q+r*r))p=(y[j]-y[i])*(z[k]-z[i])-(z[j]-z[i])*(y[k]-y[i]),q=(z[j]-z[i])*(x[k]-x[i])-(x[j]-x[i])*(z[
ソースコード
double x[301],y[301],z[301],p,q,r,s;n,i,j;main(k){for(gets(&k);~scanf("%lf%lf%lf",x+n,y+n,z+n);n++);for(;++i<n;)for(j=i;++j<n;)for(k=j;++k<n;s+=fabs(p*(*x-x[i])+q*(*y-y[i])+r*(*z-z[i]))/sqrt(p*p+q*q+r*r))p=(y[j]-y[i])*(z[k]-z[i])-(z[j]-z[i])*(y[k]-y[i]),q=(z[j]-z[i])*(x[k]-x[i])-(x[j]-x[i])*(z[k]-z[i]),r=(x[j]-x[i])*(y[k]-y[i])-(y[j]-y[i])*(x[k]-x[i]);printf("%f",s);}