uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
5a9f47cb-227d-44cf-90d4-8a8810ad5886 | YRZrandir/GumGen | dep/libigl/include/igl/copyleft/cgal/triangle_triangle_squared_distance.cpp | template < typename Kernel>
IGL_INLINE bool igl::copyleft::cgal::triangle_triangle_squared_distance(
const CGAL::Triangle_3<Kernel> & T1,
const CGAL::Triangle_3<Kernel> & T2,
CGAL::Point_3<Kernel> & P1,
CGAL::Point_3<Kernel> & P2,
typename Kernel::FT & d)
{
typedef CGAL::Point_3<Kernel> Point_3;
typedef C... | ALGO | 0.999603 | 6.766523 |
7e7bd42a-4e77-4142-8310-9e167b90d8ea | harsh2338/code-copyright | pre-processing/data/cpp/14.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
set<pair<int,int>,greater<>>st;
int ans=0;
int A[]={5, 0, 1, 3, 2, 4, 1, 0, 5};
int c=4,n=9;
unordered_map<int,int>mp;
for(int i=0;i<n && i<c;i++){
ans++;
mp[A[i]]=i;
st.insert({i,A[i]});
}
for(int i=c;i<n;i... | ALGO | 0.999959 | 3.507069 |
e8f5faed-593b-42a3-ba1e-8f0d515ba5c2 | DeepPatel25/Code | C++/Apna College/check_for_BST.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
struct Node* left;
struct Node* right;
Node(int val){
data= val;
left=NULL;
right=NULL;
}
};
bool isBST(Node* root,Node* min=NULL,Node* max=NULL){
if(root==NULL){
return true;
}
if(mi... | ALGO | 0.999411 | 5.358479 |
61e623c5-4363-443c-96a2-79140f56fe0e | coldmanck/VidHOI | detectron2_repo/detectron2/layers/csrc/ROIAlign/ROIAlign_cpu.cpp | namespace {
// implementation taken from Caffe2
template <typename T>
struct PreCalc {
int pos1;
int pos2;
int pos3;
int pos4;
T w1;
T w2;
T w3;
T w4;
};
template <typename T>
void pre_calc_for_bilinear_interpolate(
const int height,
const int width,
const int pooled_height,
const int ... | DATA | 0.927325 | 7.041143 |
58fc6d92-b02c-43d5-9ba8-46027c489d27 | thsnkl634/pdal | filters/SortFilter.cpp | #include "SortFilter.hpp"
namespace pdal
{
static StaticPluginInfo const s_info
{
"filters.sort",
"Sort data based on a given dimension.",
"http://pdal.io/stages/filters.sort.html"
};
CREATE_STATIC_STAGE(SortFilter, s_info)
std::string SortFilter::getName() const { return s_info.name; }
void SortFilter... | TOOL | 0.88995 | 6.904709 |
cc7043a9-1ed6-4307-a39d-477be02a9729 | FANZ3R/leetcode | 0543-diameter-of-binary-tree/0543-diameter-of-binary-tree.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.99997 | 6.339965 |
036da180-a978-478b-9d34-99097ee2c19f | Geekyark/Coding | may4.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int32_t main(){
ll t;
cin>>t;
while(t--){
ll count=0;
ll n,m,i,j;
cin>>n>>m;
while(i<=n && j<=n){
if((m%i)%j==(m%j)%i)
count++;
i++;
j=i+1;
}
cout<<... | ALGO | 0.999834 | 4.784586 |
f19cac43-c699-4112-b977-3d13996f90d4 | itzpankajpanwar/Leetcode | pancake-sorting/pancake-sorting.cpp | class Solution {
public:
vector<int> res;
vector<int> pancakeSort(vector<int>& arr) {
for(int i=arr.size()-1;i>0;i--)
set_max(arr,i);
return res;
}
void set_max(vector<int>& arr , int i)
{
int max=0 , index=0;
vector<int> new_array;
for(int... | ALGO | 0.999978 | 5.587987 |
25d447f1-6c66-42aa-8642-42399970a69b | ishandutta2007/codeforces | subconscious/normal/1148/D.cpp | #include<bits/stdc++.h>
#define rep(i,n) for(int i=1;i<=n;++i)
#define st first
#define nd second
#define x0 fuckcjb
#define y0 fuckjsb
#define x1 fucklgl
#define y1 fucklyw
#define pb push_back
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pr;
const int N=1e6+5,mod=1e9+7;
con... | ALGO | 0.999928 | 3.774745 |
9a41cf51-3a26-448d-8987-a1b2203de3e1 | RafayethRafi/Coding_Ninjas | Delete Last Node of a Doubly Linked List.cpp | /**
* Definition of doubly linked list:
*
* struct Node {
* int data;
* Node *prev;
* Node *next;
* Node() : data(0), prev(nullptr), next(nullptr) {}
* Node(int val) : data(val), prev(nullptr), next(nullptr) {}
* Node(int val, Node *p, Node *n) : data(val), prev(p), next(n) {}
* ... | ALGO | 0.983515 | 4.54388 |
95e74989-7847-46e3-a0b6-178d7d0261d9 | KelvinHo995/DSA-Project---Sorting-algorithms | insertionsort.cpp | #include"insertionsort.h"
void insertion_sort(int a[], int n){
for(int i = 1; i < n; i++){
int key = a[i];
int j = i - 1;
while(j >= 0 && key < a[j]){
a[j + 1] = a[j];
j--;
}
swap(a[j + 1], key);
}
}
void insertion_sort_compare(int a[], int n, lo... | ALGO | 0.999919 | 4.73409 |
bedfc815-9d5d-4a43-a945-619c5f3bba10 | lukaszbrzeszcz/PAMSI | Warcaby/src/ruchy.cpp | #include "ruchy.hh"
#include<iostream>
queue<pozycja> ruchy::KrolowaRuchy(int ID, char kolor)
{
pionek pom;
pom=szachownica.wyszukajPionek(ID,kolor);
return KrolowaRuchy(pom);
}
queue<pozycja> ruchy::KrolowaRuchy(pionek pio)
{
queue<pozycja> wyjscie;
pozycja pom;
if(pio.bialy==true)
{
if(CzyBic... | ALGO | 0.992785 | 4.018142 |
f04e9908-cd92-4d58-929c-d165b78ff96f | bansi805419/DSA | Create a function to implement the quicksort algorithm.cpp | // Create a function to implement the quicksort algorithm.
#include <iostream>
#include <vector>
int partition(std::vector<int>& arr, int low, int high) {
int pivot = arr[high];
int i = low - 1;
for (int j = low; j < high; ++j) {
if (arr[j] <= pivot) {
++i;
std::swap(arr[i... | ALGO | 0.999998 | 6.265117 |
652c7a79-60f6-4e9b-bf58-16e92ecda4af | embecosm/agc-llvm-project | llvm/utils/TableGen/InstrDocsEmitter.cpp | #include "CodeGenDAGPatterns.h"
#include "CodeGenInstruction.h"
#include "CodeGenTarget.h"
#include "TableGenBackends.h"
#include "llvm/TableGen/Record.h"
#include <string>
#include <vector>
using namespace llvm;
namespace llvm {
void writeTitle(StringRef Str, raw_ostream &OS, char Kind = '-') {
OS << std::string(... | TOOL | 0.873514 | 7.251307 |
750106b2-ed6a-4bed-98f1-55c6ffd05aca | Ragwar/TemaOOp | 2.11/2.11/2.11.cpp | // 2.11.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
int fsuma(int& x, char& sir, int& y) {
if (sir == '+')
return x + y;
else if (sir == '-')
return x - y;
}
int main() {
int x, y;
char sir;
c... | ALGO | 0.999656 | 5.230276 |
4eb9f66d-5454-48b0-8ab8-3c321ba6d81f | utkarsh-gith/Leetcode | LeetCodeProblems-CPP/1930. Unique Length-3 Palindromic Subsequences.cpp | class Solution
{
public:
int countPalindromicSubsequence(string s)
{
int count = 0;
map<char, bool> visited;
for (int i = 0; i < s.length(); i++)
{
if (visited[s[i]] == true)
{
continue;
}
visited[s[i]] = true;
... | ALGO | 0.999848 | 6.228083 |
88c46720-ecb6-47d0-ada2-6dd6ff374198 | purple-jwl/atcoder | src/ABC/155/A.cpp | #include <bits/stdc++.h>
#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define un... | ALGO | 0.999976 | 3.887022 |
2008f287-f9f1-4a91-98d9-c6d6e4d1cac4 | laureanobruno/ObservAR | ESP32/ObservAR_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/detection_postprocess.cpp | #include <algorithm>
#include <numeric>
#include <tuple>
#include "edge-impulse-sdk/third_party/flatbuffers/include/flatbuffers/flexbuffers.h"
#include "edge-impulse-sdk/tensorflow/lite/c/builtin_op_data.h"
#include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/intern... | DATA | 0.984609 | 7.373672 |
cf10fdc2-4f29-4fff-a9e4-eb22d0ab2e34 | SujalV2011/Codeforces | Practice/2085B.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main()
{
int t;
cin >> t;
while (t--)
{
ll n;
cin >> n;
vector<ll> a(n);
for (int i = 0; i < n; ++i)
{
cin >> a[i];
}
vector<pair<ll, ll>> op;
ll mid = n /... | ALGO | 0.999714 | 3.709979 |
cdd748ea-511e-4ef9-9b68-279c8d5aca05 | perrellaj17/Autonomos_Motion_Planning | AStar3Dimensions/simple_graph_search.cpp | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/types.h>
#include <time.h>
#include <sys/time.h>
#include <math.h>
#include <fstream>
#include "heap.h"
#include "heap.cpp"
#include "graph.h"
void expand(Heap<Node> &H, Node* thisNode, Node* goalNode)
{
// THISNODE IS V
// U IS NEIGHBO... | ALGO | 0.999969 | 3.643065 |
fe52c252-8f31-4bf4-aa6e-1c70d4716291 | jmouriz/spbus | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
76388fa8-3a12-47a9-b5e7-9829bb37b9fd | AmanDev17/OOP | p6.cpp | /*
experimgment no.6:
demonstrate use of vector containers and sort the elements in vector
*/
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class person
{
int tel;
string name;
public:
void get()
{
cout<<"enter name";
cin>>name;
cout<<"enter number";
cin>>tel;
}
... | ALGO | 0.996376 | 4.092515 |
cf7ad5ed-73f2-444d-9b32-cf041217290c | Gaoshj1999/Introduction-to-Programming | Code/87.cpp | #include<iostream>
using namespace std;
void swap(int &a,int &b)
{
int t=a;
a=b;
b=t;
}
int main()
{
int a[3][3];
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
cin>>a[i][j];
}
}
for(int i=0;i<3;i++)
{
for(int j=0;j<i;j++)
{
... | ALGO | 0.999979 | 3.030999 |
e28b3d2c-7fd0-4504-b8ba-999a388e87a7 | amihashemi/cs294project | Code/src/bcg_ver3/FFTMD.cpp | #include <cstdio>
#include <iostream>
#include <cassert>
#include <cmath>
#include <vector>
#include <list>
#include <memory>
#include "DBox.H"
#include "RectMDArray.H"
#include "FFT1D.H"
#include "FFTMD.H"
using namespace std;
FFTMD::FFTMD(std::shared_ptr<FFT1D> a_fft1dPtr)
{
m_fft1dPtr = a_fft1dPtr;
m_M = m_fft1d... | ALGO | 0.999437 | 3.837983 |
d5bc04a0-c3ab-4a14-b569-654f1dcd87de | ishandutta2007/codeforces | magga/normal/1246/B.cpp | #include<bits/stdc++.h>
using namespace std;
void pre(){}
#define MAXN 1000001
int spf[MAXN];
long long int n,k,d;
struct primeFactorization {
int countOfPf, primeFactor;
};
void sieve(){
spf[1] = 1;
for (int i=2; i<MAXN; i++)
spf[i] = i;
for (int i=4; i<MAXN; i+=2)
spf[i] =... | ALGO | 0.999932 | 3.663706 |
9efbdee5-e0e1-4f81-b97a-b2bac0b856d2 | Yash59ops/Leetcode-Solution | Maximum sum of Non-adjacent nodes - GFG/maximum-sum-of-nonadjacent-nodes.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999901 | 6.861091 |
28f3a686-0d0e-4f21-8d5f-0f7be6f2093c | sanghoon23/Algorithm | Programmers_1116_KaKao[3차]Compress(Map,Index활용)/ConsoleApplication1_Test/ConsoleApplication1_Test.cpp | #include "pch.h"
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <algorithm>
using namespace std;
vector<int> solution(string Msg)
{
vector<int> Answer;
int Index = 1;
map<string, int> Temp;
for (int i = 0; i < 26; ++i)
{
string In;
In.push_back(i + 65);
Temp... | ALGO | 0.999905 | 4.948953 |
46c96229-d0e4-4499-8e9e-479dc046bb40 | yanedwar/test_repo | src/lib/geo/geo.cpp | /**
* @file geo.c
*
* Geo / math functions to perform geodesic calculations
*
* @author Thomas Gubler <<EMAIL>>
* @author Julian Oes <<EMAIL>>
* @author Lorenz Meier <<EMAIL>>
* @author Anton Babushkin <<EMAIL>>
*/
#include "geo.h"
#include <float.h>
using matrix::wrap_pi;
using matrix::wrap_2pi;
#ifndef h... | ALGO | 0.995992 | 3.507359 |
2773e2b9-cd58-40ee-b32e-6adb8613d579 | tameer7595/simple-dna-sequence | dnaSeq.cpp | //
// Created by tameer on 9/11/19.
//
#include "dnaSeq.h"
std::ostream &operator<<(std::ostream &os, const DnaSequence &dt) {
size_t i = 0;
char temp;
size_t len = dt.length();
while (i < len) {
temp = dt.dna[i].get_nucleotide();
os << temp;
i++;
}
return os;
}
char D... | ALGO | 0.884542 | 6.383767 |
9e58b40c-6fc4-446e-a369-8e227bc2c8b4 | sasmith922/hw3 | llrec-test.cpp | #include <iostream>
#include <fstream>
#include <functional>
#include "llrec.h"
using namespace std;
/**
* Reads integers (separated by whitespace) from a file
* into a linked list.
*
* @param[in] filename
* The name of the file containing the data to read
* @return
* Pointer to the linked list (or NULL if em... | TOOL | 0.985154 | 5.305829 |
c42dda0d-5123-4168-9914-ff4075184574 | Thirza-12/100-days-of-code-challenge | Day_52.cpp | class Solution {
public:
int commonFactors(int a, int b) {
int count=0;
for(int i=1;i<=a && i<=b;i++)
{
if(a%i==0 && b%i==0)
{
count++;
}
}
return count;
}
};
| ALGO | 0.999831 | 5.704316 |
f54e5d45-3045-4603-b821-8f6d0e4ec6b4 | youyugithub/DySS_alpha | src/cpp_mchart1_decorrelation_EWMA_multivariate.cpp | #include <RcppArmadillo.h>
using namespace Rcpp;
//[[Rcpp::depends(RcppArmadillo)]]
//[[Rcpp::export]]
List mchart1_decorrelation_EWMA_multivariate_both(
arma::vec eps_A,arma::mat varcov_A,int nobs_A,int numdim,double lambda,double limit){
arma::vec tempe;
arma::mat Sigmacofactor,AA,AAinv,Sigmacov,Sigmavar;
a... | ALGO | 0.999737 | 5.559418 |
d1ddb4b9-f407-4698-9cba-f00012daa014 | sun01822/Toph | Set_Union.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
bool unique[1001] = {0};
int N[1000], M[1000], n, m;
int result[1000], p=0;
cin >> n >> m;
for(int i=0; i<n; i++)
{
cin >> N[i];
if(unique[N[i]] == 0)
{
unique[N[i]] = 1;
result[p] = N[i]... | ALGO | 0.99999 | 3.591959 |
10076134-6c1b-4228-95d1-101461cd13c8 | ayushkumar2808/Cpp | insert-node-in-linkedlist.cpp | #include <bits/stdc++.h>
using namespace std;
// class Node{
// public:
// int data;
// Node* next;
// Node(int data1, Node* next1){
// data = data1;
// next = next1;
// }
// };
// Node* convertArrToList(int arr[],int size){
// Node* head = new Node(arr[0],nullptr);
// Node* mover = head;
// ... | ALGO | 0.999844 | 4.879793 |
cd2efb4f-f60c-49db-8360-f823ba4d40cd | ishandutta2007/codeforces | ivan100sic/normal/460/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
int sd(int x) {
int z = 0;
while (x) {
z += x % 10;
x /= 10;
}
return z;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cerr.tie(nullptr);
l... | ALGO | 0.999353 | 3.481626 |
5791b6e4-3b7b-41dc-b293-aaea4a6cdf77 | hawking-npu/nubot_ws | src/nubot/front_vision/src/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <opencv2/opencv.hpp>
#include "nubot/core/core.hpp"
#include <ros/ros.h>
#include <cv_bridge/cv_bridge.h>
#include <std_msgs/String.h>
#include <std_msgs/Header.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/image_encodings.h>
#include <image_... | TOOL | 0.952093 | 4.067818 |
37df5f1b-678b-411f-98ef-d392edf413ba | tashobi02/Obi_CP_Snippets | Initials/Sorting_Algorithms/Bubble_Sort.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define enl "\n"
void fast() {
ios_base::sync_with_stdio(false);
cin.tie(0);
}
void bubbleSort(lli arr[], lli n) {
for (lli i = 0; i < n - 1; i++) {
for (lli j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
... | ALGO | 0.999924 | 5.419094 |
2fa678e5-414f-4b1a-b80f-c9eb61ac258c | menaehab/Codeforces-Solutions | 1001 - 2000 problems/A_Wet_Shark_and_Odd_and_Even.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <iomanip>
#include <string>
#include <set>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define el '\n'
#define all(arr) arr.begin(), arr.end()
#define ... | ALGO | 0.999995 | 4.645045 |
b56b54b8-e462-4d7c-b18f-fbadc3620f75 | goodlieees/leetcode | Subset Sums - GFG/subset-sums.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
void f(int ind,int sum,vector<int>arr,int n,vector<int>&ans){
if(ind==n){
ans.push_back(sum);
return;
}
//now
f(ind+1,sum+arr[ind],arr,n,ans);
f(ind+1,sum,arr,n,ans);... | ALGO | 0.999782 | 6.677857 |
0b647d5b-338d-4c52-97f5-3be3995082f8 | SokhengDin/ROS1-GEE-ITC | ITC_GEE_C++/print_absolute_value.cpp | #include <iostream>
using namespace std;
int main()
{
// Declaration
int number;
// Getting input
cout << "Enter an integer: ";
cin >> number;
// Find the absolute value
if (number < 0)
{
number = -number;
}
// Printting the value
cout << "ABsolute value of the numb... | TOOL | 0.959011 | 4.40585 |
5f03f9ff-cce7-4221-bd01-dc32e24b8492 | Aka2210/Leetcode | 242. Valid Anagram/LeetCode242Ex.cpp | #include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
#include<string.h>
using namespace std;
class Solution {
public:
bool isAnagram(string s, string t) {
if(s.size() != t.size()) return false;
unordered_map<char,int> smap;
unordered_map<char,int> tmap;
... | ALGO | 0.999989 | 5.140275 |
644f4d5a-443d-4d8a-a280-0c16fdb0e554 | DavidLuna-coder/EDNL | Grafos/Practica7/Ej11/Ej11.cpp | #include "../../MaterialesGrafos/grafoPMC.h"
#include "../../Floyd.hpp"
#include "../../MaterialesGrafos/matriz.h"
using namespace std;
using vertice = typename GrafoP<double>::vertice;
struct Puente
{
vertice c1;
vertice c2;
};
matriz<double> CostesMinimos(const GrafoP<double> &G1, const GrafoP<double> &G2, ... | ALGO | 0.999021 | 4.230546 |
1510da21-7a9b-463c-9840-256b41daf38b | Penpen7/procon | abc171/e/a.cpp | #include <bits/stdc++.h>
#define repz(i, z, n) for (decltype(n) i = (z); i < (n); i++)
#define rep(i, n) for (decltype(n) i = 0; i < (n); i++)
#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(v) ((ll)(... | ALGO | 0.99999 | 3.380661 |
26eeb6ff-e9c7-4c5b-b791-b801d863af3f | Hines111/Hines111.github.io | codes/cpp/chapter_stack_and_queue/deque.cpp | /**
* File: deque.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* Driver Code */
int main() {
/* 初始化双向队列 */
deque<int> deque;
/* 元素入队 */
deque.push_back(2);
deque.push_back(5);
deque.push_back(4);
deque.push_front(3);
deque.push_fron... | TEST | 0.907352 | 5.774346 |
049b0691-ce84-4515-b036-34a7429f9f75 | sajjadul404/Problem_solving | 800/A_Beautiful_Year.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int y;
cin >> y;
while (true) {
y++;
int temp = y;
set<int> digits;
bool isUnique = true;
while (temp > 0) {
int d = temp % 10;
if (digits.count(d)) {
isUnique = fal... | ALGO | 0.999132 | 4.847808 |
2ba97854-9113-4dc9-af44-6c85328d49c7 | umangja/CompetitiveProgrammingSolution | codeforces/450/B.cpp | /*input
*/
//assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pii pair<ll int,ll int>
#define vpii vector< pii >
#define vi vector<ll i... | ALGO | 0.99994 | 3.487708 |
39c4d243-79f7-40a5-8b8d-e0bc30317db0 | karanmanglani/LC | 207-course-schedule/course-schedule.cpp | class Solution {
public:
bool canFinish(int n, vector<vector<int>>& p) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
vector<int> ind(n,0);
vector<vector<int>> adj(n);
for(auto i : p) {
ind[i[0]]++;
adj[i[1]].push_bac... | ALGO | 0.999574 | 6.042077 |
39227421-75f4-4c46-9775-c6993303abde | ClydenPacheco/ClydesLab | 2nd Year/C++/Tutorial/Tutorial1.cpp | #include<stdio.h>
void function(int x)
{
if(x>=0)
{
function(--x);
printf("%d",x);
function(--x);
}
}
int main()
{
function(3);
return 0;
} | ALGO | 0.999994 | 4.010581 |
f2f0b7e5-923c-472e-a5d7-4a49fc4f64ce | UltraProton/PlacementPrep | DisjointSet/Implementation/arraybasedimplementation.cpp | #include<bits/stdc++.h>
using namespace std;
class disjoint_set{
public:
int n_set;
vector<int> parent;
vector<int> rank;
disjoint_set(int n_set);
void MAKESET(int u);
void UNION(int u, int v);
int FIND(int u);
};
int main(int argc, char const *argv[])
{
disjoint_set obj(10);
... | ALGO | 0.999948 | 4.429973 |
c5ee500a-db9f-46ca-87f4-1fd8b770646c | berksaribas/Panko-Renderer | third_party/eigen/bench/bench_reverse.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchUtil.h>
using namespace Eigen;
#ifndef REPEAT
#define REPEAT 100000
#endif
#ifndef TRIES
#define TRIES 20
#endif
typedef double Scalar;
template <typename MatrixType>
__attribute__ ((noinline)) void bench_reverse(const MatrixType& m)
{
int rows = m.r... | TEST | 0.854254 | 5.595998 |
1fec575c-d3b1-42a8-b514-f6ea1eccb2ef | Avninder99/LeetCode_GFG_Solutions | Maximum Intersecting Lines - GFG/maximum-intersecting-lines.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 maxIntersections(vector<vector<int>> lines, int N) {
// Code here
map<int, pair<int, int>>m1;
for(auto it... | ALGO | 0.999949 | 6.158844 |
1b73ed82-65db-4084-9d42-f9f75b309d39 | harshapps/CSE-programs | C++ Datastructures/Stacks/Multiplestack/multiplestack.cpp | #include<iostream>
using namespace std;
class multiplestack{
int e[1000];
int top[10];
int i;
int size;
public:
void push(int x,int n);
int pop(int n);
int isfull(int n);
int isempty(int n);
int empty();
multiplestack(int s){size=s;i=8;for(int j=0;j<i;j++)top[i]=-1;}
};
int multiplestack::pop(int n)
{if(top[... | ALGO | 0.997818 | 3.349711 |
abfd6068-3db3-459f-8dea-3c87bc20d877 | rishabhgargdps/coding_prep | stack/min_stack.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
class MinStack {
public:
stack<pair<int, int>>stk;
/** initialize your data structure here. */
MinStack() {
// stack<pair<int, int>>stk;
}
void push(int val) {
int min_value=INT_MAX;
if(stk.empty()) min_va... | ALGO | 0.999753 | 5.795802 |
31b20d8b-f1f8-49d6-b6dc-51d506bf7996 | secdec-research/secdec | pySecDecContrib/disteval/cpuworker.cpp | #define __STDC_FORMAT_MACROS
#include <assert.h>
#include <dlfcn.h>
#include <errno.h>
#include <inttypes.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <vector>
#include <ginac/ginac.h>
#include <ginac/parser.h>
#inclu... | TOOL | 0.914135 | 4.953507 |
f7bcf3ca-0a38-4043-a639-66aafc93fca2 | codeaholic-shub/ALGO-ADDICT | LEETCODE/C++/campus-bikes-ii.cpp | // Time: O(w * b * 2^b)
// Space: O(w * b * 2^b)
// if w = b, we can even apply Hungarian algorithm (see https://en.wikipedia.org/wiki/Hungarian_algorithm),
// it can be improved to O(w^3), see https://github.com/t3nsor/codebook/blob/master/bipartite-mincost.cpp
class Solution {
public:
int assignBikes(vector<vec... | ALGO | 0.999967 | 5.918024 |
cab51dc0-07bf-49a2-9602-445fed6e4b34 | AryaSamik/cf_codes | PetyaAndStrings.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
string s1, s2;
cin >> s1;
cin >> s2;
int sum1 = 0, sum2=0;
transform(s2.begin(), s2.end(), s2.begin(), ::tolower);
transform(s1.begin(), s1.end(), s1.begin(), ::tolower);
for (int i = 0; i < s1.size(); i++)
{
sum1+=(int... | ALGO | 0.999991 | 3.801139 |
78e08485-451c-43ca-97d5-adcbfa5def85 | tianyicaii/leetcode | raw/2024/leetcode/cpp/0333-largest-bst-subtree.cpp |
#include <algorithm>
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(right) {}
};
struct Re... | ALGO | 0.999971 | 6.493051 |
d3476134-2bd3-48fe-a4de-4b8750b01861 | vishusharmaX/100DaysofCodeChallenge | Difficulty: Easy/Single Number/single-number.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
int getSingle(vector<int>& arr) {
// code here
map<int,int>mpp;
for(auto it : arr){
mpp[it]++;
}
for(... | ALGO | 0.99952 | 5.694672 |
eb9fc3f5-9374-40c3-9905-7f39b72640b4 | 2261819266/Code | OI/luogu/P1280.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
const int maxn = 1e4 + 8;
std::vector<int> a[maxn];
int f[maxn];
void P1280() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0; i < m; i++) {
int x, y;
scanf("%d%d", &x, &y);
a[x].push_back(y);
}
for (int i = n; i >... | ALGO | 0.999768 | 4.13998 |
b0229fbd-1a97-4c46-8423-04a839907354 | eric-erki/opencv | 3rdparty/carotene/src/convolution.cpp | #include "common.hpp"
#include "saturate_cast.hpp"
namespace CAROTENE_NS {
bool isConvolutionSupported(const Size2D &size, const Size2D &ksize,
BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 8 &&
(border == BORDER_MODE_CONSTANT ||
border ==... | ALGO | 0.985504 | 6.352427 |
2b1ed18c-9610-4f1b-bbce-64e481fc5aa4 | YashMundankar/Leetcode | 561-array-partition-i/561-array-partition-i.cpp | class Solution {
public:
int arrayPairSum(vector<int> &nums)
{
sort(nums.begin(),nums.end());
int sum=0,i=0;
while(i<nums.size()){
sum+=nums[i];
i+=2;
}
return sum;
}
}; | ALGO | 0.999764 | 5.553337 |
da287feb-2880-4bb4-b497-167afb83e3ee | AshenSandeep/DSA-Labs | In_Lab_11/Prims.cpp | #include <iostream>
#include <vector>
using namespace std;
/////////////////////////// 210568J //////////////////////////////
int minNodeIndex(vector<int> &nodes,vector<int> &mstSet){
int minIndex=-1;
int minValue=INT_MAX;
for(int i=0;i<mstSet.size();i++){
if(!mstSet[i] && nodes[i]<minValue... | ALGO | 0.999806 | 4.653595 |
00d3fde9-b81f-4cac-9839-94477c55f698 | miemie2013/ncnn_ppyolov2 | src/layer/riscv/sigmoid_riscv.cpp | #include "sigmoid_riscv.h"
#if __riscv_vector
#include <riscv_vector.h>
#include "rvv_mathfun.h"
#include "rvv_mathfun_fp16s.h"
#endif // __riscv_vector
#include <math.h>
namespace ncnn {
Sigmoid_riscv::Sigmoid_riscv()
{
#if __riscv_vector
support_packing = true;
#if __riscv_zfh
support_fp16_storage = true;... | ALGO | 0.972039 | 6.909909 |
f5b2c201-4033-4bb2-ac82-e57eb7d526f3 | pallavi191/DSA | binary search tree/convert-sorted-array-to-binary-search-tree.cpp | // https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/description/
class Solution {
public:
TreeNode* arrayToBST(vector<int>& nums, int start, int end) {
if(start > end)
return NULL;
int mid = start + (end - start) / 2;
TreeNode* root = new TreeNode(nums[mid]... | ALGO | 0.999988 | 6.938669 |
4725ebc4-ba3c-48a8-bde8-78f48c23f64c | Dr-Khatib/PT1-SESJ1013 | Students/Jasmine/Lab2_Set4.cpp | #include <iostream>
using namespace std;
int main (){
int integer, digit, product=1;
cout << "Enter an integer number : ";
cin >> integer;
do{
digit = integer % 10;
integer /=10;
cout << digit;
if (integer !=0){
cout << " * ";
}
product *= d... | ALGO | 0.99966 | 3.553893 |
cbe063c1-9239-4781-a27e-4ae1d56a740a | HoangTam-LA/CongNgheLapTrinhDaNenTangMobi | buoi8/bai3buoi8/baibatam/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.997657 | 6.76775 |
041ea54f-73d7-48d6-b132-3af3c9d3fd28 | hirakuuuu/kyopro | others/tessoku-book/cc.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for(int i = a; i < n; i++)
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
const int MOD = 1000000007;
const int mod = 998244353;
// 問題
// https://atcoder.jp/contests/tessoku-book/tasks/tessoku_book_cc
int main(){
string s... | ALGO | 0.999957 | 4.924992 |
5449a6a2-ffe1-4608-83a3-f9259560f53b | Kaulwarmythri/DSA | problems/longest_word_in_dictionary/solution.cpp | class TrieNode{
public:
TrieNode *child[26];
bool isEnd;
TrieNode(){
this->isEnd = false;
for(int i=0; i<26; i++) this->child[i] = NULL;
}
};
class Solution {
private:
TrieNode *newNode;
//To check is all the prefixes of a word exist ie; if "temp->isEnd" for all the letters... | ALGO | 0.999982 | 6.048064 |
26eff53d-561a-45a6-89e2-8e6d9f67d98d | coalman321/cpp_test | cpp_test/src/main/cpp/lib/control/PurePursuitController.cpp | /*----------------------------------------------------------------------------*/
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* the project. */
/*-------------------------------------------------------------------------... | ALGO | 0.9897 | 5.253712 |
450ccc99-f779-4387-b009-4f84848d283e | andrewlin27/Program-Design-Concepts | Labs/string processing/deobfuscate.cpp | #include <iostream>
#include <string>
using std::cin, std::cout, std::endl, std::string;
int main() {
string sentence;
string details;
int spaceLocation=0;
cout<<"Please enter obfuscated sentence: ";
cin>>sentence;
cout<<"Please enter deobfuscation details: ";
cin>>details;
for (long un... | TOOL | 0.921327 | 3.866201 |
97aab984-d13b-4f43-93af-f434b8d72e90 | NailN-rgb/FEM1D | tools/calculus/integration.cpp | // #include <cmath>
// void quad1_stiffness(
// Equation &eq, // equation coefs
// std::vector<std::vector<float>> &local, // local matrix
// float start, // elem left end
// float end // elem right end
// ) ... | ALGO | 0.999579 | 4.097924 |
df097930-cbd7-4e42-a879-392eee3222d5 | ishandutta2007/codeforces | flashmt/normal/128/D.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cstring>
#include <string>
#include <cmath>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <sstream>
#define maxN 1
#define fr(a,b,c) for (int a=b;a<=c;a++)
#define frr(a,b,c) for (int a=b... | ALGO | 0.999996 | 3.659991 |
0e6d6346-9b24-467a-b230-cb04c47958e4 | mushfiqbh/codeforces-solution | B_Different_Divisors.cpp | // Author: Mushfiq R.
#include <bits/stdc++.h>
#define endl "\n"
#define ll long long
#define ld long double
#define ull unsigned long long
#define vsort(v) sort(v.begin(), v.end())
#define rsort(v) sort(v.begin(), v.end(), greater<int>())
#define fastIO() (ios_base::sync_with_stdio(false), cin.tie(NULL));
using namesp... | ALGO | 0.999971 | 5.151743 |
ce6fcb1a-0331-468c-80ab-252f83fa6ad4 | uygrgcmn/DSA | PROBLEM 10.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
int kthElementUtil(const vector<int>& arr1, int start1, int end1, const vector<int>& arr2, int start2, int end2, int k) {
// If arr1 is empty, return kth element of arr2
if (start1 > end1) {
return arr2[start2 + k - 1];
... | ALGO | 0.999982 | 5.983025 |
def8479e-3e3d-4c19-a7d0-a98fda7de4d9 | Lali67/Cpp_Snippet | 01-Basic/025-Printed Patterns Variations/025-Printed Patterns Variations/025-Printed Patterns Variations.cpp | // 025-Printed Patterns Variations.cpp
/*
Output:
*****
*****
*****
*****
*****
*/
#include <iostream>
const int MAX_NUM_LINES = 5;
using namespace std;
int main()
{
for (int i = 0; i < MAX_NUM_LINES; i++) {
std::cout << "*****"<< endl;
}
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
//... | ALGO | 0.988613 | 4.054486 |
24ac3086-a200-4868-9c1e-fac0a03bbe40 | Vivek1898/leetcode-practice | 0295-find-median-from-data-stream/0295-find-median-from-data-stream.cpp | class MedianFinder {
public:
priority_queue<int>max;
priority_queue<int,vector<int>,greater<int>>min;
MedianFinder() {
}
void addNum(int num) {
if(max.empty() or max.top()>=num) max.push(num);
else min.push(num);
if(max.size()>min.size()+1){
... | ALGO | 0.999981 | 6.150189 |
c105d916-78ce-4b2a-a893-a83aa1777997 | ManuSharma27/laptopdata | TimeAndSpaceComplexity/5.cpp | #include<iostream>
using namespace std;
int main(){
int n=5;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
cout<<"*"; //O(n2) -->The worst case time complexity
}
cout<<"\n";
}
return 0;
} | ALGO | 0.999697 | 3.083805 |
2708ac1e-6bdd-4888-9ced-d925c59e6730 | BACABI7/LAB_2 | algstr2/main.cpp | #include <iostream>
#include <ctime>
#include <iomanip>
#include "sort.h"
#include <time.h>
using namespace std;
int main()
{
setlocale(LC_ALL, "rus");
srand(time(NULL));
int array[150];
double time = 0;
int N = sizeof(array) / sizeof(array[0]);
cout << " : ";
for (int i = 0; i < N-1; i++) {
array[i] = rand... | ALGO | 0.998923 | 3.692743 |
156fbc6e-9d8a-4de1-b2f7-87233562b40c | JiangWenqi/Algorithm-Questions | Leetcode-Solutions/100.same-tree.cpp | /*
* @lc app=leetcode id=100 lang=cpp
*
* [100] Same Tree
*
* https://leetcode.com/problems/same-tree/description/
*
* algorithms
* Easy (56.27%)
* Likes: 7286
* Dislikes: 155
* Total Accepted: 1.2M
* Total Submissions: 2.2M
* Testcase Example: '[1,2,3]\n[1,2,3]'
*
* Given the roots of two binary ... | ALGO | 0.999895 | 7.060345 |
3697a7b8-bd3a-4361-884f-884a7ef9bec0 | xdtianyu/android-4.2_r1 | frameworks/av/media/libstagefright/codecs/amrnb/common/src/gmed_n.cpp | /*
Pathname: ./audio/gsm-amr/c/src/gmed_n.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Put file into template and first pass at optimization.
Description: Made changes based on comments from the review meeting. Used
pointers instead of index a... | ALGO | 0.999995 | 6.58524 |
4c1e171c-9a80-4f19-b4b3-bcf4f25d7e1e | mkoehnke/CarND-Path-Planning-Project | src/Eigen-3.3/unsupported/doc/examples/MatrixSquareRoot.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
const double pi = std::acos(-1.0);
MatrixXd A(2,2);
A << cos(pi/3), -sin(pi/3),
sin(pi/3), cos(pi/3);
std::cout << "The matrix A is:\n" << A << "\n\n";
std::cout << "The matrix square root of A is:... | ALGO | 0.998938 | 3.930508 |
1c608b60-d689-41b5-81e9-078fd22b3768 | username6452728464/dmchain | eos/libraries/rapidjson/example/parsebyparts/parsebyparts.cpp | // Example of parsing JSON to document by parts.
// Using C++11 threads
// Temporarily disable for clang (older version) due to incompatibility with libstdc++
#if (__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1700)) && !defined(__clang__)
#include "rapidjson/document.h"
#include "rapidjson/error/en.h"
... | TOOL | 0.856377 | 7.082315 |
e084e277-a53d-4b9e-a79e-2b1b7da973ba | ishandutta2007/codeforces | i_love_dasha_karpenko/normal/776/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define DIM 200007
#define INF 10E16
#define MAXN 10007
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pairll;
typedef ll arr[DIM];
typedef vector<ll> tree[DIM];
struct node{
ll sc,m;
};
ll n,m,flag = 0;
arr P,V,vis;
tree A;
set<ll> S;
void dfs(ll x... | ALGO | 0.999989 | 3.762774 |
89eb7393-dbe5-4df1-9e9b-5be1dacdb376 | right-x2/Algorithm_study | 2485.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char** argv)
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int num;
int n;
vector<int> v;
cin>>n;
for (int i = 0; i < n; ++i)
{
cin>>num;
v.push_back(... | ALGO | 0.999984 | 3.669049 |
cfa3db31-45bc-4803-b343-0565f0a23334 | alexandraback/datacollection | solutions_5648941810974720_1/C++/blackjaguar97/alter.cpp | #include <bits/stdc++.h>
#define P(x,y) make_pair(x,y)
using namespace std;
const int MX=(1<<20);
//int arr[MX] ;
string str[13]={"ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE"};
int num[12] = {0 , 2 , 8 , 3 , 6 , 7 , 4 , 5 , 9 , 1};
//zero// two //// eight // three // six// seven // f... | ALGO | 0.999902 | 4.263137 |
aa5b000b-292f-4150-afc3-a74bec121689 | makeloveandroid/WxMusic | amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/d4_17pf.cpp | /*
------------------------------------------------------------------------------
Filename: d4_17pf.cpp
Functions: decode_4i40_17bits
------------------------------------------------------------------------------
MODULE DESCRIPTION
FUNCTION: decode_4i40_17bits (decod_ACELP())
PURPOSE: Algebraic codebook dec... | ALGO | 0.999638 | 5.391303 |
9b474ad7-ef25-43dd-a391-25eef5e3a4ea | lsj0822/Problem_Solving | C++/연습문제/04_연결리스트/0x04[S2]_5397.cpp | #include<iostream>
#include<list>
using namespace std;
int main() {
int N;
cin >> N;
for (int i = 0; i < N; i++) {
list<char> pass;
auto c = pass.begin();
string order;
cin >> order;
for(char o : order) {
if (o == '<') {
if (c != pass.begin()) c--;
}
else if (o == '>') {
if (c != pass.en... | ALGO | 0.999876 | 4.120559 |
97ecbe8c-0b6e-4ce7-bd41-d501b3f982a4 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_739_9.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int d[20];
int main() {
int n;
while (cin >> n) {
for (int i = 0; i < n; i++) cin >> d[i];
int up = (1 << n), flag = 0;
for (int i = 0; i < up; i++) {
int tp = 0;
for (int j = 0; j < n; j++) {
if ((1 << j) & i)
... | ALGO | 0.99989 | 3.847065 |
69efc9d4-95b1-4f55-9292-1fbbb2291147 | tetraloba/competitiveProgramming | AtCoder/ABC/2XX/293/ABC293_C_2.cpp | // 2024/02/28 18:02:41
// 2024/02/28 18:43:35 AC.
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
int main(){
int H, W;
cin >> H >> W;
vector<vector<int>> A(H, vector<int>(W));
for (vector<int> &v : A) {
for (int &a : v) {
cin >> a;
... | ALGO | 0.99995 | 4.956108 |
1c82b12b-b40b-44c6-9dc5-bd0f836650e7 | cheng9911/Rocos_app_ros2 | ros2_app/src/cpp_pubapp/3rdparty/kdl/src/trajectory_segment.cpp | /*****************************************************************************
* \author
* Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven
*
* \version
* ORO_Geometry V0.2
*
* \par History
* - $log$
*
* \par Release
* $Id: trajectory_segment.cpp,v 1.1.1.1.2.7 2003/07/23 16:44:26 psoetens Ex... | TOOL | 0.887968 | 6.509564 |
0c7c4ab3-5e03-4b4f-8993-f0292a66d662 | asu-crypto/mpsica | thirdparty/linux/boost/libs/graph/example/make_maximal_planar.cpp | #include <boost/graph/make_biconnected_planar.hpp>
#include <boost/graph/make_maximal_planar.hpp>
#include <boost/graph/planar_face_traversal.hpp>
#include <boost/graph/boyer_myrvold_planar_test.hpp>
// This example shows how to start with a connected planar graph
// and add edges to make the graph maximal planar (tr... | ALGO | 0.998262 | 7.381608 |
301733c0-920a-4fab-b06e-b6b2d96fc257 | Davidysh/c-hellow | LinkList.cpp | #include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
typedef struct Node{
int data;
struct Node *next;
}Node,*List;
void CreateList(List &L,int n)
{
Node *s,*r;
int x;
L=new Node;
L->next=NULL;
r=L;
int i = 1;
while(i <= n)
{
cin>>x;
s=new Node;
s->data=x;
r->next=s;
r=s;
... | ALGO | 0.99999 | 3.271391 |
95f59bac-c5ec-4cb1-9144-ba719363ed56 | viniciuslfernandes/Estudos_Programacao_Competitiva | Contest_Oktoplus/1_Geral/D.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string x;
cin>>x;
if(next_permutation(x.begin(), x.end())){
cout<<x<<endl;
}else{
cout<<"0"<<endl;
}
return 0;
}
//Passou apos o contest | ALGO | 0.999969 | 5.381073 |
ec1dd2c2-9ee7-4500-b0f0-33c7543856e8 | deare1300/algs | leetcode/src/maximum_depth_tree.cpp | #include "include/maximum_depth_tree.h"
#include "include/treenode.h"
#include "include/header.h"
Maximum_Depth_Tree::Maximum_Depth_Tree()
{
//ctor
}
Maximum_Depth_Tree::~Maximum_Depth_Tree()
{
//dtor
}
int Maximum_Depth_Tree::maxDepth(TreeNode *root)
{
//queue<vector<TreeNode *> > v;
vector<TreeNode ... | ALGO | 0.930404 | 4.816323 |
1a595712-4acd-404e-9a15-6df362ec76b2 | arnavagrawal22/cpp-basic | matrix_search_optimised.cpp | #include <iostream>
using namespace std;
int main()
{
int n, m;
cin >> n;
cin >> m;
int a[n][m];
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
cin >> a[i][j];
}
}
int k;
cin >> k;
int i = 0;
int j = m - 1;
while (i < n ... | ALGO | 0.999925 | 3.433804 |
622a0e9d-3c37-4e09-bebe-67032515ea1d | fardinfaruqi/Learning-Cpp | Codeforces/S_Interval.cpp | #include <bits/stdc++.h>
using namespace std;
#define max(a, b) (a < b ? b : a)
#define min(a, b) ((a > b) ? b : a)
#define mod 1e9 + 7
#define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++)
#define FORL(a, b, c) for (int(a) = (b); (a) <= (c); (a)++)
#define FORR(a, b, c) for (int(a) = (b); (a) >= (c); (a)--)
#define INF... | ALGO | 0.990041 | 4.393495 |
e7022480-a704-4f53-9391-4ff254da2ba6 | ucsb-cs16-sp17/cs16-sp17-starter-code | lab07/mllfTest2.cpp | #include "linkedListFuncs.h"
#include "moreLinkedListFuncs.h"
#include "tddFuncs.h"
#include <iostream>
using namespace std;
int main() {
Node *p;
int threeNums[3]={42,57,61};
LinkedList *list = arrayToLinkedList(threeNums,3);
ASSERT_EQUALS( "[42]->[57]->[61]->null", linkedListToString(list));
cout << "Tes... | TEST | 0.967736 | 5.59293 |
af7925c1-bb46-40b6-9551-8f7ad65f3e61 | raziullah7/DSA-in-C-Plus-Plus | Array ADT (Abstract Data Type)/Array ADT/Delete.cpp | #include "ArrayADT.h"
template <class T>
void ArrayADT<T>::Delete(int position, T &element) {
// handling invalid positions
if (position < 1 || position > Size)
throw IllegalParameterValue("Invalid Position...");
// this parameter allows to return the value of the deleted position
element = Arr[position - 1];
... | ALGO | 0.983446 | 5.195295 |
4737e293-0e71-412b-aae2-eb2608265b42 | abhishek0405/Data-Structures | Graphs/UnDirectedCycleDFS.cpp | #include <iostream>
using namespace std;
#include<queue>
#include<map>
#include<list>
class graph{
public:
map<int,list<int>>mp;
int *visited;
int *inpath; //array that tells whether current node in the recursive path.If i reach a node which is aldready in the path, then cycle exist.
graph(int... | ALGO | 0.999958 | 5.331351 |
3b166d10-3a4e-4cd5-8191-aeccebde1d08 | ravenn3105/LeetCode | 2571-find-the-pivot-integer/find-the-pivot-integer.cpp | class Solution {
public:
int pivotInteger(int n) {
int total= (n+1)*n/2;
int leftsum=0, rightsum=0;
for (int i=1; i<=n; i++){
leftsum += i;
rightsum= total-leftsum+i;
if(leftsum== rightsum) return i;
}return -1;
}
}; | ALGO | 0.999957 | 5.909571 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.