lanqiao 1457 杨辉三角形(优化解法)

This commit is contained in:
2025-04-07 15:13:43 +08:00
parent 301fecc357
commit 118a9e171c

21
12lanqiao/test8-2.cpp Normal file
View File

@@ -0,0 +1,21 @@
// lanqiao 1457 杨辉三角形(优化解法)
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int a[N], b[N];
int main(){
int n; cin >>n;
if(n == 1){
cout << 1 << endl;
return 0;
}
/*
如果某一行第二个数是n那么第三个数一定是n(n-1)/2,算到44723行
44723*44723>10亿所以算到前44723行即可
*/
return 0;
}
/* test samples -> 13
6
*/