QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#302655#2734. Professional NetworkCamillus0 14ms5188kbC++20619b2024-01-11 02:07:042024-01-11 02:07:04

Judging History

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

  • [2024-01-11 02:07:04]
  • 评测
  • 测评结果:0
  • 用时:14ms
  • 内存:5188kb
  • [2024-01-11 02:07:04]
  • 提交

answer

#include "bits/stdc++.h"

using ll = long long;
using namespace std;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    deque<pair<int, int>> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i].first >> a[i].second;
    }
    sort(a.begin(), a.end());
    int res = 0;
    int k = 0;
    while (!a.empty()) {
        while (!a.empty() && a[0].first < k) {
            res++;
            k++;
            a.pop_back();
        }
        if (!a.empty()) {
            k++;
            a.pop_front();
        }
    }
    cout << res;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 14ms
memory: 5188kb

input:

200000
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0 1
0...

output:

199999

result:

wrong answer 1st lines differ - expected: '0', found: '199999'

Subtask #2:

score: 0
Wrong Answer

Test #11:

score: 4
Accepted
time: 0ms
memory: 3624kb

input:

1
0 0

output:

0

result:

ok single line: '0'

Test #12:

score: -4
Wrong Answer
time: 0ms
memory: 3616kb

input:

10
10 10000
10 10000
10 10000
10 10000
10 10000
10 10000
10 10000
10 10000
10 10000
10 10000

output:

0

result:

wrong answer 1st lines differ - expected: '100000', found: '0'

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #1:

0%