#include <iostream>
#define endl '\n'
using namespace std;
const int MAXN = 100000;
int a[MAXN + 5];
int main()
{
ios :: sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int T;
cin >> T;
while (T--)
{
int N, K;
cin >> N >> K;
long long S = 0;
for (int i = 1; i <= N; ++ i)
{
cin >> a[i];
S += a[i];
}
while (S % 2 == 0 and K != 1)
{
K /= 2;
S = 0;
for (int i = 1; i <= N; ++ i)
{
a[i] /= 2;
S += a[i];
}
}
if (S % 2 == 1) cout << 1;
else cout << 0;
}
cout << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
364 KB |
Output is correct |
2 |
Correct |
16 ms |
364 KB |
Output is correct |
3 |
Correct |
12 ms |
364 KB |
Output is correct |
4 |
Correct |
12 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
364 KB |
Output is correct |
2 |
Correct |
9 ms |
620 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
492 KB |
Output is correct |
2 |
Correct |
24 ms |
492 KB |
Output is correct |
3 |
Correct |
24 ms |
492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
37 ms |
492 KB |
Output is correct |
2 |
Correct |
37 ms |
492 KB |
Output is correct |
3 |
Correct |
36 ms |
492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
364 KB |
Output is correct |
2 |
Correct |
13 ms |
1388 KB |
Output is correct |
3 |
Correct |
12 ms |
1388 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
364 KB |
Output is correct |
2 |
Correct |
13 ms |
1388 KB |
Output is correct |
3 |
Correct |
17 ms |
1388 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
364 KB |
Output is correct |
2 |
Correct |
14 ms |
1516 KB |
Output is correct |