ll cmp(const void *a, const void *b) {
return (*(ll*)a - *(ll*)b);
}
ll solve(vector<ll> a, ll k) {
ll n = a.size();
if (k < 2 || n < 2 * k - 1) return -1;
vector<ll> s = a;
qsort(s.data(), n, sizeof(ll), cmp);
for (ll t = k - 1; t < n; ++t) {
ll i = -1;
while (a[++i] != s[t]);
ll sz = 1;
ll li = i;
for (ll u = i; u >= 0; --u) {
if (u < li - 1 && a[u] <= s[t]) {
++sz;
li = u;
}
if (sz >= k) return s[t];
}
li = i;
for (ll u = i; u < n; ++u) {
if (u > li + 1 && a[u] <= s[t]) {
++sz;
li = u;
}
if (sz >= k) return s[t];
}
}
return -1;
}
//vulnerability
return (*(ll*)a - *(ll*)b);
}
ll solve(vector<ll> a, ll k) {
ll n = a.size();
if (k < 2 || n < 2 * k - 1) return -1;
vector<ll> s = a;
qsort(s.data(), n, sizeof(ll), cmp);
for (ll t = k - 1; t < n; ++t) {
ll i = -1;
while (a[++i] != s[t]);
ll sz = 1;
ll li = i;
for (ll u = i; u >= 0; --u) {
if (u < li - 1 && a[u] <= s[t]) {
++sz;
li = u;
}
if (sz >= k) return s[t];
}
li = i;
for (ll u = i; u < n; ++u) {
if (u > li + 1 && a[u] <= s[t]) {
++sz;
li = u;
}
if (sz >= k) return s[t];
}
}
return -1;
}
//vulnerability
def solution(menu, order):
t_cost = 0
for item in order:
pizza = next(p for p in menu if p.name == item.name)
price = getattr(pizza, f'price_{item.size[0]}')
total_cost += price * item.quantity
total_pizzas = sum(item.quantity for item in order)
if total_pizzas >= 3:
cheapest_price = min(getattr(next(p for p in menu if p.name == item.name), f'price_{item.size[0]}')
for item in order)
discounted_cost = t_cost - cheapest_price
return min(t_cost, discounted_cost)
return t_cost
def findMaxLength(str1, str2, str3):
m, n = len(str1), len(str2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for i in range(1, m + 1):
for j in range(1, n + 1):
if str1[i-1] == str2[j-1]:
if not has_common_substring(str1[:i], str2[:j], str3):
dp[i][j] = dp[i-1][j-1] + 1
else:
dp[i][j] = max(dp[i-1][j], dp[i][j-1])
else:
dp[i][j] = max(dp[i-1][j], dp[i][j-1])
return dp[m][n]
def has_common_substring(s1, s2, s3):
if len(s1) >= 2 and len(s2) >= 2:
last_two = s1[-2:]
if last_two in s3 and last_two == s2[-2:]:
return True
return False
DE Shaw โ
m, n = len(str1), len(str2)
dp = [[0] * (n + 1) for _ in range(m + 1)]
for i in range(1, m + 1):
for j in range(1, n + 1):
if str1[i-1] == str2[j-1]:
if not has_common_substring(str1[:i], str2[:j], str3):
dp[i][j] = dp[i-1][j-1] + 1
else:
dp[i][j] = max(dp[i-1][j], dp[i][j-1])
else:
dp[i][j] = max(dp[i-1][j], dp[i][j-1])
return dp[m][n]
def has_common_substring(s1, s2, s3):
if len(s1) >= 2 and len(s2) >= 2:
last_two = s1[-2:]
if last_two in s3 and last_two == s2[-2:]:
return True
return False
DE Shaw โ
๐1
def isPrime(n):
if n < 2:
return False
for i in range(2, int(n**0.5) + 1):
if n % i == 0:
return False
return True
def endsWithThree(n):
return n % 10 == 3
def maxGameScore(cell):
n = len(cell)
dp = [float('-inf')] * n
dp[0] = cell[0]
for i in range(1, n):
dp[i] = max(dp[i], dp[i-1] + cell[i])
for j in range(i):
jump = i - j
if isPrime(jump) and endsWithThree(jump):
dp[i] = max(dp[i], dp[j] + cell[i])
return dp[n-1]
Prime jumps โ
class GPUAllocator
{
private:
set<int> free;
unordered_map<int, int> mp;
int n;
public:
GPUAllocator()
{
n = 1;
free.insert(1);
}
void addProcess(int process_id)
{
int t = *free.begin();
free.erase(free.begin());
mp[process_id] = t;
free.insert(n++);
}
void removeProcess(int process_id)
{
int gpuId = mp[process_id];
mp.erase(process_id);
free.insert(gpuId);
}
int smallestUnoccupied()
{
return *free.begin();
}
};
{
private:
set<int> free;
unordered_map<int, int> mp;
int n;
public:
GPUAllocator()
{
n = 1;
free.insert(1);
}
void addProcess(int process_id)
{
int t = *free.begin();
free.erase(free.begin());
mp[process_id] = t;
free.insert(n++);
}
void removeProcess(int process_id)
{
int gpuId = mp[process_id];
mp.erase(process_id);
free.insert(gpuId);
}
int smallestUnoccupied()
{
return *free.begin();
}
};
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
import java.util.*;
public class Main {
private static int solve(List<Integer> subset) {
if (subset.isEmpty()) return 0;
int result = subset.get(0);
int n = subset.size();
int opIndex = 0;
for (int i = 1; i < n; i++) {
int num = subset.get(i);
switch (opIndex) {
case 0:
result ^= num;
break;
case 1:
result += num;
break;
case 2:
result |= num;
break;
}
opIndex = (opIndex + 1) % 3;
}
return result;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
for (int t = 0; t < T; t++) {
int N = sc.nextInt();
List<Integer> numbers = new ArrayList<>();
for (int i = 0; i < N; i++) {
numbers.add(sc.nextInt());
}
int maxResult = Integer.MIN_VALUE;
for (int i = 1; i < (1 << N); i++) {
List<Integer> subset = new ArrayList<>();
for (int j = 0; j < N; j++) {
if ((i & (1 << j)) > 0) {
subset.add(numbers.get(j));
}
}
int result = solve(subset);
maxResult = Math.max(maxResult, result);
}
if (maxResult % 2 == 0) {
System.out.println("Even");
} else {
System.out.println("Odd");
}
}
sc.close();
}
}
Samraj and Bits โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
DevOps Freshers Virtual Walk-In Drive - 2024 ll SourceFuse Technologies
10k stipend amount for 6 months and if you cleared the training period it will be 4.5 lpa package as your CTC
2023/2024 batches eligible
https://docs.google.com/forms/d/e/1FAIpQLSeB24ALMihKzLcRSUyBbLqvoBTTLeKopnIE58QqLobQ5ctHEQ/viewform
10k stipend amount for 6 months and if you cleared the training period it will be 4.5 lpa package as your CTC
2023/2024 batches eligible
https://docs.google.com/forms/d/e/1FAIpQLSeB24ALMihKzLcRSUyBbLqvoBTTLeKopnIE58QqLobQ5ctHEQ/viewform
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
.: Dear 2025 grads
If you want Genpact to visit your campus then forward this form to your placement cell/TPO
https://forms.office.com/r/r6efN9nGWA
.: Data science/ML internship(Remote)
At Hey Doc AI
Stipend 12k-18k (based on your performance)
Apply at
https://forms.gle/yWxAPF4TupxSyYJ28
: Baker Huges for summer internship 2025/2026 grads
https://careers.bakerhughes.com/global/en/job/BAHUGLOBALR124156/Summer-Internships-2025-India
If you want Genpact to visit your campus then forward this form to your placement cell/TPO
https://forms.office.com/r/r6efN9nGWA
.: Data science/ML internship(Remote)
At Hey Doc AI
Stipend 12k-18k (based on your performance)
Apply at
https://forms.gle/yWxAPF4TupxSyYJ28
: Baker Huges for summer internship 2025/2026 grads
https://careers.bakerhughes.com/global/en/job/BAHUGLOBALR124156/Summer-Internships-2025-India
Office
Please fill out this form
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Wissen Technology Referrals
Batch - 2024
https://www.linkedin.com/posts/pranav-jambare_hey-folks-wissen-technology-is-hiring-activity-7221722013172658176-nNP-
Batch - 2024
https://www.linkedin.com/posts/pranav-jambare_hey-folks-wissen-technology-is-hiring-activity-7221722013172658176-nNP-
Linkedin
Pranav Jambare on LinkedIn: Hey Folks!!
Wissen Technology is hiring Java Developers freshers [ 2024โฆ | 117 comments
Wissen Technology is hiring Java Developers freshers [ 2024โฆ | 117 comments
Hey Folks!!
Wissen Technology is hiring Java Developers freshers [ 2024 Passout ].
Criteria:
CGPA: 7.5 and above, no backlogs
Branch is CS, IT or similarโฆ | 117 comments on LinkedIn
Wissen Technology is hiring Java Developers freshers [ 2024 Passout ].
Criteria:
CGPA: 7.5 and above, no backlogs
Branch is CS, IT or similarโฆ | 117 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Check out this job at EMotorad: https://www.linkedin.com/jobs/view/3981429179
Linkedin
EMotorad hiring Executive To The CPTO Intern in Bengaluru, Karnataka, India | LinkedIn
Posted 5:24:24 AM. Job Title: Executive To The CPTO InternLocation: Bangalore (Onsite)Duration: 6 MonthsCompany:โฆSee this and similar jobs on LinkedIn.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Boston Consulting Group (BCG)
is hiring for Product Analyst Internship
You Bring:
โข Degree in Business, Data Analytics, Computer Science, or related fields
โข Experience with Excel, SQL, Tableau, Power BI
Join us and be part of a team that values innovation and collaboration.
JDs and application links for all roles are below :
- https://lnkd.in/gRbNqVnz
- https://lnkd.in/ghNjWdHu
- https://lnkd.in/gtMtWuWH
- https://lnkd.in/ge_-ZArP
- https://lnkd.in/gG6WdwFQ
- https://lnkd.in/gDf4fJig
Batches : 2025/2024/2023 passouts.
is hiring for Product Analyst Internship
You Bring:
โข Degree in Business, Data Analytics, Computer Science, or related fields
โข Experience with Excel, SQL, Tableau, Power BI
Join us and be part of a team that values innovation and collaboration.
JDs and application links for all roles are below :
- https://lnkd.in/gRbNqVnz
- https://lnkd.in/ghNjWdHu
- https://lnkd.in/gtMtWuWH
- https://lnkd.in/ge_-ZArP
- https://lnkd.in/gG6WdwFQ
- https://lnkd.in/gDf4fJig
Batches : 2025/2024/2023 passouts.
lnkd.in
LinkedIn
This link will take you to a page thatโs not on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Atoa Software hiring for Quality Analyst Intern
2025/2024 passouts
Bangalore location
https://paywithatoa.zohorecruit.in/jobs/Careers/104237000000776494/Quality-Assurance---Intern?source=CareerSite
2025/2024 passouts
Bangalore location
https://paywithatoa.zohorecruit.in/jobs/Careers/104237000000776494/Quality-Assurance---Intern?source=CareerSite
Atoa software development pvt
Atoa software development pvt - Quality Assurance - Intern in Bangalore
Atoa software development pvt Working at Atoa We are driven by passion, you will be working in a team with high ownership and you will get exposure to
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Bharti Airtel Scholarship
A merit-cum-means based scholarship program has been designed for students enrolled in technology based engineering undergraduate (UG) courses and 5-year integrated programs (as per the eligibility criteria) in the top 50 NIRF Engineering institutes including IITs
https://bhartifoundation.org/bharti-airtel-scholarship/
A merit-cum-means based scholarship program has been designed for students enrolled in technology based engineering undergraduate (UG) courses and 5-year integrated programs (as per the eligibility criteria) in the top 50 NIRF Engineering institutes including IITs
https://bhartifoundation.org/bharti-airtel-scholarship/