結果
| 問題 |
No.959 tree and fire
|
| コンテスト | |
| ユーザー |
mighty-isuka
|
| 提出日時 | 2020-01-24 16:26:57 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 378 bytes |
| コンパイル時間 | 1,719 ms |
| コンパイル使用メモリ | 166,368 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-14 03:43:22 |
| 合計ジャッジ時間 | 3,304 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 37 WA * 17 |
ソースコード
#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-1)*(N-1)*pow(p,5)+4*p*p*p+2*(N+M-2)*pow(p,4)<<endl;
}
mighty-isuka