結果

問題 No.959 tree and fire
ユーザー ngtkanangtkana
提出日時 2020-03-05 23:54:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 294 bytes
コンパイル時間 1,605 ms
コンパイル使用メモリ 165,524 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-14 02:29:39
合計ジャッジ時間 2,722 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
int main(){
    int n,m;std::cin>>n>>m;
    double p;std::cin>>p;
    std::cout<<std::setprecision(10)<<(
        n==1&&m==1?p:
        n==1||m==1
        ?2*p*p+(std::max(n,m)-2)*p*p*p
        :4*p*p*p+(2*n+2*m-8)*p*p*p*p+(n-2)*(m-2)*p*p*p*p*p
        )<<std::endl;
}

0