uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
dd0caa01-e874-480f-b864-9491d5cadb4c | ashalam1/DSA-with-CPP | array/bubbleSort.cpp | #include<iostream>
using namespace std;
void bubblesort(int arr[], int n){
for(int i=0; i<n-1; i++){
for(int j=0; j<n-i; j++){
if(arr[j]>arr[j+1])
swap(arr[j],arr[j+1]);
}
}
}
int main()
{
int arr[8]={10, 1, 7, 6, 14, 9, 22, 29};
bubblesort(arr,6);
cout<<"Sor... | ALGO | 0.999729 | 5.154929 |
e60ce672-2b23-4df9-8999-2e07220c47a8 | carriez0705/leetcode | 068-TextJustification.cpp | class Solution {
public:
vector<string> fullJustify(vector<string>& words, int maxWidth) {
int n = words.size();
if(maxWidth==0) return words;
vector<int> wordLen(n, 0);
for(int i = 0; i<words.size(); i++){
wordLen[i] = words[i].size();
}
vector<strin... | ALGO | 0.999959 | 6.203205 |
a98f2b49-3b31-4296-a2ae-086c6051ce17 | sigonetwork/SPHINX-V2.1 | src/Lib/MPC/src/interactive_mid_protocols/SigmaProtocolElGamalPrivateKey.cpp | #include "../../include/interactive_mid_protocols/SigmaProtocolElGamalPrivateKey.hpp"
/**
* Computes the simulator computation with the given challenge.
* @param input MUST be an instance of SigmaElGamalPrivateKeyCommonInput.
* @param challenge
* @return the output of the computation - (a, e, z).
* @throws CheatAttemp... | ALGO | 0.999693 | 6.899559 |
76fa4120-65c5-4e69-8742-ff9722dd5ea1 | LucasGualtieri/PAA-TP01 | tests/test_tarjan.cpp | #include <iostream>
#include "../include/fleury_tarjan.hpp"
#include "../DataStructures/utils/timer.hpp"
#include "../DataStructures/include/graph/Graph.hpp"
#include "../DataStructures/include/graph/GraphBuilder.hpp"
using namespace std;
int main() {
Graph G = GraphBuilder()
.dataStructure(Graph::FastAdjacencyL... | ALGO | 0.998191 | 5.482614 |
d6d829ef-3c1f-429a-938f-eec0dbe9186b | nilaydavnath69196/My-Activities | C++/OOP/fibonacci Series2.cpp | #include<iostream>
using namespace std;
class fibonacci
{
public:
void display();
};
void fibonacci::display()
{
int i,n,first = 0, second = 1,result;
cout <<"Enter the number: ";
cin>>n;
cout << "The Fibonacci series is: " << first << " " << second << " ";
for(i=2;i<=n;i++){
result ... | ALGO | 0.998811 | 3.369439 |
fa2c42fb-9b78-4bc4-8622-bbd0206312ea | vatsav12/data-structures-and-algorithms | find_nth_last_element.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
};
Node *root = NULL;
void add_at_head()
{
Node *t = new Node();
cout<<"enter the data to be inserted at the beginign of the linked list"<<endl;
cin>>t->data;
t->next = NULL;
if(root==NULL)
{
root = t;
}
else
{
t->ne... | ALGO | 0.998193 | 3.555144 |
7c62bd6a-52d1-40db-a9c7-fc655ad67b4f | kaushikns/3d-multiscale-thrombosis-solver | palabos/examples/codesByTopic/navierStokesModels/allModels2d.cpp | #include "palabos2D.h"
#include "palabos2D.hh"
#include <vector>
#include <cmath>
#include <iostream>
#include <fstream>
#include <iomanip>
#include "poiseuille.h"
#include "poiseuille.hh"
#include "cylinder.h"
#include "cylinder.hh"
using namespace plb;
using namespace plb::descriptors;
using namespace std;
typedef ... | ALGO | 0.9972 | 6.156692 |
30921dff-84d8-4752-a89b-ba5b9a695fc9 | gingerninja0/Object_Tracking | src/tomht_tracker/src/tomht.cpp | #include <iostream>
#include "tomht.h"
TOMHT::TOMHT(/* args */)
{
hypothesis_tree = std::make_unique<std::vector<std::unique_ptr<Tree>>>();
}
TOMHT::~TOMHT()
{
}
void TOMHT::update(std::vector<Eigen::Vector3d> y_vec_)
{
y_vec = y_vec_;
std::cout << "TOMHT Spin!" << std::endl;
hypothesis_generation(... | ALGO | 0.950581 | 4.727899 |
a907dd1c-b1c6-4cb7-96aa-e5a05b24c307 | Carlos-Lai-Dev/Clike | circularqueue.cpp | #include <stdio.h>
#include <stdlib.h>
#define MAXSIZE 6
typedef struct Queue{
int front;
int rear;
int data[MAXSIZE];
}Queue;
Queue* QueueInit()
{
Queue* queue = (Queue*)malloc(sizeof(Queue));
queue -> front = queue -> rear = 0;
return queue;
}
bool IsFull(Queue* queue)
{
if((queue -> rear + 1) % MA... | ALGO | 0.99881 | 4.395532 |
f2e03279-436f-453c-843b-a2c0bfbf1c31 | 26ANSH/Codechef | Practice/FLOW007.cpp | #include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int test;
cin>>test;
while(test--)
{
int num;
cin>>num;
int rev =0, rem =0;
while(num!=0)
{
rem=num%10;
rev= (rev*10... | ALGO | 0.99993 | 5.26397 |
bcb25849-2a29-4701-aac2-060fe4fc0089 | aloybm/Struktur-Data | Pertemuan 11/lat4.cpp | #include <iostream>
#include <iterator>
#include <list>
using namespace std;
class Vertex {
private:
list<int> adj;
public:
void addEdge(int v, int w){
adj.push_back(w);
}
void showList(){
list<int>::iterator i;
for(i=adj.begin(); i ... | ALGO | 0.997307 | 4.92833 |
5fa337dd-0654-4440-9427-341d3ccb849a | ibrahimhabibeg/codeforces | problems/1800/A/sol.cpp | #include <bits/stdc++.h>
using namespace std;
char up[5] = {'M', 'E', 'O', 'W'};
char down[5] = {'m', 'e', 'o', 'w'};
int main()
{
int TC, n;
cin >> TC;
while (TC--)
{
cin >> n;
char s[n + 1];
cin >> s;
int j = 0;
for (int i = 0; i < n; i++)
{
if (i != 0 && j < 4 && (s[i] == up[j... | ALGO | 0.999916 | 4.20996 |
eee0941a-a904-4174-a977-8a3617fc2d3e | Praneeth-22/Problem-Solving---Leet-code | Graph/DFS/802 find eventual safe states.cpp | //802. Find Eventual Safe States
//Solved
//Medium
//Topics
//Companies
//There is a directed graph of n nodes with each node labeled from 0 to n - 1. The graph is represented by a 0-indexed 2D integer array graph where graph[i] is an integer array of nodes adjacent to node i, meaning there is an edge from node i to ea... | ALGO | 0.999984 | 6.634097 |
7d8a1d88-2c88-409e-8699-af1169fc666c | dkmishra2407/Leetcode-Solutions | 206-reverse-linked-list/reverse-linked-list.cpp | class Solution {
public:
ListNode* reverseList(ListNode* head) {
if(head == NULL || head->next == NULL){
return head;
}
ListNode* temp = reverseList(head->next);
ListNode* front = head->next;
front->next = head;
head->next = NULL;
return temp;
... | ALGO | 0.999723 | 5.515123 |
06aec007-7757-43f6-ac56-ade89aadce79 | SyedaShafi/C_programming | CPP/lilt_can_do_it.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
const int N = 1e7 + 1;
int main()
{
int t;
cin >> t;
while (t--)
{
int n, ele;
cin >> n;
vector<int> a;
bool flag = false;
for (int i = 0; i < n; i++)
{
cin >> ele;
... | ALGO | 0.999496 | 5.015829 |
c8225dda-2759-483a-9e8a-d3fd5e62cc01 | adityaS011/cpp-programs | 213-house-robber-ii/house-robber-ii.cpp | class Solution {
public:
int robber(vector<int>& num){
int prev2=0;
int prev=0;
for(int i=0;i<num.size();i++){
int take= num[i]; if(i>1) take+=prev2;
int not_take=0+ prev;
int sum=max(take,not_take);
prev2=prev;
prev=sum;
}
... | ALGO | 0.999915 | 5.589217 |
8f1b83ae-74da-4d0b-90ed-07ed04b6c1f9 | pkprajapati7402/Data-Structure-and-Algorithms | 01. Data Structures/01. Linked List/1. Singly-Linked-List/Problems/Reverse Singly LinkedList/ReverseSinglyLinkList.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
struct node *link;
};
struct node *start;
void insertBegin(int item)
{
node *t = new node;
t->data = item;
// allocate memory for 1 node variable and t will be pointer to that node
if (start == NULL)
{
star... | ALGO | 0.997562 | 3.971009 |
06bafb84-3132-4f7a-9794-9101faff3e6b | Rittik-kumar19/Leet_code_question | minimum-path-sum/minimum-path-sum.cpp | class Solution {
public:
int recurse(const vector<vector<int>> &grid, vector<vector<int>>& memo, int x, int y)
{
if (x == 0 and y == 0)
return grid[x][y];
if (x < 0 or y < 0)
return INT_MAX;
if (memo[x][y] > 0)
return memo[x][y];
... | ALGO | 0.999949 | 6.035066 |
f3e47be1-4ce6-4a41-98f2-3a581a478924 | atig05/sorting | selection.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
void swap(int *a,int *b){
int t=*a;
*a=*b;
*b=t;
}
void in(int ar[],int n){
cout<<"Enter elements "<<endl;
for(int i=0;i<n;i++)
cin>>ar[i];
}
void show(int ar[],int n){
int i=0;
for(i=0;i<n;i++)
cout<<ar[i]<<" ";
cout<<endl<<endl;
}
int selection(in... | ALGO | 0.999736 | 3.421704 |
882b821b-d2ec-4b7c-8dca-7b0f5c5934ba | ProtonAOSPPhoenix/frameworks_av | media/codecs/amrwb/dec/src/voice_factor.cpp | /*
------------------------------------------------------------------------------
Filename: voice_factor.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
------------------------------------------------------------------------... | ALGO | 0.999573 | 5.889938 |
4fda85d8-9353-45d8-b5fe-16fbcb362c0b | StarlitDreams/BCSE102P | PPS3/inline_circle_area.cpp | /*
Q2
Write a program that uses an inline function to calculate the area of a circle.
The function should take in the radius as a parameter and return the area.
Test the function with the following values.
For example:
Input Result
Radius = 5
78.54
Radius = 10
314.16
Radius= -9.5
Invalid
*/
#define _USE_MATH_DEFINE... | ALGO | 0.98596 | 5.436833 |
88d618ee-204e-4747-b327-fcb8fc4b6fa0 | BlackOutDevelops/OpticalFlow | OpenCV/opencv/sources/modules/videostab/src/global_motion.cpp | #include "precomp.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/videostab/global_motion.hpp"
using namespace std;
namespace cv
{
namespace videostab
{
static Mat estimateGlobMotionLeastSquaresTranslation(
int npoints, const Point2f *points0, const Point2f *points1, float *rmse)
{
Mat_<flo... | ALGO | 0.999171 | 6.562643 |
6be33fed-80c5-4086-a4a4-91653ea0bc86 | jiangxu05/notes | 题/洛谷刷题笔记/循环/最长连号.cpp | #include<iostream>
using namespace std;
//思路:
//输入n个整数,n个整数;
//最长连号:后 temp 等于前+1 b ;如果连号断了就要归一,连号长要临时存储 max;
int main (){
int n , b , temp;
int max = 1, ans = 0;
cin>>n;
cin >> b ;
for (int i = 0; i < n ; i++){
cin >> temp;
if(temp == b + 1){
++max;
}
... | ALGO | 0.999817 | 3.128174 |
dfd60d77-159f-4908-98c1-4fd7e197bfc0 | Mrtriste/Leetcode | Solutions/mianshi08.02.cpp | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <cmath>
#include <memory.h>
#include <functional>
using namespace std;
vector<vector<int>> res;
vecto... | ALGO | 0.99995 | 3.600296 |
8e07879b-cc8b-43c0-9fb5-76939b2fcf32 | bfdyoy/CodeForces | 1300Dif/1237B/main.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int a[100010],b[100010],d[1000010];
int main()
{
int n,i,s=0,now=1;
scanf("%d",&n);
for(i=1; i<=n; i++)
scanf("%d",&a[i]);
for(i=1; i<=n; i++)
scanf("%d",&b[i]),d[b[i]]=i;
for(i=1; i<=n; i++)
{
if(d[a[i]]<n... | ALGO | 0.999883 | 3.473397 |
1cc507ac-a044-47c3-acfd-ad6af34d7cd2 | rahultumpala/cses | Two_Knights.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define forn(i, k, e) for (int i = k; i < e; i++)
int32_t main() {
int n;
cin >> n;
forn(k, 1, n + 1) {
int cnt = (k * k) * (k * k - 1) / 2; // choose two positions in K x K matrix = Nc2(K*K)
int threeTwoMatrices = (k - 2... | ALGO | 0.999527 | 3.394545 |
f331d049-eefe-4fd7-8630-7b36ed7c1f8b | raincross7/code-similarity | codes/train_code/problem475/problem475_52.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#define ll long long
using namespace std;
struct Egn{
ll X, Y;
double angle;
Egn(ll inputtedX, ll inputtedY){
X=inputtedX, Y=inputtedY;
if(X==0 && Y==0) angle=0.0;
else angle=atan2(Y, X);
}
bool operator<(const Eg... | ALGO | 0.999937 | 4.06831 |
88a7f669-2e2f-4bb3-985b-e8b2a97b90c4 | kavish5/Leetcode | Vectors/search-rotated-array.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stac... | ALGO | 0.999938 | 5.812326 |
67ada5a9-c6cb-4d82-a881-3f75c5b87bca | ChetanKarwa/DSAlgoProblem | Array/FindingAllDuplicates.cpp | //Link - https://leetcode.com/problems/find-all-duplicates-in-an-array/
/*Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.
Find all the elements that appear twice in this array.
Find all duplicates in o(1) space and o(n) time*/
// approach 1
vector<in... | ALGO | 0.998901 | 6.103216 |
8d23d404-d8de-47b2-9f70-3a5c2beb81a2 | Yash-Handa/ds-algo | Matrix/Spiral_Traversal.cpp | #include <iostream>
#include <vector>
using namespace std;
template <typename T>
void spiral_traversal(T &matrix)
{
int rows = matrix.size(), cols = matrix[0].size();
int top = 0, bottom = rows - 1, left = 0, right = cols - 1;
while (top <= bottom && left <= right)
{
for (int j = left; j <= ri... | ALGO | 0.999927 | 4.672866 |
4ee9ac01-de40-4de6-bab8-eac1374150f2 | blip9/Codeforces | 208A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string song;
cin >> song;
int size = song.length();
int flag;
for(int i=0;i<size;i++){
if(song[i]=='W'&& song[i+1]=='U'&& song[i+2]=='B'){
if(flag == 1){
cout<<" ";
}
i =i+2;
... | ALGO | 0.999844 | 3.06003 |
03b67916-e9a4-4805-962c-e22d77529080 | rishabh644/Daily_Challenge | Standard_DSA/Dynamic_Programming/Different_Ways_to_Add_Parenthesis.cpp | class Solution {
public:
vector<int> diffWaysToCompute(string input)
{
vector<int>outputs;
int n=input.size();
for(int i=0;i<n;i++)
{
if(input[i]=='+' || input[i]=='-' || input[i]=='*')
{
string left=input.substr(0,i);
str... | ALGO | 0.999996 | 5.748814 |
d58b18e5-309a-4e1c-a2ea-876efd022cf3 | louiseloesch/tracking-and-detection | TrackingRandomForest/Task2/randomForest.cpp | #include "randomForest.h"
using namespace std;
using namespace cv;
void RandomForest::getNRand(std::unordered_set<int> * index, int max_number, int number_samples) {
int num;
std::unordered_set<int>::iterator search;
for (int i = 0; i < number_samples; i++) {
num = rand() % (max_number + 1);
(*index).insert... | DATA | 0.905362 | 4.861959 |
d98c7067-1aa8-4f17-8cc1-83ca88a23cf8 | BhavyanshM/LineEstimator | eigen-3.3.7/doc/examples/function_taking_ref.cpp | #include <iostream>
#include <Eigen/SVD>
using namespace Eigen;
using namespace std;
float inv_cond(const Ref<const MatrixXf>& a)
{
const VectorXf sing_vals = a.jacobiSvd().singularValues();
return sing_vals(sing_vals.size()-1) / sing_vals(0);
}
int main()
{
Matrix4f m = Matrix4f::Random();
cout << "matrix m:... | ALGO | 0.999858 | 5.283265 |
01dde061-293c-4929-af81-4750999e0133 | NipenPaul/Program-Catagory-Document | Online Judge/UVA/10327.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <sstream>
#include <set>
#include <math.h>
using namespace std;
int main()
{
int a,i,t,j,temp;
while(scanf("%d",&a)!=EOF){
int... | ALGO | 0.999671 | 3.232529 |
880f7ee0-31f8-49da-b220-2777a631b665 | Beisenbek/kbtu-teaching | programming principles I/hands on labs/hol3/solutions/wa_72763.cpp | #include <iostream>
using namespace std;
int main () {
int n;
cin >> n;
int a[500500];
int sum = 0;
for (int i = 1; i <= n; ++ i) {
cin >> a[i];
}
for (int i = 1; i <= n; ++ i) {
sum += a[i];
}
cout << sum;
return 0;
} | ALGO | 0.999546 | 3.652175 |
ab12dd6b-242b-48cd-a482-71abb0dbb046 | BrendanNolan/Commandos | main.cpp | #include <algorithm>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <stdexcept>
#include <vector>
#include "commando.h"
int main(int argc, char** argv)
{
if (argc != 5)
{
throw std::invalid_argument("Usage ./<file name>"
" random-number-seed"
... | ALGO | 0.933578 | 5.035295 |
5ab4e5d3-f416-4a93-b529-2e9d20efa734 | SETHJI01/DSA | Tree/spiral level order.cpp | #include<bits/stdc++.h>
using namespace std;
typedef struct Node{
int data;
Node *right, *left;
Node(int key){
data = key;
right = NULL;
left = NULL;
}
} Node;
Node* createTree(){
cout << "Enter the data of the node : ";
int x,ch;
cin >> x;
Node *temp = new Node(... | ALGO | 0.999976 | 4.652241 |
b11aa994-ec5e-41fe-bdd9-0952fd02f34a | premdeshmukh18/cpp-practice | string/rev_str.cpp | #include<iostream>
using namespace std;
int main()
{
string name;
cin>>name;
string rev;
int l=name.length()-1;
while(l>=0)
{
rev=rev+name[l];
l--;
}
cout<<rev;
return 0;
} | ALGO | 0.999676 | 4.345163 |
4ef4c4d3-b30e-41d4-8c7f-a2f078189146 | Bakser/My_Algorithm_Templates | 图论/生成树/Kruscal.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdlib>
using namespace std;
const int N(120);
struct hh{
int u,v,w;
bool operator <(const hh &b)const{
return w<b.w;
}
}edges[N*N];
int n,m,num,fa[N],ans,cnt;
inline int find(int x){
return x==fa[x]?x:fa[x]=find(fa[x]);
}
in... | ALGO | 0.999951 | 3.657573 |
211fcaf9-2d6a-41f3-9c2a-62def1cf193a | eezyl/code_zyl | codeforces/CF_1400_B.cpp | // =====================================================
// File : main.cpp
// Author : eezyl
// Synopsis: codeforces/atcoder template
// Address : https://codeforces.com/contest/1400/problem/B
// Date : 2020/08/25
// =====================================================
#pragma GCC optimize(... | ALGO | 0.999703 | 4.248368 |
f6c047e8-f5c0-4fcb-8b23-ed84b4343df4 | ishandutta2007/codeforces | riano_/normal/1426/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define Pr pair<ll,ll>
#define Tp tuple<ll,ll,ll>
using Graph = vector<vector<int>>;
#define double long double
const ll mod = 1000000007;
int main() {
std::ios::sync_with_stdio(false);
std::cin.ti... | ALGO | 0.999903 | 3.408639 |
7783bccc-c0b1-4c33-9ac0-0d0f573ea8b0 | Priyamesh/Leetcode_solutions | 718-maximum-length-of-repeated-subarray/718-maximum-length-of-repeated-subarray.cpp | class Solution {
public:
int findLength(vector<int>& nums1, vector<int>& nums2) {
int n=nums1.size();
int m=nums2.size();
int max_len=0;
vector<vector<int>>dp(n+1,vector<int>(m+1,0));
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
... | ALGO | 0.999981 | 5.908392 |
c3fb2655-954a-4ee9-a0ab-81482adc979d | Bonsaigin/UVa-Online-Judge | 756.cpp | /* Biorhythms
* http://uva.onlinejudge.org/external/7/756.html
* Chinese Remainder Theorem Problem
* Author: Ian Gibson
* 2/17/2015
*/
#define P_CYCLE 23
#define E_CYCLE 28
#define I_CYCLE 33
#include <stdio.h>
int mod_inv(int a, int m)
{
int m0 = m;
int temp, q;
int x0 = 0;
int x1 = 1;
if (m == 1) r... | ALGO | 0.999956 | 3.591775 |
465fb6fa-7983-49ea-925d-318ab1bbd6ad | JstMonika/VC | CodeBook/geometry/cp_geometry.cpp | #include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
double fcmp(double a, double b = 0, double eps = 1e-9) {
if (abs(a-b) < eps) return 0;
return a-b;
}
struct Point
{
double x, y;
Point() : x(0), y(0) {}
Point(double x, double y) : x(x), y(y) {}
Point operator+(Point b... | ALGO | 0.999829 | 4.147983 |
203ae477-4513-47f4-b42e-be8af19fc592 | divyam8175/Weekly_Update | 2204-find-subsequence-of-length-k-with-the-largest-sum/find-subsequence-of-length-k-with-the-largest-sum.cpp | class Solution {
public:
vector<int> maxSubsequence(vector<int>& nums, int k) {
priority_queue<int>p;
for(int i=0;i<nums.size();i++) {
p.push(nums[i]);
}
vector<int>ans;
unordered_map<int,int>mpp;
while(k--) {
mpp[p.top()]++;
p.pop(... | ALGO | 0.999993 | 5.529837 |
e331e496-bcb6-4081-9ca3-be546be56b90 | nickchen111/Leetcode | Backtrack/1254. Number of Closed Islands.cpp | /*
1254. Number of Closed Islands
*/
//DFS TC:O(m*n) SC:O(m*n)
class Solution {
public:
int closedIsland(vector<vector<int>>& grid) {
//dfs
int m = grid.size(); int n = grid[0].size();
//把邊邊的島嶼吃掉
for(int i = 0; i<m; i++){
DFS(grid, i, 0);
DFS(grid, i, n-1);
... | ALGO | 0.999937 | 6.017202 |
61e2fee4-ed35-4e5d-87d7-be2f6a71a1c7 | stevenbai0724/DMOJ-Solutions | Uncategorized/aac3/aac3p4.cpp | //https://dmoj.ca/problem/aac3p4
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
int n, m;
cin>>n>>m;
gp_hash_table<int, int>mp;
multiset<int>rows;
multiset<int>cols;
... | ALGO | 0.999931 | 3.879542 |
b0156a0a-4bd8-4d1d-89ad-7dd6be718abc | Lajith-Puthuchery/Cpp-Programs | Simple Substrings.cpp | #include <cstring>
#include <iostream>
using namespace std;
int main()
{
int n,i,j,len;
char str[100][100];
cin>>n;
for(i=0;i<n;i++)
{
cin>>str[i];
len=strlen(str[i]);
if(len==2)
{
cout<<str[i]<<endl;
}
else if(len%2==1)
{
... | ALGO | 0.99935 | 3.198176 |
c1c6abdb-20cd-42e3-9303-d501d2234e2a | parthtyagii/DSA-Codes | BuildHeapFromArray2.cpp | #include <iostream>
#include <vector>
using namespace std;
// Build Heap from Array...in-place...o(N).
bool minHeap = true;
bool compare(int a, int b)
{
if (minHeap)
{
return a < b;
}
else
{
return a > b;
}
}
void heapify(vector<int> &v, int idx)
{
int left = 2 * idx;
... | ALGO | 0.999877 | 4.897744 |
8305229b-5371-40b7-b37d-6650240389bd | vikramnagashoka/Path-Planning | src/Eigen-3.3/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.935109 | 4.152793 |
9a142fff-283a-41c2-aa9e-e537574ed80a | Tewatia5355/Lets_brew | 256_words.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:
void fun(int n, vector<string> &dict, vector<string> &ans, string s, int x, int y, string t)
{
if (y == s.size() + 1) // i... | ALGO | 0.999252 | 6.25766 |
8daba8f8-9844-4308-a532-d04abdf73c62 | nauflabhy/119_ConditonalStatement1 | nopal1.cpp | #include <iostream>
using namespace std;
float Luas, Panjang, Lebar;
void ProsedurHitungLuas(){
Luas = Panjang * Lebar;
}
int main()
{
cout << "Masukan Panjangnya : ";
cin >> Panjang;
cout << "Masukan Lebarnya : ";
cin >> Lebar;
ProsedurHitungLuas();
cout << "Luas Persegi Panjang : " << ... | TOOL | 0.870001 | 3.387149 |
ff0d489a-6d62-4be5-8b4f-455b5549d44d | younghoonyou/LeetCode | Graph/1192.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
using namespace std;
class Solution{
public:
int time;
vector<int> VisitTime, MinTime;
vector<bool> visit;
vector<vector<int>> Critical;
unordered_map<int, vector<int>> ans;//adj arr
void DFS(int cur, int parent){
... | ALGO | 0.999943 | 5.298788 |
a7ec44ec-7fbb-47b2-8f11-e22e34b29912 | hygoni/precise-leak-sanitizer | llvm/lib/Analysis/PostDominators.cpp | #include "llvm/Analysis/PostDominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/PassManager.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
#define DEBUG_TYPE "postdomtree"
#ifdef EXPENSIVE_CHECKS
sta... | TOOL | 0.987405 | 7.646368 |
23391e21-a074-4e20-99dc-9574d98dd77a | chomuscleguy/CodingTest | C++/프로그래머스/0/120810. 나머지 구하기/나머지 구하기.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int num1, int num2)
{
return num1%num2;
} | ALGO | 0.998762 | 4.609976 |
1a937ce5-c62d-4e83-b495-aa9a521c1287 | leekaka/leetcode | Linked_list/21-merge/21.merge-two-sorted-lists.cpp | /*
* [21] Merge Two Sorted Lists
*
* https://leetcode.com/problems/merge-two-sorted-lists/description/
*
* algorithms
* Easy (44.07%)
* Total Accepted: 447.1K
* Total Submissions: 1M
* Testcase Example: '[1,2,4]\n[1,3,4]'
*
* Merge two sorted linked lists and return it as a new list. The new list
* shou... | ALGO | 0.999958 | 5.574051 |
26ee2ab8-524d-4517-9535-026487a3bbf0 | PaukIsUha/optimizing_formating_code | predictions/submissions-aizu-cot-gpt4/Codenet/p01546/201193192/response_0.cpp | #include <bits/stdc++.h>
using namespace std;
#define for_(i, a, b) for (int i = (a); i < (b); ++i)
#define for_rev(i, a, b) for (int i = (a); i >= (b); --i)
typedef vector<int> Ary;
typedef vector<Ary> Mat;
struct Edge {
int to, c;
};
void maxUpdate(int &a, int b) { a = max(a, b); }
void mul(Mat &res, Mat &a, Mat &b... | ALGO | 0.999317 | 3.079572 |
f1252a0b-fc2d-49c8-aa5c-88d18114674f | ishandutta2007/codeforces | penguin1017/normal/1375/B.cpp | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define ll long long
#define lb(x) ((x)&-(x))
#define pii pair<int,int>
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define de(x) cout<<#x<<" x"<<endl
#define LCAFA rep(i... | ALGO | 0.999849 | 3.643009 |
baac8a09-e891-404d-8e3a-363afb5f4ae2 | firiexp/contest_log | codeforces/1328E.cpp | #include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;
template... | ALGO | 0.999985 | 4.737991 |
31614278-4882-419d-91fd-5af3f63915f0 | devloper016/Programming | 2444.cpp | class Solution {
public:
long long countSubarrays(vector<int>& nums, int minK, int maxK) {
long long ans = 0;
int minst =0 ,mxst=0,st=0;
bool mx=false,mn=false;
for(int i=0;i<nums.size();i++){
if(nums[i]<minK || nums[i]>maxK){
mx = false;
m... | ALGO | 0.999895 | 5.380694 |
8a8b75ae-2e6a-4dae-9b30-18d4252d53d5 | AArojas48/Assignment5 | Question 4/Solution.cpp | #include <iostream>
#include <climits>
using namespace std;
/* A path in a binary tree is a sequence of nodes where each pair of adjacent
* nodes in the sequence has an edge connecting them. A node can only
* appear in the sequence at most once. Note that the path does not
* need to pass through the root.
The pat... | ALGO | 0.999997 | 6.98696 |
cb4bacd8-fcad-4aa1-8bff-dee2d5252696 | kartik-py12/neoColab | DSA/unit 1/static/4.cpp | /*
Single File Programming Question
Problem Statement
You're an instructor managing a list of exam scores for a group of students. The scores are stored in an array, and you need to sort this array in ascending order so that you can easily identify the highest and lowest scores. You'll use two different sorting algori... | ALGO | 0.999935 | 6.562211 |
9b60abd7-2fea-4c53-985a-c3e03439a2f7 | DWitoslawski/DSA | Assignment3/main.cpp | /******************************************************************************
Name: Daniel Witoslawski
NSHE ID: 2000889468
Assignment 3: A program that will take input values from a txt file that represent
a binary tree and output if that tree is balanced or not. It will recursively
construct a binary tree... | ALGO | 0.992874 | 4.808712 |
15a37b32-2568-4d7c-93eb-411eaeebdf53 | kmjp/procon | codeforce/edu/021-040/026/c.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.998794 | 4.142207 |
ff6a2e06-29ef-4dda-ab8c-31c2ebfdc9ab | lechenyu/Arbalest-Vec | clang/lib/Sema/SemaConcept.cpp | #include "clang/Sema/SemaConcept.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaDiagnostic.h"
#include "clang/Sema/TemplateDeduction.h"
#include "clang/Sema/Template.h"
#include "clang/Sema/Overload.h"
#include "clang/Sema/Initialization.h"
#include "clang/AST/ExprConcepts... | ALGO | 0.984003 | 7.86757 |
a276c373-c5ea-4c57-8df7-e018916ad65d | manasbis10/code | D_Diagonal_Separation.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
int mod = 1e9+7;
int mod_add(int a, int b, int m) {return (a % m + b % m) % m;}
int mod_mul(int a, int b, int m) {return (a % m * b % m) % m;}
int mod_sub(int a, int b, int m) {return ((a % m - b % m) + m) % m;}
int bin_exp(int base, i... | ALGO | 0.99998 | 4.066735 |
133bd0cd-5af1-4317-84c5-170acb2a694a | Soloturkh/opencv_contrib | modules/face/src/eigen_faces.cpp | #include "precomp.hpp"
#include <opencv2/face.hpp>
#include "face_utils.hpp"
#include <set>
#include <limits>
#include <iostream>
namespace cv
{
namespace face
{
// Turk, M., and Pentland, A. "Eigenfaces for recognition.". Journal of
// Cognitive Neuroscience 3 (1991), 71–86.
class Eigenfaces : public EigenFaceRecogn... | ALGO | 0.955067 | 5.963815 |
c03172e8-95c7-4822-8622-8baf895acb99 | 2-tunaroll/CaveX_Summer_2025 | arachnida_ws/src/arachnida/src/robot_state/extendedKalmanFilter.cpp | // UNFINISHED
// Supposed to define all the functionality to run various sensor
// data through Extended Kalman Filters to improve measurement
// accuracy.
#include "robot_state/extendedKalmanFilter.h"
void arachnida::ExtendedKalmanFilter::ekfInit(EKF_t ekf) {
// Initialise matrices to zeroes
this->ekf.P = ... | ALGO | 0.997363 | 5.203413 |
d004703b-634d-4399-9b4c-029873393346 | TuringKi/llvm-project-12-wasi | libcxx/test/std/containers/sequences/forwardlist/forwardlist.modifiers/erase_after_one.pass.cpp | // <forward_list>
// iterator erase_after(const_iterator p);
#include <forward_list>
#include <cassert>
#include "test_macros.h"
#include "min_allocator.h"
int main(int, char**)
{
{
typedef int T;
typedef std::forward_list<T> C;
const T t[] = {0, 1, 2, 3, 4};
C c(std::begin(t), s... | TEST | 0.888202 | 5.68786 |
011d6cd5-f1a2-4c40-a7e7-7a4f838bb1de | williamm621/CodeWork | gradesavg.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
double scoreTotal1; // Using double for decimal answers
double scoreTotal2;
double scoreTotal3;
double scoreAverage; // Score average of all 3 tests
double scoreTotalofAllTests; // Total Sum of all tests
cout << "Test Score #1 "; // Test ... | ALGO | 0.967573 | 4.317487 |
f2cd062f-c375-4380-9ba9-f2baa71f404b | hlukare/DSA-Problem-Statements | Assignment_12.cpp | #include <iostream>
#include <algorithm>
#include<cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
const int MAX_STUDENTS = 10;
bool linearSearch(const int arr[], int size, int key) {
for (int i = 0; i < size; ++i) {
if (arr[i] == key) {
return true; // Found
}
}
... | ALGO | 0.999826 | 5.370055 |
add0d581-00a3-43ef-b2d5-61c4dcaa2f0e | rasauq1122/ProblemSolving | binary-search/BOJ2473.cpp | // 2020.07.07
#include <iostream>
#include <algorithm>
#include <memory.h>
#include <queue>
#include <stack>
#define pii pair<int,int>
#define ff first
#define ss second
#define ll long long
#define str string
#define V(T) vector<T>
#define pb push_back
#define PQ(T) priority_queue<T>
#define GPQ(T) priority_queue<T,v... | ALGO | 0.999986 | 3.808973 |
2dd1adb4-5d88-4b3b-ba2b-7fbda20ab9ee | minseo08/problem_solving | data_structures/17299.cpp | #include <iostream>
#include <stack>
#include <algorithm>
using namespace std;
int arr[1000000];
int ans[1000000];
int cnt[1000000];
stack<int> s;
int main() {
int n;
cin >> n;
for(int i = 0; i < n; i++){
cin >> arr[i];
cnt[arr[i]]++;
}
for(int i = n - 1; i >= 0; i--){
while... | ALGO | 0.999987 | 4.216647 |
16cf2615-3602-495d-84b2-8a5d70685760 | lizzzi111/stepik_c | 1_9_15.cpp | #include <iostream>
#include <cmath>
using namespace std;
int get_num_throws(int level)
{
if (level < 2)
return 0;
return ceil(0.5*sqrt(1+8*(level - 1))-0.5);
}
int get_num_throws2(int level)
{
int num_throws = 0;
long max_level = 1;
while (max_level < level)
max_level += ++num... | ALGO | 0.9994 | 3.62833 |
bd8439d7-0198-4659-bc7d-03e95ed5ebab | AmanJee-BITS/leetcode-gfg-solutions | 241-different-ways-to-add-parentheses/different-ways-to-add-parentheses.cpp | class Solution {
private:
bool helper(char ch) { return ch >= '0' and ch <= '9'; }
public:
vector<int> diffWaysToCompute(string expression) {
vector<int> ans;
if (expression.size() == 0)
return ans;
if (expression.size() == 1 or
(expression.size() == 2 && helpe... | ALGO | 0.999983 | 6.264846 |
b4f1f1eb-033d-4555-9b4b-57368e20aac6 | CppNest/Backpack-problem-with-time-constraints | AlgorytmZachlannyUlosowiony.cpp | // Algorytm Zachłanny Ulosowiony
// Algorytm Zachłanny Ulosowiony wykorzystuje Generator Danych Losowych, który najpierw wyświetla wylosowane dane, a następnie prezentuje wynik. Algorytm stosuje identyczną strategię jak Algorytm Zachłanny.
#include <iostream>
#include <vector>
#include <algorithm>
#include "GeneratorD... | ALGO | 0.999459 | 6.04069 |
19540334-72f1-428f-a89b-b9d12226a504 | coding-ninja-dsa-competitive-package/codig-ninja-dsa-learning | 03-competitive-programming/modules/012-Dynamic-Programming/code-part-2/004-Boredom.cpp | #include<bits/stdc++.h>
using namespace std;
/**
* Boredom
* - Gary is bored and wants to play an interesting but tough game . So he
* figured out a new board game called "destroy the neighbours" . In this
* game there are N integers on a board. In one move, he can pick any integer
* x from... | ALGO | 0.999819 | 4.607061 |
d6714f53-91ec-4cd4-9ee5-6c000fe1d2ad | rayan1242/DSA_PREP | following the string.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
void solve(vector<int>& a, int n) {
unordered_map<int, int> m;
for(int i = 0; i < n; i++) {
cout << static_cast<char>('a' + m[a[i]]);
m[a[i]]++;
}
cout << endl; // Add a newline after processing each tes... | ALGO | 0.999207 | 4.822898 |
d3d92742-ddf0-4683-90bd-9dfa828ab3ef | ShashiShekharSuman/DSA | minimum_weighted_subgraph_with_required_paths.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
vector<long long> dijkstra(int src, int n, vector<vector<int>> adj[])
{
vector<long long> dist(n, LLONG_MAX);
priority_queue<pair<long long, int>, vector<pair<long long, int>>, greater<pair<long long, int>>> pq;
dist[src] = ... | ALGO | 0.999965 | 6.249595 |
fa1594a3-ad41-43ef-985c-074463895b69 | sarvex/leetcode-c-sharp | solution/1600-1699/1657.Determine if Two Strings Are Close/Solution.cpp | class Solution {
public:
bool closeStrings(string word1, string word2) {
int cnt1[26]{};
int cnt2[26]{};
for (char& c : word1) {
++cnt1[c - 'a'];
}
for (char& c : word2) {
++cnt2[c - 'a'];
}
for (int i = 0; i < 26; ++i) {
if... | ALGO | 0.999992 | 5.880924 |
5eae2ae5-15f9-4c5f-8d48-cdc937aa0304 | igor-pavkov/honours-2024 | Code Examples/DiverseVul Filtered/Vulnerable/7e4cae1d2f555cbe9226b377aff4b56c9f7ddd4d.cpp | int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
{
int ret=0;
int top,al,bl;
BIGNUM *rr;
#if defined(BN_MUL_COMBA) || defined(BN_RECURSION)
int i;
#endif
#ifdef BN_RECURSION
BIGNUM *t=NULL;
int j=0,k;
#endif
#ifdef BN_COUNT
fprintf(stderr,"BN_mul %d * %d\n",a->top,b->top);
#endif
bn_check... | ALGO | 0.999359 | 5.156986 |
f24abd66-0b6f-4f88-87e9-215aeba23c10 | MateuszPuto/Cpp_learning | pi_monte_carlo.cpp | #include <iostream>
#include <ctime>
#include <cmath>
#include <cstdlib>
#include <iomanip>
using namespace std;
void pi(int ile_razy);
int main()
{
int ile;
cout << "Podaj ilosc punktow do obliczenia liczby pi: " << endl;
cin >> ile;
pi(ile);
}
void pi(int ile_razy)
{
double x, y, kolo = 0;
srand(time(NULL)... | ALGO | 0.998341 | 4.297381 |
2e181a1a-c244-4d32-a603-cd5f06b7f5df | ISOLDE-Project/riscv-llvm | libc/src/math/nvptx/floorf.cpp | #include "src/math/floorf.h"
#include "src/__support/common.h"
namespace LIBC_NAMESPACE {
LLVM_LIBC_FUNCTION(float, floorf, (float x)) { return __builtin_floorf(x); }
} // namespace LIBC_NAMESPACE
| ALGO | 0.956673 | 5.218593 |
d57ad6ad-da5b-49e5-8ed1-177cffb74d24 | ishandutta2007/codeforces | fsouza/normal/197/A.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <numeric>
#include <utility>
using namespace std;
typedef long long lint;
int main() {
int a, b, r;
scanf("%d %d %d", &a, &b, &r);
if (a >= 2*r && b >= 2*r) printf("First\n... | ALGO | 0.999806 | 3.66325 |
b9fc1210-6df5-45ef-8366-c6f2010b2dcb | fciapsa/Competitive-Programming | CodeForces/1324AYetAnotherTetrisProblem.cpp | #include <iostream>
#include <vector>
int main() {
int T, min, n, x;
bool ok;
std::cin >> T;
for (int i = 0; i < T; ++i) {
min = 100;
std::cin >> n;
std::vector<int> v(n);
for (int j = 0; j < n; ++j) {
std::cin >> x;
if (x < min)min = x;
v[j] = x;
}
ok = true;
for (int j = 0; j < n && ok; ++... | ALGO | 0.999311 | 4.84871 |
fc932a75-21eb-485d-b10e-f8e4cc7c8672 | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J01574/poker/poker.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n;
ll f[5][14];
string s;
ll check(char t){
if(t>='0'&&t<='9'){
return t-'0';
}else{
if(t=='T'){
return 10;
}
if(t=='J'){
return 11;
}
if(t=='Q'){
return 12;
... | ALGO | 0.990502 | 3.243464 |
88acc951-1a92-4e7e-b934-411f5afb13eb | ashmit0920/DAA-Lab-Assignments | Assignment 1/MergeSort-Iterative.cpp | #include <bits/stdc++.h>
using namespace std;
void merge(int arr[], int l, int m, int r);
int min(int x, int y) { return (x<y)? x :y; }
void mergeSort(int arr[], int n)
{
int curr_size;
int left_start;
for (curr_size=1; curr_size<=n-1; curr_size = 2*curr_size)
{
for (left_start=0; left_start<n-1; left_start += 2*c... | ALGO | 0.999991 | 5.403074 |
be7f990f-4e12-46d3-9d23-3958378165d6 | venkateshraju04/dsa-leetcode | 70-climbing-stairs/climbing-stairs.cpp | class Solution {
public:
int climbStairs(int n) {
if(n==1 || n==0)return 1;
vector<int>dp(n+1);
dp[0]=dp[1]=1;
for(int i=2;i<=n;i++){
dp[i]=dp[i-1]+dp[i-2];
}
return dp[n];
}
}; | ALGO | 0.999982 | 5.961718 |
bc7c20f4-c95a-4413-9ee5-8e408dd867dd | iamsile/ACM | The Game of 31-博弈sg.cpp | #include <iostream>
using namespace std;
int sg[16000],h[7];
int dfs(int s)
{
if(sg[s]!=-1)
return sg[s];
int i,j,k,b[10],sum=0;
memset(b,0,sizeof(b));
for(i=1;i<=6;i++)
sum+=h[i]*i;
for(i=1;i<=6;i++)
if(h[i]<4&&i+sum<=31) {
++h[i];
for(j=1,k=0;j<=6;... | ALGO | 0.999278 | 3.829073 |
45d006b9-7d9f-46f4-94bc-1c019ff08faf | ALeonidou2005/Competitive-Programming | DP/DP Standard Problem Solutions/DP Coins - Iteratively/dPCoins-Iteratively.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;
#define ll long long
#define llu unsigned long long
#define F first
#define S second
#define endl "\n"
#define sortVct(a) sort (a.begin(), a.end())
#de... | ALGO | 0.999991 | 4.388057 |
8695bc84-c5cd-4d09-b54c-75ba1f95b420 | sohil318/programmingProblems | btMirrorCreate.cpp | #include <iostream>
#include <stack>
using namespace std;
typedef struct Node {
int val;
Node *leftChild;
Node *rightChild;
} Node;
Node* newNode(int data)
{
Node *temp = new Node;
temp->val = data;
temp->leftChild = NULL;
temp->rightChild = NULL;
return temp;
}
Node* createTree()
{
... | ALGO | 0.999954 | 6.056694 |
63dfd9e2-ab55-45ec-a8da-84fdc9d6261e | cpp-benchmark1/OrcaSlicer | src/libigl/igl/sparse_cached.cpp | #include <iostream>
#include <vector>
#include <array>
#include <unordered_map>
#include <map>
#include <utility>
template <typename DerivedI, typename Scalar>
IGL_INLINE void igl::sparse_cached_precompute(
const Eigen::MatrixBase<DerivedI> & I,
const Eigen::MatrixBase<DerivedI> & J,
Eigen::VectorXi& data,
Eig... | ALGO | 0.996628 | 5.982346 |
488d626c-7544-4ab7-bc8d-debea51f4862 | CHOcho-quan/OJ-Journey | LeetCode/Leetcode1029_贪心两地调度.cpp | #include <iostream>
#include <vector>
#include <set>
#include <stack>
#include <algorithm>
#include <queue>
#include <cmath>
using namespace std;
int twoCitySchedCost(vector<vector<int>>& costs) {
vector<int> comp;
int result = 0;
for (int i = 0;i < costs.size();i++) {
comp.push_back(costs[i]... | ALGO | 0.999966 | 5.840155 |
bd5716ca-3a68-4468-8d93-1fc90b0a4951 | dangbach3107/PTIT_Data_Structure_and_Agorithm | CTDL_003 - PHƯƠNG ÁN TỐI ƯU.cpp | #include <bits/stdc++.h>
#define f0(i, a) for(int i = 0; i < a; i++)
#define f1(i, a) for(int i = 1; i <= a; i++)
#define read freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define ll long long
using namespace std;
void solve(){
int n, w; cin >> n >> w;
int a[n], c[n];
for(auto &x :... | ALGO | 0.999986 | 3.367951 |
d1b07ad0-9fcc-4cb1-b7b4-a711f53121f5 | polyester-CTRL/procon-archive | atcoder.jp/abc073/abc073_d/Main.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
struct Node {
vector<int> edge_to;
vector<int> edge_fro... | ALGO | 0.999971 | 4.308805 |
b04c2a59-8c52-46f3-afe5-22136f828b6f | MakotoIchinose/blender-invasion | intern/cycles/bvh/bvh_sort.cpp | #include "bvh/bvh_sort.h"
#include "bvh/bvh_build.h"
#include "util/util_algorithm.h"
#include "util/util_task.h"
CCL_NAMESPACE_BEGIN
static const int BVH_SORT_THRESHOLD = 4096;
struct BVHReferenceCompare {
public:
int dim;
const BVHUnaligned *unaligned_heuristic;
const Transform *aligned_space;
BVHRefer... | ALGO | 0.999339 | 6.766097 |
7fa719c3-e7b2-492e-816b-410a05812e0f | s-kachroo/SamsungPractice | sinkhole.cpp | /*
https://www.geeksforgeeks.org/samsung-competency-test-25-aug-19/
*/
/*
----IIT(ISM) Dhanbad----
Author: Siddhant Choudhary
--samsumg coding test--
Q.There is a large plot with various sinkholes present.
Since one sinkhole can combine with another sinkhole, it is required to get
at most one sinkhole while ... | ALGO | 0.999689 | 3.983438 |
51c182a2-60c0-4c62-939e-0d4a47b0eac2 | Orgoutsider/CarGo | src/zxing-ros/zxing/src/zxing/qrcode/decoder/BitMatrixParser.cpp | #include <zxing/qrcode/decoder/BitMatrixParser.h>
#include <zxing/qrcode/decoder/DataMask.h>
namespace zxing {
namespace qrcode {
int BitMatrixParser::copyBit(size_t x, size_t y, int versionBits) {
return bitMatrix_->get(x, y) ? (versionBits << 1) | 0x1 : versionBits << 1;
}
BitMatrixParser::BitMatrixParser(Ref<Bi... | ALGO | 0.967271 | 5.189961 |
af3fb002-dc05-43ff-b6b4-6721728b2ad1 | ian-mboya/stroller_final | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.