Posts

Showing posts from August, 2021

Maximise the Subsequence Sum Problem Code: SIGNFLIP Codechef Solution

Maximise the Subsequence Sum  Problem Code:  SIGNFLIP Solution In C++ #include<bits/stdc++.h> #include<cstring> using namespace std; #define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);  #define Mod 1000000007 #define ll long long #define vi vector<ll> #define pb push_back #define F first #define S second #define all(v) (v).begin(),(v).end() #define pii pair<ll,ll> #define vii vector<pii> #define calc_fact(n) tgamma(n+1) #define inf LONG_LONG_MAX #define mod 3e5 #define ar array #define mp make_pair; ll power(ll x, ll y) {          ll res = 1;      while (y)     {          if (y % 2 == 1)             res = (res * x);         y = y >> 1;         x = (x * x);     }     return res; } int digitCount(ll n) {   int count = 0;   while(n)   {     count++;     n = n/10;   }   return count; } ll is_prime(ll n) {   for(ll i=2; i*i <= n; i++)   {     if(n%i == 0)       return false;   }   return true; } long long int lastDigit(ll n)

Wait For Solutions

Image
  Solution Will Be posted when the Previous Posts reaches 1k Views Please wait patiently. We are coders so we need to code .