結果
| 問題 |
No.959 tree and fire
|
| コンテスト | |
| ユーザー |
tktk_snsn
|
| 提出日時 | 2021-03-01 18:41:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 447 bytes |
| コンパイル時間 | 502 ms |
| コンパイル使用メモリ | 63,484 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-03 00:55:59 |
| 合計ジャッジ時間 | 2,194 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 29 WA * 25 |
ソースコード
#include<iostream>
using namespace std;
int main(){
double n,m;
cin>>n>>m;
double p;cin>>p;
double ans=0.0;
if (n>m)swap(n,m);
if (n==1){
if (m==1){
cout<<p<<endl;
return 0;
}
ans+=2*p*p;
ans+=(m-2)*p*p*p;
cout<<ans<<endl;
return 0;
}
ans+=4*p*p*p;
ans+=(n+m-4)*p*p*p*p;
ans+=(n-2)*(m-2)*p*p*p*p*p;
cout<<ans<<endl;
return 0;
}
tktk_snsn