아무거나적어~
-
std::set::lower_bound vs std::lower_bound in C++아무거나적어~ 2023. 9. 12. 11:49
https://www.geeksforgeeks.org/difference-between-stdsetlower_bound-and-stdlower_bound-in-c/ Difference between std::set::lower_bound and std::lower_bound in C++ - 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.geeks..
-
-
dp아무거나적어~ 2023. 9. 6. 17:09
조건 dag일 때 사용 11048번: 이동하기 준규는 N×M 크기의 미로에 갇혀있다. 미로는 1×1크기의 방으로 나누어져 있고, 각 방에는 사탕이 놓여져 있다. 미로의 가장 왼쪽 윗 방은 (1, 1)이고, 가장 오른쪽 아랫 방은 (N, M)이다. 준규는 www.acmicpc.net 점화식은 세우니 나름이다 dp[i][j] := (i, j)에서 시작해서 (N, M)에 도착할 때, 최대값 dp[i][j] := (1, 1)에서 시작해서 (i, j)에 도착할 때, 최대값 등등 아래는 첫 번째 dp 정의를 이용한 풀이이다. 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 32 33 34 35 #include #d..
-
-
python string in operator ~ O(N)아무거나적어~ 2023. 9. 2. 18:50
Python string 'in' operator implementation algorithm and time complexity I am thinking of how the in operator implement, for instance >>> s1 = 'abcdef' >>> s2 = 'bcd' >>> s2 in s1 True In CPython, which algorithm is used to implement the str... stackoverflow.com
-
[dp, knapsack] 2가지 다른 풀이아무거나적어~ 2023. 8. 28. 14:42
https://www.acmicpc.net/problem/12865 12865번: 평범한 배낭 첫 줄에 물품의 수 N(1 ≤ N ≤ 100)과 준서가 버틸 수 있는 무게 K(1 ≤ K ≤ 100,000)가 주어진다. 두 번째 줄부터 N개의 줄에 거쳐 각 물건의 무게 W(1 ≤ W ≤ 100,000)와 해당 물건의 가치 V(0 ≤ V ≤ 1,000) www.acmicpc.net dp[i] := i가치를 얻을 수 있는 최소 무게 O(N²V) 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 32 33 34 35 36 #include #define endl '\n' // don't use when you cov..