結果

問題 No.959 tree and fire
ユーザー tko919tko919
提出日時 2019-12-22 09:35:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 820 bytes
コンパイル時間 1,541 ms
コンパイル使用メモリ 166,676 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-13 22:27:47
合計ジャッジ時間 3,096 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 8 WA * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
string to_str(ll x){string res; while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return res;}
template<class T> inline bool chmax(T& a,T b){ if(a<b){a=b;return 1;}return 0; }
template<class T> inline bool chmin(T& a,T b){ if(a>b){a=b;return 1;}return 0; }
//template end



int main(){
    int h,w; scanf("%d%d",&h,&w);
    double p; scanf("%Lf",&p);
    double ans=0;
    ans+=(h-2)*(w-2)*pow(p,5);
    ans+=2*(h-2+w-2)*pow(p,4);
    ans+=4*pow(p,3);
    printf("%.12f\n",ans);
    return 0;
}
0