Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: rice_ot

Problemset: Sigma Croissant

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-15 10:59:09

#include <bits/stdc++.h>
using namespace std;
long long facto(long long n){
    if(n <= 1) return 1;
    return n*facto(n-1);
}
int main(){
    int n; cin>>n;
    long long total = 0;
    for(int i = n; i>= 1; i--){
        total+=facto(i);
    }
    cout<<total;
}