-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathCoordinate_Com.cpp
More file actions
52 lines (47 loc) · 943 Bytes
/
Coordinate_Com.cpp
File metadata and controls
52 lines (47 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <bits/stdc++.h>
using namespace std;
#define lli long long
#define vi vector<int>
#define mod 1000000007
struct Coordinate_Compress{
map<lli,lli>compVal;
vi rev;
int cnt;
void add(lli x){
compVal[x];
}
void build(){
cnt=0;
for(auto &v: compVal){
rev.emplace_back(v.first);
v.second= cnt++;
}
}
inline lli getComp(lli x){
return compVal[x];
}
inline lli getOrig(lli x){
return rev[x];
}
lli getPrev(lli x){
auto it = compVal.upper_bound(x);
it--;
return it->second;
}
lli getPrev(lli x){
auto it = compVal.lower_bound(x);
return it->second;
}
};
void shiv_prime94(){
}
int main() {
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
lli test=1;
cin>>test;
while(test--)
{
shiv_prime94();
}
return 0;
}