結果

問題 No.2442 線形写像
ユーザー kw_c
提出日時 2023-09-16 16:17:27
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 3,882 bytes
コンパイル時間 2,046 ms
コンパイル使用メモリ 195,044 KB
最終ジャッジ日時 2025-02-16 22:59:36
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = n-1; i >= (0); --i)
#define IO ios::sync_with_stdio(0),cin.tie(0);
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define pf push_front
#define eb emplace_back
#define ef emplace_front
#define bpop(x) __builtin_popcount(x)
#define bpopll(x) __builtin_popcountll(x)
template<class T>
bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
template<class T>
bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
void print_imp() {}
template<class First, class... Rest>
void print_imp(First f, Rest... r) { cout<<f; if (sizeof...(r)) cout<<" "; print_imp(r...); }
template<class... Args>
void print(Args... args) { print_imp(args...); cout << endl; }
template<class T>
void print_pair(vector<T> &v) { for (auto [a,b] : v) print(a, b); }
template<class T>
void print_vec(vector<T> &v) { rep(i, v.size()) {cout << v[i]; if (i == v.size()-1) cout << endl; else cout << " ";} }
template<class T>
void print_mat(vector<vector<T>> &m) { for (auto v : m) print_vec(v); }
template<class T>
void print_bit(T s, int n) { rep(i, n) {if (s>>i&1) cout<<1; else cout<<0;} cout<<endl; }
void print_double(double x) { cout << fixed << setprecision(15) << x << endl; }
template<class T>
using min_pq = priority_queue<T, vector<T>, greater<T>>;
template<class T>
using vt = vector<T>;
template<class T>
using vvt = vt<vt<T>>;
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
const ll MOD = 1e9 + 7;
const int INF = 1001001001;
const ll LINF = 4e18;
const double PI = 3.14159265358979323846;
/*
- comb modintnCk,nPk,nHk
- matrix
- Mo Mo's algorithm
- segtree_min/max segtree
- RMQ/RMAQ_min/max lazy_segtree //
- RSQ/RSAQ lazy_segtree /
- Eratosthenes
- Factorize : O(sqrt(x))
- dydx, dydx8 dy,dx={,,,}
- grid_continue if (i < 0 || j < 0 || i >= h || j >= w) continue;
- Pascal
- Graph
- dijkstra
- bellman_ford
- topological_sort
- find_cycle_directed
- bfs01 01-BFS
- tree_diameter
- euler_tour
- build_LCA, get_LCA LCA
- build_tree_dist
- dfs_temp DFS
- init_tree_from_parents Graph
- init_graph_from_grid Graph
*/
void solve() {
int n;
cin >> n;
int n2 = 1<<n;
vt<ll> A(n2);
rep(i, n2) cin >> A[i];
if (A[0]) {
print("No");
return;
}
for (int x = 0; x < n2; x++) {
for (int s = (x-1)&x; ; s = (s-1)&x) {
if (s == 0) break;
if (A[x]^A[s] != A[x^s]) {
print("No");
return;
}
}
}
print("Yes");
}
int main() {
IO
/* int t; cin >> t; rep(_, t) solve(); */
solve();
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0