일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- localstorage
- ccw 알고리즘
- 그래프 탐색
- 자바스크립트
- Next
- JavaScript
- 게임 서버 아키텍처
- Github
- Express.js
- pm2
- router
- MongoDB
- branch
- Prisma
- 그리디
- ERD
- insomnia
- MySQL
- 이분 탐색
- PROJECT
- string
- 백준 9328번
- 백준 28298번
- visual studio code interactive 디버깅
- stack을 이용한 dfs
- HTTP
- vsc 디버깅
- map
- html5
- 백준 9466번
Archives
- Today
- Total
목록두 포인터 (1)
dh_0e

구현은 매우 쉽지만 발상하는데 시간이 꽤 걸렸던 문제A B의 합, C D의 합을 모두 구한 배열(각각 최대 1600만) 2개를 만든 뒤 정렬하여 two pointer, binary search를 사용하여 합이 0인 쌍의 개수를 구하면 된다. #include#include#includeusing namespace std;typedef long long ll;vector vec1, vec2;ll a[4001], b[4001], c[4001], d[4001];int binary_search(int en, int target) { int st = 0; while (st 0) n2--; else n1++; } printf("%lld\n", dap); return 0;}
알고리즘/Baekjoon
2025. 2. 4. 12:20