| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 436433 | 顾鑫辰 | 【C6-7】母舰 | C++ | 解答错误 | 10 | 41 MS | 1052 KB | 649 | 2026-04-14 17:07:04 |
#include <iostream> #include <algorithm> using namespace std; const int MAX = 100005; int def[MAX]; int atk[MAX]; int main() { ios::sync_with_stdio(false); cin.tie(0); int m, n; cin >> m >> n; for (int i = 0; i < m; i++) cin >> def[i]; for (int i = 0; i < n; i++) cin >> atk[i]; sort(def, def + m); sort(atk, atk + n); int i = 0, j = 0; while (i < m && j < n) { if (atk[j] > def[i]) { i++; } j++; } long long ans = 0; for (int k = j; k < n; k++) { ans += atk[k]; } cout << ans << endl; return 0; }