摘要: Codeforces Round 895 (Div. 3) A - Two Vessels 思路:找到差值,让a,b向中间靠 #include<bits/stdc++.h> using namespace std; #define int long long //#define int __int1 阅读全文
posted @ 2023-09-11 01:04 bible_w 阅读(14) 评论(0) 推荐(0) 编辑
摘要: C - Set or Decrease 思路:只有两个操作:1.ai减一 和 2.ai变aj,要让所有数总和变小且操作次数少,可以贪心的想:操作一的ai为最小的数,操作二的ai为最大的数,aj为最小的数; 那么将a排序后,枚举操作2的数量cnt,对应的可以求出在满足总和小于等于k的情况下需要操作一的 阅读全文
posted @ 2023-09-11 00:38 bible_w 阅读(6) 评论(0) 推荐(0) 编辑