QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#403053 | #4071. Galactic Collegiate Programming Contest | QRQRQR | WA | 17ms | 4380kb | C++17 | 797b | 2024-05-01 20:02:02 | 2024-05-01 20:02:03 |
Judging History
answer
#include <bits/stdc++.h>
#include <bits/extc++.h>
#define pii pair<int, int>
#define F first
#define S second
#define ranktree tree<pii, null_type, greater<pii>, rb_tree_tag, tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_pbds;
ranktree rt;
int n, m;
pii team[100005];
signed main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> n >> m;
for (int i = 0; i < n; i++) team[i].F = team[i].S = 0;
for (int i = 0; i < m; i++) {
int tt, pp;
cin >> tt >> pp;
auto it = rt.find(team[tt]);
if (it != rt.end()) rt.erase(it);
team[tt].F++;
team[tt].S -= pp;
rt.insert(team[tt]);
int rk = rt.order_of_key(team[1]);
cout << rk+1 << "\n";
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3600kb
input:
3 4 2 7 3 5 1 6 1 9
output:
2 3 2 1
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 14ms
memory: 4356kb
input:
100000 100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 1 3 1 3 1 5 1 3 1 1 1 2 1 1 1 2 1 5 1 4 1 4 1 4 1 4 1 2 1 2 1 3 1 5 1 2 1 3 1 3 1 3 1 5 1 1 1 3 1 3 1 1 1 3 1 1 1 2 1 5 1 5 1 3 1 4 1 3 1 3 1 2 1 4 1 3 1 2 1 1 1 2 1 1 1 4 1 1 1 3 1 2 1 1 1 4 1 4 ...
output:
2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 1 1 2 2 2 1 1 1 1 1 1 1 1 ...
result:
wrong answer 384th lines differ - expected: '3', found: '2'