일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 보안취약점
- HelloWorld
- opcode
- 일상회피
- Android
- 여행
- bytecode 분석
- Recylcer
- static
- bytecode
- IMPLEMENT
- 회피
- throws
- ㅇ
- 취약점
- 여행계획
- Transition
- 치유
- 심리여행
- Interface
- 버킷리스트
- javap
- abstract
- 보안
- 일상탈출
- Navigation Component
- jvm
- extends
- 심리학
- Shared Elements
Archives
- Today
- Total
패스트터틀
(Baekjoon) etc.. - (1) 이진수 연산 본문
https://www.acmicpc.net/problem/12813
12813번: 이진수 연산
총 100,000 비트로 이루어진 이진수 A와 B가 주어진다. 이때, A & B, A | B, A ^ B, ~A, ~B를 한 값을 출력하는 프로그램을 작성하시오.
www.acmicpc.net
bitmask 문제에 앞서서 손풀기
package etc;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.Buffer;
public class _12813{
public static void main(String args[]) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String A[] = br.readLine().split("");
String B[] = br.readLine().split("");
for (int i = 0; i < A.length; i++) {
System.out.print(Integer.parseInt(A[i]) & Integer.parseInt(B[i]));
}
System.out.println();
for (int i = 0; i < A.length; i++) {
System.out.print(Integer.parseInt(A[i]) | Integer.parseInt(B[i]));
}
System.out.println();
for (int i = 0; i < A.length; i++) {
System.out.print(Integer.parseInt(A[i]) ^ Integer.parseInt(B[i]));
}
System.out.println();
for (int i = 0; i < A.length; i++) {
System.out.print(Integer.parseInt(A[i]) ^ 1);
}
System.out.println();
for (int i = 0; i < A.length; i++) {
System.out.print(Integer.parseInt(B[i]) ^ 1);
}
}
}
백준문제풀이Github :
https://github.com/sdk0213/baekjoon-study
sdk0213/baekjoon-study
solve a baekjoon question. Contribute to sdk0213/baekjoon-study development by creating an account on GitHub.
github.com
'Algorithm > baekjoon' 카테고리의 다른 글
(Baekjoon) dp - (4) 피보나치 (0) | 2019.11.28 |
---|---|
(Baekjoon) dp - (3) 외판원 순회 (0) | 2019.11.22 |
(Baekjoon) dp - (2) 2×n 타일링 2 (0) | 2019.11.20 |
(Baekjoon) dp - (1) 2×n 타일링 (0) | 2019.11.20 |
(Baekjoon) GreedyAlgorithm - (13) 행렬 (0) | 2019.11.19 |
Comments