codeforces水题100道 第十八题 Codeforces Round #289 (Div. 2, ACM ICPC Rules) A. Maximum in Table (brute force)

题目链接:http://www.codeforces.com/problemset/problem/509/A
题意:f[i][1]=f[1][i]=1,f[i][j]=f[i-1][j]+f[i][j-1],求f[n][n]。
C++代码:

#include <iostream>
using namespace std;
int n, f[][];
int main()
{
cin >> n;
for (int i=;i<=n;i++)
f[i][] = f[][i] = ;
for (int i = ; i <= n; i ++)
for (int j = ; j <= n; j ++)
f[i][j] = f[i-][j] + f[i][j-];
cout << f[n][n];
return ;
}

C++

上一篇:[codeforces 509]C. Sums of Digits


下一篇:sql server 权限