点1与15WA,HELP!
查看原帖
点1与15WA,HELP!
1734522
qiruozhuo_jvruo楼主2025/6/27 17:34

Code:

/*
 * @Author: qiruozhuo 
 * @Date: 2025-06-27 17:32:10 
 * @Last Modified by:   qiruozhuo 
 * @Last Modified time: 2025-06-27 17:32:10 
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long // Use long long for large integer support
const int N = 1e5+5;
int n, m, a[N] , ans;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m;
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
        ans = max(ans , a[i]);
    }
    for(int i = 1, tmp; i <= m; i++)
    {
        cin >> tmp;
        if(n == 1 || tmp > 0)
        {
            ans += tmp;
        }
    }
    cout << ans << endl;
    return 0;
}

第1、15个点WA。

2025/6/27 17:34
加载中...