QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#847809#8780. Training, Round 2Horcrux#WA 11ms3632kbC++231.2kb2025-01-08 11:34:122025-01-08 11:34:12

Judging History

This is the latest submission verdict.

  • [2025-01-08 11:34:12]
  • Judged
  • Verdict: WA
  • Time: 11ms
  • Memory: 3632kb
  • [2025-01-08 11:34:12]
  • Submitted

answer

#include <bits/stdc++.h>

using i64 = long long;
using u64 = unsigned long long;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int n, i0, t0;
    std::cin >> n >> i0 >> t0;

    std::vector <int> l(n + 1, 0), r(n + 1, -1);
    l[0] = r[0] = t0;
    for(int i = 0; i < n; i++) {
        int il, ir, tl, tr;
        std::cin >> il >> ir >> tl >> tr;

        for(int j = i; j >= 0; j--) {
            if(il <= i0 + j && i0 + j <= ir) {
                int L = std::max(l[j], tl);
                int R = std::min(r[j], tr);
                if(L <= R) {
                    r[j] = std::max(r[j], R + 1);
                    if(r[j + 1] < l[j + 1]) {
                        l[j + 1] = L;
                        r[j + 1] = R;
                    } else {
                        l[j + 1] = std::min(l[j + 1], L);
                        r[j + 1] = std::min(r[j + 1], R);
                    }
                }
            }
        }
    }

    int ans = 0;
    for(int j = 0; j <= n; j++) {
        if(l[j] <= r[j]) {
            ans = std::max(ans, j + r[j] - t0);
        }
    }

    std::cout << ans << '\n';

    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3596kb

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: 11ms
memory: 3632kb

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'