QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#442646 | #8526. Polygon II | ucup-team2279# | WA | 0ms | 3664kb | C++14 | 421b | 2024-06-15 13:09:48 | 2024-06-15 13:09:48 |
Judging History
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'