Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: kavin8888

Problemset: Sigma Croissant

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-21 18:49:07

#include<bits/stdc++.h>
#define spps1 ios::sync_with_stdio(false)
#define spps2 cin.tie(nullptr)
#define ll long long
using namespace std;
ll int fac(int x)
{
	if(x==1)
	{
		return 1;
	}
	return x*fac(x-1);
}
int main()
{
	spps1; spps2;
	int n; cin>>n;
	ll ans=0;
	for(int i=1;i<=n;i++)
	{
		ans+=fac(i);
	}
	cout<<ans;
}