QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#437701#8780. Training, Round 2ucup-team045#WA 23ms3624kbC++20958b2024-06-09 16:03:172024-06-09 16:03:18

Judging History

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

  • [2024-06-09 16:03:18]
  • 评测
  • 测评结果:WA
  • 用时:23ms
  • 内存:3624kb
  • [2024-06-09 16:03:17]
  • 提交

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';

}

详细

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'