QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#742645#8780. Training, Round 2ydzr00000WA 3ms4976kbC++17994b2024-11-13 17:00:192024-11-13 17:00:21

Judging History

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

  • [2024-11-13 17:00:21]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:4976kb
  • [2024-11-13 17:00:19]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int lx[5001],rx[5001],ly[5001],ry[5001];
set<int>rch[5001],upd[5001];
int main(){
    int n,x,y;
    scanf("%d %d %d",&n,&x,&y);
    for(int i=1;i<=n;i++)
        scanf("%d %d %d %d",&lx[i],&rx[i],&ly[i],&ry[i]);
    rch[0].insert(0);
    for(int i=1;i<=n;i++)
    {
        int L=max(0,lx[i]-x);
        int R=min(i,rx[i]-x);
        int U=max(0,ly[i]-y);
        int D=max(i,ry[i]-y);
        for(int j=L;j<=R;j++)
        {
            vector<int>num;
            for(auto r: rch[j])
                if(r>=U&&r<=D)
                    num.push_back(r);
            for(auto x: num)
            {
                rch[j].erase(x);
                rch[j].insert(x+1);
                rch[j+1].insert(x);
                upd[j].insert(x);
            }
        }
    }
    int ans=0;
    for(int i=0;i<=n;i++)
        for(auto j: upd[i])
            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: 100
Accepted
time: 0ms
memory: 4192kb

input:

3 0 0
0 1 0 1
1 1 0 1
1 1 1 1

output:

3

result:

ok single line: '3'

Test #2:

score: -100
Wrong Answer
time: 3ms
memory: 4976kb

input:

5000 801577551 932138594
801577551 801577551 932138594 932138594
801577552 801577552 932138594 932138594
801577552 801577552 932138595 932138595
801577552 801577552 932138596 932138596
801577553 801577553 932138596 932138596
801577553 801577553 932138597 932138597
801577553 801577553 932138598 93213...

output:

4999

result:

wrong answer 1st lines differ - expected: '5000', found: '4999'