Translate

Views

Monday, June 12, 2023

Solution UVA: 10523 - Very Easy !!!

 

 Last Submissions
  Problem  VerdictLangTimeBestRankSubmit Time
 | discuss10523 - Very Easy !!! AcceptedPython0.5200.000161234 secs ago

Problem: 10523 
Suggest:
- Because python permit calc big number => Use python to slove problem

Code Python:
while True:
    try:
        n, a = map(int, input().split())
    except:
        break
    s = 0
    for i in range(n):
        s += (i+1)*(a**(i+1))
    print(s)


No comments: