Submission #251448

#TimeUsernameProblemLanguageResultExecution timeMemory
251448Vladikus004Dojave (COCI17_dojave)C++14
0 / 140
4089 ms11512 KiB
#include <bits/stdc++.h> #define inf 2e9 #define all(v) v.begin(), v.end() using namespace std; typedef long long ll; typedef long double ld; typedef pair <int, int> pii; const int N = 21; int n, a[1<<N]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); #ifdef LOCAL freopen("input.txt", "r", stdin); #endif // LOCAL cin >> n; n = (1<<n); for (int i = 0; i < n; i++) cin >> a[i]; int ans = 0; for (int i = 0; i < n; i++){ for (int j = i; j < n; j++){ int can = 0; for (int i1 = 0; i1 < n; i1++){ for (int i2 = 0; i2 < n; i2++){ swap(a[i1], a[i2]); int x = 0; for (int i3 = i; i3 <= j; i3++){ x = x ^ a[i3]; } if (x == n - 1) can = 1; swap(a[i1], a[i2]); if (can) break; } if (can) break; } ans+=can; } } cout << ans; }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...