QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#519022 | #8780. Training, Round 2 | solar_express# | WA | 12ms | 101584kb | C++14 | 718b | 2024-08-14 15:32:00 | 2024-08-14 15:32:00 |
Judging History
answer
#include<bits/stdc++.h>
#define N 5005
using namespace std;
int f[N][N];
int n,x,y;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin>>n>>x>>y;
memset(f,-1,sizeof(f));
f[1][0]=0;
for(int i=1;i<=n;++i){
int a,b,c,d;
cin>>a>>b>>c>>d;
for(int j=0;j<i;++j)
if(f[i][j]!=-1){
if(a<=x+j&&x+j<=b&&c<=y+f[i][j]&&y+f[i][j]<=d){
f[i+1][j+1]=max(f[i+1][j+1],f[i][j]);
f[i+1][j]=max(f[i+1][j],f[i][j]+1);
}
}
}
int ans=0;
for(int i=0;i<=n;++i)
if(f[n+1][i]!=-1)
ans=max(ans,f[n+1][i]+i);
cout<<ans<<'\n';
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 11ms
memory: 101468kb
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: 12ms
memory: 101468kb
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: 8ms
memory: 101524kb
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: 7ms
memory: 101584kb
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:
0
result:
wrong answer 1st lines differ - expected: '4994', found: '0'