WA,0分求帮
查看原帖
WA,0分求帮
1770267
xiayuxuan8楼主2025/6/16 11:23
#include <iostream>
using namespace std;
int a[10005],t,n;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
	cin >> t;
    while(t--){
        cin >> n;
        int s = 0;
        for(int i = 0;i<=n;i++)
        {
            cin >> a[i];
            s += a[i];
        }
        int s1 = 0;
        bool f = 1;
        for(int i = 0;i<=n-1;i++)
        {
            s1 += a[i];
            if(s1 * 2 ==s){
                cout << "Yes" << endl;
                f = 0;
                break;
            }
        }
        if(f == 1) cout << "No" << endl;
    }
	return 0;
}
2025/6/16 11:23
加载中...