首页 > AOE还是单体?
头像 yaozefeng
发表于 2026-01-20 12:59:33
/* 给牌佬写高潮了,难道我真的是尖塔赋能哥 考虑aoe的情况,如果aoe的费高于怪的数量,那对于每个怪都减一hp就需要n*x的费来进行,还不如一人一个打击减血 所以用sum存储总血量,如果x>=n就输出sum就行了 考虑aoe与平a结合的情况,同上,如果aoe有效减血的怪小于x同样也是不如平 展开全文
头像 Lambda_L
发表于 2025-12-19 00:48:19
#include <bits/stdc++.h> using namespace std; #define int long long int n, x; int calc(const vector<int> &arr, int m) { int res 展开全文
头像 ddb酱
发表于 2025-11-20 21:10:55
#include <bits/stdc++.h> using namespace std; #define endl "\n" #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() 展开全文
头像 Drink0318
发表于 2025-12-12 09:52:50
import sys import bisect n,x = map(int,input().split()) a = list(map(int,sys.stdin.read().split())) mp = 0 #当aoe消耗>=怪物总数时,全使用单体伤害最少mp if n<=x: 展开全文
头像 昨晚梦见发财了
发表于 2020-05-18 11:45:51
考点:贪心 我们可以用性价比来看。 如果我们花费x能打掉大于x的血量,我们肯定优先选择用第二种方法呀 反之我们就用第一种方法。 import java.util.*; import java.math.*; import java.io.IOExc 展开全文
头像 自由的风0450
发表于 2025-11-29 16:07:53
枚举群体伤害次数 #include <iostream> #include<vector> #include<algorithm> using namespace std; int main() { ios::sync_with_stdio(false) 展开全文
头像 Z史蒂夫
发表于 2026-01-21 17:37:29
#include <iostream> using namespace std; #include<vector> #include<algorithm> int main() { ios::sync_with_stdio(0); cin.tie( 展开全文
头像 lotusor
发表于 2026-02-05 23:24:06
n,x = map(int,input().split()) a = list(map(int,input().split())) cnt = 0 a.sort() if x >= n : print(sum(a)) else : for i in range(n-x,n): 展开全文
头像 精神病科黄主任
发表于 2020-05-22 17:52:37
思路从小到达排序后,枚举选择AOE攻击的次数,前面的肯定直接都消灭掉了,算出来后面的剩余的减去AOE伤害更新最小值即可 #include <bits/stdc++.h> using namespace std; typedef long long ll; ll a[1<<18 展开全文
头像 Drink0318
发表于 2025-12-12 09:49:13
import sys import bisect n,x = map(int,input().split()) a = list(map(int,sys.stdin.read().split())) mp = 0 #当aoe消耗>=怪物总数时,全使用单体伤害最少mp if n<=x: 展开全文