ProtyayMnd50 / getminSum.py
0 Favoriten
0 Forks
2 Dateien
Zuletzt aktiv
1 | |
2 | def getMinimumSum(arr): |
3 | n = len(arr) |
4 | if n < 3: |
5 | return -1 |
6 | |
7 | left_min = [None] * n |
8 | min_so_far = float('inf') |
9 | |
10 | # Populate left_min |
ProtyayMnd50 / variantsCount.cpp
0 Favoriten
0 Forks
4 Dateien
Zuletzt aktiv
1 | #include <bits/stdc++.h> |
2 | using namespace std; |
3 | |
4 | int countPairs(const vector<int>& projectCosts, int target) { |
5 | // Using an unordered set to keep track of visited numbers |
6 | unordered_set<int> visited; |
7 | int count = 0; |
8 | |
9 | // Iterate through each number in the list |
10 | for (int cost : projectCosts) { |
ProtyayMnd50 / dem.cpp
0 Favoriten
0 Forks
1 Dateien
Zuletzt aktiv
1 | int N = segments.size(); |
2 | |
3 | |
4 | vector<vector<int>> sortedSegments = segments; |
5 | sort(sortedSegments.begin(), sortedSegments.end(), [](const vector<int> &a, const vector<int> &b) { |
6 | return a[1] < b[1]; |
7 | }); |
8 | |
9 | |
10 | priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> minHeap; |
ProtyayMnd50 / hello.cpp
0 Favoriten
0 Forks
3 Dateien
Zuletzt aktiv
1 | #include <iostream> |
2 | #include <vector> |
3 | #include <algorithm> |
4 | #include <climits> |
5 | #include <bits/stdc++.h> |
6 | using namespace std; |
7 | #define ll long long |
8 | # updated |
9 | ll minCostProduct(const vector<vector<ll>> &seg) |
10 | { |
ProtyayMnd50 / p1_kadane_algo.cpp
0 Favoriten
0 Forks
2 Dateien
Zuletzt aktiv
1 | #include <bits/stdc++.h> |
2 | using namespace std; |
3 | #define ll long long |
4 | #define mod 1000000007 |
5 | #define INF 1e18 |
6 | #define nl "\n" |
7 | #define pb push_back |
8 | #define eb emplace_back |
9 | /*Note: emplace_back is faster than push_back*/ |
10 | #define ppb pop_back |
Neuer
Älter