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 "iostream"
using namespace std;
int t, n, k, v[100005] ;
void solve()
{
long long sum = 0 ;
string winner = "T" ;
cin >> n >> k ;
for (int i = 1 ; i <= n ; i ++)
cin >> v[i] ;
while (k && winner == "T")
{
sum = 0 ;
for (int i = 1 ; i <= n ; i ++)
sum += v[i] ;
if (sum % 2 == 1)
winner = "S" ;
for (int i = 1 ; i <= n ; i ++)
v[i] /= 2 ;
k /= 2 ;
}
if (winner == "S")
cout << 1 ;
else
cout << 0 ;
}
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... |