전체 글
-
next_permutation implementation아무거나적어~ 2023. 1. 8. 16:33
올바르게 정렬된 가장 오른쪽?의 순서쌍 (a_i, a_j)을 바꾸고 a_i+1 이후의 것들을 reverse std::next_permutation Implementation Explanation I was curious how std:next_permutation was implemented so I extracted the the gnu libstdc++ 4.7 version and sanitized the identifiers and formatting to produce the following demo... #include
-
-
python use custom compare function to heap아무거나적어~ 2023. 1. 7. 15:29
그냥 class 만들어서 < override 하라고 함 Heapq with custom predicate in Python - GeeksforGeeks A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions. www.geeksforgeeks.org
-
python deque은 []로 원소 가져올 수 있음 - 이왜진??아무거나적어~ 2023. 1. 7. 15:02
ㅈㄱㄴ How to peek front of deque without popping? I want to check a condition against the front of a queue before deciding whether or not to pop. How can I achieve this in python with collections.deque? list(my_deque)[0] seems ugly and poor for stackoverflow.com
-
-