uuid
string
repo_name
string
relative_path
string
content
string
category
string
algo_rel_score
float64
quality_score
float64
997d620a-e93d-4c23-9980-1e7e42088f29
Cellul4r/Comp_Programming
Codeforces/2036E-Reverse_the_Rivers.cpp
#include<bits/stdc++.h> using namespace std; void __print(int x) {cerr << x;} void __print(long x) {cerr << x;} void __print(long long x) {cerr << x;} void __print(unsigned x) {cerr << x;} void __print(unsigned long x) {cerr << x;} void __print(unsigned long long x) {cerr << x;} void __print(float x) {cerr << x;} void ...
ALGO
0.999712
3.477519
72b6d977-483d-4fc5-9ea0-385565b23af5
Jobayed1408/XPSC-PS
week 13/day 4/Virtual contest 2/C. Division by Two and Permutation.cpp
#include<bits/stdc++.h> using namespace std; //#define freq[n+1] = 0 void solve() { int n; cin >> n; long long int ar[n]; int freq[n+1] = {0}; for(int i=0; i<n; i++) { int x; cin>> x; while(x > n) { x /= 2; } freq[x]++; } bool b = true; for(int i=n;i>0;i--){ if(freq[i]==0){ b=fals...
ALGO
0.99978
4.658423
510905df-6285-4a03-b2c4-332fa7ba958a
LoiNguyennn/CompetitiveProgramming4_Solutions
Kattis_OJ/divideby100.cpp
#include <iostream> using namespace std; int main() { //freopen("input.txt", "r", stdin); string s1, s2; cin >> s1 >> s2; int n = s1.length(), m = s2.length(); if (m > n) { string tmp = "0."; for (int i = 1; i <= m - n - 1; ++i) tmp += "0"; s1 = tmp + s1; } ...
ALGO
0.999791
3.298904
4dc0ad4c-9b36-4549-afc2-5690a6d97d96
ImportMengjie/Leetcode
233.数字-1-的个数.cpp
/* * @lc app=leetcode.cn id=233 lang=cpp * * [233] 数字 1 的个数 * * https://leetcode-cn.com/problems/number-of-digit-one/description/ * * algorithms * Hard (34.44%) * Likes: 126 * Dislikes: 0 * Total Accepted: 7.6K * Total Submissions: 21.3K * Testcase Example: '13' * * 给定一个整数 n,计算所有小于等于 n 的非负整数中数字 1 ...
ALGO
0.999845
6.812008
e1a93c35-e965-4695-9bf8-7730c1e4e693
marcusbirkin/OTPLib
src/merger.cpp
/** * @file merger.cpp * @brief Merger thread to determine winning component for each address * @details Part of OTPLib - A QT interface for E1.59 * @authors Marcus Birkin * @copyright Copyright (C) 2022 Marcus Birkin * * This program is free software: you can redistribute it and/or modif...
TOOL
0.904584
5.247173
d37361e4-29e1-4bfe-9bdb-3347ad488485
ctosp/development
vndk/tools/header-checker/src/utils/collect_exported_headers.cpp
#include "utils/header_abi_util.h" #include <llvm/Support/FileSystem.h> #include <llvm/Support/Path.h> #include <llvm/Support/raw_ostream.h> #include <set> #include <string> #include <vector> namespace header_checker { namespace utils { static bool ShouldSkipFile(llvm::StringRef &file_name) { // Ignore swap files...
TOOL
0.851899
7.114084
906e442d-13c0-4f51-8c1d-14fe5a4a0429
hardikgupta2003/DataStructuresAndAlgorithms
Tries/Insertion.cpp
#include <iostream> using namespace std; class TrieNode { public: char value; TrieNode *children[26]; bool isTerminal; TrieNode() : value('-'), isTerminal(false) { for (int i = 0; i < 26; i++) { children[i] = NULL; } } TrieNode(char val) : value(val), i...
ALGO
0.998782
4.657123
98889e70-92f1-4dc8-8ed0-005811679aa7
MintChocoPizza/dodo
baekjoon/c++/16948/temp_2.cpp
#include <algorithm> #include <iostream> #include <queue> using namespace std; struct Chessmen { int y; int x; int depth; }; int N; int visited[200][200]; int dy[] = {-2, -2, 0, 0, 2, 2}; int dx[] = {-1, 1, -2, 2, -1, 1}; Chessmen starting; Chessmen ending; void input() { cin >> N; cin >> s...
ALGO
0.99988
4.32628
5a04601d-31de-4ae8-89b4-e80275ca71e0
YadavDhirendra/Data-Structures-and-ALgorithms-Problems
Recursion/InsertionSort.cpp
//Insertion sort by recursion #include <bits/stdc++.h> using namespace std; void InsertionSort(int *arr, int size, int i) { //base case if (i==size) return; int temp = arr[i]; int j = i - 1; //ek kadam while (j >=0) { if (arr[j] > temp) { //shift ...
ALGO
0.999991
5.041955
cf2aca8d-5517-4753-8522-4eb5bac6fd49
NUS-HcRL/cloth_opt
deps/eigen/doc/examples/Tutorial_BlockOperations_colrow.cpp
#include <Eigen/Dense> #include <iostream> using namespace std; int main() { Eigen::MatrixXf m(3,3); m << 1,2,3, 4,5,6, 7,8,9; cout << "Here is the matrix m:" << endl << m << endl; cout << "2nd Row: " << m.row(1) << endl; m.col(2) += 3 * m.col(0); cout << "After adding 3 times the first colu...
ALGO
0.993007
3.576145
f55ade30-5f31-4328-8d63-05c21a3fc4c1
irvinodjuana/acm
archive/old/codeforces/goodbye2020/A.cpp
#include <bits/stdc++.h> using namespace std; // shortened type names typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; // macros #define F first #define S second #define PB push_back #define MP make_pair #define REP(i, a, b) for (int i = a; i < b; i++) #define REPI(i, a, b) for (int i = a; i <...
ALGO
0.998681
4.950882
f7c30a1b-efd6-4052-a7cd-15fabfb34b61
hjiang13/LLMs-in-IR
POJ-104/57/1220.cpp
#include <iostream> using namespace std; int main (){ int n,i,j,l; char s[300]; cin >> "%d",&n); for (i=0; i<n; i++) { cin >> "%s",s); l=strlen(s); if (s[l-1]=='r') s[l-2]=0; if (s[l-1]=='g') s[l-3]=0; if (s[l-1]=='y') s[l-2]=0; puts(s); } return 0; }
ALGO
0.996024
3.301465
576ac869-5fa8-4b50-8407-80e352cf5bad
lili2012/eigen
doc/examples/tut_arithmetic_scalar_mul_div.cpp
#include <iostream> #include <Eigen/Dense> using namespace Eigen; int main() { Matrix2d a; a << 1, 2, 3, 4; Vector3d v(1,2,3); std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl; std::cout << "0.1 * v =\n" << 0.1 * v << std::endl; std::cout << "Doing v *= 2;" << std::endl; v *= 2; std::cout << ...
ALGO
0.99329
3.669638
bc2b4891-f83a-4c80-a7d4-8323c0831179
iamRishant/Leetcode
560-subarray-sum-equals-k/subarray-sum-equals-k.cpp
class Solution { public: int subarraySum(vector<int>& nums, int k) { map<int,int> mp; int sum=0; int ans=0; for(int i=0;i<nums.size();i++){ sum+=nums[i]; if(sum==k) ans++; int rem=sum-k; if(mp.find(rem)!=mp.end()){ ans+...
ALGO
0.999953
6.109978
6e386c5e-280a-4b8c-ba92-e87b3828c4cc
Tang1705/Happy-Reconstruction
Lib/opencv/sources/samples/cpp/tutorial_code/snippets/imgproc_HoughLinesPointSet.cpp
#include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> using namespace cv; using namespace std; int main() { Mat lines; vector<Vec3d> line3d; vector<Point2f> point; const static float Points[20][2] = { { 0.0f, 369.0f }, { 10.0f, 364.0f }, { 20.0f, 358.0f }, { 30.0f, 352.0f }, { 40.0f,...
ALGO
0.988983
3.570138
a0551b63-ee92-49aa-9267-3c02b0eb649a
ajaysonere/Complete-DSA-in-C-
Complete DSA In C++/08. Recursion/bubbleSort.cpp
#include<iostream> using namespace std; // void bubbleSortRec(int arr[], int n){ // if(n==1){ // return; // } // for(int j=0; j<n-1; j++){ // if(arr[j] > arr[j+1]){ // int temp = arr[j]; // arr[j] = arr[j+1]; // arr[j+1] = temp; // } // } // ...
ALGO
0.999961
5.477378
2ff97c16-b4e1-4c0c-9772-17452159e80b
onkarbartakke/DSA-Marathon
Segment Trees/segment_tree.cpp
#include <bits/stdc++.h> using namespace std; void Build(vector<int> &arr, int low, int high, int ind, vector<int> &seg) { if (low == high) { seg[ind] = arr[low]; return; } int mid = (high + low) / 2; Build(arr, low, mid, 2 * ind + 1, seg); Build(arr, mid + 1, high, 2 * ind ...
ALGO
0.999955
5.03335
b0b27c2a-3ba0-4022-a161-8b962fffd1ac
minblock/mieracoin
src/crypto/scrypt.cpp
#include <crypto/scrypt.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include <openssl/sha.h> static inline uint32_t be32dec(const void *pp) { const uint8_t *p = (uint8_t const *)pp; return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) + ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24)); } ...
ALGO
0.991203
5.371788
bb1eba7f-824b-4161-8986-02354865a608
KlaraSystems/freebsd-relayd
gnu/llvm/llvm/lib/CodeGen/MachineSSAUpdater.cpp
#include "llvm/CodeGen/MachineSSAUpdater.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineOperand.h"...
TOOL
0.997676
7.946615
7c187d1e-841e-4f08-a253-f7ae775c03bb
Rakibul-Hassan-1/Phitron-Modules
Semester - 02 Introduction to Algorithms/Introduction to Algorithms/Week 06 - Dynamic Programming/Module - 22 (0-1) Knapsack/practice_knapsack.cpp
#include <bits/stdc++.h> using namespace std; int save[1000][1005]; int knapsack(int n, int s, int v[], int w[]) { // base case if (n == 0 || s == 0) return 0; if (save[n][s] != -1) { return save[n][s]; } else if (w[n - 1] <= s) { int option1 = knapsack(n - 1, s - ...
ALGO
0.999992
4.292689
a3c6a3f2-f00d-4d31-a70d-fd22e7ea41fd
asmanya/leet-problems
DSA SHEET - 1/dynamicProgramming/dpOnStocks/buySellWithCooldown-memoi.cpp
#include<bits/stdc++.h> using namespace std; class Solution { private: int f(int ind, int buy, vector<int>& prices, vector<vector<int>>& dp) { if(ind >= prices.size()) return 0; if(dp[ind][buy] != -1) return dp[ind][buy]; int profit; if(buy) { profit = max(-prices[ind]...
ALGO
0.999949
5.583977
acbbe676-6fc4-4f8b-95d6-1a687f1510ec
kazunetakahashi/atcoder
2020/0210_ABC154/A.cpp
#define DEBUG 1 /** * File : A.cpp * Author : Kazune Takahashi * Created : 6/16/2020, 11:51:50 PM * Powered by Visual Studio Code */ #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <...
ALGO
0.999748
5.684742
a96a7e0c-6fc0-4813-b787-b697e9416412
AnubhavSaxena3/Cplusplus
firstrepeatingelement.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } const int N = 1e6 + 2; int idx[N]; for (int i = 0; i < N; i++) { idx[i] = -1; } int minidx = INT32_MAX; for (int i = 0; ...
ALGO
0.999984
4.430445
34400885-d4ed-49e0-84b0-830555ee9527
MOkASiH/Labs_PSTU_2023
Sem_1/2/2_14/2_14.cpp
#include <iostream> #include <cmath> using namespace std; int main() { setlocale(LC_ALL, "RU"); int n, sum = 0; cout << " : "; cin >> n; while (n != 0) { sum += n % 10; n /= 10; } cout << sum; return 0; }
ALGO
0.999685
4.150449
604e4635-bd28-41df-b189-e7b00f0f34e7
NotKohtpojiep/System-Programming
Итоговый тест 6/Тест 6.1/itogo5.Task2/itogo5.Task2.cpp
// itogo5.Task2.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы. #include <iostream> #include "Header.h" int readCountOfPersons() { int personsCount; bool isDone; do { isDone = true; std::cout << "Type count of persons" << std::endl; std::cin >> personsCount; ...
ALGO
0.998658
4.927873
73991e7f-3362-4b63-bd88-0ef474358dba
smart-make/zxing
cpp/core/src/zxing/oned/Code93Reader.cpp
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- #include "Code93Reader.h" #include <zxing/oned/OneDResultPoint.h> #include <zxing/common/Array.h> #include <zxing/ReaderException.h> #include <zxing/FormatException.h> #include <zxing/NotFoundException.h> #include <zxing/ChecksumException.h> #inc...
ALGO
0.987815
6.500492
f4f32dab-4dc7-43a9-a7b2-3d3aebf4fbfe
zhengwang721/ASF
common/services/sensors/physics/press_altitude.cpp
#include "press_altitude.h" namespace { /** ISA_LAYER - atmospheric layer parameters */ typedef struct { scalar height_bottom; /**< Height above sea level @ bottom of layer */ scalar static_press; /**< Static pressure at layer base */ scalar standard_temp; /**< Standard temperature at lay...
TOOL
0.93456
7.566378
1db2c088-18ba-4caf-abe6-8b700447900e
Ruchika349/Geeks-for-Geeks-practice
Difficulty: Hard/Count Smaller elements/count-smaller-elements.cpp
//{ Driver Code Starts #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ // User function template for C++ class Solution { public: vector<int> constructLowerArray(vector<int> &arr) { // code here int n = arr.size(); vector<int> resu...
ALGO
0.999984
5.852429
5ad6a176-63f3-4b0e-ba7c-0a2a5ca18262
u-wyh/luogu-code
P4928.cpp
#include<bits/stdc++.h> using namespace std; const int MAXN = 2e3+5; const long long INF = 1e15; int n,m; int x[5]; int y[5]; int z[MAXN]; int power[5]; int cnt[5]; long long dp[MAXN][8*8*8*8]; int main() { cin>>n>>m; power[0]=1; for(int i=1;i<=n;i++){ power[i]=power[i-1]*7; } for(int i=0;...
ALGO
0.999976
3.186744
65cee9f8-186a-48f7-8fd2-caf81c89bcd4
NoNameMing/PATB
src/solutions/57.cpp
#include <iostream> using namespace std; int main(){ string str; int n = 0, tmp, cnt1 = 0, cnt0 = 0; getline(cin, str); for (int i = 0; i < str.length(); i++){ if (str[i] >= 'a' && str[i] <= 'z') {tmp = str[i] - 'a' + 1; n += tmp;} if (str[i] >= 'A' && str[i] <= 'Z') {tmp = str[i] - 'A'+...
ALGO
0.999694
4.119439
815c4570-dd8e-4ef1-9dc8-bae73ffc1a10
luerera1/leetcode
牛客网真题/社团主席选举/Project3/Project3/源.cpp
#include<iostream> #include<string> #include<algorithm> using namespace std; bool helper(string str){ string res; bool flag = true; for (int i = 0; i < str.size(); i++){ res.push_back(str[i]); } for (int i = 0; i < str.size(); i++){ if (str[i] != 'A' && str[i] != 'H' && str[i] != 'I' && str[i] != 'M' && st...
ALGO
0.999303
4.659
93ec7ae5-1067-4de5-91e4-c4f512e89325
ismailkhan2118/DSA_Problems_Solutions
Recursion/Digital_root.cpp
//https://practice.geeksforgeeks.org/problems/digital-root/1 class Solution{ public: //Complete this function int digitalRoot(int n) { //Your code here if(n < 10) return n; return digitalRoot(n%10 + n/10); } };
ALGO
0.999869
6.06233
d9ce558f-69c8-4018-8870-5ab3eb2db23d
GurleenRajpal/DS-Cpp-Codes
_23_Graph/_13_dijkstras.cpp
// Code : Dijkstra's Algorithm // Send Feedback // Given an undirected, connected and weighted graph G(V, E) with V number of vertices (which are numbered from 0 to V-1) and E number of edges. // Find and print the shortest distance from the source vertex (i.e. Vertex 0) to all other vertices (including source vertex a...
ALGO
0.999996
4.597995
e68ad682-df9a-44f5-b791-1579e18d83f7
thuylinhptit/CTDL_GT
contest8/bai6.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define For(i,a,b) for(int i=a;i<=b;i++) void Res(){ int n; cin>>n; queue<ll> q; q.push(9); while(!q.empty()){ int t = q.front(); if(t%n==0){ cout<<t<<'\n'; return; } q.pop();...
ALGO
0.999719
4.650084
66f43758-88e2-4648-90d1-d430850d0716
JaiSukheja/LeetcodeExt
2657_Find_the_Prefix_Common_Array_of_Two_Arrays.cpp
/*Can you solve this real interview question? Find the Prefix Common Array of Two Arrays - You are given two 0-indexed integer permutations A and B of length n. A prefix common array of A and B is an array C such that C[i] is equal to the count of numbers that are present at or before the index i in both A and B. Ret...
ALGO
0.999946
6.695051
7dc3f0fe-2163-484a-a308-c312cd0a430f
sarvex/leetcode-small-basic
solution/0900-0999/0994.Rotting Oranges/Solution.cpp
class Solution { public: int orangesRotting(vector<vector<int>>& grid) { int m = grid.size(), n = grid[0].size(); int cnt = 0; typedef pair<int, int> pii; queue<pii> q; for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) { if (grid[i][j] == 2...
ALGO
0.999975
6.124527
eca33c29-8aab-46fb-bb9a-69993eb67f79
ishandutta2007/codeforces
npng/normal/1603/A.cpp
#include <cstdio> const int Maxn=100000; int n; int a[Maxn+5]; void solve(){ scanf("%d",&n); bool flag=1; for(int i=1;i<=n;i++){ scanf("%d",&a[i]); for(int j=2;j<=a[i]+1;j++){ if(a[i]%j!=0){ if(j-1>i){ flag=0; } break; } } } if(flag){ puts("YES"); } else{ puts("NO"); } } int mai...
ALGO
0.999176
4.348797
470f9073-f7c7-45fc-8b7a-d04451b2b8ee
ishandutta2007/codeforces
emiso/normal/1606/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #ifdef EBUG #include "trace.h" #else template<typename... Args> void trace(Args... args) {} #define trace2(args...) trace(args) #endif #define MN 1001000 ll t = 1, n, k, ans, a[MN], p10[110]; //char s[MN]; string str; int main() { scanf("%lld"...
ALGO
0.999609
3.486915
eff30eee-58b7-4f6e-b981-34047d80cdcf
abhishek-bathala/Coursera_DataStructures_Algorithms_Specialization
5_advanced_algorithms_&_complexity/week4_coping_with_np_completeness/2_plan_party/plan_party.cpp
#include <iostream> #include <vector> //#include <sys/resource.h> using namespace std; struct Vertex { int weight; vector <int> children; }; typedef std::vector<Vertex> Graph; typedef std::vector<int> Sum; Graph ReadTree() { int vertices_count; cin >> vertices_count; Graph tree(vertices_count); ...
ALGO
0.999909
4.405395
71076db2-19af-40bc-ab14-ed8420f0d15e
damondql/StringNet_Herding
findPathSpeeds.cpp
#pragma once #include <math.h> #include "findShortestPath.cpp" #include "AllParametersExperiment.cpp" using namespace std; using namespace arma; struct pathVel_elem { vec v; double v_bar; double s_bar1; double s_bar2; vec T; double T_bar1; double T_bar2; double u_maxD; double v_max...
ALGO
0.99839
3.849937
af0676fb-82de-4a9e-9bdd-4b21dad2b04e
ishandutta2007/codeforces
dreamoon_love_aa/normal/1513/C.cpp
/*{{{*/ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #include<string> #include<iostream> #include<sstream> #include<set> #include<map> #include<queue> #include<bitset> #include<vector> #include<limits.h> #include<assert.h> #define SZ(X) ((int)(X).size()) #define ALL(X) (X).be...
ALGO
0.999888
3.90521
5e12d57f-db63-44ba-a109-f594e269156e
JagadeeswarJ/os-cpp-codes
extras/02-peterson.cpp
#include <bits/stdc++.h> using namespace std; bool flag[2] = {false, false}; int turn; void enter_critical(int pid) { int other = 1 - pid; flag[pid] = true; turn = other; while (flag[other] && turn == other) { } } void exit_critical(int pid) { flag[pid] = false; } int main() { enter_...
ALGO
0.999879
4.486638
f14efba2-1226-4b93-86f4-cd96c01812d7
SubhamRajChoudhary/capstone_IITP
src/arch/intsimdmatrix.cpp
#include "intsimdmatrix.h" #include "matrix.h" // for GENERIC_2D_ARRAY #include "simddetect.h" // for SIMDDetect namespace tesseract { const IntSimdMatrix *IntSimdMatrix::intSimdMatrix = nullptr; // Computes a reshaped copy of the weight matrix w. void IntSimdMatrix::Init(const GENERIC_2D_ARRAY<int8_t> &w, std::...
ALGO
0.992689
6.317689
c29c9bbf-4160-40c6-9876-be7d6364c1ad
YvesHarrison/Leetcode
Array/495. Teemo Attacking/solution.cpp
class Solution { public: int findPoisonedDuration(vector<int>& timeSeries, int duration) { int len=timeSeries.size(); if(len==0) return 0; int cn=0; for(int i=1;i<len;++i){ if(timeSeries[i]-timeSeries[i-1]>=duration)cn+=duration; else cn+=timeSeries[i]-timeSer...
ALGO
0.999756
6.400055
dc31a48a-07c6-4edc-8239-6565c8ed5e5b
GabrielEstevam/icpc_contest_training
uri/uri_cpp/estruturas_e_bibliotecas/p1548.cpp
#include <iostream> #include <sstream> #include <string> #include <stdlib.h> #include <stdio.h> using namespace std; void mergeSort (int * numeros, int inicio, int fim); void intercala (int * numeros, int inicio_a, int fim_a, int inicio_b, int fim_b); int * copia (int * original, int tamanho); void imprime_fila (int ...
ALGO
0.999535
4.451776
211d284c-8cba-4b42-a93a-46db50406669
blueboy/portaltbc
dep/src/g3dlite/SplineBase.cpp
#include "G3D/platform.h" #include "G3D/Spline.h" namespace G3D { float SplineBase::getFinalInterval() const { if (! cyclic) { return 0; } else if (finalInterval <= 0) { int N = time.size(); if (N >= 2) { return (time[1] - time[0] + time[N - 1] - time[N - 2]) * 0.5f; ...
ALGO
0.99651
7.841708
4d1f0fe5-eeb3-4e15-90c5-f3a01b5fcab9
ishandutta2007/codeforces
sfiction/normal/1070/I.cpp
#include <stdio.h> #include <string.h> #include <vector> #include <queue> using namespace std; const int maxn=1500; const int maxe=5000; int first[maxn], nxt[maxe], vv[maxe]; int cap[maxe], flow[maxe], pre[maxn]; bool vis[maxn]; int dis[maxn]; int maxflow(int s, int t) { int ans=0; queue<int> q; while (true) { ...
ALGO
0.999924
3.786362
9e304b65-e265-4e99-9c0b-e13c90b8d3b6
Sookmyung-Algos/2021algos
algos_assignment/team_pratice/ucpc/눈송리즘/week5/18223.cpp
#include <iostream> #include <queue> #include <vector> #define MAX 987654321 using namespace std; vector<pair<int, int>> adj[5001]; int dis[5001], v, e, p; void dijkstra(int s) { fill(dis, dis + v + 1, MAX); priority_queue<pair<int, int>> pq; dis[s] = 0; pq.push({ 0,s }); while (!pq.empty()) { int d = -pq.top(...
ALGO
0.999938
4.252245
56668a99-75f4-4da8-afe8-d3e4b0444e1e
Md-Johaer-Plabon/CSES-Solution
Dynamic Programming/Coin Combination I.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define mod 1000000007 int main() { ll n, x; cin >> n >> x; ll coin[n + 5], dp[x + 5]; dp[0] = 1; for (int i = 0; i < n; i++)cin >> coin[i]; for (int i = 1; i <= x; i++)dp[i] = INT_MAX; dp[0] = 0; for (int i = 0; i < n; i++) for (int j = 1; j...
ALGO
0.999982
4.140558
eb51037c-b420-40f8-a25c-97fb747409d2
michaelcli/multiorderAlgorithm
src/multiorder_alg/src/MultiorderSolver.cpp
#include <multiorder_alg/MultiorderSolver.hpp> namespace Multiorder { MultiorderSolver::MultiorderSolver( std::map<int, std::set<int>>& neighbors, std::vector<std::vector<double>>& weights, int numNodes, double capacity) : neighbors_(neighbors), weights_(weights), numNodes_(numNodes), capaci...
ALGO
0.999974
7.117697
77d31020-5b7d-463d-8fec-6de7fc6fdf57
cdax/node-eigen
deps/eigen-3.2.5/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_1nn.cpp
#include <iostream> #include <Eigen/Dense> using namespace std; using namespace Eigen; int main() { Eigen::MatrixXf m(2,4); Eigen::VectorXf v(2); m << 1, 23, 6, 9, 3, 11, 7, 2; v << 2, 3; MatrixXf::Index index; // find nearest neighbour (m.colwise() - v).colwise().squaredNorm()...
ALGO
0.999955
4.138078
b059770a-71f2-4c9f-a1e8-8949ea8cab7f
nader-grt/Problemsolvingwithcpp
level02/index16.cpp
#include <iostream> #include <cmath> #include <string> #include <limits> using namespace std ; // 97 to 122 a to z string ReadWord(string message) { string word = "" ; short count =0; cout<<message<<endl ; cin>>word ; do { bool result = int(word[count] ) >=97 && int(word...
ALGO
0.993287
4.430123
92a230bc-6fff-4682-9f3a-2f4b2b2d313b
Afif718/Debugging-My-Fears
3_Basic_Data_Structures/11_Module_7.5_Practice_Day_2/3_maximum_value_in_linkedlist.cpp
#include<bits/stdc++.h> using namespace std; // Definition of a Node in a singly linked list class Node{ public: int val; // Stores the value of the node Node* next; // Pointer to the next node // Constructor to initialize node with a value and set next to NULL Node(int val){ this->...
ALGO
0.999975
5.518038
f6e99578-f3fc-4289-892d-2218a3883819
RobynDoyle/CPP_Projects
TicTacToe/TicTacToe.cpp
#include <iostream> using namespace std; void drawBoard(char *spaces); void playerMove(char *spaces, char player); void computerMove(char *spaces, char computer); bool checkWinner(char *spaces, char player, char computer); bool checkTie(char *spaces); int main(){ char spaces[9] = {' ', ' ', ' ', ' ', ' ', ' ', '...
ALGO
0.998826
4.982492
feb71ee7-aa4f-42ca-8443-a5ad71be54a1
HustRobot/VSLAM
13.前端project/0.2/src/visual_odometry.cpp
/*================================================================================= * Copyleft! 2018 William Yu * Some rights reserved:CC(creativecommons.org)BY-NC-SA * Copyleft! 2018 William Yu * 版权部分所有,遵循CC(creativecommons.org)BY-NC-SA协议授权方式使用 * * Filename ...
TOOL
0.885902
6.009411
d660e810-c252-4d51-bf7b-5f35e18f27ee
kritikarag/DSA-Prep
Dynamic Programming/Practice/coin_combinations_I.cpp
#include<bits/stdc++.h> using namespace std; int main(){ int n, x; cin >> n >> x; vector<int>coins(n),dp(x+1); int mod = 1e9+7; for (int i = 0; i < n; i++) { cin >> coins[i]; } dp[0] = 1; for (int weight = 0; weight <= x; weight++) { for (int i = 1; i <= n; i++) ...
ALGO
0.999996
4.863287
1d935382-4ed0-489e-8dbf-2202eadfe15b
Karanbyte07/C-DSA-Library
Lecture 031 Recursion Classes/bubbleSort.cpp
#include <bits/stdc++.h> using namespace std; void bubbleSort(int arr[], int n){ //base case if(n == 0 || n == 1) return ; //already sorted //1 case solve kr do jo ki largest element ko end me rkah dega for(int i = 0; i < n - 1; i++){ if(arr[i] > arr[i+1]){ swap(arr[i], arr[i+1]); ...
ALGO
0.999779
5.200171
194c0cd7-7163-4311-8f91-c151cc9edda7
San0330/C-Codes
Standard library functions/Queues and Stacks/stack.cpp
#include<iostream> #include<stack> using namespace std; int main(){ stack<int> st; if(st.empty()) cout << "Stack is empty\n"; else cout << "Stack is not empty\n"; for(int i = 0; i < 5; i++){ st.push(i); } while(!st.empty()){ cout << "Size of stack is " << st.size() << endl; cout << "Top = ...
ALGO
0.954519
3.737219
150f4dc0-c140-45d7-afd5-11e7851da441
jiyak12/DSA_IN_C-
Array/prog1.cpp
// all elements in the array should be of the same data type //if an array is defined globally i.e before int main , the values of all the elements becomes equal to the globally defined value. //the max size of array which can be declared inside int main function is 10^6 while the global value is 10^7 //in an array the...
ALGO
0.997268
5.31411
4ec9780b-5512-44ad-b3da-1f95eb8f586e
divmish-1007/CrackYourPlacement
choclate-distribution-problem/code.cpp
class Solution{ public: long long findMinDiff(vector<long long> a, long long n, long long m){ //code sort(a.begin(), a.end()); long long mini = INT_MAX; for(int i=0; i<n-m+1; i++){ long long diff = a[m-1+i] - a[i]; mini = min(mini, diff); ...
ALGO
0.999971
5.375034
d5b7628e-3c49-4793-b4e9-4e567d134037
eric-haibin-lin/pelotondb
src/postgres/backend/executor/nodeSetOp.cpp
#include "postgres.h" #include "access/htup_details.h" #include "executor/executor.h" #include "executor/nodeSetOp.h" #include "utils/memutils.h" /* * SetOpStatePerGroupData - per-group working state * * These values are working state that is initialized at the start of * an input tuple group and updated for each...
ALGO
0.980127
6.40112
08913de0-f8ff-4ea0-ae22-1f93a7733702
NekoLily/hae_bernard_gp2
Box2D-master/Box2D/Collision/b2CollideCircle.cpp
#include "Box2D/Collision/b2Collision.h" #include "Box2D/Collision/Shapes/b2CircleShape.h" #include "Box2D/Collision/Shapes/b2PolygonShape.h" void b2CollideCircles( b2Manifold* manifold, const b2CircleShape* circleA, const b2Transform& xfA, const b2CircleShape* circleB, const b2Transform& xfB) { manifold->pointCou...
ALGO
0.999318
7.761623
e93d3121-3162-491b-a1fb-21d490fc4961
KDE/calligra-history
plugins/reporting/barcode/code128paint.cpp
/* * This file contains the implementation of the Code 128 barcode renderer. * All this code assumes a 100dpi rendering surface for it's calculations. */ #include <QString> #include <QVector> #include <QRect> #include <QPainter> #include <QPen> #include <QBrush> #include "renderobjects.h" static const int SET...
TOOL
0.944536
4.969103
5ec65613-2ded-4362-9f58-9dec803ac261
matthewh806/killing_me_softly_with_his_dsp
code/playground/fft/CLIMain.cpp
// clang-format off #include "JuceHeader.h" // clang-format on #include "FFTWrapper.h" namespace OUS { void createSineWavetable(std::array<float, FFTWrapper::FFTSize * 2>& sineTable, size_t size) { auto angleDelta = juce::MathConstants<double>::twoPi / (double)(size - 1); auto currentAngle = 0...
ALGO
0.934209
5.834108
f567abc9-c6bc-434e-916f-36d30af4d46e
gcourchinoux/llvm-gaspard
tools/dsymutil/MachOUtils.cpp
#include "MachOUtils.h" #include "BinaryHolder.h" #include "DebugMap.h" #include "LinkUtils.h" #include "llvm/CodeGen/NonRelocatableStringpool.h" #include "llvm/MC/MCAsmLayout.h" #include "llvm/MC/MCMachObjectWriter.h" #include "llvm/MC/MCObjectStreamer.h" #include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCStreame...
TOOL
0.866603
7.057561
96e3229c-2a0a-4fa6-9865-0ebfac3af078
gcourchinoux/llvm-gaspard
lib/Analysis/DivergenceAnalysis.cpp
#include "llvm/Analysis/DivergenceAnalysis.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/Passes.h" #include "llvm/Analysis/PostDominators.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/IR/Dominators.h" #include "llvm/IR/InstIterator.h" #include "llvm/IR/Instructions.h" #include "llvm/...
ALGO
0.923987
7.853137
3c006eed-390c-4b46-a08f-6656d2ddfb3d
v-shadowmaster/DATA-STRUCTURES-ALGORITHMS
1-ARRAYS/easy/missing_repeating.cpp
/* Given an unsorted array arr[] of size n, containing elements from the range 1 to n, it is known that one number in this range is missing, and another number occurs twice in the array, find both the duplicate number and the missing number. Examples: Input: arr[] = [3, 1, 3] Output: [3, 2] Explanation: 3 is occurs...
ALGO
0.998359
5.530377
db398a0f-cb2a-4bf8-837c-b07e4ae93c2a
prisrv/prisrv
Algorithm/MIRACL/ps_big.cpp
/* * C++ class to implement a power series type and to allow * arithmetic on it * * WARNING: This class has been cobbled together for a specific use with * the MIRACL library. It is not complete, and may not work in other * applications * * See Knuth The Art of Computer Programming Vol.2, Chapter 4.7 */ #i...
ALGO
0.994505
3.42893
7d0cddf6-2a49-4f5b-a4af-c1570c927225
dejdy/BI-OSY
2 - Memory manager/ccpu.cpp
#ifndef __PROGTEST__ #include <cstdio> #include <cstdlib> #include <cstdint> #include <cstring> #include <pthread.h> #include <semaphore.h> #include "common.h" using namespace std; #endif /* __PROGTEST__ */ //------------------------------------------------------------------------------------------------- ...
TOOL
0.871463
4.308201
d7e2e3e2-76e5-481c-a5fe-04a350f3a5f7
BSEF19M513/OOP-DSA
Lab1/Task1/03 BinarySearch-recursive.cpp
// C++ code to linearly search x in arr[]. If x // is present then return its location, otherwise // return -1 #include <iostream> #include<ctime> #include<cstdlib> using namespace std; // A recursive binary search function. It returns // location of x in given array arr[l..r] if present, // otherwise -1 int bina...
ALGO
0.999919
5.267922
3834a5ed-81a1-425f-b586-990b2ff15938
emathgroup/selectedTopics
content/attached/trees/find2.cpp
#include <time.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <sys/types.h> #include <algorithm> #include <vector> #include <set> #include <string> #include <assert.h> #ifndef NDEBUG #define ASSERT(x) assert(x) #else #define ASSERT(x) #endif #include <time.h> #include <st...
ALGO
0.985221
3.119154
dd69efdf-ed36-415a-8548-57aeae8a94dc
GianMusca/cpp-blockchain-implementation
EDA-TPF3-G3/Crypto/shark.cpp
// shark.cpp - originally written and placed in the public domain by Wei Dai #include "pch.h" #include "shark.h" #include "misc.h" #include "modes.h" #include "gf256.h" #if CRYPTOPP_GCC_DIAGNOSTIC_AVAILABLE # pragma GCC diagnostic ignored "-Wmissing-braces" #endif NAMESPACE_BEGIN(CryptoPP) static word64 SHARKTransf...
ALGO
0.999773
7.770734
a7eaad1b-f0ee-4042-b5f5-711ab0fbf3da
balabit-deps/balabit-os-9-llvm-toolchain-15
libcxx/benchmarks/algorithms/sort.bench.cpp
#include <algorithm> #include "common.h" namespace { template <class ValueType, class Order> struct Sort { size_t Quantity; void run(benchmark::State& state) const { runOpOnCopies<ValueType>( state, Quantity, Order(), BatchSize::CountElements, [](auto& Copy) { std::sort(Copy.begin(), Copy.end...
TEST
0.884812
6.609788
d33060c0-1f11-4058-b8d7-ce6342fa4ce5
ondrejbiza/fewshot
prereq/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.cpp
namespace detectron2 { template <typename scalar_t> at::Tensor nms_rotated_cpu_kernel( const at::Tensor& dets, const at::Tensor& scores, const double iou_threshold) { // nms_rotated_cpu_kernel is modified from torchvision's nms_cpu_kernel, // however, the code in this function is much shorter because ...
ALGO
0.994573
7.66435
a9979262-1475-4194-beca-0de567949c77
singhal-amit/B.Tech-LAB-Courses
Sem 3/Computational Methods/prg_09 (Gauss_Jordan Method).cpp
#include <iostream> #include <iomanip> using namespace std; void convertone(float m[3][3], float a[3][3], int x) { float f = m[x][x]; for (int j = 0; j < 3; j++) { if (m[x][x] != 0.0) { m[x][j] /= f; a[x][j] /= f; } } } void RowOperations(float m[3][3], float a[3][3], int row, int n) { for (int i = ...
ALGO
0.999775
3.620973
fa848379-28dc-4956-8191-d80624546b16
Maher12-hub/C-and-C-plus-plus
nesting_for_loop.cpp
#include<iomanip> #include<iostream> using namespace std; int main(){ for (int a=1;a<=20;a++){ for (int b=1;b<=10;b++){ cout<<setw(4)<<a*b; } cout<<endl; } }
ALGO
0.937295
3.150895
651c694b-f3b9-4929-b609-fdf3d53d964a
alexandraback/datacollection
solutions_5652388522229760_0/C++/duyhai/main.cpp
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <fstream> #include <sstream> #include <algorithm> #include <map> #include <set> #include <unordered_set> #include <unordered_map> #include <utility> #include <string> #include <cstring> #include <queue> #include <stack> #define DBGMODE #...
ALGO
0.997698
5.373467
9fc41634-d8dd-4d68-a61b-5a754e89ffb4
tenlee2012/AllCode
HDUOJ/HDU1892.cpp
//Author LJH //www.cnblogs.com/tenlee #include <cstdio> #include <cstdlib> #include <cstring> #include <cctype> #include <cmath> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <map> #define clc(a, b) memset(a, b, sizeof(a)) using namespace std; const int inf = 0x3f; const int INF = 0...
ALGO
0.991175
4.487836
0851e7b4-1a5a-422b-bfe9-cbc0b36e9e9f
ishandutta2007/codeforces
ynsm/normal/1198/D.cpp
#include <bits/stdc++.h> #define f first #define s second #define pb push_back #define mp make_pair using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<long long, long long> pll; const int N = (int)2e5 + 123, inf = 1e9, mod = 1e9 + 7; const ll INF = 1e18; int n, a[55][55], dp[55][55...
ALGO
0.999672
4.04193
594fd75e-ea61-4580-bdb9-13c14e0efb9f
dezhonger/LeetCode
Leetcode1521.cpp
class Solution { public: int closestToTarget(vector<int>& arr, int target) { //&运算是单调递减的,且不同的值最多只有20个(&运算只会把1变为0) int n = arr.size(); set<int> s; int ans = INT_MAX; for (int r = 0; r < n; r++) { ans = min(ans, abs(target - arr[r])); set<int> s2; ...
ALGO
0.99997
5.500244
1bf8e099-078f-4b0f-ad4b-010dcbe21471
InflixOP/LeetCode-CPP-Solutions
#3068 Find the Maximum Sum of Node Values.cpp
class Solution { public: long long maximumValueSum(vector<int>& v, int k, vector<vector<int>>& edges) { long long total=accumulate(v.begin(), v.end(), 0ll); long long totalDiff=0; long long diff; int positiveCount=0; long long minDiff=numeric_limits<int>::max(); for(a...
ALGO
0.999955
5.455032
9dbe7b29-5b03-4688-afe1-a7d236156e5f
ParanoidMarvin0/CS115
Lecture/assignment_six/process.cpp
#include <iostream> using namespace std; #include "process.h" void process_sequence(Container& c) { int x; // Read input sequence cin >> x; while (cin) { c.insert(x); cin >> x; } // Write output sequence while (! c.empty()) { cout << c.remove() << endl; } }
ALGO
0.998961
4.764324
05a704ae-3285-4c0b-819c-ebdc6995e9b5
KristinaYuan/PKU-cxsjsx-2025-Spring
C++部分/2025自由演武场C++/上机练习07/04 编程填空:Printer.cpp
#include<iostream> #include<algorithm> #include<vector> #include<bitset> using namespace std; class Printer{ private: int val; public: Printer(int x):val(x){} void operator() (int n) { if (n > val) { cout << n << ","; } } void operator() (string s) { if (s.length() > val) { cout << s << ","; } } }...
ALGO
0.995414
3.833607
191615cf-a1e4-4dc6-a877-8f36d7889350
lukix013/aisd-project
prz_wiel.cpp
#include "prz_wiel.h" #include <algorithm> bool czy_wspoliniowe(Point a, Point b, Point c) { return (b.x - a.x) * (c.y - a.y) == (b.y - a.y) * (c.x - a.x); } // sprawdza czy 3 punkty są współliniowe bool do_krawedzi(Point p, Point a, Point b) { if (czy_wspoliniowe(p, a, b)) { // sprawdza wspołliniowość punktu...
ALGO
0.999441
5.080661
7b90f277-3b60-4af2-be37-af481655cf51
SuryaPratapSinghRana/DSA
pattern/pattern21.cpp
#include<iostream> using namespace std; int main(){ int n; cout<<"enter the value of a"; cin>>n; int space=1; int i=1; int p=2; while(i<=n/2){ int j=1; while(j<=i) { cout<<"*"; j++; } space=1; while((space)<=(n-p)){ ...
ALGO
0.999745
3.29294
5115f47b-f065-4482-9d9b-43c2bda12a11
WillianM19/Exercicios-em-Cpp
Lista de Exercícios 4 - Vetores/10.cpp
// 10. Faça um algoritmo para preencher um de 20 números. Após isto, deverá ser lido mais um número qualquer e verificar se esse número existe no vetor ou não. Se existir, o algoritmo deve pedir um novo número. #include <iostream> using namespace std; int main(){ float vetor[20], comparador; int aux = 1; ...
ALGO
0.980097
3.115366
97438797-24b6-414a-bbee-76c36b852fb1
azertybae/Labs_PSTU
task 2/z2.2.cpp
#include <iostream> using namespace std; int main() { int n, proizv; proizv = 1; cin >> n; for (int i = 1; i <= n; i++) { proizv *= i; } cout << proizv; return 0; }
ALGO
0.999971
4.94745
d7cdfa22-6485-4b68-8b53-9e199abf7db9
heybornfire/cpp
dp2/eggdroping.cpp
#include<iostream> #include <cstdlib> #include<cstring> #include<algorithm> #include <climits> using namespace std; int memo[1000][1000]; int eggdropping(int n,int k) { if(n==1) return k; if(k==1||k==0) return k; if(memo[n][k]!=-1) return memo[n][k]; int mintrial=INT_MAX; for(int i=1;i<=k;i++) { mintrial=...
ALGO
0.99991
4.938378
7b8c409f-2dbb-4541-85d8-033ecc6cfd4e
apooravraj/DSA
73-set-matrix-zeroes/set-matrix-zeroes.cpp
class Solution { public: void setZeroes(vector<vector<int>>& matrix) { int m = matrix.size(); int n = matrix[0].size(); bool firstRowImpacted = false; bool firstColImpacted = false; for(int col = 0; col < n; col++) { if(matrix[0][col] == 0) { firs...
ALGO
0.99914
6.817002
7dfb6bd6-1066-4d9c-9027-b3d88e0fbd2f
MinhTuNguyen02/Code-Cpp
baitapC++_2/BTTH/TH4/bai4.cpp
#include <iostream> using namespace std; class So_nguyen_duong{ private: int Giatri; public: So_nguyen_duong(){ Giatri = 1; } ~So_nguyen_duong(){ } void setGiatri(int gt){ Giatri = gt; } int getGiatri(){ return Giatri; } int GiaiThua(){ int gt=1; for(int i=Giatri; i>0; i--){ g...
ALGO
0.997103
4.027805
a8a05a11-701a-4d36-9d0a-7f7f4dea6bdb
Chrislai502/EECS149_FP
kobuki/src/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp
#include <Eigen/Dense> #include <iostream> using namespace Eigen; using namespace std; int main() { MatrixXf m(2,2); m << 1,-2, -3,4; cout << "1-norm(m) = " << m.cwiseAbs().colwise().sum().maxCoeff() << " == " << m.colwise().lpNorm<1>().maxCoeff() << endl; cout << "infty-norm(m...
ALGO
0.999631
4.076589
ada76298-a8cb-4cbc-9251-a0574f44c8cc
its-coder5128/leetcode
my-folder/problems/longest_substring_without_repeating_characters/solution.cpp
class Solution { public: int lengthOfLongestSubstring(string s) { unordered_map<char,int> m; int l = 0; int r = 0; int n = s.size(); int maxi = 0; while(r<n) { char c = s[r]; if(m.find(c) != m.end() && l<=m[c]) { ...
ALGO
0.999899
6.151004
edf0fae7-43c3-4f8d-9729-844fe29edd93
zahrahcc/tekmob-3-dan-4
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
59a8cacd-c869-4641-8b78-dd6a83a86a81
ashmanmode/code-samples
GfG/288B.cpp
#include <bits/stdc++.h> using namespace std; #define fr(i,n) for(int i = 0 ; i < n ; i++ ) #define mp(a,b) make_pair(a,b) #define pb(a) push_back(a) #define printvect(a) fr(i,a.size()) cout << a[i] << " " ; typedef unsigned long long int ull; int main() { string n; cin >> n; int siz = n.size(); int num = (int)(n...
ALGO
0.999731
4.277679
ff4a3fcc-fed1-4aef-8942-b9c7ce86a68c
wafiqmuhaz/BootcampFlutter
PengayaanHarian/pengayaanapp13/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.997968
6.76073
cf52793c-5f85-45b0-80eb-280ca83b16e7
FRC1296/CheezyDriver2016
third_party/eigen/bench/sparse_lu.cpp
// g++ -I.. sparse_lu.cpp -O3 -g0 -I /usr/include/superlu/ -lsuperlu -lgfortran -DSIZE=1000 -DDENSITY=.05 && ./a.out #define EIGEN_SUPERLU_SUPPORT #define EIGEN_UMFPACK_SUPPORT #include <Eigen/Sparse> #define NOGMM #define NOMTL #ifndef SIZE #define SIZE 10 #endif #ifndef DENSITY #define DENSITY 0.01 #endif #ifnd...
ALGO
0.994694
4.187482
d5dcceee-6f14-4640-addf-3549d8ef4006
lclpsoz/competitive-programming
ARCHIVE/2018-11-25-1727/2905.cpp
#include "bits/stdc++.h" using namespace std; ////////////// Prewritten code follows. Look down for solution. //////////////// #define x first #define y second #define len(x) ((int)(x).size()) using pii = pair<int, int>; using ll = long long; using llu = long long unsigned; using ld = long double; const ld EPS = 1e-9...
ALGO
0.997578
3.484346
c754f41f-2491-40df-bc04-08fc9026c39e
jeevasidarth/Data_structure_lab
Lab 9/bstree.cpp
//To do the insertion and inorder, preorder , postorder using binary search tree #include <cstdio> #include <cstdlib> class tree { private: struct node { int data; struct node *left; struct node *right; } *root; public: tree() { root = NULL; } struct node *getroot(...
ALGO
0.999935
4.908973
74ea5d04-77d8-4185-b735-ccaaa64fa7a1
bira37/problem-solving
URI/1195.cpp
#include <stdio.h> #include <stdlib.h> typedef struct node{ struct node *esq; struct node *dir; int info; }Node; Node* inicializa(){ return NULL; } void insere(Node**t,int n){ if(!(*t)){ (*t)=(Node*)malloc(sizeof(Node)); (*t)->info=n; (*t)->esq=NULL; (*t)->dir=NULL; } else { if(n <= (*t)->info) inser...
ALGO
0.999826
4.071814
9e8801dc-4c57-459f-8c3d-348a8d78fd59
2984jun/data_structure
search/sqelist.cpp
#include<stdio.h> #include<malloc.h> #define MAXL 100 typedef int KeyType; typedef char InfoType; typedef struct { KeyType key; InfoType data; }RecType; void CreateList(RecType R[],KeyType keys[],int n) { for(int i=0;i<n;i++) R[i].key=keys[i]; } void DispList(RecType R[],int n) { for(int i...
ALGO
0.999459
3.302129