QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#427297 | #8780. Training, Round 2 | ucup-team2279# | WA | 1ms | 5916kb | C++20 | 584b | 2024-06-01 12:02:11 | 2024-06-01 12:02:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N=5005;
int n,x,y;
bitset <N> f[N],pre[N];
int main(){
cin>>n>>x>>y;
f[0][0]=1;
for(int i=0; i<=n; i++) pre[i]=pre[i-1],pre[i][i]=1;
for(int i=1; i<=n; i++){
int a,b,c,d; cin>>a>>b>>c>>d;
a-=x,b-=x,c-=y,d-=y;
c=max(c,0),d=min(d,i-1);
for(int j=min(b,i-1); j>=max(a,0); j--){
auto s=f[j]&pre[d];
if(c>0) s&=~pre[c-1];
f[j+1]|=s;
f[j]|=s<<1;
}
}
int ans=0;
for(int i=0; i<=n; i++)
for(int j=0; j<=n; j++) if(f[i][j]) ans=max(ans,i+j);
printf("%d\n",ans);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 5916kb
input:
3 0 0 0 1 0 1 1 1 0 1 1 1 1 1
output:
2
result:
wrong answer 1st lines differ - expected: '3', found: '2'