QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#21270 | #2817. 鸽鸽的分割 | gsh# | AC ✓ | 3ms | 3584kb | C++11 | 944b | 2022-03-04 14:19:21 | 2022-05-08 02:49:00 |
Judging History
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;
}
/*
-------------------------------------------------
*/
詳細信息
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