QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#403070 | #4071. Galactic Collegiate Programming Contest | QRQRQR | WA | 60ms | 4824kb | C++17 | 880b | 2024-05-01 20:21:18 | 2024-05-01 20:21:19 |
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<pair<pii, int>, null_type, greater<pair<pii, int>>, rb_tree_tag, tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_pbds;
ranktree rt;
int n, m;
pair<pii, int> 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.F = team[i].F.S = 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.F++;
team[tt].F.S -= pp;
team[tt].S = i+1;
rt.insert(team[tt]);
int rk = rt.order_of_key(team[1]);
cout << rk+1 << "\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3576kb
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: 39ms
memory: 4824kb
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 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