uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
2c8e23a0-6517-454f-8c35-0fc6b7eae2c5 | abdkhaleel/Placement-preparation | Binary Search Tree/LC-653. Two Sum IV - Input is a BST.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.999998 | 6.318491 |
f8fa1980-bb79-4308-a7a5-c1b7d26549fe | RuoAndo/NII-SOCs-admin-tools | scripts/session/cron/count_subtype_final.cpp | #if __linux__ && defined(__INTEL_COMPILER)
#define __sync_fetch_and_add(ptr,addend) _InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(ptr)), addend)
#endif
#include <string>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cstdio>
#include <iostream>
#include <fstream>
#includ... | DATA | 0.976201 | 4.177145 |
0b88f24b-1aa6-414f-860b-09a86943a594 | Mifaho/StefanLab5PM | main.cpp |
#include "Person.h"
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <algorithm>
/*
struct MyPrint {
const bool operator()(const Person &person) {
std::cout << person.getName() << " är " << person.getHeight() << "m lång" << std::endl;
};
};*/
int main(int argc, char** argv) {
srand... | TOOL | 0.953677 | 4.169152 |
77b75e5f-6147-44c5-bf77-27b69ef442cd | micklevast/Striver-191-SDE_Sheet-Vishal_chauhan | Day18/Q2/meth1.cpp | #include <bits/stdc++.h>
/**
* 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, Tr... | ALGO | 0.99975 | 6.252254 |
ae081fa4-9253-4f1a-8c8f-125047c386df | suryakantkasare/DSA | Tree/Clone_a_BT_with_random.cpp |
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
struct Node *random;
Node(int x){
data = x;
left = NULL;
right = NULL;
random = NULL;
}
};
int checkcloned(Node* a, Node *b)
{
if ((a == NULL and b == NULL))
return 1;
if (a != ... | ALGO | 0.999892 | 4.005796 |
9aef8d9b-e725-4ed8-9b2f-c5cddcf47242 | telecobazar/C-programs- | esprimo.cpp | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main (){
int num1,a;
bool primo = true;
a=1; /*Esta variable usamos para contar los divisores del número introducido, la inicializamos a 1*/
printf("Introduce un numero: ");
scanf("%d",&num1);
printf("Estos son los divisores exactos encontrados: ");
for(... | ALGO | 0.99616 | 3.128768 |
8334155b-477e-4f20-b159-45b1c4cf95b8 | MohamedAIsmail/LeetCode-Problems | 2-add-two-numbers/2-add-two-numbers.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution
{
public:
ListNode *addTwoNumbe... | ALGO | 0.999845 | 6.451302 |
37f088ec-8123-45ce-967a-eac3194a7c20 | sagittariusk2/Leetcode-solutions | number-complement/number-complement.cpp | class Solution {
public:
int findComplement(int num) {
bitset<32> b1(num);
bool s = false;
for(int i=31; i>=0; i--) {
if(b1[i]==1) s = true;
if(s) {
if(b1[i]==1) b1[i]=0;
else b1[i]=1;
}
}
return b1.to_ullong... | ALGO | 0.999727 | 5.583045 |
0a42cdbb-6386-44ab-95bf-0ae25453df8b | ujjwal56/principal-of-programming-languages | ppl1.b (w4).cpp | #include<iostream>
using namespace std;
int main()
{
int mat1[3][3], mat2[3][3], i, j, mat3[3][3];
cout<<"Enter matrix 1 elements :";
for(i=0; i<3; i++)
{
for(j=0; j<3; j++)
{
cin>>mat1[i][j];
}
}
cout<<"Enter matrix 2 elements :";
for(i=0; i<3; i++)
{
for(j=0; j<3; j++)
{
cin>>mat2[i][j];
}... | ALGO | 0.998704 | 3.323394 |
07e95c08-7181-4aa7-92e9-ef7b00d88938 | wazenmai/Leetcode | Easy/459_repeated_substring_pattern/solution4.cpp | /**
* Title: Repeated Substring Pattern (Leetcode Easy)
* Author: Bronwin Chen <<EMAIL>>
* Date: 21, August, 2023
* Method: Here I implement the KMP algorithm to find whether t contains s.
* We need to first compute s's longest proper prefix suffix array (LPS), then when matching t and s, if t... | ALGO | 0.999936 | 6.246677 |
70df5e8f-a0e2-4f74-b7ef-6414cad32751 | anishmehta24/cp | D_Problem_about_GCD.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <math.h>
#include <string>
#include <numeric>
#include <algorithm>
#include <queue>
const int MOD = 998244353;
#define ll long long int
using namespace std;
int main() {
int t;
cin >> t;
while(t--) {
ll l, r, G;
... | ALGO | 0.999396 | 4.695069 |
b6661065-9001-45d6-aff5-79f88c7aa00a | kminami0/AtCoder | atcoder.jp/arc006/arc006_3/Main.cpp | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define INF 1000000000
// aよりもbが大きいならばaをbで更新する
// (更新されたならばt... | ALGO | 0.999973 | 4.472584 |
0d9bea20-09ea-4b77-aa75-cfd5b109c67d | pankajbhatt150/LeetCode-Question-DSA-14-days- | 290-word-pattern/290-word-pattern.cpp | class Solution {
public:
bool wordPattern(string pattern, string s) {
int ind = 0;
int i = 0;
string str = "";
unordered_map<string,char> wordmap;
unordered_map<char,string> patternmap;
while(i<s.size()){
if(s[i]==' '){
if(wordmap.count(str) ... | ALGO | 0.999602 | 6.255044 |
716cfb12-3fdc-41fc-896a-a71d0e7360a8 | HONGYANGGAN/leetcode | solution/2600-2699/2616.Minimize the Maximum Difference of Pairs/Solution.cpp | class Solution {
public:
int minimizeMax(vector<int>& nums, int p) {
sort(nums.begin(), nums.end());
int n = nums.size();
int l = 0, r = nums[n - 1] - nums[0] + 1;
auto check = [&](int diff) -> bool {
int cnt = 0;
for (int i = 0; i < n - 1; ++i) {
... | ALGO | 0.99999 | 5.561461 |
de34cfc5-94a2-4830-98ec-85c9a35d49f5 | MPSLab-ASU/CCF-20.04 | llvm-project/libcxx/test/std/utilities/function.objects/func.search/func.search.bmh/default.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14
// XFAIL: libc++
// <functional>
// boyer_moore_horspool searcher
// template<class RandomAccessIterator1,
// class Hash = hash<typename iterator_traits<RandomAccessIterator1>::value_type>,
// class BinaryPredicate = equal_to<>>
// class boyer_moore_horspool_searc... | TEST | 0.924245 | 6.586237 |
d3676f0b-728b-48d6-a99d-05753d71f69e | Liouvi/IG-SLAM | thirdparty/eigen/doc/examples/class_VectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived>
segmentFromRange(MatrixBase<Derived>& v, int start, int end)
{
return Eigen::VectorBlock<Derived>(v.derived(), start, end-start);
}
template<typename Derived>
const Eigen::Vec... | TOOL | 0.988879 | 4.383477 |
e397c499-b830-493f-917e-273c21e4b087 | JonathonLuiten/diff-gaussian-rasterization-w-depth | third_party/glm/test/core/core_func_matrix.cpp | #include <glm/ext/matrix_relational.hpp>
#include <glm/ext/matrix_transform.hpp>
#include <glm/ext/scalar_constants.hpp>
#include <glm/mat2x2.hpp>
#include <glm/mat2x3.hpp>
#include <glm/mat2x4.hpp>
#include <glm/mat3x2.hpp>
#include <glm/mat3x3.hpp>
#include <glm/mat3x4.hpp>
#include <glm/mat4x2.hpp>
#include <glm/mat... | TEST | 0.868908 | 6.702728 |
95d75410-f486-4dd9-a0e2-1568de5292d4 | binay0607/cpp | recursion/11_subsetsum1.cpp | //here we have to print sum of all the subsets
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define vii vector<pii>
#define li list<int>
#define nl "\n"
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define ppc __buil... | ALGO | 0.999971 | 3.833077 |
5d5f9676-1fe2-4dea-92fa-b4492542f424 | KoalaYan/LeetCode | 295. Find Median from Data Stream/295. Find Median from Data Stream.cpp | #include"vector"
#include"algorithm"
#include"iostream"
#include"queue"
using namespace std;
class MedianFinder {
public:
/** initialize your data structure here. */
priority_queue<int,vector<int>,greater<int>> minHeap;
priority_queue<int,vector<int>,less<int>> maxHeap;
MedianFinder() {}
void add... | ALGO | 0.999989 | 5.29747 |
7b752302-20b8-4959-82ee-e1d97b956a39 | Zaxuhe/ludum-dare-24 | shared/util/PrimeSearch.cpp | #include "PlatformPrecomp.h"
/*************************************************************************
PrimeSearch.cpp
**************************************************************************/
#include "PrimeSearch.h"
int PrimeSearch::prime_array[] =
{
// choose the prime numbers to closely match the expected memb... | ALGO | 0.999202 | 4.793552 |
693cb24d-9b33-4698-b9e4-ac6c25ee46b0 | GabRodrigues23/atividades_Cpp | 05 - Funções/ex_l002.cpp | #include <iostream>
using namespace std;
const int size = 5;
int res, soma;
int somar(int a){
res+= a;
return res;
}
int main(){
int vetor[size];
for(int i = 0; i < size; i++){
cout << "Valor " << i+1 << ": ";
cin >> vetor[i];
soma = somar(vetor[i]);
}
cout << "O valor da soma e: " << soma;
return... | ALGO | 0.995401 | 3.605287 |
0cd514a1-f316-48b7-b710-64e483aab3ce | kayaru28/programming_contest | old_contest/at_coder_abc253_B.cpp |
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <map>
#include <math.h>
#include <queue>
#include <vector>
#include <stack>
#include <set>
#include <bitset>
using namespace std;
#define rep(i,n) for (ll i = 0; i < (n) ; i++)
#define rep2(i,n,i2,n2) for (ll i = 0; i < (n) ; i++) for (ll i2 = 0;... | ALGO | 0.999416 | 4.429618 |
f921b3e6-4c3f-41eb-a0e0-c023bf4ca8e4 | faizan346/Ds-Algo-Cplusplus | backtracking/8cryptarithmetic.cpp | #include<bits/stdc++.h>
using namespace std;
int countRun = 0;
long long getNum(string& s,unordered_map<char, int>& umap) {
long long dig = 1;
long long num = 0;
for(int i = s.size()-1; i >= 0; i--) {
num += dig * umap[s[i]];
dig *= 10;
}
return num;
}
void printCom(string &a, stri... | ALGO | 0.999588 | 4.198245 |
efd478f2-8a52-45c9-bf63-781c4e37645e | rodrigocdeaguiar/exercicios_C_ulbra_comandos_selecao | Exercicio6.cpp | #include <stdio.h>
#include <conio.h>
main(){
float num1, num2, num3;
printf("Digite um numero:\n");
scanf("%f", &num1);
printf("Digite outro numero:\n");
scanf("%f", &num2);
printf("Digite outro numero:\n");
scanf("%f", &num3);
if(num1 > num2 && num1 > num3) {
printf("Maior numero: %.2f", num1);
}
else{
... | ALGO | 0.995933 | 3.450045 |
bb1626d1-681e-4fb0-90aa-240d6233d670 | yashmin-singla/6Companies30days | Express as sum of power of natural numbers - GFG/express-as-sum-of-power-of-natural-numbers.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:
long long int t[1001][1001];
long long int mod=1e9+7;
long long int solve(int n,int x,int i){
if(n==0){
retu... | ALGO | 0.999925 | 6.14894 |
a2e85c4b-93aa-4150-960f-1bbee27fb55c | efornal/captura | christian_workspace/tp6/fuente/ejer6/filtro_color_promedio.cpp | #define cimg_use_fftw3 1
#ifdef cimg_use_fftw3
extern "C" {
#include "fftw3.h"
}
#endif
#include <iostream>
#include "../lib6/restauracion.h"
#include <CImg.h>
using namespace std;
using namespace cimg_library;
int main(int argc, char **argv) {
const char
*filename =
cimg_option( "-f", "../../imagenes/par... | TOOL | 0.91583 | 4.435547 |
8147dc0f-59c5-4599-8bb0-e5d9118e839e | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12324_23.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, i, x = 0;
string s;
cin >> n;
for (i = 1; i <= n; i++) {
cin >> s;
if (s[1] == '+')
x++;
else
x--;
}
cout << x << endl;
return 0;
}
| ALGO | 0.999877 | 4.240181 |
cf3de718-c0a4-486f-a084-8071e9e901de | Mohammed-Dada/Assignment-Four | 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 |
ee51be5d-4032-4254-96a1-eded6a8158bd | Bhavik1605/Bhavik_python | Practice_C++/03_Function_Program/05_Fibonacci.cpp | /* Program to print Fibonacci Series using function */
#include<iostream>
using namespace std;
void fib(int n)
{
int t1 = 0;
int t2 = 1;
int t3;
cout<<endl<<"Fibonacci Series upto ["<<n<<"] Terms are : ";
for (int i = 1; i <= n; i++)
{
cout<<t1<<" ";
t3 = t1 + t2;
t1 ... | ALGO | 0.999688 | 4.774693 |
82f2d1ef-b493-448a-8495-47fd2aef76a6 | suman105/GeeksforGeeks-DSA-Solutions | Medium/Stack Permutations/stack-permutations.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 isStackPermutation(int N,vector<int> &A,vector<int> &B)
{
int i=0;
stack<int> st;
for(int k=0;k<N;k++)
... | ALGO | 0.999936 | 5.53532 |
20eabb13-0dbb-48bf-b5df-b4d7544d2ca2 | owl2lwo12/2023-24-winter-Study | 24SummerStudy/24-7-24/programmers_carpet.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(int brown, int yellow) {
vector<int> answer;
int width = brown;
width -= 4; // 4
width /= 2; // ΰ 2 Ƿ
int height = 1;
width -= 1;
for (; width > height;) {
if (height * width == yellow) {
... | ALGO | 0.993782 | 5.416864 |
fe1a9058-4eb1-4f9c-82d5-91b169381fe2 | jccarvalhosa/maratona | escoladeverao/maior_palindromo_comum/palindromo_fr.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <utility>
#include <algorithm>
#include <set>
#include <vector>
#include <stack>
using namespace std;
const int M = 55555;
const int N = 11;
const int K = N*M+1;
int MSK = 0;
int n;
char dic[N][M];
/*
Solução para o problema do maior palíndromo co... | ALGO | 0.999906 | 4.281748 |
33f6a76f-323c-4592-87ea-b862d3b42c29 | Gowtham-M1729/HackerearthPrograms | C++/Misnum.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,k,j,input;
static int c[100000];
cin>>n;
vector<int>a;
vector<int>b;
for(int i=0;i<n;i++)
{
cin >> input;
a.push_back(input);
c[a[i]]++;
}
cin>>k;
for(j=0;j<k;j++)
{
cin ... | ALGO | 0.999993 | 3.129013 |
543500cc-ff48-471d-b642-1be5dd81379e | carloscl2001/EDNL | grafos/fobos_deimos_europa.cpp | #include <iostream>
#include <cmath>
#include "grafoPMC.h"
using namespace std;
struct ciudad{
double cx;
double cy;
};
template <typename tCoste>
struct puente{
GrafoP<tCoste>::vertice c1, c2;
};
template <typename tCoste>
struct solucion{
matriz<tCoste> m_solucion_;
vector<puente> v_solucion... | ALGO | 0.999813 | 4.180307 |
dcd7a896-964c-435b-92ab-169859359b95 | superAman07/Cpp-basic-STL-to-advance-DSA | 44. DS for prices with duplicate allowed item.cpp | #include<bits/stdc++.h>
using namespace std;
// multimap<int,string>mp;
// void add(int price,string name){
// mp.insert({price,name});
// }
void find(int price){
for(auto it=mp.find(price);it!=mp.upper_bound(price);it++){
cout<<(*it).second<<" "<<(*it).first<<"\n";
}
}
void find(int price){
... | ALGO | 0.998907 | 3.940071 |
26b69f56-0dfe-4136-a32c-bfa3b5b14168 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_1679_10.cpp | #include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
ll MOD = 1000000007;
const ll root = 3;
ll binpow(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1) res = (res * a) % MOD;... | ALGO | 0.999909 | 3.908343 |
8070b816-7fe2-464d-be0e-dcf8f2fe2a7a | elvircrn/ccppcodes | carobnjak.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long int ll;
#define INF 1<<27
int T, Zadaci [100000], N;
int solve(int current_index, int number_of_people)
{
if (number_of_pe... | ALGO | 0.999606 | 3.03848 |
9d871309-e71b-4863-858d-075e3c202353 | revelator/The-Darkmod-Experimental | src/game/ai/Tasks/InvestigateSpotTask.cpp | #include "precompiled_game.h"
#pragma hdrstop
static bool versioned = RegisterVersionedFile( "$Id$" );
#include "InvestigateSpotTask.h"
#include "WaitTask.h"
#include "../Memory.h"
#include "../Library.h"
namespace ai {
const int INVESTIGATE_SPOT_TIME_REMOTE = 2000; // ms (grayman #2640 - change from 600 -> 2000)
co... | ALGO | 0.918107 | 6.043047 |
f9ceba47-5cf7-46c7-bde3-8e9a66836eb3 | silvalab/MMOptimizer | src/Model.cpp | #include "Model.hpp"
#include <math.h>
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))
using namespace MarkovChannel;
static double vscale = 50.0;
namespace Model {
int Model::Model::count = 0;
MarkovChannel::ModelParameter prms;
Model::Model(int N, double p)
{
... | ALGO | 0.989208 | 4.044857 |
301641b6-dd59-41ed-b1ae-1a706a3e6448 | pritmanvar/DSA-with-CPP | Binary Search Tree/Lowest Common Ancestor in a BST.cpp | // Problem Link : https://practice.geeksforgeeks.org/problems/lowest-common-ancestor-in-a-bst/1#
Node* LCA(Node *root, int n1, int n2)
{
Node* lca = NULL;
// i will travel till both required node are in left subtree or both are in right subtree
// as i will find one or both are i different direction i will ... | ALGO | 0.999988 | 6.112339 |
39b54349-03d3-4b07-9158-7127dcd98393 | beomjunlim/codetree-TILs | 240102/연속 부분 합의 최댓값 구하기/max-of-partial-sum.cpp | #include <iostream>
#include <algorithm>
using namespace std;
#define MAX 100000
int arr[MAX+1];
int dp[MAX+1];
int main() {
int n;
cin>>n;
for(int i=1; i<=n; i++){
cin>>arr[i];
}
dp[1] = arr[1];
for(int i=2; i<=n; i++){
dp[i] = max(dp[i-1] + arr[i], arr[i]);
}
sor... | ALGO | 0.999957 | 3.864536 |
4034cdf6-d6f9-412c-8326-bff76eaad406 | kinaphar/AtCoder | ABC/ABC336/d-hn3.cpp | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); ... | ALGO | 0.999985 | 4.217825 |
d7438be1-86ed-44bb-80e3-7eb7d5c46782 | ayoubmajid67/Basic-roadmap | 07 - Algorithms & Problem Solving Level 3/CODE/problem7.cpp | /*
problem 7 :
write a program to fill a 3*3 matrix with ordered numbers :
and print it , then transpose matrix and print it :
*/
#include <iostream>
#include "myLib.h"
#include <ctime>
#include <iomanip>
using namespace std;
void FillMatrixWithOrderedValues(int matrix[3][3], int l, int c)
{
for (int i = 0; i < ... | ALGO | 0.999262 | 3.982288 |
253deb7b-2e5c-4081-8993-ce148212eca5 | wimleers/qarminer | src/ruleminer.cpp | #include "ruleminer.h"
/**
* An exact implementation of algorithm 6.2 on page 351 in the textbook.
*/
QList<AssociationRule> RuleMiner::generateAssociationRules(QList<ItemList> frequentItemsets, QList<SupportCount> frequentItemsetsSupportCounts, float minimumConfidence) {
QList<AssociationRule> associationRules;... | ALGO | 0.999148 | 5.616196 |
7d48aa65-5f13-45cf-9b31-30b6d22a9da1 | vivtrain/leetcode | Grind75/59-ContainerWithMostWater/cpp/ContainerWithMostWater.cpp | #include "ContainerWithMostWater.h"
#include <vector>
using namespace std;
int Solution::maxArea(vector<int>& height) {
int left = 0, right = height.size() - 1;
int bestArea = 0;
while (left < right) {
int area = (right - left) * min(height[left], height[right]);
if (area > bestArea)
bestArea = ar... | ALGO | 0.999933 | 6.660486 |
1ed677cc-6e27-436c-b463-a0c136d52c5d | tetriv0217/DSA-with-Tejas | 7_Linked_List/2DLL/2Mid/3_deleteDuplicates.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *next;
Node *prev;
Node(int x)
{
data = x;
next = NULL;
prev = NULL;
}
};
class Solution
{
public:
Node *removeDuplicates(struct Node *head)
{
// Your code here
Node *temp... | ALGO | 0.999535 | 5.443289 |
5f789fb4-242c-4d7e-99e6-24a581cad985 | HJWAJ/acm_codes | CF/20120327/A.cpp | #include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<string>
#include<vector>
using namespace std;
int n;
double a,d;
struct nod
{
int i;
double t;
double v;
double ts;
}node[100... | ALGO | 0.999969 | 3.034009 |
daba5d40-1441-4dc0-bad9-c886b5e908d9 | AdityaC-0605/DSA | merge_list.cpp | #include <iostream>
using namespace std;
// Define ListNode structure
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
public:
ListNode* mergeT... | ALGO | 0.999904 | 6.186143 |
0655bb08-961c-498f-b605-0592737559dc | AlabasterRig/Data-Structures-And-Algorithms | ARRAY/Left and Right Shift/Rotate_One_By_One.cpp | #include <iostream>
using namespace std;
void rotate(int arr[], int n, int d)
{
int p = 1;
while(p <= d)
{
int last = arr[0];
for(int i = 0; i < n-1; i++)
{
arr[i] = arr[i + 1];
}
arr[n-1] = last;
p++;
}
}
void printArray(int arr[], int n)
{
... | ALGO | 0.999719 | 5.777215 |
65ed7a05-d004-4a27-a7f8-7f8c70750e8c | CommonShared/SDL2_examples | src/sdlpal/winrt/SDLPal.Common/WinRTIO.cpp | /* -*- mode: c; tab-width: 4; c-basic-offset: 4; c-file-style: "linux" -*- */
#include <wrl.h>
#include <string>
#include <map>
#include <DXGI.h>
#include <shcore.h>
#include <unordered_set>
#include "AsyncHelper.h"
#include "StringHelper.h"
#pragma comment(lib, "ShCore.lib")
#define PAL_PATH_NAME "SDLPAL"
static c... | TOOL | 0.879101 | 4.34587 |
a4137717-ca4c-48f9-b0fb-b0f6cbd3b464 | kimdy003/AlgorithmStudy | 알고리즘 이론/Graph/조합.cpp | //조합
#include<iostream>
#define MAX 5
using namespace std;
int arr[MAX];
int Select[MAX];
bool visit[MAX];
#if 1
void DFS(int idx, int cnt){
if(cnt == 3){
for(int i=0; i<MAX; i++){
if(visit[i] == true)
cout << arr[i] << " ";
}
cout << "\n";
return;
... | ALGO | 0.99988 | 3.64316 |
9fff44ad-2421-4c89-bcfd-9249035f851d | KZyred/CPP-tutorial | 14-Advance Sorts/quickSort.cpp | #include <iostream>
#include <algorithm> // for std::is_sorted
using namespace std;
void swap(int array[], int firstIndex, int secondIndex)
{
int temp = array[firstIndex];
array[firstIndex] = array[secondIndex];
array[secondIndex] = temp;
}
int pivot(int array[], int pivotIndex, int endIndex)
{
int sw... | ALGO | 0.999968 | 5.035043 |
17513eb2-42a3-41ca-aaee-a1479ee2206d | Hcm455429728/Trans_PingStitching | Trans_PingStitching/Trans_PingStitching/eigen3/blas/single.cpp | #define SCALAR float
#define SCALAR_SUFFIX s
#define SCALAR_SUFFIX_UP "S"
#define ISCOMPLEX 0
#include "level1_impl.h"
#include "level1_real_impl.h"
#include "level2_impl.h"
#include "level2_real_impl.h"
#include "level3_impl.h"
float BLASFUNC(sdsdot)(int* n, float* alpha, float* x, int* incx, float* y, in... | TOOL | 0.965012 | 3.381595 |
059a950d-5fd3-475e-a4c3-cc649db5334c | jongwonyang/basic-algo-lecture-workbook | 0x02/2752.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a, b, c;
cin >> a >> b >> c;
int first, second, third;
first = min({ a, b, c });
third = max({ a, b, c });
second = a + b + c - first - third;
cout << first << ' ' << second << ' ' << third;
} | ALGO | 0.999913 | 3.980319 |
e64457c2-0903-442d-8d4b-df3dc92726f1 | Mahmoud3ali/CompetitiveProgramming | CodeForces/CF768-D12-E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
unordered_map<short ,map<ll,short> > mp ;
short go(short idx , ll x)
{
if(idx == 0) return 0;
else if(idx < 0) return -100;
if(mp[idx][x] != 0) return mp[idx][x] ;
else
{
set<short> s ;
for(int i = idx ; i > 0 ; i--... | ALGO | 0.999957 | 4.407835 |
ea5972c6-8b11-401b-8618-ef73cc9842e1 | jri8/PolynomialCalculator | jri8P1.cpp |
#include <fstream>
#include <string>
#include <sstream>
#include "LList.h"
#include "Stack.h"
#include "Term.h"
using namespace std;
//void uploadFile(string fname, LList &list);
int main(int argc, const char * argv[])
{
string fname = argv[1]; //getting file name from command line
string info; //holds a line... | TOOL | 0.955306 | 3.924763 |
4f692ff4-3301-4e8c-8a9a-8526d9127faa | patrickziegler/leetcode | src/216_combination_sum_3.cpp | /*
Find all valid combinations of k numbers that sum up to n such that the following conditions are true:
Only numbers 1 through 9 are used.
Each number is used at most once.
Return a list of all possible valid combinations. The list must not contain the same combination twice, and the combinations may be ret... | ALGO | 0.999095 | 7.354695 |
3a815548-d7aa-4988-bb0f-b6d1622433a0 | AjayBrahmakshatriya/llvm-bb-emitter | lib/CodeGen/GlobalISel/RegBankSelect.cpp | #include "llvm/CodeGen/GlobalISel/RegBankSelect.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"
#include "llvm/CodeGen/GlobalISel/RegisterBank.h"
#include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h"
#include... | ALGO | 0.909675 | 3.69253 |
c1edac58-2ab5-4002-881f-e13dec0fb2ec | sshwas/DesignPattern | Strategy/Sort.cpp | #include <iostream>
using namespace std;
//-------------- encapsulating behavior --------------//
class SortBehavior
{
public:
virtual void sort() const = 0;
};
class Merge : public SortBehavior
{
public:
virtual void sort() const
{
cout << "Merge sort()\n";
}
};
class Quick : public SortBehavior {
public:
vi... | TOOL | 0.995564 | 5.88603 |
11ec2c18-5d1a-435b-b83c-e0561e08f8cb | matpx/blendini | src/extern/libigl/include/igl/flood_fill.cpp | template <typename Derivedres, typename DerivedS>
IGL_INLINE void igl::flood_fill(
const Eigen::MatrixBase<Derivedres>& res,
Eigen::PlainObjectBase<DerivedS> & S)
{
using namespace Eigen;
using namespace std;
typedef typename DerivedS::Scalar Scalar;
const auto flood = [&res,&S] (
const int xi,
co... | ALGO | 0.981489 | 5.372252 |
c212221a-215d-4e11-8e0b-641379c4459b | RimaTasneem/c-programing | pat5.cpp | #include<stdio.h>
int main ()
{
int n,i,j,space;
printf ("Enter the number of rows in diamond\n");
scanf ("%d",&n);
space=n-1;
for(i=1;i<=n;i++)
{
for(int s=1;s<=space;s++)
{
printf(" ");
}
space--;
for(j=1;j<=2*i-1;j++)
{
printf("*");
}
printf("\n");
}
space=1;
for(i=1;i<=n-1;i++)
{
f... | ALGO | 0.999756 | 3.800529 |
ddfb0c5a-3cb8-4d08-8fe6-49873335aa34 | alamin147/competitive-programming | codeforces/1859A.cpp | #include <bits/stdc++.h>
using namespace std;
int a[105];
int main()
{
int t, n;
cin >> t;
while (t--)
{
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i];
sort(a + 1, a + n + 1);
int l = n;
while (a[n] == a[l])
l--;
if (!l)
... | ALGO | 0.999769 | 3.655506 |
3d543ef0-ec1a-41ac-9fd2-40660f9474d0 | kmou424/HDUOJ | 2007.cpp | //
// Created by kmou424 on 2021/9/6.
//
#include <iostream>
#include <string.h>
using namespace std;
int main() {
int a, b;
long long res1 = 0, res2 =0;
while (cin >> a >> b) {
if (a > b) {
int temp = a;
a = b;
b = temp;
}
for (int i = a; i <= ... | ALGO | 0.999766 | 4.712965 |
7270c5e1-a111-4cea-b778-0a400243280c | athp18/leetcode-grind | medium/findMinRotatedArray.cpp | class Solution {
public:
int findMin(vector<int>& nums) {
int l = 0;
int r = nums.size() - 1;
while (l < r) {
int mid = (l + r) / 2;
if (nums[mid] > nums[r]) {
l = mid + 1;
// this means we're in the decreasing part of the array, wh... | ALGO | 0.999987 | 6.454091 |
382ecd51-03a0-4ca0-bda1-cdd134c8083d | doushe821/Differentiator | Sources/Taylor.cpp | #include <stdio.h>
#include "../Headers/Taylor.h"
#include "../Headers/Differentiator.h"
#include "../Libs/doublecmp/doublecmp.h"
int Taylor(tree_t* tree, VariableTable_t* VarTable, FILE* outTex, FILE* outPlot, size_t degree, double point)
{
VarTable->Vars[0].value = point;
fprintf(outTex, "\\newpage\n");
... | ALGO | 0.951427 | 3.564708 |
334c69e6-6123-4027-b3c5-bc291db52193 | KatsuyaKikuchi/ProgrammingContest | Google Code Jam/2021/Round 2/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pll;
#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(40)
const ll MOD = 1000000007;
const ll INF = (ll) 1e15;
const ll MAX = (ll) 1e6 + 5;
ll F[MAX];
ll solve... | ALGO | 0.99978 | 4.818198 |
ad76907a-f503-4fe0-a594-553af7b4b8f0 | raincross7/code-similarity | codes/train_code/problem160/problem160_401.cpp | #include<iostream>
#include<string>
using namespace std;
int main()
{
string s,t;
cin>>s>>t;
string ans=t+s;
cout<<ans;
} | ALGO | 0.982236 | 3.592462 |
e70bbbf0-d2f7-4929-a538-d0da44d7d0bb | victorgdc/leetcode-submissions | problems/snapshot-array/Memory Limit Exceeded/2-21-2023, 7_53_35 PM/Solution.cpp | // https://leetcode.com/problems/snapshot-array
class SnapshotArray {
private:
unordered_map<int, vector<int>> map;
vector<int> sn_ar;
int snap_count = 0;
public:
SnapshotArray(int length):sn_ar(length) {
}
void set(int index, int val) {
sn_ar[index] = val;
}
int sna... | ALGO | 0.914427 | 6.686024 |
b131070b-5ee0-4a99-8c49-495fcb6b5455 | n0IQ/Competitive-Programming | codeforces/1561/C.cpp | #include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ff first
#define ss second
#define rep(i, a, b) for(int i = a; i... | ALGO | 0.999825 | 4.221704 |
b20f1b15-176e-4be9-a368-5e1652dbcddb | sanjaysinghmp09/DSA-Series- | day-5.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cout << "Enter the number of rows: ";
cin >> n;
for (int i = 1; i <= n; i++) // Change condition to include n rows
{
for (int j = 1 ; j <= i ; j++)
{
cout << "* ";
}
cout << endl;
}
r... | ALGO | 0.995887 | 4.357925 |
dfd1f2b6-9b42-4f83-91b0-21c478df6ddb | chinmaym/codechef-easy-prob | factorial/prog.cpp | #include<cstdio>
#include<cmath>
using namespace std;
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
long long int n,f,r,i,c=0;
scanf("%lld",&n);
f=(n)/5;
if(n>=(5*5))
for (i = 2; pow(5,i)<=n ; i++)
{
c+=(n/(pow(5,i)));
}
r=f+c;
printf("%lld\n",r);
}
}
| ALGO | 0.999787 | 3.680804 |
7106a78c-83fb-412e-8595-a77744405d21 | jainveejain/CPP | CdacAssignment/days/day8/VectorDemo.cpp | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
class Book{
};
int main(){
vector<Book> books;
Book b1;
books.push_back(b1);
cout<<"1:Add "<<endl;
cout<<"2:display "<<endl;
cout<<"3:remove "<<endl;
cout<<"4:sum "<<endl;
cout<<"5:avrage "<<endl;
cout<<"6:size "<<e... | TOOL | 0.967359 | 3.542289 |
31214185-d6c4-4b4b-9199-d12389f38faa | ViralTaco/code | C++/isPrime/isPrime/main.cpp | // Find primes between 2 and 1000
#include <iostream>
using namespace std;
bool isPrime(int);
int main(int argc, const char * argv[]) {
int p = 1000;
// Logic:
while (p --> 2) { if(isPrime(p) == 1) cout << p << ", "; }
return 0;
}
bool isPrime(int x){
// Variables:
int d;
// Logic:
... | ALGO | 0.999454 | 4.966036 |
9d8ca738-9b3b-4729-8b5b-8356bba6b5d4 | Trevorchenmsu/LeetCode-Solutions | leetcode/editor/en/[62]Unique Paths.cpp | //A robot is located at the top-left corner of a m x n grid (marked 'Start' in t
//he diagram below).
//
// The robot can only move either down or right at any point in time. The robot
//is trying to reach the bottom-right corner of the grid (marked 'Finish' in the d
//iagram below).
//
// How many possible unique p... | ALGO | 0.999936 | 6.707696 |
dc353873-2631-4f9d-a2b1-26e005188872 | KarTaGo124/LeetCode-Solutions | Doubly-Linked-List/430.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
Node* prev;
Node* next;
Node* child;
};
*/
class Solution
{
public:
Node *flatten(Node *head)
{
if (head == nullptr)
return head;
auto current = head;
while (current != nullptr)
{
if (current->child != nullptr)
{
auto nextCurr = curr... | ALGO | 0.999947 | 5.747711 |
60727465-a574-4448-89fb-21629ce6dcc5 | lakshaywadhwacse/Leetcode-Solutions | kmost_frequent_element.cpp | class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
vector<int>ans;
map<int,int>m;
list<int>*freq;
int maxfreq=INT_MIN;
for(int i=0;i<nums.size();i++)
{
if(m.find(nums[i])!=m.end())
{
m[nums[i]]+=1;
... | ALGO | 0.999992 | 5.937716 |
cdef8066-7d4d-4f9d-b78c-249b074a03e8 | Jeanpierrre/Proyecto_BD2 | Statich_hash/static_hash.cpp | //
// Created by sotom on 24/09/2023.
//
//
#include "static_hash.h"
static_hash::static_hash( string dataFile, int m) {
this->data_file=dataFile;
this->M=m;
if(size_data()==0){
cout<<"Archivo vacio"<<endl;
initialize_hash_structure(m);
//cargar_indices_a_table();
}
}
int sta... | TOOL | 0.916871 | 3.834648 |
d598e69d-c313-458f-9d48-0fdbce865b57 | WhiteF326/cpp | ABC/ABC071/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define fs(n) fixed << setprecision(n)
using ll = long long;
ll fact(ll x) { return x <= 1 ? 1 : x * fact(x - 1); }
//再帰処理で時間を食い過ぎるので階乗をメモ化する
map<ll, ll> factMemo;
ll memo_fact(ll x){
if(factMemo[x] != 0) return factMemo[x];
else return x <= 1 ? 1 : x * fact(x - 1);... | ALGO | 0.999992 | 4.832012 |
22be1bba-a0d5-48fc-8a62-e225c0fbabac | na6an/sdcnd-t2 | P3-Particle_Filter/src/particle_filter.cpp | /*
* particle_filter.cpp
*
* Author: Tiffany Huang
* Modified by: Nathan
*/
#include <algorithm>
#include <iostream>
#include <iterator>
#include <math.h>
#include <numeric>
#include <random>
#include <sstream>
#include <string>
#include "particle_filter.h"
using namespace std;
void ParticleFilter::init(doub... | ALGO | 0.993216 | 5.286234 |
52780b54-89c0-409c-9f73-45e705fd169d | chenfushan/alps_algorithm | bracketMatch/bracketMatch/main.cpp | #include <iostream>
#define ElementType char
using namespace std;
struct Node;
typedef Node * PtrToNode;
typedef PtrToNode Stack;
struct Node{
ElementType X;
PtrToNode Next;
};
int isEmpty(Stack S){
return S->Next == NULL;
}
Stack createStack(void){
Stack S;
S = (Stack)malloc(sizeof(Stack));
... | ALGO | 0.999726 | 3.640155 |
e2c55524-59ba-4e7b-b61f-21a5d7d23f20 | Maggi87/C-Programming | Assignment 14 (String)/Q.1/mainfile.cpp | /*
1.Write a program which accept string from user count number of
words from string
Input : “Marvellous Multi OS”
Output : 3
*/
#include<stdio.h>
#include"myheader.h";
int main()
{
char arr[30];
int iRet = 0;
printf("Enter the String");
scanf("%[^'\n']s",arr);
iRet = WordCount(arr);
printf("No of word i... | ALGO | 0.996269 | 3.85073 |
9e1c06da-16de-4ed2-9896-ab587ef8b30a | malaksayour/hslam-dev | src/FSLAM/Thirdparty/opencv-3.4.6/opencv_contrib-3.4.6/modules/saliency/samples/computeSaliency.cpp | #include <opencv2/core/utility.hpp>
#include <opencv2/saliency.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
using namespace std;
using namespace cv;
using namespace saliency;
static const char* keys =
{ "{@saliency_algorithm | | Saliency algorithm <saliencyAlgorithmType.[saliencyAlgorithmTypeSubType]> }"
... | ALGO | 0.9695 | 5.991583 |
bafa60df-3d98-4703-a5ee-63809198bc39 | stevenbai0724/DMOJ-Solutions | COCI/coci14c1p1.cpp | //
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <cmath>
using namespace __gnu_pbds;
using namespace std;
#define int long long
#define string std::string
const int mod = 1e9 + 7;
mt19937_64 rng(std::chrono::system_clock::now().time_since_epoch().count());
signed main(){
cin.tie(n... | ALGO | 0.999799 | 3.702493 |
e9beb29b-9fcc-4c4f-b2b1-d8ae0b040ee6 | vi5hnuu/love-babbar-dssa-sheet-sol | linkedList/141. Linked List Cycle.cpp | /*
Given head, the head of a linked list, determine if the linked list has a cycle in it.
There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the index of the node that tail's next pointer is connect... | ALGO | 0.999782 | 5.644678 |
5cca9a69-e592-424f-9ac2-2ed0eddf3ec0 | rajibdpi/leetcodes | algorithms/cpp/makeTheXorOfAllSegmentsEqualToZero/MakeTheXorOfAllSegmentsEqualToZero.cpp | // Source : https://leetcode.com/problems/make-the-xor-of-all-segments-equal-to-zero/
// Author : Hao Chen
// Date : 2021-03-20
/*****************************************************************************************************
*
* You are given an array nums and an integer k. The XOR of a segment [left, right... | ALGO | 0.999965 | 6.045409 |
f79f97f0-4b72-44a5-a68a-81968f869914 | rospix/compton_cone_generator | src/compton_cone_generator.cpp | /* includes //{ */
#include <ros/ros.h>
#include <nodelet/nodelet.h>
#include <rad_msgs/Cone.h>
#include <rad_msgs/ClusterList.h>
#include <Eigen/Eigen>
#include <mrs_lib/param_loader.h>
#include <mrs_lib/geometry/misc.h>
#include <mrs_lib/geometry/cyclic.h>
#include <mrs_lib/mutex.h>
#include <mrs_lib/transformer.... | TOOL | 0.912562 | 6.07599 |
d410c7c5-b942-432d-b85d-7a7871672267 | DraSoGo/Competitive_Programming | Other/0208_ThaiID.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int sum = 0;
string a;
cin >> a;
for (int i = 0; i < a.length(); i++)
{
sum += (a[i] - '0') * (13 - i);
}
cout << sum << "\n";
sum = sum%11;
cout << a;
if (sum <= 1)
{
cout << 1-sum;
}
else
... | ALGO | 0.999754 | 4.132902 |
f53e04f4-4fb8-4883-b9d4-83bf3f0e62e1 | AlexandruPintea2000/Cpp-libraries-applications | Applications/Slce/slce initial.cpp | #include <string.h>
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
string filename;
string ext;
string filepath;
string file_1 = "";
string file_2 = "";
// inverts a string
void invert_string( string &a )
{
int size = a.length();
string b = "";
for ( int i=size-1; i>=0; i=i-1 )
... | TOOL | 0.892105 | 3.422962 |
2addf8e6-3ea3-4865-b3e3-93c23ffd5999 | theSoberSobber/CP-Snippets | codes/bfs-dist.cpp | //bfs-dist
//bfs that measures levels/dist
queue<int> q;
vector<int> dist, visG(n+1, 0);
q.push(1); visG[1]=1;
while(!q.empty()){
int curr = q.front();
q.pop();
for(auto i: g[curr]){
if(!visG[i]) continue;
dist[i] = dist[curr] + 1;
q.push(i);
}
}
| ALGO | 0.999533 | 4.550711 |
0664c7f5-9a31-4268-bbcd-e20137cd5efc | util6/cpp-algorithm-code | make24.cpp | #include "bits/stdc++.h"
using namespace std;
const int N = 100,eps = 1e-5;
int n;
double a[N];
bool st[N];
bool dfs(int u,double x){
if (u>=n){
return false;
}
if (x-24<eps){
return true;
}
st[u] = true;
if (st[u]){
dfs(u+1,a[u]+x);
dfs(u+1,a[u]-x);
if (x==0){
x=1;
}
dfs(... | ALGO | 0.99947 | 3.497931 |
db63c7f7-fa84-41a7-9548-1e9017df497c | arjo31/Personal-DSA-Problems | Tree/Binary Tree/right_and_left_side_view.cpp | #include "binary_tree.h"
//Right Side View
void rightRecursion(TreeNode *root, int level, vector<int> &res)
{
if (root == NULL)
return;
if (res.size() == level)
res.push_back(root->val);
rightRecursion(root->right, level + 1, res);
rightRecursion(root->left, level + 1, res);
}
vector<i... | ALGO | 0.999569 | 5.919681 |
341044b0-8cbe-49ff-b3e3-177ee04c8dc4 | Ajla115/Full-C-Plus-Plus-Course | Week1/Lab1/PalindromCheck.cpp | // Created by User on 11. 2. 2024..
#include <iostream>
#include <cstring> // for strlen
using namespace std;
void checkIfPalindrom(std::string a) {
bool word = false;
for (int i = 0; i < a.length(); i++) {
if (a[i] == ' ') {
continue;
}
std::string noSpacesWord;
no... | ALGO | 0.999034 | 3.896126 |
ea9c19e5-592f-4514-88ca-d20a9e0ea48b | yanxiuzi/opencv-3.4.2-build-with-ffmpeg-and-cuda | modules/video/src/bgfg_gaussmix2.cpp | /*//Implementation of the Gaussian mixture model background subtraction from:
//
//"Improved adaptive Gaussian mixture model for background subtraction"
//Z.Zivkovic
//International Conference Pattern Recognition, UK, August, 2004
//http://www.zoranz.net/Publications/zivkovic2004ICPR.pdf
//The code is very fast and per... | ALGO | 0.982518 | 6.485644 |
99f91738-b7ec-4917-a99b-96bc8b237b48 | shihabLuminar/fake_store_api_integration_jan | 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 |
c0b7177b-328c-4050-a8ab-a00d81cb801c | galder-game-jam/galder-game-jam-2022 | external_libs/box2d/testbed/tests/shape_cast.cpp | #include "test.h"
#include "box2d/b2_distance.h"
class ShapeCast : public Test
{
public:
enum
{
e_vertexCount = 8
};
ShapeCast()
{
#if 1
m_vAs[0].Set(-0.5f, 1.0f);
m_vAs[1].Set(0.5f, 1.0f);
m_vAs[2].Set(0.0f, 0.0f);
m_countA = 3;
m_radiusA = b2_polygonRadius;
m_vBs[0].Set(-0.5f, -0.5f);
m_vBs[1]... | TEST | 0.923741 | 7.456041 |
06d4bec5-22cf-4a04-9252-28fc98cf4074 | ishandutta2007/codeforces | lawrenceli/normal/611/D.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <ios>
using namespace std;
typedef long long ll;
const int maxn = 5005;
const int mod = 1e9 + 7;
const int mod2 = 1e9 + 9;
const int mult = 31;
int n;
char s[maxn];
int dp[maxn][maxn], p[maxn][maxn];
int h1[maxn], h2[maxn], pw1[m... | ALGO | 0.999995 | 4.644189 |
afdc4519-4f98-4eec-ab4d-01e1d50d40cd | GoldSwan/Algorithm-Practice | programers/P0020_targetNumber/goldswan/targetNumber_goldswan.cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
int answer=0;
void dfs_function(vector<int> numbers, int target, int sum, int height){
if(numbers.size()==height)
{
if(sum==target)
answer++;
return;
}
dfs_function(numbers, target, sum+numbers.at(height), height+1);
dfs_funct... | ALGO | 0.999944 | 5.136726 |
47027aba-5266-4cbf-8fab-a54070a6cc23 | ishandutta2007/codeforces | ngyupeng06/normal/1344/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int li;
typedef pair<int,int> pii;
typedef pair<li,li> pll;
#define mp make_pair
#define pb push_back
long long n, k, m, t, a, b, c, d, e, f, x, y;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
bool vis[1005][1005];
char arr[1005][1005];
void fi... | ALGO | 0.999859 | 3.898516 |
9f003977-aa8f-4080-a6f7-51884c9190a1 | CSULA-RoboSub/Robosub2018 | hardware_interface/src/include/DVLHelper.cpp | #include "DVLHelper.h"
//positive is right negative is left
double DVLHelper::getDirection(double x1, double y1, double x2, double y2, double yaw){
double direction = 0;
double heading;
//convert to heading
if (90 <= yaw && yaw <= 180)
heading = yaw - 90;
else
heading = yaw + 270;
... | TOOL | 0.871351 | 5.167706 |
63129bd8-6595-4538-acfc-8408ff38364d | diepbp/SlicingCBMC | goto-instrument/accelerate/overflow_instrumenter.cpp | #include <iostream>
#include <util/std_expr.h>
#include <util/std_code.h>
#include <util/arith_tools.h>
#include <util/simplify_expr.h>
#include <goto-programs/goto_program.h>
#include "overflow_instrumenter.h"
#include "util.h"
//#define DEBUG
/*
* This code is copied wholesale from analyses/goto_check.cpp.
*/
... | ALGO | 0.892373 | 7.55794 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.