Submission
Status:
Compilation Error
Score: 0
User: kaka
Problemset: โชว์ของโลมา
Language: cpp
Time: 0.000 second
Submitted On: 2025-03-25 07:00:03
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll solve(ll n, ll last) {
if (n == 1) return (last + 1) % 10;
if (n == 2) return (last + 4) % 10 + (last + 3) % 10;
return solve(n - 2, 4 * n - 4 + last) + (3 * n - 2 + last) % 10 + (3 * n - 1 + last) % 10;
}
int main() {
ios_base::sync_with_stdio(false),cie.tie(NULL);
ll n;
cin >> n;
cout << solve(n, 0) << endl;
return 0;
}