QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#485323 | #6703. Tokens on the Segments | Ink_bai | WA | 0ms | 3592kb | C++14 | 734b | 2024-07-20 16:26:55 | 2024-07-20 16:26:55 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main()
{
int T;
cin >> T;
while (T--)
{
int n;
cin >> n;
vector<pair<int, int>> sss(n);
for (int i = 0; i < n; ++i)
{
int l, r;
cin >> l >> r;
sss[i] = {r, l};
}
sort(sss.begin(), sss.end());
int count = 0;
int last_placed = -1;
for (const auto& seg : sss)
{
int r = seg.first;
int l = seg.second;
if (l > last_placed)
{
++count;
last_placed = r;
}
}
cout << count << endl;
}
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3592kb
input:
2 3 1 2 1 1 2 3 3 1 2 1 1 2 2
output:
2 2
result:
wrong answer 1st numbers differ - expected: '3', found: '2'