Files
lanqiao/12lanqiao/test8-2.cpp

21 lines
434 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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
*/