uuid
stringlengths
36
36
repo_name
stringlengths
5
123
relative_path
stringlengths
5
4k
content
stringlengths
33
2.85M
category
stringclasses
6 values
algo_rel_score
float64
0.85
1
quality_score
float64
3
8.76
dd03ac95-ec11-42b3-b30c-7726a5ed415b
0TheSpy/ClientMod3Emulator
hl2sdk/game/client/client_virtualreality.cpp
#include "client_virtualreality.h" #include "materialsystem/itexture.h" #include "materialsystem/materialsystem_config.h" #include "view_shared.h" #include "view_scene.h" #include "VGuiMatSurface/IMatSystemSurface.h" #include "vgui_controls/Controls.h" #include "sourcevr/isourcevirtualreality.h" #include "ienginevgui....
TOOL
0.853946
5.701287
bf56a879-57dd-4d4d-877a-252844b9fb7b
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_10780_1.cpp
#include <bits/stdc++.h> using namespace std; inline int ckmax(int &a, int b) { return a < b ? a = b, 1 : 0; } inline int ckmin(int &a, int b) { return a > b ? a = b, 1 : 0; } int ans; const int oo = 1e9, maxn = 510, maxe = 10000000; int e = 1, to[maxe], ne[maxe], he[maxn], cap[maxe], cost[maxe]; int d[maxn], vis[maxn]...
ALGO
0.99989
4.349766
494fe881-1a74-43cb-aa52-c27bb2167909
emthrm/cp-library
test/graph_cost-free/tree/centroid.test.cpp
/* * verification-helper: IGNORE * verification-helper: PROBLEM https://atcoder.jp/contests/arc087/tasks/arc087_d */ #include <iostream> #include <vector> #include "emthrm/graph_cost-free/tree/centroid.hpp" #include "emthrm/math/modint.hpp" int main() { using ModInt = emthrm::MInt<1000000007>; int n; std::c...
ALGO
0.999588
5.114825
7b669d2b-1734-4040-b3f8-6297eb6d95f5
shivangdatta/DSA
graph/dfs_components.cpp
//using dfs traversal for components which may or may not be conncected also count differenct components #include <iostream> #include <bits/stdc++.h> using namespace std; template <typename T> class Graph{ map <T , list<T>> adjList; public: void addEdge(T u , T v , bool bidir = true){ adjList[u].push...
ALGO
0.99957
5.224476
b00b4cc5-3489-476b-9cd3-6adbdea3077c
AlanBinu007/CodeForces-Solutions
312A - Whose sentence is it.cpp
//4263699 Aug 11, 2013 7:03:13 AM fuwutu 312A - Whose sentence is it? GNU C++0x Accepted 62 ms 100 KB #include <string> #include <iostream> using namespace std; int main() { int n; cin >> n; char ch[101]; cin.getline(ch, 101); string s; while (n--) { cin.getline(ch, 101);...
ALGO
0.99981
3.364761
77bcf7ae-45a7-431a-96d2-1c756b2aeef1
kushalsng/Leetcode
342-power-of-four/342-power-of-four.cpp
class Solution { public: bool isPowerOfFour(int n) { if(n<=0) return false; if((n & n-1) == 0){ if(__builtin_popcount(n-1) %2 == 0) return true; } return false; } };
ALGO
0.999357
5.855204
f5ad4070-bf4a-4777-bb32-ef199aebc092
GamerCampTeam3/ManicMiner
cocos2d/plugin/jsbindings/manual/pluginxUTF8.cpp
#include "pluginxUTF8.h" namespace pluginx { #define CCLOGERROR(...) do {} while(0) #ifndef NULL #define NULL 0 #endif int cc_wcslen(const unsigned short* str) { int i=0; while(*str++) i++; return i; } /* Code from GLIB gutf8.c starts here. */ #define UTF8_COMPUTE(Char, Mask, Len) \ if (Char <...
TOOL
0.8857
6.107236
8fafbdc9-712f-4e0d-a489-c3795d332411
aokblast/LeetCode_Problem_Solving
Medium/500_Keyboard_Row.cpp
// //Runtime 38 //Memory Usage 17.7 class Solution { public: int dir[2][2] = {-1, 1, 1, -1}; vector<int> findDiagonalOrder(vector<vector<int>>& mat) { int n = mat.size(), m = mat[0].size(); vector<int> ans(m * n); int i = 0, x = 0, y = 0, d = 0; for(i; i < m * n; ++i){ ...
ALGO
0.999987
5.968318
d8ee9bdd-4f5d-47d3-a272-9dcd915c1aef
shafeenyousafzaii/Flutter_Work
testing/windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998157
6.761023
34f09f18-2b02-41c5-b8c8-8ac978b449c7
jeewhanchoi/ALTO-stream
src/kruskal_model.cpp
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include <assert.h> #include <time.h> #include <omp.h> #include <util.hpp> #include "kruskal_model.hpp" // #define DEBUG 1 #define MAX(x, y) (((x) > (y)) ? (x) : (y)) void ExportKruskalModel(KruskalModel *M, char *file_path) { // factor...
ALGO
0.998086
3.779451
7bffbe7e-4bb7-4ced-9a54-476604e840bc
elprogramadorr/ICPC-Teambook-Perritos-Malvados-UMSS-
Other/Simulated Annealing OBI.cpp
#include <iostream> #include <vector> #include <algorithm> #include <set> #include <bits/stdc++.h> #include <ctime> #include <random> #define pb push_back #define F first #define S second #define vi vector<int> #define int long long #define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); using nam...
ALGO
0.999968
4.384418
da633b7e-c736-43be-80db-952b2c9afa30
stefdasca/CompetitiveProgramming
Codeforces/Codeforces Round #312/CF558-D2-E.cpp
#include<bits/stdc++.h> #define god dimasi5eks #pragma GCC optimize("O3") #define fi first #define se second #define pb push_back #define pf push_front #define mod 1000000007 #define dancila 3.14159265359 #define eps 1e-9 using namespace std; typedef long long ll; int n, q; char c[100002]; int frq[402][30], whr[100...
ALGO
0.999987
3.488041
7476c997-3d86-4ce6-a53a-1308a6d9367d
DenisGZM/SS_T2
main.cpp
#include <iostream> #include <random> #include <mpi.h> #include <omp.h> static const double predefined_res = 1./24; static double eps; static long points_batch_num = 10000; struct Point { double x,y,z; }; #define return_finalize(exit_num) MPI_Finalize(); \ return (exit_num); do...
ALGO
0.9996
4.529766
04049f87-0a0a-4128-a157-d45adcbbb0a8
brayandm/Competitive-Programming
Codes/dacin21_codebook-master/dp/convex_hull3d_merge.cpp
// convex hull trick in 3D // requires distinct monotone x-coordinates // O(log(n)^2) per query or update #undef _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; using ll = long long; ll searches = 0; ll builds = 0; // persistent treap struct Perstree{ static mt19937 RNG; struct Persnode{ a...
ALGO
0.999964
4.510789
1297aa1d-ff58-438e-8461-1e2640abb407
alexvelea/competitive
contests/mindcoding2014Finals1/arghezi.cpp
#include <iostream> #include <fstream> #include <algorithm> #include <deque> #include <cstdlib> #include <vector> #include <cstring> #include <cmath> #include <map> #include <set> #include <string> #define per pair<int,int> #define mp make_pair #define pb push_back #define DN 100005 #define DM 1000 using namespace std...
ALGO
0.999964
3.85698
fc7b2c3f-9ef8-49de-beca-d4f9646ce591
zeugma-hamper/cpp-zeugma
src/RawEventParsing.cpp
// // (c) treadle & loam, provisioners llc // #include "RawEventParsing.h" #include "ZESpatialEvent.h" #include "Vect.h" #include "conjure-from-toml.h" #include <map> #include <vector> #include <utility> #include <algorithm> #include <iomanip> #include <sstream> #include <toml.hpp> #include <filesystem> using ...
TOOL
0.900823
4.368994
f3f59767-ba8a-4c4b-961b-79371f91a3da
alfresonico666/C-Plus-Plus-Projects
For-Tablasdel1al10.cpp
//JOSE ALFREDO CASTILLO ORTIZ 1949648 M4 #include <stdio.h> int main(){ int i; int m; int mult; for(i=1; i<=10; i++){ for (m=0;m<=10;m++){ mult=i*m; printf("%d x %d = %d\n",i,m,mult); } } }
ALGO
0.998928
3.664796
c35ffc4d-2abe-4db5-ab60-659693f003f9
maplelearC/LeetCode
145. Binary Tree Postorder Traversal/Leetcode145.cpp
// // Created by 24191 on 2022/9/30. // /* 给你一棵二叉树的根节点 root ,返回其节点值的 后序遍历 。 示例 1: 输入:root = [1,null,2,3] 输出:[3,2,1] 示例 2: 输入:root = [] 输出:[] 示例 3: 输入:root = [1] 输出:[1] */ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : ...
ALGO
0.999878
6.732694
77fce837-6c88-4dd4-ba6a-c0e38961c04a
aditya-agr/GeeksForGeeks-POTD
Insert in Sorted way in a Sorted DLL.cpp
class Solution { public: Node* sortedInsert(Node* head, int x) { // Code here Node* node = new Node(); node->data = x; if(head->data > x){ head->prev = node; node->next = head; return node; } Node * temp = head; while(temp...
ALGO
0.999917
5.666997
bf505708-0887-44c4-87e6-167ae7fee385
fixedperson/boj
boj25305/main.cpp
#include <bits/stdc++.h> using namespace std; vector<int> v; int N, k; bool comp(int a, int b){ return a > b; } int main() { cin >> N >> k; for(int i = 0; i < N; i++) { int x; cin >> x; v.push_back(x); } sort(v.begin(), v.end(), comp); cout << v[k-1]; retu...
ALGO
0.999906
3.751329
d4f9bed8-383a-4080-aca0-b7552cc520d6
srikanth-narayanan/CarND-MPC-Challenge
mpc_to_line/src/Eigen-3.3/bench/benchmark-blocking-sizes.cpp
#include <iostream> #include <cstdint> #include <cstdlib> #include <vector> #include <fstream> #include <memory> #include <cstdio> bool eigen_use_specific_block_size; int eigen_block_size_k, eigen_block_size_m, eigen_block_size_n; #define EIGEN_TEST_SPECIFIC_BLOCKING_SIZES eigen_use_specific_block_size #define EIGEN_T...
TOOL
0.879948
5.95051
c303f8dd-d975-4cee-a3dc-e04ac2c814c7
uzal3002/ProblemSolving-C-C-
GitHub/Codeforces/C++/Sort_It.cpp
#include <bits/stdc++.h> using namespace std; struct Student { string nm; int cls; char s; int id; int math_marks; int eng_marks; }; bool cmp(Student a, Student b) { int totalA = a.math_marks + a.eng_marks; int totalB = b.math_marks + b.eng_marks; if (totalA != totalB) { ...
ALGO
0.98967
3.711558
f5bafad5-7df2-42d4-9812-a9f00a37abe7
josuerom/Competitive-Programming
Training/UVa/CP3/Computational Geometry/Basic Geometry/00476 - Points in Figures Rectangles.cpp
#include <bits/stdc++.h> #define endl '\n' #define debug(X) cout << #X << " = " << X << endl #define fori(i,b,e) for (int i = (b); i < (e); ++i) #define mod(x,m) ((((x) % (m)) + (m)) % (m)) #define sq(x) (x) * (x) using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef ve...
ALGO
0.997852
3.413847
ecd168ae-d65e-4f73-b3ec-b1f751e5d4cf
heejin5178/HASS
mongo-r3.6.18/src/mongo/db/pipeline/accumulator_std_dev.cpp
#include "mongo/platform/basic.h" #include "mongo/db/pipeline/accumulator.h" #include "mongo/db/pipeline/accumulation_statement.h" #include "mongo/db/pipeline/document.h" #include "mongo/db/pipeline/expression.h" #include "mongo/db/pipeline/expression_context.h" #include "mongo/db/pipeline/value.h" namespace mongo {...
TOOL
0.900242
7.616923
de3072cb-b465-4256-8369-75b1ffad71ef
tsunghuanghsieh/leetcode
problems/product-of-two-run-length-encoded-arrays/Solution.cpp
#include <iostream> #include <vector> using namespace std; class Solution { public: // Naive approach (expanding encoded to 1D array and multiply) will run into TLE at runtime in several TCs. vector<vector<int>> findRLEArray(vector<vector<int>>& encoded1, vector<vector<int>>& encoded2) { vector<vector...
ALGO
0.999562
4.537939
392ecbed-bb06-4027-8674-3698d9e78b3c
xdandroid/frameworks_base
media/libstagefright/codecs/amrnb/common/src/q_plsf.cpp
/* ******************************************************************************** * * GSM AMR-NB speech codec R98 Version 7.5.0 March 2, 2001 * R99 Version 3.2.0 * REL-4 Version 4.0.0 * *********************************************************...
ALGO
0.931323
5.527266
e472980b-6f58-4804-8953-d259aed32df7
Nishantranjan91/cpp50DaysPractice
Day_23/volumeOfTheCylinder.cpp
#include<iostream> #include<math.h> using namespace std; int main(){ int radius; int height; float pi= 3.14; float volume=pi*radius*radius*height; cout<<"enter the value of radius:"; cin>>radius; cout<<"enter the value of height:"; cin>>height; cout<<volume; }
ALGO
0.987999
4.360822
a8e183db-3248-4943-83af-6a5d1c71102f
ZZiAnnn/XMU-Learning
大二下/计算机图形学/Lab/计图实验4/eigen-3.3.7/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Eigen::MatrixXf m(2,2); m << 1, 2, 3, 4; //get location of maximum MatrixXf::Index maxRow, maxCol; float max = m.maxCoeff(&maxRow, &maxCol); //get location of minimum MatrixXf::Index minRow, m...
ALGO
0.999735
4.008351
ec85b8fa-a0a6-4c75-9a81-8c73a080aa58
wasif2020/Leetcode-GFG
48-rotate-image/48-rotate-image.cpp
class Solution { public: void transpose(vector<vector<int>>&matrix){ int n=matrix.size(); for(int i=0; i<n; i++){ for(int j=0; j<n; j++){ if(i<j) swap(matrix[i][j],matrix[j][i]); } } } void rotate(vector<vector<int>>& matrix) ...
ALGO
0.999977
6.187115
e8a11cfc-5e04-49fe-9ee9-a48d3b0237bb
sinian666/code_102_5
1cpp_副本4/chapter_sorting/insertion_sort.cpp
/** * File: insertion_sort.cpp * Created Time: 2022-11-25 * Author: Krahets (<EMAIL>) */ #include "../utils/common.hpp" /* 插入排序 */ void insertionSort(vector<int> &nums) { // 外循环:base = nums[1], nums[2], ..., nums[n-1] for (int i = 1; i < nums.size(); i++) { int base = nums[i], j = i - 1; /...
ALGO
0.999924
6.157312
47b0d82b-148d-4858-9eb1-86b1d93bc75f
YevheniiKost/Algorithms
AlgorithmsCPlusPlus/Sorting/MergeSort.cpp
#include <iostream> #include "MergeSort.h" void MergeSort::sort(int arr[], int size) { if (size < 2) return; mergeSort(arr, 0, size - 1); } void MergeSort::mergeSort(int arr[], int start, int end) { if (start >= end) return; int mid = (start + end) / 2; mergeSort(arr, start, mid)...
ALGO
0.999627
5.417041
7fd62119-9b39-4328-8842-9c72a19c2673
Aviral-Saxenaa/coding
sliding_window/Pick_Toys.cpp
#include <bits/stdc++.h> using namespace std; //! Problem Statement // John is at a toy store help him pick maximum number of toys. He can only select in a continuous manner and he can select only two types of toys. int main() { int t; cin >> t; while (t--) { string s; cin >> s; ...
ALGO
0.999911
5.184123
3d0fe906-cf54-42ad-a524-5a5f9ceafec7
Sookmyung-Algos/2021algos
algos_semina/3rd_seminar/C_20207/vinblanx_20207.cpp
#include <iostream> #include <algorithm> #include <queue> using namespace std; int dx[] = { 0, 0, 1, -1 }; int dy[] = { 1, -1, 0, 0 }; struct sc { int start; int end; }; bool operator < (const sc& a, const sc& b) { if (a.start == b.start) return a.end > b.end; return a.start < b.start; } sc sche[1000]; bool ch...
ALGO
0.999629
4.13183
1e078c3b-2cef-466f-af1e-f74143a117e5
divyansh1511/CPP
INTERVIEW BIT/HASHING/anagrams.cpp
#include<bits/stdc++.h> using namespace std; vector<vector<int>> anagrams(vector<string> v){ unordered_map<string , vector<int>> mp; for (int i = 0; i < v.size(); i++) { string t = v[i]; sort(t.begin() , t.end()); mp[t].push_back(i); } vector<vector<int>> ans; for(auto i...
ALGO
0.999979
4.917857
2d58f431-847a-4fd2-87f0-0f75152d4bd2
dgcnz/competitive-programming
atcoder/abc173_a-payment.cpp
#include <bits/stdc++.h> using namespace std; int main(void) { int n; cin >> n; cout << (1000 - (n % 1000)) % 1000 << endl; return 0; }
ALGO
0.999041
3.659418
e77b4604-d68e-4091-9d5a-bfabe45d53b5
sandeshghimire/CPPAPIDESIGN
C++/c20_code/c20_code/01_IteratorAdapters/05_InsertIterator.cpp
#include <algorithm> #include <functional> #include <iterator> #include <vector> #include <iostream> #include <set> using namespace std; // Function template to populate a container of ints. // The container must support push_back(). template<typename Container> void populateContainer(Container& cont) { int num; w...
TOOL
0.996544
4.435305
55ed9929-23f5-40f0-9751-e0ea3cc49bcd
ujjwalsingh12/sheet
count_inversions.cpp
//count_inversions.cpp #include <bits/stdc++.h> using namespace std; int merge(vector<int> &arr, int low, int mid, int high) { vector<int> temp; // temporary array int left = low; // starting index of left half of arr int right = mid + 1; // starting index of right half of arr //Modification 1...
ALGO
0.999962
5.103275
ceaf203a-78f0-4574-961d-928138974a70
Sanskar6000/DSA
Code Templates/Binary_Search/Real_Numbers_binary_search.cpp
#include <bits/stdc++.h> using namespace std; //1. Check if function is monotonically increasing or decreasing //If so find search space to apply binary search double multiply(double number, int n) { double ans = 1.0; for(int i = 1;i<=n;i++) { ans = ans * number; } return ans; } void getNthRo...
ALGO
0.999941
4.406909
534a9c28-a191-4dd2-8bf1-b9e6c3e31af4
Al-Amin134/Compiler-Design
03.cpp
/* بسم الله الرحمن الرحيم ♥♥♥♥♥ ♥♥ ♥♥♥♥♥ ♥♥♥ ♥♥♥ ♥♥ ♥♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥♥♥ ♥♥♥♥ ♥♥ ♥♥♥♥ ♥♥ ♥♥♥♥♥♥♥ ♥♥ ♥♥♥♥ ♥♥♥♥♥♥♥ ♥♥ ♥♥♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥♥♥♥♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥ ♥♥♥♥ */ #include <b...
ALGO
0.965419
3.250732
3de31851-4782-480b-8621-0831331706ab
YB73/Coding-Ninjas-CP
AdvancedRecursion/CreatingExpression1.cpp
#include<bits/stdc++.h> using namespace std; bool exp(vector<int>&arr, int k, int i, int total){ if(i == arr.size()){ if(total == k){ return true; } return false; } bool ans1 = exp(arr,k,i+1,total+arr[i]); if(ans1 == true){ return true; } return exp(arr,k,i+1,...
ALGO
0.999999
4.16461
a5eb4b77-8930-4908-ad7f-c7886912759a
travp624/frameworks_base
media/libstagefright/codecs/amrwb/src/dec_acelp_2p_in_64.cpp
/* ------------------------------------------------------------------------------ Filename: dec_acelp_2p_in_64.cpp Date: 05/08/2007 ------------------------------------------------------------------------------ REVISION HISTORY Description: ------------------------------------------------------------------...
ALGO
0.999722
5.926583
3ff362e3-ec63-4071-88e4-a190e156891c
leegw1211/algorithm
2023하반기/week2/1436-영화감독 숌.cpp
#include <iostream> using namespace std; int main() { int n, i=665, is_endnumber, count = 0; cin >> n; while(true) { i++; is_endnumber = i; while(true) { if (is_endnumber % 1000 % 666 == 0 && is_endnumber % 1000 != 0) { count++; break; } is_endnumber /= 10; if (is_endnumber < 666) break; ...
ALGO
0.999329
3.296441
5313dced-58a5-41f5-9fcb-77c610d9636b
saurav7488/Revision
Graph/Q5_rat-in-a-maze-problem.cpp
#include<bits/stdc++.h> using namespace std; class Solution{ public: void fun(vector<vector<int>>m,vector<string>&path,int i,int j,string c) { if(i==m.size()-1 and j==m.size()-1 and m[i][j]==1) { path.push_back(c); return; } if(i<0 or j<0 or i>=...
ALGO
0.999987
5.441292
0aff1fd8-a3de-4793-9ac7-cddac42ea013
seative/practice
leetcode/hot100/49.cpp
// 给你一个字符串数组,请你将 字母异位词 // 组合在一起。可以按任意顺序返回结果列表。 // 字母异位词 是由重新排列源单词的所有字母得到的一个新单词。 // 示例 1: // 输入: strs = ["eat", "tea", "tan", "ate", "nat", "bat"] // 输出: [["bat"],["nat","tan"],["ate","eat","tea"]] // 示例 2: // 输入: strs = [""] // 输出: [[""]] // 示例 3: // 输入: strs = ["a"] // 输出: [["a"]] #include <algorithm> #include <...
ALGO
0.999874
6.261033
e337893d-88bc-4af3-8a92-b3cf3dcf0a8c
jiangyinzuo/algorithm
src/mathmatic/fast_pow/JiangSu2018_I.cpp
#include<cstdio> using namespace std; long long f[109][109]; long long temp[109][109]; long long resMatrix[109][109]; long long max(long long a, long long b) { return a>b?a:b; } void multiple(long long x[109][109], long long y[109][109], int m) { for(int i=1;i<=m;i++){ for(int j=1;j<=m;j++){ ...
ALGO
0.999981
3.260888
d1ee492e-0f4f-494c-9234-1bbec9620685
Jatin-Shihora/DSA-Essentials_Core-CS
Data_Structures/Array/Inversion_Count/Inversion_Count_Optimized.cpp
//Complexity Analysis of this approach //Time Complexity: O(n^2), Two nested loops are needed to traverse the array from start to end so the Time complexity is O(n^2) //Space Complexity:O(1), No extra space is required. // C++ program to Count Inversions // in an array #include <bits/stdc++.h> using namespace std; i...
ALGO
0.999928
4.557744
3b8c8497-14fe-4aaf-b9cd-4143e704ccf8
nucleargezi/acm-icpc
problemset/prac_pam/P_4287_SHOI_2011_双倍回文.cpp
#include "YRS/Z_H/MeioN.hpp" #include "YRS/all.hpp" #include "YRS/string/pam.hpp" // #define tests void Yorisou() { INT(n); S(s); PAM seg(s); vector lps = seg.keis_lps(); vector le = seg.lps_len_per_node(); const int N = len(lps); ll ans = 0; for (int i = 2; i < N; ++i) { auto [c, l] = lps[i]; ...
ALGO
0.999868
4.928213
b92b2e75-0c56-4aa4-ad49-c0e3afe74f27
imrann2005/cp-dsa-cf-lc-cc
1913B.cpp
#include <bits/stdc++.h> using namespace std; #define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define ll long long #define vi vector<int> #define vll vector<ll> #define pb push_back #define all(v) v.begin(), v.end() #define sz(v) ((int)(v).size()) #define yes cout << "YES\n" #define no cout << "NO\n" ...
ALGO
0.999789
5.12899
072572a3-cc30-4219-8a7b-b1c5bb95e989
ACES-DYPCOE/Data-Structure
Tree/C++/Range_Update_Trick.cpp
//Range Update trick // The program allows you to update a range of array values. //for eg. If we have an integer array of 10 elements and we want to update all the values from the 5th term to the 9th term by X(an integer) then we can use this programme // the function takes in 3 arguments, the stating location, the en...
ALGO
0.999554
3.739274
42339f84-5ce2-4c3a-b6d6-ea11bc588968
seeeeeeven7/informatics
Codeforces/18/1853/B.cpp
#include <iostream> #include <string> #include <algorithm> #include <iomanip> #include <vector> #include <map> #include <stdio.h> #include <math.h> #include <string.h> #include <set> #include <queue> using namespace std; /* Template starts here */ long long mo = 1000000007; // This variable may be changed later #def...
ALGO
0.999963
3.590442
66d0e1b8-1f6c-44a6-a403-4cf05ff13802
jayeshborase/Leetcode_solution
872-leaf-similar-trees/872-leaf-similar-trees.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999949
6.37368
77a05051-aca5-4734-8b68-98bc10f739b5
sandesh-theMayGuy/DSA-in-C-CPP
CPP/knapsack algorithms/Fractional_Knapsack.cpp
//FRACTIONAL KNAPSACK // greedy approach to solve the knapsack problem #include<iostream> using namespace std; class greedy{ public: int id; float weight; float profit; float pw; float amount; void ratio(){ pw=profit/weight; } }; int main(){ int n; float cap,totalm=0,totalp=0; cout<<"enter the no.of ...
ALGO
0.999853
3.919926
46de5b39-cdd7-4772-8bc0-f7d558e44c6d
habib09/problem-solution
uva/10701 - Pre, in and post.cpp
#include <iostream> #include <cstring> #include <cstdio> using namespace std; #define MAX_CHARS 53 char preo[MAX_CHARS], ino[MAX_CHARS]; struct Node{ char key; Node *left; Node *right; Node(){ this->key = key; left = NULL; right = NULL; } }; int find(char ch, int lo, int h...
ALGO
0.999606
3.67554
a9b6ad08-613f-4bf3-ab82-d668e9fdb297
kypomon/PAT
B1001.cpp
//patҼ1001 ˲(3n+1) #include<iostream> #include<string> #include <iomanip> using namespace std; int main() { int n; cin >> n; int k = 0; while (n!=1) { k++; if (n % 2 == 0) { n = n / 2; } else n = (3 * n + 1) / 2; } cout << k; system("pause"); return 0; }
ALGO
0.999922
4.208932
2262f793-8884-4fc7-b1f8-75164063576c
shubham25kr07/Artificial_Intelligence
Lab_3/q4a.cpp
#include<bits/stdc++.h> #define mv_ map<string,vector<string>> #define m_ map<string,int> #define vp_ vector<vector<vector<pair<string,string>>>> #define pp_ pair<int,pair<int,int> > #define IOS ios_base::sync_with_stdio(false);cin.tie(NULL); using namespace std; void initialise_visited(mv_ &sdata,m_ &visited) { f...
ALGO
0.999696
4.082635
dafebeb6-0a90-4e1f-a937-e0bebe175a14
YOU-i-Labs/webkit
Source/WebCore/platform/MIMETypeRegistry.cpp
#include "config.h" #include "MIMETypeRegistry.h" #include "MediaPlayer.h" #include <wtf/HashMap.h> #include <wtf/MainThread.h> #include <wtf/NeverDestroyed.h> #include <wtf/StdLibExtras.h> #if USE(CG) #include "ImageSourceCG.h" #include "UTIRegistry.h" #include <ImageIO/ImageIO.h> #include <wtf/RetainPtr.h> #endif ...
CONFIG
0.885713
6.514897
e57ea322-0434-460f-bcce-9d97edbc8662
m4nh/visy
src/apps/mls_filter.cpp
#include <pcl/ModelCoefficients.h> #include <pcl/point_types.h> #include <pcl/io/pcd_io.h> #include <pcl/kdtree/kdtree_flann.h> #include <pcl/surface/impl/mls.hpp> #include <pcl/surface/mls.h> #include <pcl-1.8/pcl/visualization/pcl_visualizer.h> #include <pcl/features/normal_3d.h> #include <pcl/features/normal_3d_omp...
ALGO
0.962608
5.013758
37402ed8-c461-4990-a398-a15c5f8c7f86
JLUrob/multi-sensor_calibration_evaluation
lidar2camera/Method/my_lidar2camera/joint_calib/3rdparty/eigen3/doc/snippets/MatrixBase_all.cpp
Vector3f boxMin(Vector3f::Zero()), boxMax(Vector3f::Ones()); Vector3f p0 = Vector3f::Random(), p1 = Vector3f::Random().cwiseAbs(); // let's check if p0 and p1 are inside the axis aligned box defined by the corners boxMin,boxMax: cout << "Is (" << p0.transpose() << ") inside the box: " << ((boxMin.array()<p0.array(...
ALGO
0.994676
3.460357
6f5f3127-7767-43fa-91de-333fdbbd4cce
shelltdf/osgall
prebuild/cgal-master/Surface_mesh_topology/examples/Surface_mesh_topology/facewidth.cpp
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h> #include <CGAL/Linear_cell_complex_constructors.h> #include <iostream> #include <fstream> #include <cstdlib> #include <CGAL/Curves_on_surface_topology.h> #include "draw_facewidth.h" using LCC_3 =CGAL::Linear_cell_complex_for_combinatorial_map<2, 3>...
ALGO
0.985883
5.879971
ef526933-f24c-46f5-95e8-b152ecfbc847
RealworldSystems/android-qt
util/qlalr/examples/lambda/main.cpp
#include "lambda.h" #include <cstdio> #include <cstdlib> #include <cstring> #include "parser_table_p.h" class Parser: protected parser_table { public: union Value { int ival; // ### more... }; public: Parser(); ~Parser(); bool parse(); protected: inline void reallocateStack(); ...
TOOL
0.879262
5.933392
8359c00c-6be4-48d8-876c-e709486beabe
anishgupta675/FINAL450
Binary_Trees/Print_all_K_Sum_paths_in_a_Binary_tree/main.cpp
#include <bits/stdc++.h> using namespace std; // utility function to print contents of // a vector from index i to it's end void printVector(const vector<int>& v, int i) { for (int j = i; j < v.size(); j++) cout << v[j] << " "; cout << endl; } // binary tree node struct Node { int data; Node...
ALGO
0.999933
3.991905
a9b4a849-9e67-4e20-a877-e43d05afeb9f
i-am-sahin/PokeDex
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998859
6.785645
dc8f084c-1ccb-4305-9734-ce46f41701c6
HitakshSharma13/C-Class-and-Objects-Solved-Examples
ex31.cpp
// C++ program to Calculate Electricity Bill of Person using Class. #include<iostream> #include<cmath> #include<cstring> using namespace std; class ElectricityBill { private: int customer_no; string customer_name; int units; double bill; public: void input(); void calculate(); voi...
TOOL
0.884385
5.442478
95352f9b-a3e6-4804-b2c7-56b16185068d
LDlornd/OI-Memory
洛谷/比赛/粲泽的小测试/U13904 龙盘雪峰信息解析器/U13904 龙盘雪峰信息解析器.cpp
#include<cstdio> #include<iostream> #include<cstring> #include<cmath> using namespace std; const int MAXN=25000; char s[MAXN][9],prim[MAXN],gs=0; inline bool judge(int x) { if(s[x][1]=='1'&&s[x][2]=='0'&&s[x][3]=='1') return true; if(s[x][1]=='1'&&s[x][2]=='1'&&s[x][3]=='1') return true; if(s[x][1]=='0') {p...
ALGO
0.9994
3.050285
dd581a04-803a-4a63-b4de-7348c0ecd84e
fuqiuai/LeetCode
algorithms/83RemoveDuplicates.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* deleteDuplicates(ListNode* head) { if (!head) return head;//特殊情况,空链表 ListNode *tail=head; while(ta...
ALGO
0.999945
5.779151
b363f023-cf0a-4609-88ae-52e26894728f
GuptaDivyansh26/DSA-Practice
codes/2025-02-24/Sum of first n integers.cpp
#include<iostream> using namespace std; int sum(int n) { if(n <= 0) return 0; return n + sum(n - 1); } int main() { int n; cout << "Enter num: "; cin >> n; cout << "Sum from 1 to num: " << sum(n); return 0; }
ALGO
0.99947
4.146377
a700895c-dcc8-41db-9ac2-9ed284b37e9c
Innnoa/STL
Container library/list/reverse/main.cpp
/** * ClassName: ${NAME} * package: ${PACKAGE_NAME} * Description: * @Author: innno * @Create: 2024/2/27 - 21:54 * @Version: v1.0 */ #include <bits/stdc++.h> using namespace std; ostream& operator<<(ostream& ostr, const list<int>& list) { for (auto& i : list) ostr << ' ' << i; return ostr; } in...
ALGO
0.999045
4.274911
472466e3-9628-40f6-be15-436f15086f0e
amineAllache/llvm-bolt19
libc/src/math/generic/fminimum.cpp
#include "src/math/fminimum.h" #include "src/__support/FPUtil/BasicOperations.h" #include "src/__support/common.h" #include "src/__support/macros/config.h" namespace LIBC_NAMESPACE_DECL { LLVM_LIBC_FUNCTION(double, fminimum, (double x, double y)) { return fputil::fminimum(x, y); } } // namespace LIBC_NAMESPACE_DEC...
ALGO
0.999457
5.988354
364661ea-9528-4f3b-9055-cfd60aa51fb7
johnannysker/Conversor-de-moeda
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998784
6.761023
bb649c8a-6efb-4ffb-b268-d2f12057fbf7
remote-android/platform_external_swiftshader
third_party/llvm-7.0/llvm/lib/Analysis/OrderedBasicBlock.cpp
#include "llvm/Analysis/OrderedBasicBlock.h" #include "llvm/IR/Instruction.h" using namespace llvm; OrderedBasicBlock::OrderedBasicBlock(const BasicBlock *BasicB) : NextInstPos(0), BB(BasicB) { LastInstFound = BB->end(); } /// Given no cached results, find if \p A comes before \p B in \p BB. /// Cache and numbe...
ALGO
0.996509
7.905323
c41c12ae-0d40-41a4-b09c-5b4b5a62cb31
ArtemSilinn/school-homework
11.11.18-hw3-prime/6.cpp
/* Напишите программу, выписывающую все элементы последовательности, имеющие не менее пяти делителей */ #include <iostream> using namespace std; int main() { int n; cin >: n; int *m = new int[n]; for (int i = 0; i < n; i++) { cin >> *(m + i); }; cout << '\n'; for (int i = 0; i < n; i++) { int k = 0; i...
ALGO
0.999374
3.361891
565d85d1-a009-42df-a0e4-653b3370de0c
kamyu104/LeetCode-Solutions
C++/maximum-good-people-based-on-statements.cpp
// Time: O(n^2 * 2^n) // Space: O(1) // brute force, bitmask class Solution { public: int maximumGood(vector<vector<int>>& statements) { auto check = [&statements](int mask) { for (int i = 0; i < size(statements); ++i) { if (((mask >> i) & 1) == 0) { continu...
ALGO
0.995379
6.11371
a434a3b3-583d-49ac-87fb-d8ad485f4cae
Yatharth-Tomar/Assignment-1
index.cpp
#include <iostream> #include <unordered_map> using namespace std; int firstUniqChar(string s) { unordered_map<char, int> charFreq; for (char c : s) { charFreq[c]++; } for (int i = 0; i < s.length(); i++) { if (charFreq[s[i]] == 1) { return i; } return -1; ...
ALGO
0.99801
6.426643
eb97893a-c431-47dd-8897-7555497993e8
debsourav33/Category-Wise-Oonline-Judge-Solutions
Trie/4682- Xor Sum.cpp
#include<bits/stdc++.h> using namespace std; //{ #define cel(n,k) ((n-1)/k+1) #define sets(a) memset(a, -1, sizeof(a)) #define clr(a) memset(a, 0, sizeof(a)) #define max(a,b) ((a)>(b)? (a):(b)) #define min(a,b) ((a)<(b)? (a):(b)) #define fr(n) for(int i=0;i<n;i++) #define fr1(n) for(int i=1;i<=n;i++) #define pb push_b...
ALGO
0.999988
4.295014
cd8aeae8-3fe1-440d-8e81-c6773aa4ac3e
Ayushluthra2001/DataStructurewithAyushluthra
Reach Alice.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: string reachAlice(int d, int x, int y, int k) { // code here x = d/x; y = d/y + k ; return x<=y ? "Walk" : "Bike"; } }; //{ Driver Code St...
ALGO
0.999273
5.079982
20d8ff49-82c9-43e0-bb56-1f41c2af3ef9
pulkitgaur07/Data-Structures-and-algorithm
Dynamic Programming/all_palindromic_partitions.cpp
// Question : Given a string s, find all possible ways to partition it such that every substring in the partition is a palindrome. // Examples: // Input: s = "geeks" // Output: [[g, e, e, k, s], [g, ee, k, s]] // Explanation: [g, e, e, k, s] and [g, ee, k, s] are the only partitions of "geeks" where each substring is...
ALGO
0.99974
6.425328
2a647622-5eb0-4374-ac9c-43f1d9e62789
kalu-github/module_qrcode
lib_czxing_source_all_1.2.0/src/main/cpp/zxing_1.2.0/src/ReedSolomonDecoder.cpp
#include "ReedSolomonDecoder.h" #include "GenericGF.h" #include "ZXConfig.h" #include <algorithm> #include <stdexcept> #include <utility> namespace ZXing { static bool RunEuclideanAlgorithm(const GenericGF& field, std::vector<int>&& rCoefs, GenericGFPoly& sigma, GenericGFPoly& omega) { int R = Size(rCoefs); // == ...
ALGO
0.998328
6.783045
bd6b3983-110f-4021-ae5c-279219fef5ad
LihengGong/parallel_proj
OpenMP/ext/eigen/doc/examples/QuickStart_example2_dynamic.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; using namespace std; int main() { MatrixXd m = MatrixXd::Random(3,3); m = (m + MatrixXd::Constant(3,3,1.2)) * 50; cout << "m =" << endl << m << endl; VectorXd v(3); v << 1, 2, 3; cout << "m * v =" << endl << m * v << endl; }
ALGO
0.998946
3.513405
9337cb9f-6280-40b1-8753-1af8ba88a63b
harsh-kumar-css/DSA
codeforces/b.cpp
#include<bits/stdc++.h> using namespace std; int main() { long long int n =0,q=0; cin>>n>>q; int sum =0,x=0; vector<int>v; while(n--) { cin>>x; sum+=x; v.push_back(x); } while(q--) { int type = 0; cin>>type; if(type == 1) { ...
ALGO
0.999519
3.566347
05255b64-f781-4ed7-b501-559828da9ae4
coody0111/LeetcodeRecord
binary_tree/94/inorder.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999935
6.48423
cc55b000-42a1-4cb2-adb6-1f45fc74c747
SageEkpang/AdvancedRealtimeGraphicsNew
FrameworkDX11/DirectXMeshTangentFrame.cpp
#include "DirectXMeshP.h" using namespace DirectX; namespace { //--------------------------------------------------------------------------------- // Compute tangent and bi-tangent for each vertex //--------------------------------------------------------------------------------- template<class index_...
ALGO
0.996761
7.803738
c4413201-928a-4584-b6fe-52cb6830e9ea
dbdxnuliba/IHMC-
ihmc-perception/matlab/drillTask/lib/kdtree/kdtree_nearest_neighbor.cpp
#include "KDTree.h" #ifndef CPPONLY #include "mex.h" void retrieve_tree( const mxArray* matptr, KDTree* & tree){ // retrieve pointer from the MX form double* pointer0 = mxGetPr(matptr); // check that I actually received something if( pointer0 == NULL ) mexErrMsgTxt("vararg{1} must be a valid k-...
ALGO
0.922084
5.151767
861914ba-6ebb-4507-b10b-69fd5caa3b7c
Chan531/BaekJoon_Online_Judge
수정렬하기4.cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, num; vector<int> v; cin >> n; for (int i = 0; i < n; i++) { cin >> num; v.push_back(num); } sort(v.begin(), v.end(), greater<int>()); ...
ALGO
0.999889
4.679408
ac5d0fcb-ad38-4afc-8520-6e1354988ac3
jhyeon99/BOJ
BOJ/2623.cpp
#include <bits/stdc++.h> using namespace std; const int MAX = 1001; int par[MAX]; vector<int> child[MAX]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; for (int i = 0; i < m; i++) { int s; cin >> s; int prev = 0; for (int i = 0; i < s; i++) { int curr; cin >> curr...
ALGO
0.999978
3.802481
fa0edbff-9f10-48fe-a63e-f7cc675a6bd0
amansaxena1/Competitive-Coding
Codeforces/D_Twist_the_Permutation.cpp
#include <bits/stdc++.h> #define llint long long int #define mod 1000000007 #define pb push_back #define mp make_pair #define ff first #define ss second #define all(c) c.begin(), c.end() #define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr) using namespace std; void aman() { llint n; ...
ALGO
0.999925
4.348417
e1f15348-828c-4cd5-9e47-6319b5bde03f
mamun4122/My-Online-Judge-Submission
Codeforces/Codeforces Round #374 (Div. 2) - 721/721B-Passwords.cpp
#pragma comment(linker, "/stack:640000000") #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> #include <iomanip> #include <iterator> #include <list> #include <map...
ALGO
0.999749
3.420606
36a47f8b-5724-4f23-8684-260f7f9bc176
ObsidianCoreCoin/Obsidiancoin
src/rest.cpp
#include <attributes.h> #include <chain.h> #include <chainparams.h> #include <core_io.h> #include <httpserver.h> #include <index/txindex.h> #include <primitives/block.h> #include <primitives/transaction.h> #include <rpc/blockchain.h> #include <rpc/server.h> #include <streams.h> #include <sync.h> #include <txmempool.h> ...
WEB
0.888765
5.929643
600ebb06-e3de-4fe9-89a7-d4d4a3327015
arjashok/COMSC-110
Week11-Chapter10/mySavingsPlan3.cpp
// Lab 10.2 // Programmer: Arjun Ashok // Editor(s) used: Visual Studio Code && Replit.com // Compiler(s) used: Visual Studio Code w/ MinGW && Replit.com // #include <algorithm> #include <fstream> // File IO #include <iomanip> #include <iostream> // Console IO #include <string> // String var using namespace std; #in...
TOOL
0.984462
4.544415
445d6b99-2700-4c59-9547-b6ae678e4e08
Sagar-Mondal/GFG-POTD
Difficulty: Medium/Topological sort/topological-sort.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: void topoSortUtil(int v, vector<vector<int>>& adj, vector<bool>& visited, stack<int>& st) { visited[v] = true; for (int i : adj[v]) { if (!visited...
ALGO
0.999836
6.583778
88237a1d-b862-418a-bfe3-b1ad804ea896
ishandutta2007/codeforces
sus/normal/1692/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; #define yes cout << "YES" << '\n' #define no cout << "NO" << '\n' #define sp " " #define ln '\n' void solve2(char arr[8][8]){ for(int i=0; i<8; i++){ for(int j=0; j<8; j++){ if(arr[i][j]=='#' &...
ALGO
0.999634
3.437329
7564550f-c0fb-454e-b8a4-3fab983406a6
Yoochanhong/codetree-TILs
240528/홀수만 더하기/add-only-odd-numbers.cpp
#include <iostream> int main() { int n, c = 0; std::cin >> n; for (int i = 0, a; i < n; i++) { std::cin >> a; if (a % 2 && a % 3 == 0) c += a; } std::cout << c; return 0; }
ALGO
0.999864
4.420568
b106dc87-96ee-44ed-96ac-71ee1098c06b
Abirrahman2/DYNAMIC-PROGRAMMING
FROG.cpp
#include<bits/stdc++.h> using namespace std; int cost(int index,int arr[],int n,int k,int dp[]) { if(n==index) { return 0; } if(dp[index]!=-1) { return dp[index]; } int r=INT_MAX; int l=0; for(int i=1;i<=k;i++) { if(index+i<=n) { l=cost(...
ALGO
0.999979
4.495117
344d663e-5d47-4b1d-9a6b-281527a2a49f
vfolunin/archives-solutions
CSES/1141.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> #include <map> #include <string> using namespace std; struct Counter { map<int, int> count; int duplicateCount = 0; void inc(int x) { duplicateCount += count[x]++ == 1; } void dec(int x) { duplicateCount -= ...
ALGO
0.999901
4.354513
0c3d0c2f-0c38-4bee-9117-a3f051b72d1b
msujera0111/LC-solutions
LC solutions/826_Most_Profit_Assigning_Work.cpp
#include <bits/stdc++.h> using namespace std; class Solution { public: int maxProfitAssignment(vector<int>& difficulty, vector<int>& profit, vector<int>& worker) { int n=size(profit); vector<pair<int,int>> combine(n); for (int i = 0; i < n; i++) { combine[i]={difficulty...
ALGO
0.999981
5.328457
b509bb17-b88a-484b-8d99-c01bce28cf32
Prahmodh-Raj1/DSA-Solutions
Dynamic Programming/DP on Stocks/Best time to sell stock with transaction fee.cpp
class Solution { public: int getAns(vector<int> &Arr,int ind,int buy,int n,int fee,vector<vector<int>> &dp){ if(ind==n) return 0; //base case if(dp[ind][buy]!=-1) return dp[ind][buy]; int profit; if(buy==0){// We can buy the stock profit = max(0+getAns(Arr,ind+1,0,n,f...
ALGO
0.999933
5.234057
3842ee46-7d4f-4465-94e0-ba17e287876a
jackeylovely-hub/2021_algorithm_camp
week8/class_01_图论/acwing_850._Dijkstra求最短路 II.cpp
#include<iostream> #include<algorithm> #include<queue> #include<cstring> using namespace std; const int N = 1e6 + 10; typedef pair<int, int> PII;//最短路 节点(node y) //邻接表存储稀疏图 int h[N], e[N], w[N], ne[N], idx; int dist[N]; bool st[N]; int n, m; void add(int a, int b, int c) { e[idx] = b, w[idx] = c, ne[idx] = h[a...
ALGO
0.999902
4.405406
46adc340-0d75-4244-8c83-14a8f26d5a1c
GustavoZanardi15/Prova-Pratica-PROJETO-BARBEARIA
windows/runner/utils.cpp
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unuse...
TOOL
0.998756
6.772262
52eee95e-f6b9-40e7-a281-0f8cc536309e
Allergy27/Allergy-to-not-study
cpp/Luogu/25_5_16/7_7_Fenwick_3374.cpp
/* Copyright 2025 Allergy * @author Allergy * @email <EMAIL> * @workspace cpp\luogu\25_5_16\7_7_Fenwick_3374.cpp * @date 2025/05/16 18:26:07 */ #include <bits/stdc++.h> #define lowbit(x) ((x) & (-(x))) #define ln '\n' #define judge(x) std::cout << ((x) ? "Yes\n" : "No\n") using ll = int64_t; using PII...
ALGO
0.999934
4.57678
3d283bbd-1b6f-4be3-b4f2-bba34e0a4977
geez6572/leetcode
cpp/easy/MaximumProduct.cpp
#include <climits> #include <vector> using namespace std; int maximumProduct(vector<int> &nums) { int min1 = INT_MAX, min2 = INT_MAX; int max1 = INT_MIN, max2 = INT_MIN, max3 = INT_MIN; for (auto num : nums) { // 处理获取最大3个值的逻辑 // 如果num大于最大值则依次往下赋值 if (num > max1) { max3 = max2; max2 = max1...
ALGO
0.999856
5.242894
df94e638-dfa2-418b-8051-8a3f85068e82
turingcompl33t/pelib
PeLib/PeLib.cpp
// PeLib.cpp // Portable Executable parsing library implementation. #include <windows.h> #include <memory> #include <vector> #include <string> #include <iostream> #include "PeLib.h" #include "Internal.h" namespace PeLib { /* ---------------------------------------------------------------------------- * PeParser:...
TOOL
0.970273
5.073427