跳到正文

个人记录

打表的第2题。

zyd1210约 10 分钟
原文
文章信息与版本

文章信息

发布
2026年7月18日
收录
2026年7月18日
更新
2026年10月11日
篇幅
约 10 分钟
获赞
1

版本

  1. v2当前
  2. v1

打表的第2题。

哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈

今天做了P2807,老师讲了一大堆的方法但我第一反应就是 正解打表。

这年头谁还写正解啊

C++
#include<bits/stdc++.h>
#define ll long long
//#define itn int
#define db double
#define str string
#define qwq return
#define forl(i,s,n) for(int i=s;i<=n;i++)
#define forll(i,s,n) for(int i=s;i>=n;i--)
#define for_l(i,s,n) for(int i=s;i<n;i++)
#define for_ll(i,s,n) for(int i=s;i>n;i--)
#define forlll(s,n) for(s=s;s>=n;s--)
/*
#include<windows.h>
#include<vector>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<cstdio>
#include<queue>
#include<algorithm>
#include<string>
#include<cmath>
Hello World!
*/
using namespace std;
int a[]={
0,
1,
5,
13,
27,
48,
78,
118,
170,
235,
315,
411,
525,
658,
812,
988,
1188,
1413,
1665,
1945,
2255,
2596,
2970,
3378,
3822,
4303,
4823,
5383,
5985,
6630,
7320,
8056,
8840,
9673,
10557,
11493,
12483,
13528,
14630,
15790,
17010,
18291,
19635,
21043,
22517,
24058,
25668,
27348,
29100,
30925,
32825,
34801,
36855,
38988,
41202,
43498,
45878,
48343,
50895,
53535,
56265,
59086,
62000,
65008,
68112,
71313,
74613,
78013,
81515,
85120,
88830,
92646,
96570,
100603,
104747,
109003,
113373,
117858,
122460,
127180,
132020,
136981,
142065,
147273,
152607,
158068,
163658,
169378,
175230,
181215,
187335,
193591,
199985,
206518,
213192,
220008,
226968,
234073,
241325,
248725,
256275,
263976,
271830,
279838,
288002,
296323,
304803,
313443,
322245,
331210,
340340,
349636,
359100,
368733,
378537,
388513,
398663,
408988,
419490,
430170,
441030,
452071,
463295,
474703,
486297,
498078,
510048,
522208,
534560,
547105,
559845,
572781,
585915,
599248,
612782,
626518,
640458,
654603,
668955,
683515,
698285,
713266,
728460,
743868,
759492,
775333,
791393,
807673,
824175,
840900,
857850,
875026,
892430,
910063,
927927,
946023,
964353,
982918,
1001720,
1020760,
1040040,
1059561,
1079325,
1099333,
1119587,
1140088,
1160838,
1181838,
1203090,
1224595,
1246355,
1268371,
1290645,
1313178,
1335972,
1359028,
1382348,
1405933,
1429785,
1453905,
1478295,
1502956,
1527890,
1553098,
1578582,
1604343,
1630383,
1656703,
1683305,
1710190,
1737360,
1764816,
1792560,
1820593,
1848917,
1877533,
1906443,
1935648,
1965150,
1994950,
2025050,
2055451,
2086155,
2117163,
2148477,
2180098,
2212028,
2244268,
2276820,
2309685,
2342865,
2376361,
2410175,
2444308,
2478762,
2513538,
2548638,
2584063,
2619815,
2655895,
2692305,
2729046,
2766120,
2803528,
2841272,
2879353,
2917773,
2956533,
2995635,
3035080,
3074870,
3115006,
3155490,
3196323,
3237507,
3279043,
3320933,
3363178,
3405780,
3448740,
3492060,
3535741,
3579785,
3624193,
3668967,
3714108,
3759618,
3805498,
3851750,
3898375,
3945375,
3992751,
4040505,
4088638,
4137152,
4186048,
4235328,
4284993,
4335045,
4385485,
4436315,
4487536,
4539150,
4591158,
4643562,
4696363,
4749563,
4803163,
4857165,
4911570,
4966380,
5021596,
5077220,
5133253,
5189697,
5246553,
5303823,
5361508,
5419610,
5478130,
5537070,
5596431,
5656215,
5716423,
5777057,
5838118,
5899608,
5961528,
6023880,
6086665,
6149885,
6213541,
6277635,
6342168,
6407142,
6472558,
6538418,
6604723,
6671475,
6738675,
6806325,
6874426,
6942980,
7011988,
7081452,
7151373,
7221753,
7292593,
7363895,
7435660,
7507890,
7580586,
7653750,
7727383,
7801487,
7876063,
7951113,
8026638,
8102640,
8179120,
8256080,
8333521,
8411445,
8489853,
8568747,
8648128,
8727998,
8808358,
8889210,
8970555,
9052395,
9134731,
9217565,
9300898,
9384732,
9469068,
9553908,
9639253,
9725105,
9811465,
9898335,
9985716,
10073610,
10162018,
10250942,
10340383,
10430343,
10520823,
10611825,
10703350,
10795400,
10887976,
10981080,
11074713,
11168877,
11263573,
11358803,
11454568,
11550870,
11647710,
11745090,
11843011,
11941475,
12040483,
12140037,
12240138,
12340788,
12441988,
12543740,
12646045,
12748905,
12852321,
12956295,
13060828,
13165922,
13271578,
13377798,
13484583,
13591935,
13699855,
13808345,
13917406,
14027040,
14137248,
14248032,
14359393,
14471333,
14583853,
14696955,
14810640,
14924910,
15039766,
15155210,
15271243,
15387867,
15505083,
15622893,
15741298,
15860300,
15979900,
16100100,
16220901,
16342305,
16464313,
16586927,
16710148,
16833978,
16958418,
17083470,
17209135,
17335415,
17462311,
17589825,
17717958,
17846712,
17976088,
18106088,
18236713,
18367965,
18499845,
18632355,
18765496,
18899270,
19033678,
19168722,
19304403,
19440723,
19577683,
19715285,
19853530,
19992420,
20131956,
20272140,
20412973,
20554457,
20696593,
20839383,
20982828,
21126930,
21271690,
21417110,
21563191,
21709935,
21857343,
22005417,
22154158,
22303568,
22453648,
22604400,
22755825,
22907925,
23060701,
23214155,
23368288,
23523102,
23678598,
23834778,
23991643,
24149195,
24307435,
24466365,
24625986,
24786300,
24947308,
25109012,
25271413,
25434513,
25598313,
25762815,
25928020,
26093930,
26260546,
26427870,
26595903,
26764647,
26934103,
27104273,
27275158,
27446760,
27619080,
27792120,
27965881,
28140365,
28315573,
28491507,
28668168,
28845558,
29023678,
29202530,
29382115,
29562435,
29743491,
29925285,
30107818,
30291092,
30475108,
30659868,
30845373,
31031625,
31218625,
31406375,
}; 
int t,n;
int main(){
	ios::sync_with_stdio(false);
	cin.tie();
	cout.tie();
	cin>>t;
	while(t--){
		cin>>n;
		cout<<a[n]<<"\n";
	}
}

哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈

又水了一篇

原文