QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#437647#8780. Training, Round 2ucup-team3651WA 3150ms6072kbC++201.0kb2024-06-09 14:32:272024-06-09 14:32:27

Judging History

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

  • [2024-06-09 14:32:27]
  • 评测
  • 测评结果:WA
  • 用时:3150ms
  • 内存:6072kb
  • [2024-06-09 14:32:27]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define N 5050
using namespace std;
int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0' && ch>'9')f=(ch=='-'?-1:f),ch=getchar();
    while(ch>='0' && ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
    return x*f;
}
void write(int x){
    if(x<0)x=-x,putchar('-');
    if(x/10)write(x/10);
    putchar(x%10+'0');
}
vector f(N,bitset<N>{});
bitset<N> g;
int main(){
    #ifdef EAST_CLOUD
    freopen("a.in","r",stdin);
    freopen("a.out","w",stdout);
    #endif
    int n=read(),a=read(),b=read();
    f[0][0]=1;
    for(int i=1;i<=n;i++){
        int l=read(),r=read(),L=read(),R=read();
        l=max(0,l-a);r=r-a;L=max(0,L-b);R=R-b;
        for(int j=0;j<n;j++)g[j]=(j>=L && j<=R);
        for(int j=i;j>=0;j--){
            f[j]|=(f[j]&g)<<1;
            if(j!=0)f[j]|=(f[j-1]&g);
        }
    }
    int res=0;
    for(int i=0;i<=n;i++){
        for(int j=0;j<=n;j++){
            if(f[i][j])res=max(res,i+j);
        }
    }
    write(res);
}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 6064kb

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: 0
Accepted
time: 3115ms
memory: 5992kb

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:

5000

result:

ok single line: '5000'

Test #3:

score: 0
Accepted
time: 3099ms
memory: 6072kb

input:

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

output:

5000

result:

ok single line: '5000'

Test #4:

score: -100
Wrong Answer
time: 3150ms
memory: 6024kb

input:

5000 76836128 716580777
76836128 76836128 716580777 716580777
76836129 76836129 716580777 716580777
76836130 76836130 716580777 716580777
76836131 76836131 716580777 716580777
76836131 76836131 716580778 716580778
76836131 76836131 716580779 716580779
76836131 76836131 716580780 716580780
76836128 7...

output:

5000

result:

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