Submission #967986

#TimeUsernameProblemLanguageResultExecution timeMemory
967986weakweakweakBinaria (CCO23_day1problem1)C++17
6 / 25
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; int main () { int n, k, ans = 0; cin >> n >> k; deque <int> v, v2; for (int i = 0; i + k <= n; i++) { int x; cin >> x; v.push_back(x); } for (int i = 0; i < (1 << n); i++) { int sum = 0; for (int j = 0; j < k; j++) sum += ((1 << j) & i) > 0; v2.clear(); for (int j = 0; j + k <= n; j++) { v2.push_back(sum); if (j + k == n) break; sum += ((1 << (j + k)) & i) > 0; sum -= ((1 << j) & i) > 0; } if (v2 == v) ans++; } cout << ans << '\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...