結果
問題 |
No.959 tree and fire
|
ユーザー |
![]() |
提出日時 | 2020-01-24 16:30:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 378 bytes |
コンパイル時間 | 1,599 ms |
コンパイル使用メモリ | 167,240 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 03:43:26 |
合計ジャッジ時間 | 3,121 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 52 WA * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ long N,M; cin>>N>>M; cout <<fixed<< setprecision(10) ; double p; cin>>p; if(N==1&&M==1)cout<<p<<endl; else if(N==1&&M!=1)cout<<(M-1)*pow(p,3)+2*p*p<<endl; else if(M==1&&N!=1)cout<<(N-1)*pow(p,3)+2*p*p<<endl; else cout<<(M-2)*(N-2)*pow(p,5)+4*p*p*p+2*(N+M-4)*pow(p,4)<<endl; }