QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#164895 | #7120. Soccer | Crysfly | Compile Error | / | / | C++17 | 1.7kb | 2023-09-05 14:28:13 | 2024-04-28 07:29:24 |
Judging History
你现在查看的是最新测评结果
- [2024-04-28 07:29:24]
- 管理员手动重测本题所有提交记录
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-09-05 14:28:14]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-09-05 14:28:13]
- 提交
answer
// what is matter? never mind.
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2")
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
//#define int long long
#define ull unsigned long long
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;
#define N 2005
#define inf 0x3f3f3f3f
int n,a[N][N];
int up[N][N],dw[N][N];
int f[N][N],len[N][N];
int ls[N],rs[N],st[N],tp,rt;
int biggest_stadium(int nn,vector<vector<int>>MP){
n=nn; For(i,1,n)For(j,1,n)a[i][j]=MP[i-1][j-1];
For(i,1,n)For(j,1,n)up[i][j]=(a[i][j]?0:up[i-1][j]+1);
Rep(i,n,1)For(j,1,n)dw[i][j]=(a[i][j]?0:dw[i+1][j]+1);
// For(i,1,n)For(j,1,n)cout<<up[i][j]<<" \n"[j==n];
int res=0;
For(i,1,n){
int l=1,r;
For(j,1,n)f[i][j]=-inf,ls[j]=rs[j]=0;
for(;l<=n;l=r+1){
r=l;
while(r<n && a[i][r+1]==a[i][l])++r;
if(a[i][l])continue;
tp=0;
For(j,l,r){
while(tp&&dw[i][st[tp]]>dw[i][j]) ls[j]=st[tp--];
if(tp) rs[st[tp]]=j; st[++tp]=j;
}
rt=st[1];
auto dfs=[&](auto self,int u,int l,int r){
assert(l<=r);
f[i][u]=dw[i][u]*(r-l+1);
len[i][u]=r-l+1;
if(ls[u]) dfs(self,ls[u],l,u-1),f[i][u]=max(f[i][u],f[i][ls[u]]+(r-u+1)*dw[i][u]);
if(rs[u]) dfs(self,rs[u],u+1,r),f[i][u]=max(f[i][u],f[i][rs[u]]+(u-l+1)*dw[i][u]);
if(f[i-1][u]>=0) f[i][u]=max(f[i][u],f[i-1][u]+(len[i][u]-len[i-1][u])*dw[i][u]);
res=max(res,f[i][u]);
};
dfs(dfs,rt,l,r);
}
}
return res;
}
詳細信息
answer.code: In lambda function: answer.code:52:43: error: use of ‘dfs’ before deduction of ‘auto’ 52 | if(ls[u]) dfs(self,ls[u],l,u-1),f[i][u]=max(f[i][u],f[i][ls[u]]+(r-u+1)*dw[i][u]); | ^~~ answer.code:53:43: error: use of ‘dfs’ before deduction of ‘auto’ 53 | if(rs[u]) dfs(self,rs[u],u+1,r),f[i][u]=max(f[i][u],f[i][rs[u]]+(u-l+1)*dw[i][u]); | ^~~