Skip to content

Instantly share code, notes, and snippets.

@sandes
Last active November 5, 2019 20:02
Show Gist options
  • Save sandes/81d913d9cf8664c862ee to your computer and use it in GitHub Desktop.
Save sandes/81d913d9cf8664c862ee to your computer and use it in GitHub Desktop.
#include <iostream>
#include <map>
using namespace std;
typedef map<int,int> map_p;
bool areinverse(map_p M1, map_p M2){
if(M1.size()!=M2.size()) return false;
map_p::iterator p = M1.begin();
while(p!=M1.end()){
if(M2.find(p->second)!=M2.end()){
if(M2[p->second]!=p->first) return false;
}else
return false;
p++;
}
return true;
}
int main(int argc, char *argv[]) {
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment