QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#427303#8780. Training, Round 2ucup-team2279#WA 1ms5860kbC++20617b2024-06-01 12:10:442024-06-01 12:10:45

Judging History

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

  • [2024-06-01 12:10:45]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5860kb
  • [2024-06-01 12:10:44]
  • 提交

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);
		if(c>d) continue;
		b=min(b,i-1),a=max(a,0);
		for(int j=b; j>=a; 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;
}

详细

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 5860kb

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'