Submission #845891

# Submission time Handle Problem Language Result Execution time Memory
845891 2023-09-06T17:49:15 Z samekkk Football (info1cup20_football) C++14
0 / 100
31 ms 600 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a,b) for (int a = 0; a < (b); ++a)
#define pb push_back
#define all(t) t.begin(), t.end()

const int max_N = 1e5+5;
int t = 0, n = 0, k = 0;
ll s = 0;
int A[max_N];

int main()
{
    // Jak suma nieparzysta to odrazu win, jak nie to dla jakies dowolnej potegi dwojki suma A[i]/2^x musi byc nieparzysta, wtedy sie da
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> t;
    while(t--)
    {
        cin >> n >> k;
        rep(i,n) cin >> A[i];
        s = 0;
        rep(i,n) s += A[i];
        if (s % 2 == 1)
        {
            cout << '1';
            continue;
        }
        int ilo = 1;
        bool czy_OK = false;
        while(ilo < 1e9)
        {
            ll sum = 0;
            rep(i,n) sum += A[i] / ilo;
            if (sum % 2 == 1)
            {
                czy_OK = true;
                break;
            }
            ilo *= 2;
        }
        if (czy_OK == true) cout << '1';
        else cout << '0';
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 1 ms 344 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 31 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -