2 条题解
-
0
//如果x>y,那么所有门一定会被破坏掉, //如果x<=y,那么应该尽可能破坏更多的门,如果门被修复,则无法被破坏,而被破坏的门又无法被修复,所以修复者会把破坏者能破坏的门修复一下 // //如果门的耐久<x,那么破坏者就有机会将门破坏掉,同时也是修复者修复的对象。 // /* * Create By leo * Gods and Buddhas, bless me to rank higher! * Date: 2025年10月28日 - 0:06:32 */ #include<bits/stdc++.h> using namespace std; const int N = 2e5 + 12; int a[N]; void solve() { int n,x,y;cin >> n >> x >> y; for (int i = 1;i <= n;i++)cin >>a[i]; if (x > y) { cout << n << '\n'; return ; } int ans = 0; for (int i = 1;i <= n;i++) { if (a[i] <= x)ans ++; } cout << ceil(1.0 * ans / 2) << '\n'; } int main() { int t = 1; //cin >> t; while (t--) { solve(); } return 0; }
信息
- ID
- 707
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 7
- 标签
- 提交数
- 43
- 已通过
- 9
- 上传者