Skip to content

Instantly share code, notes, and snippets.

@greenbagels
Last active July 27, 2016 04:07
Show Gist options
  • Save greenbagels/bae6950a74ef431b43ab26403bae90e0 to your computer and use it in GitHub Desktop.
Save greenbagels/bae6950a74ef431b43ab26403bae90e0 to your computer and use it in GitHub Desktop.
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;using v=std::vector<int>;string escape(v j,int i){v h;do{h.push_back(i);try{if(i<=1?0:!((lround(tgamma(i))+1)%i)){i-=j[i];}else{i=j[i];}}catch(const out_of_range& e){cerr<<i;}}while(find(h.begin(),h.end(),i)!=h.end());return string("false");}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment