QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#21257#2814. 不用找的树gogo#TL 0ms0kbC++14335b2022-03-04 14:08:032022-05-08 02:48:02

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:02]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2022-03-04 14:08:03]
  • 提交

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: 0
Time Limit Exceeded

input:

100000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

output:

323344994227101747
1
2
4
8
16
31
57
99
163
256
386
562
794
1093
1471
1941
2517
3214
4048
5036
6196
7547
9109
10903
12951
15276
17902
20854
24158
27841
31931
36457
41449
46938
52956
59536
66712
74519
82993
92171
102091
112792
124314
136698
149986
164221
179447
195709
213053
231526
251176
272052
29420...

result: