Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- BFS
- 강화학습
- DP
- object detection
- canny edge detection
- Mask Processing
- dfs
- 머신러닝
- MinHeap
- 그래프 이론
- 딥러닝
- opencv
- Reinforcement Learning
- 백준
- machine learning
- eecs 498
- deep learning
- LSTM
- CNN
- r-cnn
- MySQL
- dynamic programming
- C++
- YoLO
- real-time object detection
- AlexNet
- One-Stage Detector
- two-stage detector
- Python
- image processing
Archives
- Today
- Total
목록반복문 (1)
JINWOOJUNG

접근법 다른 두 수의 합으로 특정 수를 나타내는지를 확인하기 위해서는 특정 수 보다 작은 두 수를 선택해야 하기에 정렬이 필요하다. 또한, 이중 for문으로 직접 접근하기에는 두 수를 찾기 위한 while문이 추가적으로 필요하여 $O(n^3)$ 시간복잡도가 발생한다. 따라서 $nlogn$의 알고리즘이 필요하기에 quick sort에서 활용한 방식처럼 pointer를 이용하여 접근하였으며, 0과 자기자신이 더해져 다른 위치의 자기자신을 나타내는 예외사항을 처리하도록 노력하였다. 정답 import sys N = int(input()) arr = list(map(int,sys.stdin.readline().split(" "))) arr.sort() cnt = 0 for i in range(N): tmp = a..
백준
2023. 12. 29. 00:23