๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.61K photos
3 videos
95 files
10.6K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll M = 1e9+7 ;

int main() {

    ll n;cin>>n ;
    vector<ll> v(31) ;
    for(ll i = 1;i<=n;i++){
      ll x;cin>>x ;
      v[x]++ ;
    }
    vector<ll> p ;
    for(ll i = 2;i<=30;i++){
      bool ch = 1 ;
      for(ll j = 2;j*j<=i;j++){
        if(i%(j*j)==0)ch = 0 ;
      }
      if(ch)p.push_back(i) ;
    }
    ll one = 1 ;
    while(v[1]){
      one = one*2%M ;
      v[1]-- ;
    }
    n = p.size() ;
    ll ans = 0 ;
    for(ll i = 1;i<(1ll<<n);i++){
      ll pro = 1 ;
      ll tot = 1 ;
      bool ch = 1 ;
     
      for(ll j =0;j<n;j++){
        if((1ll<<j)&i){
          if(__gcd(pro,p[j])!=1){
            ch = 0 ;
            break;
          }
          pro = pro*p[j] ;
          tot = tot*v[p[j]]%M ;
        }
      }
     
      tot = tot*(one)%M ;
      if(ch){
        ans += tot ;
        ans %= M ;
      }
    }
    cout<<(ans+M)%M<<endl;
   

    return 0;

  }

  }
omega prime
media .netโœ…
from collections import deque
def timeOfBuffering(arrivalRate, packets):
    buffer = deque()
    current = 1
    time = 0

    for i in range(0, len(packets), arrivalRate):
        time += 1

        for j in range(i, min(i + arrivalRate, len(packets))):
            packet = packets[j]
            if packet != current:
                buffer.append(packet)

        if current in buffer:
            buffer.remove(current)
        elif current == packets[i]:
            pass
        else:
            return time

        current += 1

    return -1


Video Buffering โœ…
๐Ÿ‘2
def maxProfit(cost, x):
    ans = 0
    mod = 10 ** 9 + 7
    for i in range(len(cost) - 1, -1, -1):
        if cost[i] <= x:
            x -= cost[i]
            ans = (ans + pow(2, i, mod)) % mod
    return ans