This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "fstream"
using namespace std;
ifstream cin ("in.in") ;
ofstream cout ("out.out") ;
int t, n, k ;
void solve()
{
int x ;
long long sum = 0 ;
cin >> n >> k ;
for (int i = 1 ; i <= n ; i ++)
cin >> x, sum += x ;
while (k != 1 && sum % 2 == 0)
k /= 2, sum /= 2 ;
if (k == 1)
cout << 1 << '\n' ;
else
{
cout << sum % 2 << '\n' ;
}
}
int main ()
{
cin >> t ;
for (int tt = 1 ; tt <= t ; tt ++)
solve() ;
return 0 ;
}
# | 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... |