Dream_Coder10's blog

By Dream_Coder10, history, 3 years ago, In English

How can I generate all prime numbers in range 1-10^12...

==================

I Tried with segmeted sieve, but I am not getting values over 10^6... Please give me the instructions or the modified segmented sieve code(it will be really helpful if you give me the code) so that I can learn by debugging it..!!

Problem => https://paste.ubuntu.com/p/TGd3NrfJS8/

Thanks in Advance..!!

Full text and comments »

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

By Dream_Coder10, history, 3 years ago, In English

why moduler multiplicative inverse is not working under modulo 1000000007 by fermats littile theorem ? let n=11 & k=3 ; n/k should be equal to 3. but its giving me 666666675. same thing goes for n=10 & k=4;

problem:

https://paste.ubuntu.com/p/vgTZcHQ8Rv/

my code:

https://paste.ubuntu.com/p/s2m5q4JtMs/

Full text and comments »

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

By Dream_Coder10, history, 3 years ago, In English

Suppose there are two number n & k where 1 <= k <= n <= 1e9 . Now I have to calculate n/k (modulo 1e9 + 7)

==========================================================================================================================

My approach:

I used fermats little theorem to calculate moduler multiplecative inverse & then i printed n*(moduler multiplecitive inv.); But in this approach many test cases like "n=11,k=3" or "n=10 ,k=4" are not working properly & giving me wrong answer..

problem: ( https://paste.ubuntu.com/p/vgTZcHQ8Rv/ ) what I have to modify in this code ( https://paste.ubuntu.com/p/T2h9CsjpXx/ )?

Thanks in advance

Full text and comments »

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

By Dream_Coder10, history, 4 years ago, In English

(https://codeforces.com/contest/1360/submission/90406376)

In this submission "char a[60][60]" written before "int main()" and for two dimensional character array inpute taken in one dimensionally...

I wrote char a [60][60] inside "int main()" & took input in two dimensionally "cin>> a[i][j]" , I did not get any errors in my compiler(codeblocks) but Codeforces Showed me judgemental error..... But after submitting the above code,it has accepted!!!....

Can anyone explain me why this has happened?

Full text and comments »

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

By Dream_Coder10, history, 4 years ago, In English

How to block a user? Or how to hide from the user? Or how can I change my handle?

Full text and comments »

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