QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#21258#2817. 鸽鸽的分割gogo#AC ✓4ms3592kbC++14335b2022-03-04 14:08:362022-05-08 02:48:16

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:48:16]
  • 评测
  • 测评结果:AC
  • 用时:4ms
  • 内存:3592kb
  • [2022-03-04 14:08:36]
  • 提交

answer

#include <bits/stdc++.h>
//#define int long long
#define ll long long
#define db double
#define fi first
#define se second
#define pii pair<int,int>
#define vi vector<int>

using namespace std;
ll n; 
int main() {
	while (cin>>n) {
		ll ans=n*(n-1)/2+1+n*(n-1)*(n-2)*(n-3)/1/2/3/4;
		cout<<ans<<'\n';
	}
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 4ms
memory: 3592kb

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