๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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;
bool isEnough(int mid, int N, int targetCount) {
    int count = 0;
    for (int i = 1; i <= N; ++i) {
        count += min(N, mid / i);
    }
    return count >= targetCount;
}

string solve(int N) {
    int totalElements = N * N;
    int targetCount = (totalElements + 1) / 2; 
    int low = 1, high = N * N;
   
    while (low < high) {
        int mid = (low + high) / 2;
        if (isEnough(mid, N, targetCount)) {
            high = mid;
        } else {
            low = mid + 1;
        }
    }
   
    return to_string(low);
}

int main() {
    int N;
    cin >> N;

    string median = solve(N);
    cout << median << endl;

    return 0;
}


Infoedge โœ…
#include <bits/stdc++.h>
using namespace std;
int solve(const vector<int>& nums, int factor) {
    int low = -1;
    int high = nums.size() - 1;
        while (low < high) {
        int mid = (low + high + 1) / 2;
        if (nums[mid] < factor) {
            low = mid; 
        } else {
            high = mid - 1;
        }
    }
    return (low == -1) ? 0 : nums[low]; 
}

int main() {
    int N, m;
    cin >> N >> m;
   
    vector<int> nums(m);
    for (int i = 0; i < m; ++i) {
        cin >> nums[i];
    }
   
    sort(nums.begin(), nums.end());
    int s = 0;
        for (int i = 1; i <= sqrt(N); ++i) {
        if (N % i == 0) {
            s += solve(nums, i);
            if (i != N / i) {
                s += solve(nums, N / i);
            }
        }
    }
   
    cout << s << endl;
   
    return 0;
}


FACTOR LOWER BOUNDโœ…
Infoedge
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int t = sc.nextInt();
        int[][] tasks = new int[n][2];
        for (int i = 0; i < n; i++) {
            tasks[i][0] = sc.nextInt();
            tasks[i][1] = sc.nextInt();
        }
        t = sc.nextInt();
        int newTaskStart = sc.nextInt();
        int newTaskEnd = sc.nextInt();
        int k = sc.nextInt();
        System.out.println(isTaskPossible(tasks, n, newTaskStart, newTaskEnd, k) ? 1 : 0);
    }

    static boolean isTaskPossible(int[][] tasks, int n, int newTaskStart, int newTaskEnd, int k) {
        List<int[]> intervals = new ArrayList<>();
        for (int[] task : tasks) {
            intervals.add(new int[]{task[0], 1});
            intervals.add(new int[]{task[1], -1});
        }
        intervals.add(new int[]{newTaskStart, 1});
        intervals.add(new int[]{newTaskEnd, -1});

        intervals.sort((a, b) -> a[0] == b[0] ? Integer.compare(a[1], b[1]) : Integer.compare(a[0], b[0]));

        int count = 0;
        for (int[] interval : intervals) {
            count += interval[1];
            if (count > k) {
                return false;
            }
        }
        return true;
    }
}

Infoedge โœ…
#define ll long long

#include <bits/stdc++.h>
using namespace std;

bool isEnough(ll mid, ll N, ll targetCount) {
    ll count = 0;
    for (ll i = 1; i <= N; ++i) {
        count += min(N, mid / i);
    }
    return count >= targetCount;
}

string solve(ll N) {
    ll totalElements = N * N;
    ll targetCount = (totalElements + 1) / 2;
    ll low = 1, high = N * N;
    while (low < high) {
        ll mid = (low + high) / 2;
        if (isEnough(mid, N, targetCount)) {
            high = mid;
        } else {
            low = mid + 1;
        }
    }
    return to_string(low);
}

int main() {
    ll N;
    cin >> N;
    string median = solve(N);
    cout << median << endl;
    return 0;
}

