arjun17's blog

By arjun17, history, 6 years ago, In English

Is there any way for checking a point strictly inside a convex polygon in O(1)?

I know the logarithm technique.

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it

By arjun17, history, 6 years ago, In English

How can I get all divisors of a number using Pollard Rho Algorithm?

Thanks in advance.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By arjun17, history, 6 years ago, In English

How inclusion exclusion is related with Mobius function ? In F.Relatively Prime Powers judge solution with Mobius function.

Can anyone help me get the trick for this problem with Mobius function ?

Full text and comments »

  • Vote: I like it
  • +16
  • Vote: I do not like it

By arjun17, history, 6 years ago, In English

Think any one have collection of function in a header file. How it can be use in Codeforces submission?

Thanks in advance.

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it

By arjun17, history, 6 years ago, In English
#include <bits/stdc++.h>
using namespace std;

const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
/*const long long RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();*/


struct HASH {
    template <class T>
    T operator()(T x) const { 
        return hash<T>{}(x ^ RANDOM ); 
    }
};

int main(int argc, char const *argv[])
{
    unordered_map<int, int, HASH> table;
    /* unordered_map<long long, int, HASH> table; */

    return 0;
}

I'm implementing own hash function in unordered_map and facing a problem.

If my map key is int type I've to write const int RANDOM

If my map key is long long type I've to write const long long RANDOM

blah blah ......

How it can be better using Template?

Full text and comments »

  • Vote: I like it
  • -2
  • Vote: I do not like it