QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#21282#2817. 鸽鸽的分割WhybullYMe#AC ✓1ms3716kbC++14191b2022-03-04 14:28:552022-05-08 02:49:50

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:50]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3716kb
  • [2022-03-04 14:28:55]
  • 提交

answer

#include<iostream>
#include<cstdio>
using namespace std;
int n;
int main()
{
    while(cin>>n)
        cout<<1ull+1ull*n*(n-1)/2+1ull*n*(n-1)/2*(n-2)/3*(n-3)/4<<'\n';
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3716kb

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