| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1366696 | makon | RUN Sequence (KAISTRUN26SPRING_B) | Pypy 3 | 5141 ms | 2090436 KiB |
import sys
input = sys.stdin.readline
def main():
R, U, N = map(int, input().split())
LIM = 10 ** 18
fib = [0, 1, 1]
while len(fib) <= N - 1 and fib[-1] <= LIM:
fib.append(min(LIM, fib[-1] + fib[-2]))
p = fib[N - 2] if N - 2 < len(fib) else LIM
q = fib[N - 1] if N - 1 < len(fib) else LIM
x_cnt = min(q, R)
y_cnt = min(p, U)
ans = x_cnt * U + R * y_cnt - x_cnt * y_cnt
print(ans)
if __name__ == "__main__": main()Compilation message (stdout)
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
