結果
| 問題 | No.959 tree and fire |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-08 02:15:41 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 479µs | |
| コード長 | 451 bytes |
| 記録 | |
| コンパイル時間 | 1,758 ms |
| コンパイル使用メモリ | 172,656 KB |
| 実行使用メモリ | 9,912 KB |
| 最終ジャッジ日時 | 2026-10-08 02:15:45 |
| 合計ジャッジ時間 | 3,394 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main(void){
ll n, m; double p; cin >> n >> m >> p;
if(n>m) swap(n, m);
double p2=p*p, p3=p2*p, p4=p2*p2, p5=p4*p;
if(n==1){
if(m==1){printf("%.10f\n", p); return 0;}
int c1=2, c2=m-2;
printf("%.10f\n", p2*c1+p3*c2);
return 0;
}
ll c2=4, c3=2*(n+m-4), c4=n*m-c2-c3;
printf("%.10f\n", p3*c2+p4*c3+p5*c4);
return 0;
}