QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#442646#8526. Polygon IIucup-team2279#WA 0ms3664kbC++14421b2024-06-15 13:09:482024-06-15 13:09:48

Judging History

你现在查看的是最新测评结果

  • [2024-06-15 13:09:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3664kb
  • [2024-06-15 13:09:48]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;const int N=2e5+5;int n,t,p[N],mx[N],f[N][1000];int main(){cin>>n;for(int i=1,u,v;i<=n;i++){cin>>u>>v;if(u>v)swap(u,v);p[u]=v;}n*=2;f[n+1][0]=n;for(int i=n;i;i--)for(t=1,f[i][0]=i-1;;t++){f[i][t]=f[i+1][t]?f[i+1][t]:n+1;if(p[i]&&mx[i+1]<t)f[i][t]=min(f[i][t],f[p[i]+1][t-mx[i+1]-1]?f[p[i]+1][t-mx[i+1]-1]:n+1);if(f[i][t]<p[i-1])mx[i]=t;if(f[i][t]>n)break;}cout<<t-1;return 0;}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3664kb

input:

3
0 2 0

output:

0

result:

wrong answer 1st numbers differ - expected: '166666668', found: '0'