Greek
Infoedge โœ…
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int N, m;
    cin >> N >> m;
    vector<int> nums(m);
    for (int i = 0; i < m; i++) {
        cin >> nums[i];
    }

    sort(nums.begin(), nums.end());

    int sum = 0;
    for (int i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            auto it1 = lower_bound(nums.begin(), nums.end(), i);
            if (it1 != nums.begin()) sum += *(--it1);
            if (i != N / i) {
                auto it2 = lower_bound(nums.begin(), nums.end(), N / i);
                if (it2 != nums.begin()) sum += *(--it2);
            }
        }
    }

    cout << sum << endl;
    return 0;
}


// Indian Geek โœ…
def specialBinaryTree(arr):
    from collections import Counter
    freq = Counter(arr)
    min_val, max_val = min(arr), max(arr)
    count = 0
   
    for root in range(min_val, max_val + 1):
        l, r = min_val, max_val
        while l <= r:
            s = l + r
            if s == 2 * root:
                count += freq[l] * freq[r] if l != r else freq[l] * (freq[l] - 1) // 2
                l += 1
                r -= 1
            elif s < 2 * root:
                l += 1
            else:
                r -= 1

    return count
Special binary treeโœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
import java.util.*;

public class Main {
    private static final int MOD = 1000000007;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int k = scanner.nextInt();
        int n = scanner.nextInt();
        int[] power = new int[n];
        for (int i = 0; i < n; i++) {
            power[i] = scanner.nextInt();
        }
        PriorityQueue<Integer> maxHeap = new PriorityQueue<>(Collections.reverseOrder());
        for (int i = 0; i < n; i++) {
            int maxPower = power[i];
            for (int j = i; j < n; j++) {
                if (power[j] > maxPower) {
                    maxPower = power[j];
                }
                maxHeap.add(maxPower);
            }
        }
        long totalPower = 0;
        for (int i = 0; i < k && !maxHeap.isEmpty(); i++) {
            totalPower = (totalPower + maxHeap.poll()) % MOD;
        }

        System.out.println(totalPower);
    }
}


Dr Usual and mystic herbsโœ…
We have open roles for Genpact for Voice Process at Noida. โค๏ธโค๏ธโค๏ธ

Any Graduate is eligible

Salary: 5 to 7 LPA

Skills/Requirements:
1. Clear and articulate verbal communication to interact effectively with customers.
2. Good listening skills to understand and respond to customer needs.
3. Ability to handle customer inquiries, provide information, and resolve issues professionally.

Date of Interview: 29th August, 2024.

Time 11:00 AM to 1PM

Zoom id: https://genpact.zoom.us/j/3545711001
Happy Janmashtami everyoneโค๏ธ๐Ÿชˆ๐Ÿฆš! On this auspicious occasion of Janmashtami, may Lord Krishna remove all obstacles from your path and lead you to your dream job. Happy Janmashtami! Jai Shree Krishna! ๐ŸŒธ๐Ÿ™๐Ÿฆšโค๏ธ
โค7๐ŸŽ‰5
๐Ÿ“Œ Company: Bluetris Technologies

โœจExciting Opportunity for DevOps freshers in Jaipur!

๐Ÿ”น Position: DevOps Engineer
(0-6 Months Experience)
๐Ÿ”น Location: Jaipur

Key Skills:
- Understanding of DevOps principles and practices
- Experience with tools like Docker,    Kubernetes, Jenkins, and Git
- Knowledge of cloud platforms (AWS, Azure, GCP) is a plus
- Strong problem-solving skills and a proactive attitude

๐Ÿ“ฉ To Apply: Send your resume to Khushi.bumb@bluetris.com
 If you are an MBA passed out from 2023/2024 Batch, working in Supply Chain Industry Interests you, Here is the opportunity....!!
Join Us and become part of a Dynamic team.

Criteria :MBA Operations or Supply chain management (Mandate)
Job Location - Bangalore

Interested applicants kindly share your CV at Meghana.kumar@dhl.com /
komma.teja@dhl.com
Hiring Period โ€“ 27th Aug 2024 to 28th Aug 2024