백준 1929번 소수 구하기https://www.acmicpc.net/problem/1929 1929번: 소수 구하기첫째 줄에 자연수 M과 N이 빈 칸을 사이에 두고 주어진다. (1 ≤ M ≤ N ≤ 1,000,000) M이상 N이하의 소수가 하나 이상 있는 입력만 주어진다.www.acmicpc.net 정답 코드#include using namespace std; int a, b; int arr[1000001] = { 1,1,0 }; void find(int a, int b); int main() { cin >> a >> b; find(a, b); } void find(int a, int b) { for (int x = 2; x < 1000001/x; x++) { if (arr[x] == 1) conti..
백준 1927번 최소 힙https://www.acmicpc.net/problem/1927 1927번: 최소 힙첫째 줄에 연산의 개수 N(1 ≤ N ≤ 100,000)이 주어진다. 다음 N개의 줄에는 연산에 대한 정보를 나타내는 정수 x가 주어진다. 만약 x가 자연수라면 배열에 x라는 값을 넣는(추가하는) 연산이고, x가 0www.acmicpc.net 정답 코드#include #include #include #include using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int N, x; cin >> N; priority_queue pQ; for (int i = 0; i > ..
백준 1926번 그림https://www.acmicpc.net/problem/1926 1926번: 그림어떤 큰 도화지에 그림이 그려져 있을 때, 그 그림의 개수와, 그 그림 중 넓이가 가장 넓은 것의 넓이를 출력하여라. 단, 그림이라는 것은 1로 연결된 것을 한 그림이라고 정의하자. 가로나 세로www.acmicpc.net 정답 코드#include #include using namespace std; int arr[501][501]; int visit[501][501]; int dx[4] = { 1,0,-1,0 }; int dy[4] = { 0,1,0,-1 }; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, m;..
백준 1920번 수 찾기https://www.acmicpc.net/problem/1920 1920번: 수 찾기첫째 줄에 자연수 N(1 ≤ N ≤ 100,000)이 주어진다. 다음 줄에는 N개의 정수 A[1], A[2], …, A[N]이 주어진다. 다음 줄에는 M(1 ≤ M ≤ 100,000)이 주어진다. 다음 줄에는 M개의 수들이 주어지는데, 이 수들www.acmicpc.net 정답 코드#include #include int static compare(const void* first, const void* second) { if (*(int*)first > *(int*)second) return 1; else if (*(int*)first < *(int*)second) return -1; else ret..
- Total
- Today
- Yesterday
- 자바
- 투 포인터
- Do it!
- 백준
- DP
- C++ Stack
- 세그먼트 트리
- 유니온 파인드
- java
- js
- CSS
- 에라토스테네스의 체
- C++
- DFS
- HTML5
- 알고리즘 공부
- 유클리드 호제법
- 자바스크립트
- 카운팅 정렬
- 스택
- c++ string
- 이분 매칭
- 알고리즘
- BFS
- 스프링 부트 crud 게시판 구현
- 반복문
- 자료구조
- html
- 우선순위 큐
- 백준 풀이
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |