935

lsz_

wssdl
zgyfhyhzy

zhangyuzhe
Acwer
LLLHHH

xwas

6个月前

6个月前

6个月前

7个月前

# include[HTML_REMOVED]

const int N = 1e5 + 10;
int f1[N],f2[N];
int k,m,n1,n2;
using namespace std;

int main()
{
cin >> n1 >> n2 >> k >> m;
for (int i = 0; i < n1; i ) cin >> f1[i];
for (int i = 0; i < n2; i
) cin >> f2[i];
bool flag = true;
if (f1[k - 1] < f2[n2 - m]) flag = true;
else flag = false;
if (flag) puts(“YES”);
else puts(“NO”);
return 0;
}

12个月前

12个月前

12个月前

12个月前

# include [HTML_REMOVED]

using namespace std;

typedef long long LL;

int n;
LL a[100010];

void solve()
{
cin >> n;
unordered_map[HTML_REMOVED] cnt1, cnt2;

cnt1[0] = cnt2[0] = 1; // 表示不移动元素
LL sum = 0;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
cnt1[a[i]]++;
sum += a[i];
}

if (sum % 2)
{
cout << "NO" << endl;
return;
}

LL t = 0;
sum /= 2;
for (int i = 1; i <= n; i++)
{
t += a[i];
cnt1[a[i]]--;
cnt2[a[i]]++;

if (cnt1[sum - t] > 0 || cnt2[t - sum] > 0)
{
cout << "YES" << endl;
return;
}
}

cout << "NO" << endl;
return;


}

int main()
{
int T;
cin >> T;
while (T–)
solve();
}

2021-12-07 08:06

2021-12-07 07:58
。。。