QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#21285 | #2817. 鸽鸽的分割 | DaBenZhongXiaSongKuaiDi# | AC ✓ | 3ms | 3780kb | C++20 | 275b | 2022-03-04 14:30:07 | 2022-05-08 02:50:17 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main(){
unsigned long long k,s,p;
int n;
while(scanf("%d",&n)!=EOF){
s=(unsigned long long)n;k=0;
k=1ull+n*(n-1)/2ull;
p=n*(n-1)/2ull;
p=p*(n-2)/3ull;
p=p*(n-3)/4ull;
k=k+p;
cout<<k<<endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3780kb
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