Algorithm ๐ง๐ป๐ป/๋ฐฑ์ค(BOJ)
[๋ฐฑ์ค,c++] 12813๋ฒ - ์ด์ง์ ์ฐ์ฐ
dkswnkk
2021. 11. 2. 22:50
12813๋ฒ: ์ด์ง์ ์ฐ์ฐ
์ด 100,000 ๋นํธ๋ก ์ด๋ฃจ์ด์ง ์ด์ง์ A์ B๊ฐ ์ฃผ์ด์ง๋ค. ์ด๋, A & B, A | B, A ^ B, ~A, ~B๋ฅผ ํ ๊ฐ์ ์ถ๋ ฅํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค.
www.acmicpc.net
#include <iostream>
#include <bitset>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
bitset<100000>A,B;
cin>>A>>B;
cout<<(A&B)<<'\n';
cout<<(A|B)<<'\n';
cout<<(A^B)<<'\n';
cout<<(~A)<<'\n';
cout<<(~B)<<'\n';
}