QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#884339#3554. Sweepingmakrav#0 519ms35096kbC++201.4kb2025-02-06 00:15:042025-02-06 00:15:05

Judging History

This is the latest submission verdict.

  • [2025-02-06 00:15:05]
  • Judged
  • Verdict: 0
  • Time: 519ms
  • Memory: 35096kb
  • [2025-02-06 00:15:04]
  • Submitted

answer

#include <bits/stdc++.h>
#include <cassert>

using namespace std;

#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()

void solve() {
    int n, m, q; cin >> n >> m >> q;
    vector<pair<int, int>> a(m);
    for (int i = 0; i < m; i++) cin >> a[i].first >> a[i].second;
    vector<int> l(m), r(m);
    for (int i = 0; i < m; i++) {
        l[i] = a[i].first; r[i] = n - a[i].second;
    }
    set<int> ys;
    while (q--) {
        int t; cin >> t;
        if (t == 1) {
            int ind; cin >> ind; ind--;
            auto it = ys.lower_bound(a[ind].second);
            if (it != ys.end()) {
                cout << max(n - *it, a[ind].first) << ' ' << a[ind].second << '\n';
            } else {
                cout << a[ind].first << ' ' << a[ind].second << '\n';
            }
        } else if (t == 2) {
            int hg; cin >> hg;
            ys.insert(hg);
        } else if (t == 3) {
            int wg; cin >> wg; continue;
        } else {
            int x, y; cin >> x >> y;
            a.pb({x, y});
            l.pb(x); r.pb(n - y);
            m++;
        }
    }
}

signed main() {
    int tt = 1;
    #ifdef LOCAL 
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
        cin >> tt;
    #else 
        cin.tie(0)->sync_with_stdio(false);
    #endif

    while (tt--) {
        solve();
    }
    return 0;
}

詳細信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3840kb

input:

999999999 2000 5000
406191928 499382196
562579162 405324970
758918451 226610082
56425557 481714604
280111172 204083332
178122667 423322594
656895843 125933171
283229448 255332800
375268656 368221716
287124150 218833686
67804037 252992256
736660159 61831334
50624783 762562411
127286172 739867871
2174...

output:

703152954 155393653
568874648 274309686
58956946 596540151
199070534 386549252
373137208 134433052
196862582 704927063
601883225 329807019
487677860 110879212
661256159 124128317
751624518 7040884
174003214 771291775
770471768 196307582
256547879 535773866
36478325 753856112
175794127 430044359
2562...

result:

wrong answer 4th lines differ - expected: '199070534 583395188', found: '199070534 386549252'

Subtask #2:

score: 0
Wrong Answer

Test #7:

score: 0
Wrong Answer
time: 503ms
memory: 35096kb

input:

1000000000 500000 1000000
565671866 434313351
151160620 848839277
759673958 240326022
747919325 251939968
652216454 341792707
697972826 302025968
437943290 562056699
963595717 25130832
833492450 163447023
453783218 546216655
852488265 147511733
364464144 334147914
493873353 504061372
104992045 86556...

output:

993267240 6732751
315188472 684811456
76595172 922437952
486780435 512724930
161829967 836886041
572132261 427866716
750002500 65762937
750002500 77683574
207947130 792051536
343822470 656177426
727111507 272888421
706937632 293061330
885997292 113491348
625002500 346017967
875002500 50191019
288866...

result:

wrong answer 1841st lines differ - expected: '524954061 474350994', found: '525395000 474350994'

Subtask #3:

score: 0
Wrong Answer

Test #14:

score: 0
Wrong Answer
time: 519ms
memory: 29760kb

input:

1000000000 499999 1000000
1603 999995752
1621 999984188
3408 999983654
3743 999979285
3830 999978594
5050 999974201
7426 999970241
13957 999962424
14611 999962335
16341 999954169
20684 999953545
21401 999952737
25492 999948443
25736 999946928
26128 999941492
29341 999937495
29753 999929827
33929 999...

output:

311900542 626076836
353587097 582311003
135154605 823201952
88429068 879554432
716432267 229484324
157875583 797283755
196566000 758913803
902622474 69540417
391122000 571623281
653250000 299154784
782914000 185504610
673610863 267731597
844354000 118664505
70986711 901272703
456658000 481766999
456...

result:

wrong answer 8th lines differ - expected: '902622474 90110001', found: '902622474 69540417'

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #1:

0%