Submission

Status:

xxxxxxxxxx

Subtask/Task Score:

0/100

Score: 0

User: C12

Problemset: โชว์ของโลมา

Language: cpp

Time: 0.002 second

Submitted On: 2026-03-05 21:37:18

#include <bits/stdc++.h>
using namespace std;

#define ll long long

int v[2*int(1e7)+1] = {0};

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    ll n;
    cin >> n;

    ll sum = 0;
    ll now = 0;

    while(n > 2){
        now += n*2;
        now += (n-2);

        now %= 10;
        sum += now;
        now++;
        
        now %= 10;
        sum += now;
        now += (n-3);

        n -= 2;
    }

    if(n == 2){
        now += n+1;
        
        now %= 10;
        sum += now;
        now++;
        
        now %= 10;
        sum += now;
    }
    else{
        now++;

        now %= 10;
        sum += now;
    }
    // cout << now << ' ';
    cout << sum;

    return 0;
}