結果

問題 No.959 tree and fire
ユーザー Konton7
提出日時 2020-01-18 12:00:54
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 2,758 ms
コンパイル使用メモリ 191,532 KB
最終ジャッジ日時 2025-01-08 19:59:12
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 18 WA * 36
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;


int main()
{


    int h, w;
    ll s;
    double p;
    cin >> h >> w;
    cin >> p;
    
    if (h == 1 && w == 1)
        p = p;
    else if (h == 1)
        p = 2 * pow(p, 2) + pow(p, 3) * (w - 2);
    else if (w == 1)
        p = 2 * pow(p, 2) + pow(p, 3) * (h - 2);
    else
        p = 4 * pow(p, 3) + pow(p, 3) * (2*(h + w - 4)) + pow(p, 5) * ( (h-2) * (w-2) );
    printf("%.8f\n" , p);
    

    return 0;
}
0