uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
4202eef4-f1e6-4fda-9f3b-4310371f11e7
Otherwa/Data-Structures-and-Algorithm
Stack/2ReverseStack.cpp
#include<bits/stdc++.h> using namespace std; void insertAtBottom(stack <int> &st, int top){ //we are sending reference because this is a void function all the changes will be made in the stack only. //base condition: if(st.empty()){ st.push(top); return; } int ele=st.top(); ...
ALGO
0.999641
5.086819
401bbdf0-12ab-4ea2-a4ff-a742d4692767
CHIANGEL/leetcode
leetcode_algorithms/cpp/0014_LongestCommonPrefix/LongestCommonPrefix.cpp
class Solution { public: string longestCommonPrefix(vector<string>& strs) { int n = strs.size(); if (!n) return ""; int min_length = strs[0].length(); for (int i = 1; i < n; ++i) min_length = min_length > strs[i].length() ? min_length : strs[i].length(); for (int i = 0; i < min_length; ++i) for (int...
ALGO
0.999752
5.935015
69c61631-0a67-4eb4-b938-0bd76040e541
0x11111111/VisualLab
dependencies/include/igl/copyleft/cgal/triangulate.cpp
#include "triangulate.h" #include "assign_scalar.h" #include "../../list_to_matrix.h" #include <CGAL/Point_2.h> #include <CGAL/Constrained_Delaunay_triangulation_2.h> #include <CGAL/Constrained_triangulation_plus_2.h> #include <CGAL/Triangulation_face_base_with_info_2.h> #include <CGAL/Exact_predicates_exact_constructi...
ALGO
0.998599
6.653448
afe362a1-53a9-4c2b-9179-a7d9ddf6e88e
solorzaa/Team-B-MRSD
PROJECT FILES/Localization/IMU/Beagle_Calibration/pr12/pr12/eigen-eigen-10219c95fe65/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; int main() { Eigen::MatrixXf mat(2,4); mat << 1, 2, 6, 9, 3, 1, 7, 2; std::cout << "Column's maximum: " << std::endl << mat.colwise().maxCoeff() << std::endl; }
ALGO
0.99981
3.779679
e6b8fc7f-a95e-4798-91d6-c38142b74ea9
npv2k1/CTDLvaGT
ZCode/Cpp/DSA01006.cpp
#include <iostream> using namespace std; int x[50] = {0}, vs[50] = {0}; void DeQuyHV(int k,int n){ for (int i = n; i >=1; i--) { if(!vs[i]){ x[n-k+1]=i; vs[i]=1; if(k==1){ for (int j = 1; j <= n; j++) { cout<<x[j]; ...
ALGO
0.999894
4.417768
40b51ee1-32fe-4f0f-8ccd-aed8e2489943
jiiink/DataStructure
STL_array_and_vector_1b/STL_2800___Vector_General_1e/Vector_Apply_0200___Deep_Vector_2e/Deep_Vector_100___Simple_2D_vector_Indexing.cpp
#include <bits/stdc++.h> #define allout(MSG,X) std::cout<<"\n"<<MSG <<" : ";for(auto w:X)std::cout<<w<<", " using namespace std; int main() { vector< vector <int> > deep_vec { {3,4,5}, {32, 32, 33}, {77}, \ {101, 102, 103,104}, {1000,1010}} ; for( auto welem : deep_vec ) {...
ALGO
0.948118
3.309518
15ff91ae-b530-487c-ab25-d23527526f85
Gon20000/my-cpp-journey
cp/codeforces/hello_2019/b.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n{}, total{}; cin >> n; vector<int> dirs(n); for(int& x : dirs) { cin >> x; total += x; } int subsets{1 << n}; for(int i{0}; i < subsets; ++i) { int curr{}; for(int j{}; j ...
ALGO
0.999964
4.384514
9f4fd9de-659c-4597-a83d-1c23e0eb543f
anderasinggih/COTS_2211104007_Andera-Singgih-Pratama
p1/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.998095
6.76775
67f61953-fe21-4972-a67c-11b9bc4a1e5e
MohamadAshrafSalama/User-Stories-generation
Code_Snippets/201-210/s461290725.cpp
#include <iostream> #include <cstdio> #include <cstdlib> #include <algorithm> #include <cmath> #include <vector> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <queue> #include <ctime> #include <cassert> #include <complex> #include <string> #include <cstring> #include <chrono> ...
ALGO
0.999823
4.142391
29996edb-0680-4590-b8d9-f4939aa56a5b
Gustavo-Cardoso/fatec-gti
FATEC/1° Semestre/Algoritmos/Aula 9 - 06.04.2023/converte_centrimetro_para_polegada/converte_centrimetro_para_polegada.cpp
#include "stdio.h" int main() { float cen = 0, pole = 0; char resp; do { printf("Informe o valor em centimetros: \n"); scanf(" %f", &cen); if (cen > 0){ pole = cen * 0.3937; printf("%.2f centimetros equivale %.2f polegadas \n", cen, pole); } printf("Deseja converter outros? \n"); sca...
TOOL
0.87312
3.669801
cc3350da-39d8-4654-8ca0-a0ad2c4ff28d
Veljko28/cpp-data-algrtms
codeforces/ConveyorsBelt.cpp
#include <iostream> #include <cmath> #include <vector> #include <algorithm> #include <iterator> #include <numeric> #include <string> #include <cstring> #include <ctime> #include <set> #include <list> #include <sstream> #include <iomanip> #include <map> #include <stack> #include <unordered_map> #include <queue> #include...
ALGO
0.99948
4.531819
309c1b53-d43a-4abe-b718-0739e1d391ad
michaelarakel/acmp-solutions
A Walk with a Horse (0325).cpp
#include <iostream> #include <string> using namespace std; char col (int i, int j) { char c; if (i%2 == j%2) c = 'w'; else c = 'b'; return c; } int main () { //ifstream cin ("INPUT.TXT"); //ofstream cout ("OUTPUT.TXT"); const int f1[] = {-2, -2, -1, -1, 1, 1, 2, 2}, f2[] = {-1, 1, -2, 2, -2, 2, -1, 1...
ALGO
0.999985
3.658044
79685f1c-adbc-498e-b206-bd8c98535752
Shihabagent47/chat_app_frontend
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.998733
6.76775
a9becad6-7a2d-45a6-a2f7-f8b01b55ca0f
kunal114/LeetCode
105-construct-binary-tree-from-preorder-and-inorder-traversal/105-construct-binary-tree-from-preorder-and-inorder-traversal.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.999996
6.566833
de9d4e0c-7f20-449d-9ec6-9ef6a1db31c2
hfhongzy/CodeForOI
codeforces-1523d.cpp
#include <bits/stdc++.h> #define rep(i, j, k) for(int i = j; i <= k; ++ i) #define per(i, j, k) for(int i = j; i >= k; -- i) using namespace std; typedef long long ll; const int N = 2e5 + 10; int n, m, p, len, q[N]; char s[N][64], ans[64]; int main() { default_random_engine e; int w = 20050910 ^ chrono::high_resolu...
ALGO
0.999959
3.356945
26db7c02-da59-49ba-a2c1-0b595d4278ec
callmepandey/Code-Geass
Code-Geass-Backend-main/codes/2c88c290-98b4-4c58-8ec2-13a90930fd50.cpp
#include <iostream> #include <unordered_map> using namespace std; int main() { int t; cin >> t; while(t--) { int n , s; cin >> n >> s; unordered_map < int,int > frq; int done = 0; for(int i = 0;i<n;++i) { int a; cin >> a; if(frq.count(...
ALGO
0.999669
3.038184
6db9b4f2-4ec0-4036-9398-ece52c193582
Kandepet/ImageSimilarity
ext/HaarWavelet/imgseek.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <math.h> #include <Magick++.h> #include "haar.h" #include "imgseek.h" #include <fstream> #include <iostream> using namespace std; using Magick::Image; using MagickCore::DestroyImage; using MagickCore::ExceptionInfo; using namesp...
ALGO
0.991244
4.745166
e9482add-7860-4f1b-a900-b8fd93df815b
MiniotBV/wheel2
wheel2/speedcomp.cpp
#include "log.h" #include "speedcomp.h" #include "carriage.h" #include "pins.h" #include "helper.h" #include "plateau.h" void SpeedComp_::init() { LOG_DEBUG("speedcomp.cpp", "[init]"); float radialCounter; clearSamples(); clearCompSamples(); for (int i = 0; i < pulsesPerRev; i++) { radialCounter = (i * ...
ALGO
0.902095
3.068758
98a011c9-4c95-43a9-b8a2-05ba7bef76bd
G1rmmr/code-test
BOJ/C++/16236_baby_shark.cpp
#include <iostream> #include <array> #include <queue> struct Shark { short Y; short X; short Size; short NumFish; }; const short kMAX = 20; const std::array<short, 4> gDy = {1, -1, 0, 0}; const std::array<short, 4> gDx = {0, 0, -1, 1}; std::array<std::array<short, kMAX>, kMAX> gMap, gDist; bool BFS...
ALGO
0.999749
4.859876
532a167b-bd3a-4ae4-9e07-60e1208c9836
MijaTola/Codeforce
361B.cpp
#include <bits/stdc++.h> using namespace std; int main(){ int n,k; int v[100000]; cin >> n >> k; if(n == k) return cout << -1, 0; for (int i = 1; i < n - k; ++i) cout << i + 1 << " "; cout << 1 << " "; for (int i = n-k+1; i <= n; ++i) cout << i << " "; return 0; }
ALGO
0.999911
3.366654
1407d0f2-f9fc-4bd0-818a-81a21e8cdc3a
Chiyoshic/SCAU-OJ-online-judge
2-数据结构/实验6-排序/8638-直接插入排序.cpp
#include <iostream> #include <vector> using namespace std; /* 直接插入排序算法实现 * 算法思想:将待排序元素插入到已排序序列的适当位置 * 记忆方法:类似整理扑克牌,每次将新牌插入到已排序牌中的正确位置 */ int main(){ // 输入数据 int n; // 元素个数 cin >> n; vector<int> v(n+1, 0); // 使用v[0]作为哨兵 for(int i=1; i<=n; i++){ cin >> v[i]; // 输入待排序元素 } // 直接...
ALGO
0.999991
4.505604
684d6175-edc8-4bc6-ac33-351cf08a0cf2
whiteibescu/CPP
_2020_06_25Assignment/tree3.cpp
#include <cstdio> #include <iostream> using namespace std; int main(void) { int i, j; int multiplication[10][10]; //2 迭 for (i = 2; i <= 9; i++) // ϰ ϱ { cout << "\n[" << i << "]\n\n"; for (j = 1; j <= 9; j++) { multiplication[i][j] = i * j; cout << i << "X" << j << "=" << multiplication[i][j] << ...
ALGO
0.989524
3.658207
2d8b7800-783e-423c-9ca3-83b86f8090ef
bzztbomb/win32libs-lightspark
llvm/examples/Kaleidoscope/Chapter5/toy.cpp
#include "llvm/DerivedTypes.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/JIT.h" #include "llvm/LLVMContext.h" #include "llvm/Module.h" #include "llvm/PassManager.h" #include "llvm/Analysis/Verifier.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetSelect.h" #inclu...
TOOL
0.958761
6.942013
920806a7-d239-4bfb-b52b-d6bfb2081d61
MarkKim1/random_study
Samgsung/4386.cpp
#include <iostream> #include <vector> #include <math.h> #include <algorithm> using namespace std; vector<pair<double, double>> coords; vector<pair<double, pair<double, double>>> graph; class DSU { public: vector<int> root; DSU(int x) { for (int i = 0; i < x; i++) { root.push_bac...
ALGO
0.999768
3.95264
2e24b6d7-d19c-4b63-b53b-899ed2233f4e
poulamibonnie/AlgorithmAndDesign
StableMatching/Pet.cpp
//--------------------------------------------------------------------------- // PET.CPP // Defination of members exclusive to Person class. // Author(s): Poulami Das Ghosh //--------------------------------------------------------------------------- // Pet class: This is a derived class to Entity and stores the prefe...
TOOL
0.932894
4.396752
26230342-6a97-44ce-a7bb-b457f14d1d62
Lessica/HikariSummer
llvm/utils/TableGen/DAGISelEmitter.cpp
#include "CodeGenDAGPatterns.h" #include "DAGISelMatcher.h" #include "llvm/Support/Debug.h" #include "llvm/TableGen/Record.h" #include "llvm/TableGen/TableGenBackend.h" using namespace llvm; #define DEBUG_TYPE "dag-isel-emitter" namespace { /// DAGISelEmitter - The top-level class which coordinates construction /// a...
ALGO
0.980047
7.925504
6c444825-82ae-4674-bfd2-43eb928919d3
sarvex/leetcode-scala
solution/1600-1699/1655.Distribute Repeating Integers/Solution.cpp
class Solution { public: bool canDistribute(vector<int>& nums, vector<int>& quantity) { int m = quantity.size(); int s[1 << m]; memset(s, 0, sizeof(s)); for (int i = 1; i < 1 << m; ++i) { for (int j = 0; j < m; ++j) { if (i >> j & 1) { ...
ALGO
0.999968
5.627283
b1597ecf-d473-4ff7-8592-f0d26bd1d6cd
satyamdash/DSA-daily
26Mar-PPOTD-GFG.cpp
//{ Driver Code Starts #include<vector> #include<string> #include<sstream> using namespace std; // } Driver Code Ends class Solution { public: bool wordBreakRec(int ind, string &s, vector<string> &dictionary, vector<int> &dp) { if (ind >= s.size()) { return true; } if (dp[ind] != -1) ...
ALGO
0.998606
5.983878
3da2fda7-eca4-4cb9-a4bc-e8e77cd10a3c
Slava/competitiveProgramming
lksh/day01/mincoin2.cpp
#include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <iostream> using namespace std; typedef unsigned long long ull; const int N = 1010; int n, c, k, a[N][N], b[N], inf = 101010, ans[N], an; ull K, v[N][N]; int main() { #ifndef imslavko freopen("mincoin2.in", "r", stdin); freopen("...
ALGO
0.999904
3.190901
63a1c226-6bcc-4d71-9c7d-63239eeb76dd
CatGrassMan/MTH9821-Numerical-Method
Code/Iteration.cpp
#include "Decomposition.hpp" #include "Iteration.hpp" #include "Substitution.hpp" #include "Solvers.hpp" #include "Interpolation.hpp" #include "Optionpricing.hpp" #include "FiniteDiff.hpp" #include<iostream> #include<Eigen/Dense> #include<iomanip> #include<tuple> #include<math.h> #include<vector> //Norm function doubl...
ALGO
0.999983
3.281262
7a186178-7478-4a44-bfb5-f63a7f6cf9e0
dimmkan/MSHP
lesson7/l7-9/l7-9/main.cpp
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int max = (a > b) ? (a > c) ? a : c : (b > c) ? b : c; int sum = a+b+c; cout << ((max > (sum-max)*2)?"YES":"NO"); return 0; }
ALGO
0.999926
3.615956
8cbc7fdb-5b1c-4295-937d-d75e4f5fb181
marvalarva2929/Competitive_Programming
USACO practice problems/Silver/circular_barn.cpp
#include <bits/stdc++.h> #define int long long #define nl " \n" #define pi pair<int, int> #define ff first #define ss second using namespace std; const int mxn = 1e5, mxa = 5e6; int a[mxn]; vector<int> pr; bool isc[mxa +1]; int mvs[mxa + 1]; int lrg[4]; void solve() { int n; cin >> n; int mn = INT_MAX; f...
ALGO
0.999875
4.667664
a19d920a-6850-44b6-bb1b-e699c5e5301b
ShaoChenHeng/codeOfACM
2019/12/9/qsort.cpp
#include <bits/stdc++.h> using namespace std; void qsort(int a[], int l,int r) { int mid = a [ ( l + r ) / 2 ]; int i=l,j=r; do{ while( a[i] < mid ) i++; while( a[j] > mid ) j--; if( i <= j ) { swap( a[i], a[j]); i++; j--; } }...
ALGO
0.999924
4.278636
81dcb718-6753-4d0b-9ecb-72004ed0fafc
Sumonta056/Start-CP-Again
LeetCode/209.minimum-size-subarray-sum.cpp
/* * @lc app=leetcode id=209 lang=cpp * * [209] Minimum Size Subarray Sum */ // @lc code=start class Solution { public: int minSubArrayLen(int target, vector<int>& nums) { int left = 0; int right = 0; int minimumLength = INT_MAX; int sum = 0; while (right < nums.size())...
ALGO
0.99998
6.81906
a0e231f1-e808-44c7-b285-8ab0ac4a645d
satishSingh0710/LeetCoding
0005-longest-palindromic-substring/0005-longest-palindromic-substring.cpp
class Solution { public: string longestPalindrome(string s) { int n = s.size(); vector<vector<int>> dp(n, vector<int>(n, -1)); // for odd length palindromes for (int i = 0;i<n;i++){ for (int j = 0;i+j<n && i-j >= 0;j++){ if(s[i-j] == s[i+j]){ ...
ALGO
0.999978
6.079277
1959059b-7980-45cc-ab98-a5a7d898a65c
fithisux/FSL
extras/include/boost/libs/graph/example/bron_kerbosch_print_cliques.cpp
//[code_bron_kerbosch_print_cliques #include <iostream> #include <boost/graph/undirected_graph.hpp> #include <boost/graph/bron_kerbosch_all_cliques.hpp> #include "helper.hpp" using namespace std; using namespace boost; // The clique_printer is a visitor that will print the vertices that comprise // a clique. Note t...
ALGO
0.999754
6.690554
8be5ef31-d937-48b9-8c14-794a0a6d0f35
harrypotter0/algorithms-in-python
CP/Lunchtime/April Lunchtime 2018 Division 2 /p4.cpp
#include <bits/stdc++.h> using namespace std; #define lli long long #define rep(i,a) for(i = 0 ; i < a ; i++) #define REP(i,a,b) for(i = a ; i <= b ; i++) #define opt ios_base::sync_with_stdio(false);cin.tie(NULL); void solve() { lli i,n,sum = 0; cin >> n; vector<lli > v(n); rep(i,n) { cin >...
ALGO
0.999584
3.36514
9d13d2f9-408a-458e-ade5-63bf4937f086
devsisters/2021-NDC-ICECREAM
cpp/B/A/A/ABAA.cpp
#include "ABAA.h" #include "A/ABAAA.h" #include "B/ABAAB.h" #include "C/ABAAC.h" #include "D/ABAAD.h" #include "E/ABAAE.h" namespace ABAA { std::string run() { std::string out("ABAA"); out += std::string(SEPARATOR); out += ABAAA::run(); out += std::string(SEPARATOR); out += ABAAB::run(); out += std::strin...
TOOL
0.900991
5.021125
6083e58b-641d-4cc6-bd30-9d86df29f23c
hyeon-jeong/study_with_BOTTLES
개인문제/정연/week34/블랙잭.cpp
#include <iostream> #define MAX 100 using namespace std; int main() { int num, target, blackjack, sum = 0; int min = 9999999; int card[MAX] = {0, }; cin >> num >> target; for(int i = 0; i < num; i++) cin >> card[i]; for(int i = 0; i < num-2; i++) for(int j = i+1; j < num-1...
ALGO
0.999766
4.536674
c48ca39e-a8ec-4b18-af7b-1cb34038af12
AlaaAbuHantash/Competitive-Programming
Codeforces/230A - Dragons.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <queue> #include <map> #include <utility> using namespace std; int main() { long long s , n , p ; int i; cin >> p >> n ; bool f = true; long long a , b ; vector< pair <long long , long long > > p2 (n) ; for ( ...
ALGO
0.999994
3.666519
8aa3bc00-1052-457a-82e3-b062f2721c77
meysam-bagheri/MercuryDPM
Drivers/USER/Luca/ScrewFillerAlpha.cpp
#include "Mercury3D.h" #include "Boundaries/PeriodicBoundary.h" #include "Walls/InfiniteWall.h" #include "Walls/InfiniteWallWithHole.h" #include "Walls/AxisymmetricIntersectionOfWalls.h" #include "Helicoid03.h" #include "Species/LinearViscoelasticSpecies.h" #include "Species/LinearViscoelasticFrictionSpecies.h" #inclu...
ALGO
0.998608
3.884009
f4fd3b5f-210a-47d0-b07e-64efe8b53c26
etsc9287/Starting-Computing
CSCI 1300 HW 3/sphereVolume.cpp
// CS1300 Spring 2019 // Author: Ethan Schacht // Recitation: 304 – Hao // Cloud9 Workspace Editor Link: https://ide.c9.io/etsc9287/es_csci1300 // Homework 3 - Problem # 5 #include <iostream> #include <math.h> using namespace std; //Algorithm: Print volume of a sphere based on radius. //1. take radius as a parame...
ALGO
0.958856
5.324129
de461241-8499-407f-9736-59cd3d74c48a
earda/Helix-Jump-Unity
Helix Jump Replika/Library/PackageCache/com.unity.ide.visualstudio@2.0.11/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp
#include <iostream> #include <sstream> #include <string> #include <filesystem> #include <windows.h> #include <shlwapi.h> #include "BStrHolder.h" #include "ComPtr.h" #include "dte80a.tlh" constexpr int RETRY_INTERVAL_MS = 150; constexpr int TIMEOUT_MS = 10000; // Often a DTE call made to Visual Studio can fail after ...
TOOL
0.96062
6.947423
5b73b752-df08-49e2-8224-a82fad5be291
m4oughi/100DaysofCode
pureCPP/0005. Day 5/Vector/009. InsertErase Operations/016. Inserting Large Number of Elements/main.cpp
#include <iostream> #include <vector> int main() { std::vector<int> numbers; numbers.reserve(1000); // Pre-allocate memory to improve performance for (int i = 0; i < 1000; ++i) { numbers.insert(numbers.begin(), i); // Insert at the beginning } std::cout << "Size after inserting 1000 el...
ALGO
0.995767
5.12355
36584af9-4898-4bfc-8ac9-4c971963bfe9
FahmiHidayat2/Praktikum-Struktur-Data-Modul-2
MODUL 2 -ARRAY/Unguided 3.cpp
#include <iostream> #include <limits> // Untuk menggunakan std::numeric_limits using namespace std; int main() { int n; // Meminta pengguna untuk memasukkan panjang array cout << "Masukkan panjang array: "; cin >> n; // Deklarasi array sesuai dengan panjang yang dimasukkan oleh pengguna int a...
ALGO
0.982694
4.475333
8ee713e9-9b59-40c1-a82b-87c9df171976
itohdak/AtCoder
ARC/068/D_.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++) #define repl(i,n) REP(i,0,n) #define all(v) v.begin(), v.end() const int inf = 1e9+7; const ll longinf = 1LL<<60; c...
ALGO
0.999795
4.348937
e4a0936c-21c4-4a94-abba-9252b0e04c7e
XdanMT/cuda_learining
6.stream/src/utils.cpp
#include <iostream> #include <random> // 初始化介于a, b之间的随机整数 void init_matrix_float(float* A, int m, int n, float min_val, float max_val, int seed) { srand(seed); if (min_val > max_val) { std::swap(min_val, max_val); } for (int i = 0; i < m * n; i++) { A[i] = min_val + (float)rand() / RAN...
ALGO
0.968382
4.559712
08e7ca9d-638e-4c3e-9af3-22999d7bdeda
stephan-biomedical-engineer/Kinematics_cpp
Eigen/failtest/qr_int.cpp
#include "../Eigen/QR" #ifdef EIGEN_SHOULD_FAIL_TO_BUILD #define SCALAR int #else #define SCALAR float #endif using namespace Eigen; int main() { HouseholderQR<Matrix<SCALAR, Dynamic, Dynamic> > qr(Matrix<SCALAR, Dynamic, Dynamic>::Random(10, 10)); }
TEST
0.974774
3.0876
c6ba891f-f4db-4e30-906f-468d23486c24
HimaxWiseEyePlus/Seeed_Grove_Vision_AI_Module_V2
EPII_CM55M_APP_S/app/scenario_app/ei_standalone_inferencing/ei-model/edge-impulse-sdk/dsp/kissfft/kiss_fftr.cpp
#include "edge-impulse-sdk/dsp/kissfft/kiss_fftr.h" #include "edge-impulse-sdk/dsp/kissfft/_kiss_fft_guts.h" struct kiss_fftr_state{ kiss_fft_cfg substate; kiss_fft_cpx * tmpbuf; kiss_fft_cpx * super_twiddles; #ifdef USE_SIMD void * pad; #endif }; kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft...
ALGO
0.999773
5.828986
834406ee-d66f-4c6e-a28d-5bd429c1cdd5
fuchstraumer/Caelestis
old/src/util/UtilitySphere.cpp
#include "util/UtilitySphere.hpp" #include "glm/gtc/matrix_transform.hpp" namespace vpsk { constexpr float USPHERE_FLOAT_PI = 3.14159265359f; UtilitySphere::UtilitySphere(const glm::vec3 & _center, const float & _radius) : Center(_center), Radius(_radius) {} bool UtilitySphere::CheckRayIntersection(cons...
ALGO
0.981788
7.138994
63f60969-42f7-460b-8788-d8b08ae48838
iamrahul25/LeetCode
Sorting/maximum-bags-with-full-capacity-of-rocks.cpp
class Solution { public: //Time: O(N) Space: O(1) or O(N) int maximumBags(vector<int>& capacity, vector<int>& rocks, int additionalRocks) { int n = rocks.size(); int sum = 0; for(int i=0; i<n; i++){ capacity[i] = capacity[i] - rocks[i]; } sort(capacity.begi...
ALGO
0.999662
5.732522
84cf0eb0-1d05-4710-81b5-17097c89282c
jgsonntag/simplefms5
utility.cpp
#include "utility.h" #include <iostream> using namespace std; void sec2hms(double sec,int *h,int *m,double *s) { double newsec = sec; int dow = (int)(newsec/86400.0); newsec -= dow*86400; int hr = (int)(newsec/3600.0); newsec -= hr*3600; int min = (int)(newsec/60.0); newsec -= min*60.0; *h = hr; *m...
TOOL
0.990466
4.628583
dd8de8f2-8bbf-42d3-a8c3-a3709137651d
SudShekhar/Programming
codeforces/212Div2/3.cpp
// Standard includes #include<cstdio> #include<iostream> #include<cstdlib> #include<cmath> #include<cstring> #include<limits.h> #include<string.h> //Data Structures #include<algorithm> #include<vector> #include<string> #include<set> #include<map> #include<utility> #include<stack> #include<queue> using namespace std; ...
ALGO
0.999206
3.322883
a91202e5-2dee-4a0b-9220-f054b3ee7b47
iagohenrique2009/dash_eats
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.9988
6.76073
36b00471-387c-4af8-9f30-c588242198a3
113bommy/deepmind_codecontests_refine
cpp_source_filter_file/cpp_train_6276_16.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); vector<pair<int, int> > v_p; int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; if (x2 < x1) swap(x1, x2); if (y2 < y1) swap(y1, y2); for (int i = y1; i <= y2; i++) { v_p.push_back(make_pair(...
ALGO
0.999778
4.188254
969c8ad2-11c1-4dae-93ea-1987488a3caa
maruthi-venkat/Leetcode
2221-check-if-a-parentheses-string-can-be-valid/check-if-a-parentheses-string-can-be-valid.cpp
class Solution { public: bool canBeValid(string s, string locked) { if(s.size() % 2) return false; int balance = 0; int available = 0; for(int i=0;i<s.size();i++){ if(locked[i] == '1'){ if(s[i] == '('){ balance += 1; ...
ALGO
0.99949
5.862607
e5051ddb-a1d7-4514-b90c-8540f59657ab
Tonaeus/dsalgo
System Design/kth-largest-element-in-a-stream.cpp
/* Problem - Create a class that maintains and returns the kth highest score after each new score submission, given an integer "k" and a stream of test scores Approaches 1. Track only the "k" greatest scores, with the smallest score at the front, to maintain the kth highest score Data Structure...
ALGO
0.999936
5.991789
1b6f0f8f-68e2-4300-a8d0-f464acfdafad
Ccode104/Algorithms
Divide and Conquer/3.3) Application of Binary Search.cpp
// Divide and Conquer // Based on 'Search' /********************************************************************************************************* Input : array of 'n' distinct elements Output : index i such that arr[i]==i ************************************************************************************...
ALGO
0.999763
4.927322
0c197777-5283-4ff3-8149-821021de82c5
Lcollection/Codebook
Data-Struct/icodes/abcConstRef.cpp
// template function with const reference parameters // to compute an expression #include<iostream> using namespace std; template<class T> T abc(const T& a, const T& b, const T& c) { return a + b * c; } int main() { cout << abc(2,3,4) << endl; return 0; }
TOOL
0.967431
5.06696
8d91dfb1-d947-4147-af2c-68127a36a093
ytia001/leetcode-practice
LeetCode/232. Implement Queue using Stacks/Queue.cpp
#include <stack> using namespace std; class MyQueue { private: stack<int> st1; stack<int> st2; public: MyQueue() { } void push(int x) { while(!st1.empty()){ st2.push(pop()); } st1.push(x); while(!st2.empty()){ st1.push(st2.top()); st2.pop...
ALGO
0.996479
5.571382
a3983f70-4d91-413e-9257-a4049e9d8063
wilsonsamarques/Cpp_code
Book/Chapter 4/count2/count2/main.cpp
#include <iostream> using namespace std; int main() { int n = 0; int i = 0; // Loop counter in "for" statement. // Get num from the keyboard and initialize it. cout << "Enter a number and press ENTER: "; cin >> n; for (i = 1; i <= n; ++i) { // For i = 1 to n cout << i << " "; // Print i. } return ...
ALGO
0.997109
3.580904
5ddfe5c7-6432-4de3-b8e6-af8d285544aa
Executioner769/CSES
DynamicProgramming/removal_game.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long // https://www.youtube.com/watch?v=DMkXbGm4g6o int main() { int n; cin >> n; vector<ll> nums(n); // store max diff between first player score - second player score in the interval i and j inclusive. vector<vector<ll>> dp...
ALGO
0.999975
4.582734
4a88d016-5ec3-4a9a-aadb-358c8c1e29cc
mycode-hub/InterviewBits
Linked List/RemoveDuplicatesfromSortedList.cpp
/* Remove Duplicates from Sorted List Asked in: Microsoft VMWare Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. */ /** * Definition for singly-linked list. * struct ListNode { * int val; ...
ALGO
0.999922
4.64801
b546d70e-dafc-4be3-aa2c-0a4e4cd170f3
thigiacmaytinh/TGMTcpp
lib/opencv342/modules/core/src/norm.cpp
#include "precomp.hpp" #include "opencl_kernels_core.hpp" #include "stat.hpp" /****************************************************************************************\ * norm * \**********************************************************...
ALGO
0.998817
4.335221
2bd1f7f7-5d40-4924-a5f2-7b87f94c18ce
erikhallin/Box2D
include/Box2D/Dynamics/Joints/b2FrictionJoint.cpp
#include <Box2D/Dynamics/Joints/b2FrictionJoint.h> #include <Box2D/Dynamics/b2Body.h> #include <Box2D/Dynamics/b2TimeStep.h> // Point-to-point constraint // Cdot = v2 - v1 // = v2 + cross(w2, r2) - v1 - cross(w1, r1) // J = [-I -r1_skew I r2_skew ] // Identity used: // w k % (rx i + ry j) = w * (-ry i + rx j) //...
ALGO
0.990914
7.570709
f7b0ea3c-ae11-4a44-876b-3c8b40d2b68d
thaines/hyperion
eos/src/eos/alg/solvers.cpp
#include "eos/alg/solvers.h" #include "eos/file/csv.h" #include "eos/math/eigen.h" #include "eos/math/complex.h" namespace eos { namespace alg { //------------------------------------------------------------------------------ EOS_FUNC void MaximiseFixedLenDualQuad(real32 a,real32 b,real32 c,real32 d,real32 n,real32...
ALGO
0.999569
5.171464
7f69a337-a61f-4f86-8516-b419b8e950af
akkifcs189/A2Z-SDE
1. Basics/Step-1.4: Basic Maths/GCDorHCF.cpp
int calcGCD(int n, int m){ while(n > 0 && m > 0) { if(n > m) n = n % m; else m = m % n; } if(n == 0) return m; return n; }
ALGO
0.999729
4.595421
6c4d68b3-6178-4230-9b1d-8ea720fc03ee
ishandutta2007/codeforces
yuu/normal/1181/D.cpp
#include <bits/stdc++.h> using namespace std; #define FOR(i, j, k) for(int i=(j); i<=(k); i++) #define FFOR(i, j, k) for(int i=(j); i<(k); i++) #define DFOR(i, j, k) for(int i=(j); i>=(k); i--) #define bug(x) cerr<<#x<<" = "<<(x)<<'\n' #define pb push_back #define mp make_pair #define bit(s, i) (((s)>>(i))&1LL) #define...
ALGO
0.999978
3.455063
0b1f3064-1cd5-4948-99b5-5fe3df52162b
jackiesogi/CPE49
Odd sum/Odd sum.cpp
#include <iostream> using namespace std; int main() { int t, a, b, sum; cin >> t; // size of test case for (int i = 0; i < t; i++) { cin >> a >> b; sum = 0; if (a % 2 == 0) { a++; } while (a <= b) { sum = sum + a; a += 2; } c...
ALGO
0.999919
4.330182
162e8f09-44b9-41de-8a1c-1a11ddcc2c14
buglabs/android-buglabs-frameworks-base
media/libstagefright/codecs/amrnb/enc/src/l_negate.cpp
/* ------------------------------------------------------------------------------ INPUT AND OUTPUT DEFINITIONS Inputs: L_var1 = 32 bit long signed integer (Word32) whose value falls in the range : 0x8000 0000 <= L_var1 <= 0x7fff ffff. Local Stores/Buffers/Pointers Needed: None Global Stores/...
TOOL
0.987153
5.632393
3b6f40d7-cd9c-4612-90be-83498b464c14
nileshwankhede03/basic-cpp-programs
.history/pattern11_20250219112947.cpp
#include "./stdc++.h" using namespace std; void print11(int n) { for(int i = 0; i < n; i++) { } cout << endl; } int main() { // 2 : test cases // 3 : for 3 * // 5 : for 5 * int testCases; cin >> testCases; for(int i = 0; i < testCases; i++) { int n; cin ...
ALGO
0.999736
4.118882
7abeafb2-8de1-4ae1-bf28-bc118cff77a7
Hetzeer/cuda-2024
3821B1PE1/3_naive_gemm_omp/pozdnyakov_vasya/naive_gemm_omp.cpp
std::vector<float> NaiveGemmOMP(const std::vector<float>& a, const std::vector<float>& b, int n) { std::vector<float> result(n * n, 0.0f); #pragma omp parallel for collapse(2) for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { ...
ALGO
0.999349
5.683753
3b4f630f-017e-457b-a400-f47456c929c9
pawan-nirpal-031/Algorithms-And-ProblemSolving
Active/CodeForces/C_Number_of_Pairs.cpp
// Problem Link : https://codeforces.com/problemset/problem/1538/C #include <bits/stdc++.h> using namespace std; typedef unsigned long long int ull; typedef long long int ll; typedef long double ld; #define Mod 1000000007 #define Infinity (ll)1e18 #define Append(a) push_back(a) #define Pair(a,b) make_pair(a,b) #define ...
ALGO
0.999891
5.208596
0b78fbd1-9acf-4424-9958-c9f83b8141a1
ishandutta2007/codeforces
wygzgyw/normal/1621/G.cpp
// wygzgyw #include <bits/stdc++.h> using namespace std; template <typename T> void read(T &t) { t=0; char ch=getchar(); int f=1; while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); } do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f; } template <typename T> void write(T t) { if (t<0) { put...
ALGO
0.999939
3.719754
30ae62ea-0dcf-4ef0-847f-a40676cffc45
simran-ctrl/100daysofcode
Longest K unique characters substring - GFG/longest-k-unique-characters-substring.cpp
//{ Driver Code Starts //Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: int longestKSubstr(string s, int k) { // your code here int n = s.length(); if (n == 0 || k <= 0) { return -1; // I...
ALGO
0.999795
6.533557
aee0c6f8-a487-4b4d-8d57-8489b4c2ebe1
IlianTheOne0/CloudStorage_cpp
Core/Domain/UseCases/Tools/ToolsImplemention/split.cpp
#include "../tools.h" #include "../../../../../Infrastructure/Config/domainConfig.h" vector<wstring> Tools::split(const wstring& input, wchar_t delimiter) { vector<wstring> tokens; wstringstream stream(input); wstring token; while (getline(stream, token, delimiter)) { tokens.push_back(token); } r...
TOOL
0.948176
5.099296
1913b542-eafe-4279-87a4-141ffc20ff9a
raincross7/code-similarity
codes/train_code/problem330/problem330_365.cpp
#include<bits/stdc++.h> #define ll long long #define ALL(v) (v).begin(),(v).end() #define REP(i,p,n) for(int i=p;i<(int)(n);++i) #define rep(i,n) REP(i,0,n) #define dump(a) (cerr << #a << "=" << (a) << endl) #define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl; template<clas...
ALGO
0.999928
3.900053
3f31f017-d8c8-4bcd-b735-7cc32cd22cf3
diyorxalloqov/Uzum_clone
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.9988
6.76073
bc726233-5bdd-4697-b12a-904441f7a234
Capstone41006/DuplicatedSpaceServer
gaussian-splatting/SIBR_viewers/src/core/raycaster/PlaneEstimator.cpp
#include "PlaneEstimator.hpp" #include <random> typedef Eigen::Array<bool, Eigen::Dynamic, 1> ArrayXb; PlaneEstimator::PlaneEstimator() {} PlaneEstimator::PlaneEstimator(const std::vector<sibr::Vector3f> & vertices, bool excludeBB) { Eigen::AlignedBox<float, 3> boxScaled; if (excludeBB) { Eigen::AlignedBox<floa...
ALGO
0.990184
5.914748
830db5e2-641f-4b7c-9812-db6efc825e71
li-ming-jiang/MyOpenSees
SRC/reliability/analysis/stepSize/FixedStepSizeRule.cpp
// $Revision: 1.8 $ // $Date: 2008-02-29 19:47:20 $ // $Source: /usr/local/cvs/OpenSees/SRC/reliability/analysis/stepSize/FixedStepSizeRule.cpp,v $ // // Written by: // Kevin Mackie (<EMAIL>) // Michael Scott (<EMAIL>) // #include <FixedStepSizeRule.h> #include <StepSizeRule.h> #include <math.h> #include <Vector.h> ...
ALGO
0.999503
5.997732
a78bec25-7432-4484-badd-cd9162d14646
dario-passarello/advent-of-code-2020
day5/day5.cpp
#include <string> #include <fstream> #include <iostream> #include <regex> #include <numeric> #include <map> using namespace std; #define N_BITS 10 inline char t_char(char a) { switch (a) { case 'F': case 'L': return 0; case 'B': case 'R': return 1; default: cout <<...
ALGO
0.999816
4.941239
f59b64ec-7008-4d50-a0dd-c131c68ebec1
Ukeme-Edet/CodeForces
1829d_gr.cpp
#include <bits/stdc++.h> using namespace std; /** * @brief find_pile - find if there is a pile of stones that can be divided into two piles such that one is twice the other * * @param n The number of stones in the pile * @param m The target size * @param hm A hashmap to store the results of the subproblems * @r...
ALGO
0.999897
5.574495
feb05eba-f771-4156-aedd-12196f2f81dc
cjaneyes/cjaneyes.github.io
data/lemur-4.12/app/src/BuildIndex.cpp
/*! \page BuildIndex <P> This application builds an index for a collection of documents. <P> To use it, follow the general steps of running a lemur application. <p> The parameters are: <p> <ol> <li> <tt>index</tt>: name of the index table-of-content file without the extension. <li> <tt>indexType</tt>: the type of inde...
DATA
0.863579
5.529194
8faf4728-020b-4f47-9200-f17a5033724d
avinash201199/DSA-Questions
Dynamic Programming/C++/EggDroppingPuzzle.cpp
// You are given N identical eggs and you have access to a K-floored building from 1 to K. // There exists a floor f where 0 <= f <= K such that any egg dropped at a floor higher than f will break, // and any egg dropped at or below floor f will not break. There are few rules given below. // -> An egg that survive...
ALGO
0.999886
5.083249
ad866b75-1dd0-43f4-ac6a-4dcb2273db34
huytan29/CTDL_pTIT
DSA_goc/cpp-dsa/DSA07045.cpp
#include <bits/stdc++.h> using namespace std; void Solution(string s) { int idx = 0; deque<char> dq; for (auto i : s) { if (i == '<') { if (idx > 0) idx--; } else if (i == '>') { if (idx < dq.size()) idx++; } else if (i == '-') { if (idx > 0) { ...
ALGO
0.999948
4.091452
6e4e183b-9ac6-40db-8f5e-3f85168f8f63
PranjalKumar09/C-Data-Structures
DP/longestIncreasing_Subsequence.cpp
#include <bits/stdc++.h> using namespace std; /* LONGEST INCREASING SUBSEQUENCE */ vector<int> arr = {10, 9, 2, 5, 3, 7, 101, 18}; int n = arr.size(); // Recursive approach (Brute Force) for Longest Increasing Subsequence int f(int i, int prev) { if (i >= n) return 0; int take = 0; if (prev == -1 |...
ALGO
0.99998
5.05414
aee88f92-7571-439c-a72f-3e4ca3d20ba4
nirjhor01/recursion-bactracking
1306. Jump Game III.cpp
class Solution { public: bool ok = 0; int func(int ind, vector<int>&arr, vector<int>&dp){ if(ind >= arr.size()) return 0; if(ind < 0) return 0; if( arr[ind] == 0) ok = 1; if(dp[ind] != -1) return dp[ind]; dp[ind] = 1; int op1 = func(ind + arr[ind], arr, dp); ...
ALGO
0.999993
5.390977
465c572c-eb39-4289-a8b9-afa7a995c5b4
trinhminhtriet/leetcode
solutions/0000-0099/0040.combination-sum-ii/Solution2.cpp
class Solution { public: vector<vector<int>> combinationSum2(vector<int>& candidates, int target) { sort(candidates.begin(), candidates.end()); vector<vector<int>> ans; vector<int> t; function<void(int, int)> dfs = [&](int i, int s) { if (s == 0) { ans.emp...
ALGO
0.999978
6.56852
01f0fccd-fe02-4793-acc0-a27a9d928f4a
Yuulis/AtCoderSolution_old
AtCoder/AHC/016/A.cpp
#include <bits/stdc++.h> #include <atcoder/all> #define all(x) (x).begin(), (x).end() #define fix(x) fixed << setprecision(x) #define rep(i,start,end) for(int i=(start);i<(int)(end);i++) #define rrep(i,start,end) for(int i=((int)(start));i>=(end);i--) constexpr auto PI = 3.14159265358979; constexpr auto INF = 1e+9; c...
ALGO
0.999659
3.514801
6541ac5c-a92a-411b-a4e5-b6f4c1cd042d
ishandutta2007/codeforces
qwqcorz/normal/1609/D.cpp
#include<bits/stdc++.h> using namespace std; const int N=1e3+5; int read() { int s=0; char c=getchar(),lc='+'; while (c<'0'||'9'<c) lc=c,c=getchar(); while ('0'<=c&&c<='9') s=s*10+c-'0',c=getchar(); return lc=='-'?-s:s; } void write(int x) { if (x<0) putchar('-'),x=-x; if (x<10) putchar(x+'0'); else write(x/10...
ALGO
0.999864
4.024987
878c875f-04cb-4220-a1d1-5c29f6d4b5b0
taotesea/EclipseDeeplearning4j
libnd4j/include/ops/declarable/generic/parity_ops/segment_mean.cpp
// // Created by <EMAIL> on 2/21/2018. // #include <ops/declarable/CustomOperations.h> #include <ops/declarable/helpers/segment.h> namespace sd { namespace ops { CUSTOM_OP_IMPL(segment_mean, 2, 1, false, 0, 0) { auto input = INPUT_VARIABLE(0); auto idxSegments = INPUT_VARIABLE(1); ...
TOOL
0.989003
7.332324
6700d7d7-38fe-4ec0-805a-0f799b787890
simar1998/SP_NURBS_RTX
intersect/TopSorter.cpp
// // Created by simar on 7/19/2023. // #include "TopSorter.h" #include "RayGenerator.h" /** * Sorting out topological cordinate system that is given from ray intersection test on an offset plane * Clustering system to be determined * @param intersections * @return */ std::vector<std::vector<Vec3>> TopSorter::so...
ALGO
0.998526
3.390895
a613e581-d9d2-46a2-b08d-8b4f96f8c445
janghoikz/Practice
Practice/Practice.cpp
#include <iostream> void PrintArray(int input[], int size) { for (int i = 0; i < size; i++) { std::cout << input[i] << " "; } std::cout << std::endl; } void Swap(int& value1, int& value2) { int temp = value1; value1 = value2; value2 = temp; } // Sequential sort // 시간복잡도 : O(n^2) // ...
ALGO
0.999932
5.303199
43911412-b729-4054-bee1-96598b019725
HumanHyeon/Algorithm_Book
archive/SeHyeon/21.09.12 Coding Practice No.80.cpp
https://programmers.co.kr/learn/courses/30/lessons/82612 #define SUB(X, Y) ((X) > (Y) ? 0 : (Y) - (X)) long long allPrice(int p, int c) { if (!c) return 0; return (p * c + allPrice(p, c - 1)); } long long solution(int price, int money, int count) { return (SUB(money, allPrice(price, count))); }
ALGO
0.999645
3.931951
d5a079a7-62d9-4eb5-9445-de9ae91fa761
12dxc/algorithm
常见数据结构/二叉树/常见问题/二叉树的最近公共祖先节点.cpp
#include <iostream> using namespace std; 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), left(left), right(righ...
ALGO
0.999984
5.451355
94e39b54-1705-4aea-b264-31ef436e8fc9
ZhouLiqian/CPlusPlus_Note
leetcode/leetco/合并两个排序的链表.cpp
// code11.cpp // leetcode // 合并两个排序的链表 // Created by Qian on 6/19/23. #include <iostream> using namespace::std; /*输入两个递增排序的链表,合并这两个链表并使新链表中的节点仍然是递增排序的*/ struct ListNode{ int val; ListNode *next; ListNode(int x) : val(x), next(NULL){} }; class Solution { public: //方法一 ListNode* mergeTwoLists(...
ALGO
0.999956
5.506559
b1dc3983-f987-485b-8d63-b98bb80b39f2
113bommy/deepmind_codecontests_refine
cpp_gold_filter_file/cpp_train_1202_1.cpp
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; int n = s.size(); int dir[4] = {0, 0, 0, 0}; if (n & 1) n = -1; for (int i = 0; i < n; ++i) { if (s[i] == 'L') dir[0]++; else if (s[i] == 'R') dir[1]++; else if (s[i] == 'U') dir[2]++; else ...
ALGO
0.999878
3.355164
5dd592ad-024b-4439-ba19-edcc2f8f2fef
atul799/CarND-Path-Planning-Project
src/Eigen-3.3/unsupported/doc/examples/EulerAngles.cpp
#include <unsupported/Eigen/EulerAngles> #include <iostream> using namespace Eigen; int main() { // A common Euler system by many armies around the world, // where the first one is the azimuth(the angle from the north - // the same angle that is show in compass) // and the second one is elevation(the angl...
ALGO
0.989945
5.125681
b7e107bf-1a30-42ed-8da7-5dd94a8b81f6
DevDadd/PTIT-DSA
noiday.cpp
#include <iostream> #include <queue> #include <vector> using namespace std; long long minCostToConnectRopes(vector<int>& a) { priority_queue<int, vector<int>, greater<int> > minHeap(a.begin(), a.end()); long long res = 0; while (minHeap.size() > 1) { int first = minHeap.top(); minHeap.po...
ALGO
0.999943
5.061486
b4d12cf9-abad-4112-8906-9e21feb4785f
tazzledazzle/tazzledazzle.github.io
_posts/ea-forge-service.cpp
#include <string> #include<iostream> #include <utility> class Item { private: std::string name; int quantity; float price; public: Item(std::string name, int quantity, float price) : name{std::move(name)}, quantity{quantity}, price{price} {} std::string get_name() const { return name; ...
TOOL
0.979859
6.950861