結果
| 問題 | No.959 tree and fire |
| コンテスト | |
| ユーザー |
masumasumath1
|
| 提出日時 | 2020-01-03 11:55:19 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 618 bytes |
| 記録 | |
| コンパイル時間 | 349 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 21,852 KB |
| 最終ジャッジ日時 | 2026-05-16 18:55:15 |
| 合計ジャッジ時間 | 4,334 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 1 TLE * 1 -- * 52 |
ソースコード
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 and M == 1:
print(p)
exit()
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