# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
954250 |
2024-03-27T13:57:57 Z |
vjudge1 |
Deda (COCI17_deda) |
C++17 |
|
1000 ms |
1464 KB |
#include <bits/extc++.h>
#include <bits/stdc++.h>
#define pii pair<int,int>
using namespace __gnu_pbds;
using namespace std;
tree <pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> s;
int main(){
int n, q, m = 0;
cin >> n >> q;
//no gets off see as inf
//
while(q){
char op;
int a, b;
cin >> op >> a >> b;
if(op == 'M'){
//a=x,b=studentA
s.insert({b,a});
m++;
}
if(op == 'D'){
//a=Y,b=B >=Bstu,smallest station stu
//小於等於Y站的ID(b)y最小的->order(k)if *it.second <= b;
int k = 0;
while(k < m){
auto it = s.find_by_order(k);
if( it->second <= a && it->first >= b){
cout << it->first << endl;//<< " " << it->second << "("<< a << "," << b << ")" << endl;
break;
}
k++;
}
if(k == m) cout << -1 << endl;
}
q--;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
40 ms |
476 KB |
Output is correct |
4 |
Correct |
721 ms |
1464 KB |
Output is correct |
5 |
Execution timed out |
1065 ms |
936 KB |
Time limit exceeded |
6 |
Execution timed out |
1056 ms |
952 KB |
Time limit exceeded |
7 |
Execution timed out |
1034 ms |
1044 KB |
Time limit exceeded |