Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: C12
Problemset: โชว์ของโลมา
Language: cpp
Time: 0.002 second
Submitted On: 2026-03-05 21:38:13
#include <bits/stdc++.h>
using namespace std;
#define ll long long
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;
}