๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
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 โ
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 <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 โ
#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โ
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โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
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
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
Zoom Video
Join our Cloud HD Video Meeting
Zoom is the leader in modern enterprise video communications, with an easy, reliable cloud platform for video and audio conferencing, chat, and webinars across mobile, desktop, and room systems. Zoom Rooms is the original software-based conference room solutionโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Send resume at : aayushar@qti.qualcomm.com ( Recruiter Mail )
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐ 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
โจ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
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐PhonePe is hiring for Site Reliability Engineer - System Engineer
Experience: 0 - 2 year's
Expected Salary: 15-25 LPA
Apply here:
https://boards.greenhouse.io/embed/job_app?token=5921398003&gh_src=961e65dc3us
Experience: 0 - 2 year's
Expected Salary: 15-25 LPA
Apply here:
https://boards.greenhouse.io/embed/job_app?token=5921398003&gh_src=961e65dc3us
boards.greenhouse.io
Site Reliability Engineer
Bangalore
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
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
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
Forwarded from ๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Guys Maybe Telegram Will Banned Soon In India
We Have Second Option That Is WhatsApp Channel
So, We Have Created a WhatsApp Channel
โ๏ธ WhatsApp Channel Link : https://whatsapp.com/channel/0029Vam1NUC7tkj7UpHG9w2p
We Have Second Option That Is WhatsApp Channel
So, We Have Created a WhatsApp Channel
โ๏ธ WhatsApp Channel Link : https://whatsapp.com/channel/0029Vam1NUC7tkj7UpHG9w2p
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Email: hr@aiindia.ai
๐1