ru
Feedback

Не попадитесь на канал ботавода! Telemetrio находит и помечает такие каналы 👉 Хотите видеть метку — оформите подписку

Deloitte | COGNIZANT | IBM | CAPGEMINI

Deloitte | COGNIZANT | IBM | CAPGEMINI

Открыть в Telegram
7 122
Подписчики
-124 часа
-207 дней
-11030 дней
Архив постов
import java.io.*; import java.util.*; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int N=sc.nextInt(); int M=sc.nextInt(); int K=sc.nextInt(); int [] price=new int[N]; int[] protein=new int[N]; for(int i=0;i<N;i++){ price[i]=sc.nextInt(); } for(int i=0;i<N;i++){ protein[i]=sc.nextInt(); } int maxProtein = 0; for (int mask = 0; mask < (1 << N); mask++) { int[][] best= new int[N][2]; for (int i = 0; i < N; i++) { best[i][0] = price[i]; best[i][1] = price[i] / 2; } PriorityQueue<int[]> pq = new PriorityQueue<>( (a, b) -> (b[0] - b[1]) - (a[0] - a[1]) ); int currentPrice = 0; int currentProtein = 0; for (int i = 0; i < N; i++) { if ((mask & (1 << i)) != 0) { currentPrice +=best[i][0]; currentProtein += protein[i]; pq.add(new int[] {best[i][0], best[i][1]}); } } int coupons = 0; while (coupons < K && !pq.isEmpty()) { int[] option = pq.poll(); if (option[0] > option[1]) { currentPrice -= (option[0] - option[1]); coupons++; } } if (currentPrice <= M) { maxProtein = Math.max(maxProtein, currentProtein); } } System.out.println(maxProtein); } } //maximum protein value

CAPGEMINI ON-CAMPUS coding✅✅ Contact: @mlcoder2
+1
CAPGEMINI ON-CAMPUS coding✅✅ Contact: @mlcoder2

Here we upload COMPANY OA questions only like CTS, ACCENTURE, CAPGEMINI...Etc👇👇👇 https://t.me/OA_CODING

CAPGEMINI ON-CAMPUS EXAM DONE SUCCESSFULLY✅✅✅ Contact:@mlcoder2
+2
CAPGEMINI ON-CAMPUS EXAM DONE SUCCESSFULLY✅✅✅ Contact:@mlcoder2

ORACLE✅✅✅
+1
ORACLE✅✅✅

Accenture ON-CAMPUS ✅✅✅ Contact :@mlcoder2
+2
Accenture ON-CAMPUS ✅✅✅ Contact :@mlcoder2

ON-CAMPUS ACCENTURE EXAM CLEARED ✅ FOR any exam Contact: @mlcoder2
ON-CAMPUS ACCENTURE EXAM CLEARED ✅ FOR any exam Contact: @mlcoder2

ON-CAMPUS ACCENTURE EXAM CLEARED ✅ FOR any exam Contact: @mlcoder2
ON-CAMPUS ACCENTURE EXAM CLEARED ✅ FOR any exam Contact: @mlcoder2

ON-CAMPUS ACCENTURE EXAM CLEARED ✅ FOR any exam Contact: @mlcoder2
ON-CAMPUS ACCENTURE EXAM CLEARED ✅ FOR any exam Contact: @mlcoder2

Accenture ON-CAMPUS exam ✅✅✅ FOR ANY ON-CAMPUS EXAM Contact:@mlcoder2
+2
Accenture ON-CAMPUS exam ✅✅✅ FOR ANY ON-CAMPUS EXAM Contact:@mlcoder2

Barclays ✅✅✅ For Any ON-CAMPUS/OFF-CAMPUS exam👇👇 contact: @mlcoder2
+1
Barclays ✅✅✅ For Any ON-CAMPUS/OFF-CAMPUS exam👇👇 contact: @mlcoder2

Amazon ON-CAMPUS ✅✅✅ Contact:@mlcoder2
+1
Amazon ON-CAMPUS ✅✅✅ Contact:@mlcoder2

Amazon ON-CAMPUS✅✅✅ Contact:@mloder2
+1
Amazon ON-CAMPUS✅✅✅ Contact:@mloder2

Brillio exam ✅✅✅ All the codes & queries✅✅ Contact:@mlcoder2
+4
Brillio exam ✅✅✅ All the codes & queries✅✅ Contact:@mlcoder2

ON-CAMPUS INFOSYS✅✅✅ Contact: @mlcoder2
+4
ON-CAMPUS INFOSYS✅✅✅ Contact: @mlcoder2

SWIGGY EXAM ✅✅✅✅ Contact:@mlcoder2
+2
SWIGGY EXAM ✅✅✅✅ Contact:@mlcoder2

INFOSYS ON-CAMPUS EXAM CLEARED ✅✅✅ 100% RESULTS FOR ANY EXAM contact : @mlcoder2
INFOSYS ON-CAMPUS EXAM CLEARED ✅✅✅ 100% RESULTS FOR ANY EXAM contact : @mlcoder2

INFOSYS ON-CAMPUS EXAM ✅✅✅ Contact: @mlcoder2
INFOSYS ON-CAMPUS EXAM ✅✅✅ Contact: @mlcoder2

INFOSYS PSEUDOCODES
+4
INFOSYS PSEUDOCODES

Capgemini Internal Exam done successfully ✅✅✅ Contact : @mlcoder2 #java
Capgemini Internal Exam done successfully ✅✅✅ Contact : @mlcoder2 #java