結果

問題 No.1432 Not Xor
ユーザー oliverx3oliverx3
提出日時 2021-03-19 21:45:47
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 4,354 bytes
コンパイル時間 4,021 ms
コンパイル使用メモリ 259,052 KB
最終ジャッジ日時 2025-01-19 18:16:13
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

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

#include<bits/stdc++.h>
// using namespace std;
#if __has_include(<atcoder/all>)
#include<atcoder/all>
// using namespace atcoder;
#endif
#define int long long
#pragma region header
#pragma region alias
using lint = long long;
using ll = long long;
using P = std::pair<int,int>;
template<class T> using prique = std::priority_queue<T,std::vector<T>,std::greater<T>>;
#pragma endregion
#pragma region macros
#define rep(i, n) for(int i = 0;i<(int)(n);i++)
#define REP(i, m, n) for(int i = (m);i<(int)(n);i++)
#define drep(i, n) for(int i = (n)-1;i>=0;i--)
#define DREP(i, m, n) for(int i = (m)-1;i>=(int)(n);i--)
#define all(v) (v).begin(),(v).end()
#define reall(v) (v).rbegin(),(v).rend()
template<class T, class U>
bool chmax(T& a,const U b) {
if(a < b) {
a = b;
return true;
}
return false;
}
template<class T, class U>
bool chmin(T& a,const U b) {
if(a>b) {
a = b;
return true;
}
return false;
}
std::map<int,int> prime_div(int n) {
std::map<int,int> mp;
if(~n&1) while(~n&1) n>>=1,mp[2]++;
for(int i = 3;i<=std::sqrt(n);i+=2) {
if(n%i==0) {
while(n%i==0) {
n/=i;
mp[i]++;
}
}
}
if(n!=1) mp[n]++;
return mp;
}
#pragma endregion
#pragma region constant
constexpr long long inf = 1LL << 61;
constexpr int dx[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
constexpr int dy[9] = {0, 1, 0, -1, 1, -1, 1, -1, 0};
constexpr long long mod = 1e9+7;
constexpr long long MOD = 998244353;
#pragma endregion
#pragma region inout
template<class T>
std::ostream& operator<<(std::ostream& stream, const std::vector<T>& v) {
for(int i = 0; i < (int)(v.size()); i++) {
stream << v[i];
if(i != (int)(v.size()) - 1) stream << ' ';
}
return stream;
}
template<typename Itr>
inline void print(const Itr& begin, const Itr& end, bool endline = true, const char* BEGIN = "{", const char* mid = ", ", const char* END = "}") {
if(begin == end) return;
std::cout << BEGIN << *begin;
for(Itr itr = begin+1; itr < end; itr++) std::cout << mid << *itr;
std::cout << END;
if(endline) std::endl(std::cout);
return;
}
template<class T>
std::istream& operator>>(std::istream& stream, std::vector<T>& v) {
for(T& p:v) stream >> p;
return stream;
}
template<typename Itr>
inline void input(Itr begin, Itr end) {
for(Itr& itr = begin; itr < end; itr++) std::cin >> *itr;
return;
}
template<class T, class U>
std::ostream& operator<<(std::ostream& stream, const std::pair<T,U>& pair) {
return stream << pair.first << ' ' << pair.second;
}
template<class T, class U>
inline void print(const std::pair<T,U>& pair,const bool endline = true, const char* begin = "(", const char* mid = ", ", const char* end = ")") {
std::cout << begin << pair.first << mid << pair.second << end;
if(endline) std::endl(std::cout);
else std::cout << ' ';
return;
}
template<class T, class U>
std::istream& operator>>(std::istream& stream, std::pair<T,U>& pair) {
return stream >> pair.first >> pair.second;
}
template<class T, class U>
inline void input(std::pair<T,U>& pair, const bool first = true, const bool second = true) {
if(first) std::cin >> pair.first;
if(second) std::cin >> pair.second;
}
#pragma endregion
#pragma region DEBUG
#ifdef _DEBUG
#define debug(x) {do{std::cout << #x << ": ";view(x);}while(0);}
#else
#define debug(x)
#endif
template<class T> inline void view(const T& x) {
std::cout << x << std::endl;
}
template<class T> inline void view(const std::vector<T>& v) {
print(all(v));
}
#pragma endregion
#pragma endregion
const int MAX = 510000;
const int MOD_ = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
//
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++){
fac[i] = fac[i - 1] * i % MOD_;
inv[i] = MOD_ - inv[MOD_%i] * (MOD_ / i) % MOD_;
finv[i] = finv[i - 1] * inv[i] % MOD_;
}
}
//
long long COM(int n, int k){
if (n < k) return 0;
if (n < 0 || k < 0) return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD_) % MOD_;
}
signed main() {
int a,b;
std::cin >> a >> b;
std::cout << (a|b) + (a&b) << std::endl;
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0