QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#21270#2817. 鸽鸽的分割gsh#AC ✓3ms3584kbC++11944b2022-03-04 14:19:212022-05-08 02:49:00

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-08 02:49:00]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3584kb
  • [2022-03-04 14:19:21]
  • 提交

answer

//author:望远星
#include<bits/stdc++.h>
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define mk make_pair
#define sml(x,y) (x=min(x,y))
#define big(x,y) (x=max(x,y))
#define ll long long
#define ull unsigned long long
#define db double
#define fo(i,x,y) for(int i=x;i<=y;++i)
#define go(i,x,y) for(int i=x;i>=y;--i)
using namespace std;
ull seed=chrono::system_clock::now().time_since_epoch().count();
mt19937 rnd(seed);
inline int rm(int x,int y){return rnd()%(y-x+1)+x;}
inline int read(){ int x=0,f=1; unsigned char ch=getchar()-48; while(ch>9){ if(ch==253) f=-1; ch=getchar()-48; } while(ch<=9){ x=x*10+ch; ch=getchar()-48; } return x*f; }
inline void out(int *a,int l,int r){fo(i,l,r) cout<<*(a+i)<<' ';puts("");}

signed main(){
	int n;
	while(cin>>n) cout<<1+n*(n-1)/2+n*(n-1)*(n-2)*(n-3)/24<<'\n';
	return 0;
}
/*
-------------------------------------------------
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 3584kb

input:

0
1
2
3
4
5
6
7
8
9
10
20
30
40
50
60
61
62
63
64

output:

1
1
2
4
8
16
31
57
99
163
256
5036
27841
92171
231526
489406
523686
559737
597619
637393

result:

ok 20 lines