Skip to main content

Posts

Showing posts from August, 2022

Codeforces Round #816 (Div. 2) (A. Crossmarket)

Bismillahir Rahmanir Rahim ///Author: Tanvir Ahmmad ///CSE,Islamic University,Bangladesh #include< iostream > #include< cstdio > #include< algorithm > #include< string > #include< cstring > #include< sstream > #include< cmath > #include< cstring > #include< vector > #include< queue > #include< map > #include< set > #include< stack > #include< vector > #include< iterator > #include   < functional >   ///sort(arr,arr+n,greater<int>()) for decrement of array /*every external angle sum=360 degree   angle find using polygon hand(n) ((n-2)*180)/n*/ ///Floor[Log(b)  N] + 1 = the number of digits when any number is represented in base b using   namespace  std; typedef   long   long ...

Codeforces Round #816 (Div. 2) (B. Beautiful Array)

Bismillahir Rahmanir Rahim ///Author: Tanvir Ahmmad ///CSE,Islamic University,Bangladesh #include< iostream > #include< cstdio > #include< algorithm > #include< string > #include< cstring > #include< sstream > #include< cmath > #include< cstring > #include< vector > #include< queue > #include< map > #include< set > #include< stack > #include< vector > #include< iterator > #include   < functional >   ///sort(arr,arr+n,greater<int>()) for decrement of array /*every external angle sum=360 degree   angle find using polygon hand(n) ((n-2)*180)/n*/ ///Floor[Log(b)  N] + 1 = the number of digits when any number is represented in base b using   namespace  std; typedef   long   long ...

Manthan, Codefest 16 (B. A Trivial Problem)

  Bismillahir Rahmanir Rahim Count how many fives because  5 * 2 = 10 ///Author: Tanvir Ahmmad ///CSE,Islamic University,Bangladesh #include< iostream > #include< cstdio > #include< algorithm > #include< string > #include< cstring > #include< sstream > #include< cmath > #include< cstring > #include< vector > #include< queue > #include< map > #include< set > #include< stack > #include< vector > #include< iterator > #include   < functional >   ///sort(arr,arr+n,greater<int>()) for decrement of array /*every external angle sum=360 degree   angle find using polygon hand(n) ((n-2)*180)/n*/ ///Floor[Log(b)  N] + 1 = the number of digits when any number is represented in base...

Codeforces Round #696 (Div. 2) (B. Different Divisors)

Bismillahir Rahmanir Rahim   We think given number is  381 .so distance between output ' s divisor is minimum  381 . We need to find a prime  382  or after that. if  we get the prime then we again add  381  with that prime number. then  this  or after  this  number prime is allowed. so like the  1 ->( 1 + 381 )= 382 ..untill get the prime.. . 383 ->( 383 + 381 )= 764 ..untill get the prime.. . 769 ->( 769 * 383 )= 294527 Output is 294527. ///Author: Tanvir Ahmmad ///CSE,Islamic University,Bangladesh #include< iostream > #include< cstdio > #include< algorithm > #include< string > #include< cstring > #include< sstream > #include< cmath > #include< cstring ...

Technocup 2018 - Elimination Round 2 (C. Maximum splitting)

  Bismillahir Rahmanir Rahim 4  is the lowest composite number so we must think about  4  divisibility( 0 - 3 ) Case  1 : if  number  divided by  4  the it is  OK Case  2 :After dividing  4  the number it ' s reminder is  1  then        num= 1  output is (- 1 ).        num= 5  output is (- 1 ).        after that  number is  9  other is  4 .alike  13 = 9 + 4   21 = 9 + 4 + 4 + 4 Case  3 :After dividing  4  the number it ' s reminder is  2  then        num= 2  output is (- 1 ).        after that  number...

CodeTON Round 1 (Div. 1 + Div. 2, Rated, Prizes!) (C. Make Equal With Mod)

Bismillahir Rahmanir Rahim   Thinking like a CUP_CAKE: Example  1 :  1   8   9  whatever we will  do  output is still  NO Example  2 :  0   8   9  first mod  9  then mod  8  after that  0   0   0 .So output is   YES Example  3 :  1   5   8  first mod  7  then mod  4  after that  1   1   1 .So output is  YES Example  4 :  0   5   8  first mod  8  then mod  5  after that  0   0   0 .So output is  YES Only the  consecutively elements &  1  remaining  makes the output of  this   array ' s output NO. ///Author: Tanvir Ahmmad ///CSE,Islamic University...

Codeforces Round #485 (Div. 2) (B. High School: Become Human)

Bismillahir Rahmanir Rahim If x and y are large numbers, you can use logarithms: Comparing x^y versus y^x means comparing y*log(x) versus x*log(y) ///Author: Tanvir Ahmmad ///CSE,Islamic University,Bangladesh #include< iostream > #include< cstdio > #include< algorithm > #include< string > #include< cstring > #include< sstream > #include< cmath > #include< cstring > #include< vector > #include< queue > #include< map > #include< set > #include< stack > #include< vector > #include< iterator > #include   < functional >   ///sort(arr,arr+n,greater<int>()) for decrement of array /*every external angle sum=360 degree   angle find using polygon hand(n) ((n-2)*180)/n*/ ///Floor[Log(b)  N]...

Light OJ -- 1214(Large Division)

Bismillahir Rahmanir Rahim ///Author: Tanvir Ahmmad ///CSE,Islamic University,Bangladesh #include< iostream > #include< cstdio > #include< algorithm > #include< string > #include< cstring > #include< sstream > #include< cmath > #include< cstring > #include< vector > #include< queue > #include< map > #include< set > #include< stack > #include< vector > #include< iterator > #include   < functional >   ///sort(arr,arr+n,greater<int>()) for decrement of array /*every external angle sum=360 degree   angle find using polygon hand(n) ((n-2)*180)/n*/ ///Floor[Log(b)  N] + 1 = the number of digits when any number is represented in base b using   namespace  std; typedef   long   long ...

Codecraft-17 and Codeforces Round #391 (Div. 1 + Div. 2, combined) (B. Bash's Big Day)

  Bismillahir Rahmanir Rahim ///Author: Tanvir Ahmmad ///CSE,Islamic University,Bangladesh #include< iostream > #include< cstdio > #include< algorithm > #include< string > #include< cstring > #include< sstream > #include< cmath > #include< cstring > #include< vector > #include< queue > #include< map > #include< set > #include< stack > #include< vector > #include< iterator > #include   < functional >   ///sort(arr,arr+n,greater<int>()) for decrement of array /*every external angle sum=360 degree   angle find using polygon hand(n) ((n-2)*180)/n*/ ///Floor[Log(b)  N] + 1 = the number of digits when any number is represented in base b using   namespace  std; typedef   long  ...