結果

問題 No.959 tree and fire
ユーザー Forested
提出日時 2020-05-26 12:30:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 698 bytes
コンパイル時間 805 ms
コンパイル使用メモリ 91,516 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-13 02:37:49
合計ジャッジ時間 2,229 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 52 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
using namespace std;

int main(void) {
    cout << fixed << setprecision(10);
    
    int N, M;
    double P;
    cin >> N >> M >> P;
    if (N > M) swap(N, M);
    if (N == 1) {
        if (M == 1) cout << P << endl;
        else cout << P * P * 2 + P * P * P * (M - 2) << endl;
    } else {
        cout << P * P * P * 4 + P * P * P * P * (2 * N + 2 * M - 8) + P * P * P * P * P * (N - 2) * (M - 2) << endl;
    }
    return 0;
}
0