Submission #675206

#TimeUsernameProblemLanguageResultExecution timeMemory
675206mouseyFootball (info1cup20_football)C++14
100 / 100
34 ms496 KiB
//#pragma GCC optimize("Ofast,unroll-loops") //#pragma GCC target("avx2,fma,bmi,bmi2,sse4.2,popcnt,lzcnt") #include <bits/stdc++.h> #define int long long #define ll long long #define vll vector<ll> #define vllp vector<pair<ll, ll> > #define vi vector <int> #define vip vector <pair <int, int> > #define db double #define ldb long double #define pdb pair <double, double> #define YES cout<<"Yes" #define NO cout<<"No" #define nl cout<<"\n" #define vv vector <vector <ll> > #define pll pair <ll, ll> #define pi pair <int, int> #define pb push_back #define f first #define s second using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const ll mod=1e9+7; const ll modx=998244353; const double eps=1e-9; const ll INF=2e9; const ll INFINF=9e18; const int N=1e5; int n, k, a[N+5]; void input() { cin >> n >> k; for(int i = 1; i <= n; i++) cin >> a[i]; } void solve() { int cur=1; while(cur<=k) { int cnt=0; for(int i = 1; i <= n; i++) cnt+=a[i]; if(cnt%2) { cout << 1; return; } cur*=2; for(int i = 1; i <= n; i++) a[i]/=2; } cout << 0; } signed main() { // auto start_time = chrono::high_resolution_clock::now(); // #ifdef ONLINE_JUDGE // freopen("f.in", "r", stdin); // #endif // freopen("f.in", "r", stdin); // freopen("kek.out", "w", stdout); ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int t=1; cin >> t; for(int i = 1; i <= t; i++) { input(); solve(); } // auto end_time = chrono::high_resolution_clock::now(); // double duration = chrono::duration_cast<chrono::milliseconds>(end_time - start_time).count(); // cout << "\n[ " << duration << " ms ]\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...