Hi.
I just started to write a program with MAP and PAIR but I had some problems with it. I wanted to keep some pairs and wanted to later find them in O(lgn) so I wrote the code below :
int main () {
int i,n,x,y,counter;
counter=0;
scanf("%d",&n);
for (i=0;i<n;i++) {
scanf("%d %d",&x,&y);
if (mapx.find(pairx(x,y))==mapx.end()) {
mapx[pairx(x,y)]=counter++;
}
}
scanf("%d %d",&x,&y);
printf("%d\n",mapx[pairx(x,y)]);
return 0;
}
I am a beginner and I know :D and I would be glad if anyone can help me ;).
Sorry for being too talkative
Oops the key type was pairx But still has bunch of compilation errors