递推水题 Codeforces Round #289 (Div. 2, ACM ICPC Rules) A. Maximum in Table

题目传送门

 /*
模拟递推水题
*/
#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
using namespace std; const int MAXN = + ;
const int INF = 0x3f3f3f3f;
int a[MAXN][MAXN]; int main(void)
{
#ifndef ONLINE_JUDGE
freopen ("A.in", "r", stdin);
#endif int n;
while (~scanf ("%d", &n))
{
for (int i=; i<=n; ++i)
{
a[][i] = ;
a[i][] = ;
} for (int i=; i<=n; ++i)
{
for (int j=; j<=n; ++j)
{
a[i][j] = a[i-][j] + a[i][j-];
}
} printf ("%d\n", a[n][n]);
} return ;
}
上一篇:Codeforces Round #289 (Div. 2, ACM ICPC Rules) E. Pretty Song 算贡献+前缀和


下一篇:《学习OpenCV》练习题第四章第三题a