結果
| 問題 |
No.959 tree and fire
|
| コンテスト | |
| ユーザー |
iqueue02
|
| 提出日時 | 2020-07-29 11:33:29 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 537 bytes |
| コンパイル時間 | 2,309 ms |
| コンパイル使用メモリ | 191,452 KB |
| 最終ジャッジ日時 | 2025-01-12 07:30:58 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
int main() {
int n, m;
cin >> n >> m;
ld p;
cin >> p;
if (n > m) swap(n, m);
ld res = 0;
if (n == 1) {
if (m == 1) res = p;
else res = p * p * 2 + p * p * p * (m - 2);
} else {
res = p * p * p * 4 + p * p * p * p * 2 * (n + m - 4) + p * p * p * p * p * (n - 2) * (m - 2);
}
printf("%.12Lf\n", res);
return 0;
}
iqueue02