Submission #887002

#TimeUsernameProblemLanguageResultExecution timeMemory
887002TurcavidFootball (info1cup20_football)C++14
0 / 100
2060 ms428 KiB
#include <bits/stdc++.h>

using namespace std;

int32_t main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n, k0;
        cin>>n>>k0;
        bool ok=false;
        for(int j=0; j<32; j++)
        {
            int k=(1<<j);
            if(k0&k == 0)
                continue;
            int xsum=0;
            for(int i=1; i<=n; i++)
            {
                int a;
                cin>>a;
                int c=a/k;
                int r=a%k;
                if(c%2 == 1)
                {
                    c=k;
                }
                else
                {
                    c=0;
                }
                xsum=(xsum^(c^r));
            }
            if(xsum != 0)
                ok=true;
        }
        cout<<ok;
    }
    return 0;
}

Compilation message (stderr)

football.cpp: In function 'int32_t main()':
football.cpp:17:21: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   17 |             if(k0&k == 0)
      |                   ~~^~~~
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...