Accepted
Code
def functionality(H, W):
total_count = 0
max_square_size = min(H, W)
for s in range(1, max_square_size + 1):
count_for_size = (H - s + 1) * (W - s + 1)
total_count += count_for_size
return total_count
H, W = map(int, input().split())
print(functionality(H, W))
Information
- Submit By
- Type
- Submission
- Problem
- P1121 Square Counting Challenge
- Contest
- Brain Booster #7
- Language
- Python 3 (Python 3.12.3)
- Submit At
- 2024-11-05 14:38:59
- Judged At
- 2024-11-11 02:32:55
- Judged By
- Score
- 100
- Total Time
- 23ms
- Peak Memory
- 3.125 MiB