이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//#pragma GCC optimize("Ofast,unroll-loops")
//#pragma GCC target("avx,avx2,fma,sse4.2")
#include<bits/stdc++.h>
#define ll long long
#define int long long
#define ii __int128
#define ld long double
#define cd complex<ld>
#define pll pair<int,int>
#define pii pair<int,int>
#define pld pair<ld,ld>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll n, k;
ll A[100005];
void solve()
{
cin >> n >> k;
ll sum1 = 0, sum2 = 0;
for(int i = 1; i<=n ; i++)
{
cin >> A[i];
sum1+=A[i];
sum2 += A[i]/2;
}
sort(A+1,A+n+1);
if(n%2==1)
{
cout << 1;
return;
}
for(int i = 1; i<= n; i+=2)
{
if(A[i]!=A[i-1])
{
cout << 0;
return;
}
}
cout << 1;
}
signed main()
{
ios_base::sync_with_stdio(NULL) ; cin.tie(nullptr) ; cout.tie(nullptr);
int t = 1; cin >> t;
//cout << -1;
while(t--)
{
solve();
// cout << "\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |