結果
| 問題 |
No.959 tree and fire
|
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2020-01-18 12:01:59 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 477 bytes |
| コンパイル時間 | 2,564 ms |
| コンパイル使用メモリ | 191,664 KB |
| 最終ジャッジ日時 | 2025-01-08 20:00:00 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 27 WA * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll h, w;
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;
}
Konton7