[HDU4669]Editor (栈)

Posted lincold

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[HDU4669]Editor (栈)相关的知识,希望对你有一定的参考价值。

技术分享图片

题意

模拟编辑器,还是给链接吧

https://vjudge.net/problem/HDU-4699

思路

两个栈

代码

//poj1050
//n^4暴力
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#define N 105
#define INF 0x3fffffff
using namespace std;
int a[N][N];
int sum[N];
int ans;
int main()
{
    int n; scanf("%d", &n);
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            scanf("%d", &a[i][j]);
    for (int i = 1; i <= n; i++) {
        memset(sym, 0, sizeof(sum));
        for (int j = i; j <= n; j++) {
            int num = 0;
            for (int k = 1; k <= n; k++) {
                num += sum[k] += a[j][k];
                ans = max(ans, num);
                if (num < 0) num = 0;
            }
        }
    }
    printf("%d
", ans);
    return 0;
}

以上是关于[HDU4669]Editor (栈)的主要内容,如果未能解决你的问题,请参考以下文章

栈专题练习

Unity报错:Read only asset Packages/com.xxxxx.xxx.xxxx/Editor/VSCodeDiscovery.cs.IPGSD has no meta(代码片段

Unity报错:Read only asset Packages/com.xxxxx.xxx.xxxx/Editor/VSCodeDiscovery.cs.IPGSD has no meta(代码片段

获取和恢复monaco editor的undo/redo栈

Ace Editor 手动添加片段

HDU 6957 Maximal submatrix(悬线法 || 优先队列 || 单调栈 )