简体中文
Telegram

帖子import java.io.*;

2024年12月3日
D
Deloitte | COGNIZANT | IBM | CAPGEMINI
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
1.7K ·

信息流中的邻近内容

DDeloitte | COGNIZANT | IBM | CAPGEMINICAPGEMINI ON-CAMPUS EXAM DONE SUCCESSFULLY✅✅✅ Contact:@mlcoder2DDeloitte | COGNIZANT | IBM | CAPGEMINICAPGEMINI ON-CAMPUS coding✅✅ Contact: @mlcoder2
这条消息
DDeloitte | COGNIZANT | IBM | CAPGEMINIimport java.io.*; import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); String s=sc.nextLine(); int aDDeloitte | COGNIZANT | IBM | CAPGEMINIAMAZON ✅✅✅✅ Contact : @mlcoder2

来自搜索索引的公开信息流 ChatCrawler ——“公开 Telegram 的 Google”;随着该社群被抓取而更新。 时间为 UTC。

仅限公开内容,使用 Telegram 官方 API。 关于 · 常见问题 · 索引限制 · 移除页面 · 目录 · 搜索 · 计算方法