結果
問題 | No.3031 (物理学)長距離相互作用 |
ユーザー | 夕叢霧香(ゆうむらきりか) |
提出日時 | 2018-02-28 22:49:01 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,678 bytes |
コンパイル時間 | 817 ms |
コンパイル使用メモリ | 69,120 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-07 15:08:29 |
合計ジャッジ時間 | 1,399 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | WA | - |
testcase_07 | AC | 2 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 2 ms
5,376 KB |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:71:25: warning: 'coef[1]' is used uninitialized [-Wuninitialized] 71 | else if(i==7)coef[1]+=c; | ~~~~~~~^~~ main.cpp:67:10: note: 'coef[1]' was declared here 67 | double coef[5]; | ^~~~ main.cpp:77:12: warning: 'coef[4]' is used uninitialized [-Wuninitialized] 77 | coef[4]+=c; | ~~~~~~~^~~ main.cpp:67:10: note: 'coef[4]' was declared here 67 | double coef[5]; | ^~~~ main.cpp:81:15: warning: 'coef[3]' may be used uninitialized [-Wmaybe-uninitialized] 81 | ans-=coef[3]*gh; | ~~~~~~~^~~ main.cpp:67:10: note: 'coef[3]' was declared here 67 | double coef[5]; | ^~~~
ソースコード
#include<algorithm> #include<iostream> #include<vector> using namespace std; typedef long long lint; typedef vector<int>vi; typedef pair<int,int>pii; #define rep(i,n)for(int i=0;i<(int)(n);++i) const double ans1=-1.1638780202724224; const double ans2=-1.3555525130426718; const double ans4=-1.995873239222159; const int DEBUG=0; #if 0 int main(){ double coef[5]; rep(i,8) { double c;cin>>c; if(i==0)coef[0]+=c; else if(i==7)coef[1]+=c; else if(i==1||i==2||i==4)coef[2]+=c; else coef[3]+=c; } rep(i,8){ double c;cin>>c; coef[4]+=c; } if(DEBUG){ cerr<<"coef:"; rep(i,5)cerr<<" "<<coef[i]; cerr<<endl; } double ef=ans2/2*3; double gh=ans2/2-ans1; printf("E-F=%.15f\n",ef); printf("G-H=%.15f\n",gh); double ans;cin>>ans; if(DEBUG){ cerr<<coef[0]<<"E+"<<coef[1]<<"F+"<<coef[2]<<"G+"<<coef[3]<<"H+"<< coef[4]<<"I="<<ans<<endl; } double tmp=ans; { tmp+=coef[1]*ef; coef[0]+=coef[1]; coef[1]=0; } { tmp+=coef[3]*gh; coef[2]+=coef[3]; coef[3]=0; } if(DEBUG){ cerr<<coef[0]<<"E+"<<coef[1]<<"F+"<<coef[2]<<"G+"<<coef[3]<<"H+"<< coef[4]<<"I="<<tmp<<endl; } double egi=tmp/coef[0]; printf("E+3G-4I=%.15f\n",egi); } #else double ef=-2.033328769564008; double gh=0.486101763751086; double egi=-2.323933631643025; int main(){ double coef[5]; rep(i,8) { double c;cin>>c; if(i==0)coef[0]+=c; else if(i==7)coef[1]+=c; else if(i==1||i==2||i==4)coef[2]+=c; else coef[3]+=c; } rep(i,8){ double c;cin>>c; coef[4]+=c; } double ans=0; ans-=coef[1]*ef; ans-=coef[3]*gh; ans+=-coef[4]/4*egi; printf("%.15f\n",ans); } #endif