| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1364381 | saywoo | RUN Sequence (KAISTRUN26SPRING_B) | C++20 | 1 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
ll r, u, n;
ll f[51];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> r >> u >> n;
f[1] = 1; f[2] = 1;
for (int i = 3; i <= 50; i++) f[i] = f[i-1] + f[i-2];
if (n >= 50) { cout << r * u << '\n'; return 0; }
if (r <= f[n-1]) cout << r * u << '\n';
else cout << f[n-1] * u + (r - f[n-1]) * f[n-2] << '\n';
return 0;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
