QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#437701 | #8780. Training, Round 2 | ucup-team045# | WA | 23ms | 3624kb | C++20 | 958b | 2024-06-09 16:03:17 | 2024-06-09 16:03:18 |
Judging History
answer
#include<iostream>
#include<cstring>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
using LL = long long;
int main(){
#ifdef LOCAL
freopen("data.in", "r", stdin);
freopen("data.out", "w", stdout);
#endif
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(0);
int n, x, y;
cin >> n >> x >> y;
vector<int> pt(n + 1, -1);
pt[0] = 0;
int ans = 0;
for(int i = 1; i <= n; i++){
int l1, r1, l2, r2;
cin >> l1 >> r1 >> l2 >> r2;
for(int j = 0; j <= n; j++){
if (x + j < l1 or x + j > r1 or pt[j] == -1) continue;
int mn = max(0, l2 - y);
int mx = min(n - j, r2 - y);
if (pt[j] >= mn and pt[j] <= mx){
ans = max(ans, j + ++pt[j]);
if (j == 0){
pt[pt[j]] = 0;
}
}
}
}
cout << ans << '\n';
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3512kb
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: 23ms
memory: 3624kb
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:
4
result:
wrong answer 1st lines differ - expected: '5000', found: '4'