题解 | #吃冰棍#
吃冰棍
https://www.nowcoder.com/practice/f1717be0fb8a4aa8bee07aa024a65d64
#include <bits/stdc++.h> using namespace std; typedef long long ll; // 可以嗦任意次冰棍 // ^ : 两数相加,不含进位! // & : 两数相加,只含有进位! int main() { ll n, x, a; cin >> n >> x; ll ret(0); for (int i = 0; i < n; i++) { cin >> a; ret = max(ret, a | x); } cout << ret << endl; return 0; }