ruhan.habib39's blog

By ruhan.habib39, history, 4 years ago, In English,

Hello All! Since APIO is coming, and, well, we need practice, I've created a contest at HackerRank with problems from APIO 2012. The contest will be a five hour contest, and will start from 16:00 UTC+6. The contest link: Contest Link

And sorry if I made any mistakes.

Read more »

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

By ruhan.habib39, history, 4 years ago, In English,

What's the name of the following algorithm:

const int MAXN = 100*1000;
unordered_map<int,int> factors[MAXN+10];
vector<bool> isprime(MAXN+10, true);
int primeFactor[MAXN+10];

void init() {
   isprime[0] = isprime[1] = false;
   for(int i = 2; i*i <= MAXN; i++) {
     if(isprime[i]) {
       for(int j = i*i; j <= MAXM; j += i) {
          isprime[j] = false;
          primeFactor[j] = i;
       }
     }
   }
   for(int i = 2; i <= MAXM; i++) {
     if(isprime[i]) factors[i][i] = 1;
     else {
       int dv = primeFactor[i];
       factors[i] = factors[i/dv];
       factors[i][dv]++;
     }
   }
}

Read more »

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

By ruhan.habib39, history, 4 years ago, In English,

Hello friends! Codeforces is a great website, and it has lots of features. Though the features are enough for me, what about country based ranking during contests like Codeforces Round? Adding a country based ranking during contest may be cool, isn't it?

Read more »

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