結果
| 問題 | 
                            No.959 tree and fire
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tamato
                         | 
                    
| 提出日時 | 2019-12-22 12:13:07 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 256 bytes | 
| コンパイル時間 | 319 ms | 
| コンパイル使用メモリ | 82,080 KB | 
| 実行使用メモリ | 54,736 KB | 
| 最終ジャッジ日時 | 2024-09-14 02:54:51 | 
| 合計ジャッジ時間 | 3,953 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 50 WA * 4 | 
ソースコード
N, M = map(int, input().split())
p = float(input())
if N == M == 1:
    print(p)
elif N == 1:
    print(p**3 * (M-2) + p**2 * 2)
elif M == 1:
    print(p**3 + (N-2) + p**2 * 2)
else:
    print(p**5 * (N-2) * (M-2) + p**4 * ((N-2)*2 + (M-2)*2) + p**3 * 4)
            
            
            
        
            
tamato