結果
| 問題 |
No.959 tree and fire
|
| ユーザー |
masumasumath1
|
| 提出日時 | 2020-01-03 11:53:35 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 536 bytes |
| コンパイル時間 | 144 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 26,752 KB |
| 最終ジャッジ日時 | 2024-11-22 19:00:58 |
| 合計ジャッジ時間 | 131,671 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 1 TLE * 43 |
ソースコード
N,M = map(int,input().split())
p = float(input())
ans = 0
for i in range(N):
for j in range(M):
#角のとき
if (i,j) in [(0,0),(0,M-1),(N-1,0),(N-1,M-1)]:
if N == 1 or M == 1:
ans += p**2
else:
ans += p**3
#端のとき
elif (i in [0,N-1]) or (j in [0,M-1]):
if N == 1 or M == 1:
ans += p**3
else:
ans += p**4
#真ん中のとき
else:
ans += p**5
print(ans)
masumasumath1