일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- java
- 자바 컬렉션
- 너비우선탐색
- 백준
- SQLite와 Realm 차이점
- 소수 알고리즘
- 안드로이드 DBMS
- android adapterview
- oracle
- 소수
- db
- android fragment
- 안드로이드 AdapterView
- 자료구조
- 백준 알고리즘
- 컬렉션
- 깊이우선탐색
- Github
- 안드로이드 파일
- 안드로이드
- support 라이브러리
- 알고리즘
- support fragment
- android support
- anr
- DFS
- 액티비티 ANR
- 안드로이드 ANR
- application not responding
- BFS
- Today
- Total
목록2018/08/16 (5)
밍의 기록들😉
소인수분해정수 N을 소수의 곱으로 분해소수를 구하지 않고 해결 가능N을 소인수분해 했을 때, 나타날 수 있는 인수 중에서 가장 큰 값은 루트 N따라서 2부터 루트 N까지 나눌 수 없을 때까지 계속해서 나누면 됨코드 for(int i=2; i*i1){ System.out.println(n); }
보호되어 있는 글입니다.
소수(Prime Number)약수가 1과 자기 자신 밖에 없는 수N이 소수가 되려면, 2보다 크거나 같고, N-1보다 작거나 같은 자연수로 나누어 떨어지면 안된다.N의 약수 중에서 가장 큰 것은 N/2보다 작거나 같기 때문이다.N = a x b로 나타낼 수 있는데, a가 작을수록 b는 크다.가능한 a중에서 가장 작은 값은 2이기 때문에 b는 N/2를 넘지 않는다.코드private static boolean prime(int n) { if(n
https://www.acmicpc.net/problem/1735 public class FractionSum { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a_n = scan.nextInt(); int a_d = scan.nextInt(); int b_n = scan.nextInt(); int b_d = scan.nextInt(); int d = a_d * b_d; a_n = a_n * b_d; b_n = b_n *a_d; int n = a_n +b_n; int gcd_num = gcd(n,d); n = n/gcd_num; d = d/gcd_num; System.out.println(n +" "+..