uuid stringlengths 36 36 | repo_name stringlengths 5 133 | relative_path stringlengths 3 3.76k | content stringlengths 282 4.03M | category stringclasses 6
values | algo_rel_score float32 0.9 1 | quality_score float32 3 8.13 | source_meta dict |
|---|---|---|---|---|---|---|---|
353f5453-c7b3-426f-b1a2-24bec77d14c2 | pi-rate14/C-codes | Leetcode/DFSandBFS/FloodFill.cpp | #include <bits/stdc++.h>
using namespace ::std;
class Solution
{
public:
void dfs(int i, int j, int source, int newColor, vector<vector<bool>> &visited, vector<vector<int>> &image)
{
if (i < 0 or j < 0 or i >= image.size() or j >= image[0].size() or visited[i][j] == 1 or image[i][j] != source)
... | ALGO | 0.99983 | 6.10826 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2020-02-01T09:54:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd5e0d5c1... |
2b5b9d5a-f4f2-4f45-a1a4-e97891e25323 | Micuks/code | kb_ans/topic4/t4ph/t4ph.hpp | #ifndef _t4ph_20191221_
#define _t4ph_20191221_
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
const int MAXC = 1024;
int cow_co... | ALGO | 0.999961 | 3.167421 | {
"github_metadata": {
"branch": "master",
"commit_count": 541,
"repo_created_at": "2020-11-12T05:37:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54f65174... |
64cd6f79-f77c-43ac-a239-40dfed5002c6 | GabrielBejar/CCOMP2_2023-2 | Ejercicios/Ejer_Cocktail.cpp | #include <iostream>
using namespace std;
void camb(int* p, int* q) {
int temp = *p;
*p = *q;
*q = temp;
}
void cocktail(int* ini, int* fin) {
bool cambiado = true ;
while (cambiado && ini < fin) {
int x = 0;
for (int* i = ini; i < fin; i++) {
if (*i > *(i + 1)) {
... | ALGO | 0.999883 | 4.707472 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-23T06:24:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74ab621d0fc4... |
c962b3ba-6fb9-45a2-88af-ca1ddb125c2c | joaogui1/Competitive-Programming | Miscelany/horrible_queries.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
//----------------------------
#define MAXN 100100
#define Left(x) x << 1
#define Right(x) (x << 1) + 1
long long int tree[4*MAXN];
long long int lazy[4*MAXN];
//----------------------------
long long int query(long long int node, long long ... | ALGO | 0.999817 | 3.877242 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2018-06-15T16:37:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1bc77358... |
02283d95-9e3f-47e2-8b46-6285bf7e8ad6 | BhishamGahlaut805/C_CPP_DSA_Algorithms | linkedlist/questionll.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
// 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) {}
}... | ALGO | 0.99997 | 6.417524 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-04-25T13:24:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0796176d00b4... |
31f0fec5-edbe-41de-be82-1b6a13dae7bd | rslinford/DWC_CS217_Data-Structures-and-Algorithms | Structures/sortedlinkedlist.h | /*! \file sortedlinkedlist.h
* \brief Header file for class container::SortedLinkedList
*
* \section svn Source Control
*
* $URL: http://tablet-001/svn/DWC/CS217/trunk/Structures/sortedlinkedlist.h $
* $Date: 2009-06-16 20:52:47 -0400 (Tue, 16 Jun 2009) $
* $Author: slinford $
* $Revision: 418 $
*
* \sec... | TOOL | 0.970821 | 6.940652 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-10-17T16:35:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2224f7ffa4... |
9a922547-5771-4561-91ad-d1e97d9aaf19 | vinukohshawenn/DataStruct | lab6/infxpostfx.cpp | #include <iostream>
#include <cctype> // For isdigit()
#include <cstring> // For string functions
#include "Stack.h" // Include the Stack ADT
using namespace std;
string infixExpression;
string postfixExpression;
// Function prototypes
int precedence(char op);
bool isOperator(char ch);
string infixToPostfix(stri... | ALGO | 0.998402 | 5.575243 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2025-05-04T12:44:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a55bc506782... |
d16010b5-726a-4bf4-a571-0ce2d45cd86c | EhsanGhasemii/AlgorithmHub | two-sum/main.cpp | #include <iostream>
#include "../include/algorithm.h"
#include "../include/vector.h"
#include <vector>
#include <cstdint>
#include <limits>
#include <algorithm>
#include <unordered_map>
class Solution { // O(n^2)
public:
std::vector<int> twoSum(std::vector<int>& nums, int target) {
for (uint32_t i = 0; ... | ALGO | 0.999985 | 5.610024 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-10-20T08:33:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f31d218132be... |
39dc8e76-ef09-43d8-acd5-0d8fb26c718c | Edith-3000/Algorithmic-Implementations | Strings/String Matching(or Searching) Algorithms/Rabin-Karp Algorithm/Rabin-Karp Algorithm.cpp | // PROBLEM STATEMENT: Problem: Given two strings - a pattern and a text, determine if the pattern appears
// in the text and if it does, enumerate all its occurrences in O(|n|+|m|) time.
// n = text length, m = pattern length.
/**********************************... | ALGO | 0.999893 | 5.927056 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2020-07-24T04:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8910b32... |
8aa493a9-5014-42f6-9633-d32c0eb8ed1d | HHayk004/Chessnoor_Tasks | EnumsStructsAndSort/func.cpp | #include "func.h"
void sortInput(SortType& sort)
{
int sort_option_int = 0;
do
{
std::cout << "Enter the sorting Algotithm (0 for Selection, 1 for Bubble)";
std::cin >> sort_option_int;
} while (0 < sort_option_int && sort_option_int > 1);
sort.sort_option = static_cast<SortingAlgo... | ALGO | 0.993719 | 5.076341 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-02-23T15:03:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8a34329d59... |
71503426-7ad3-4a15-bc61-7098b6c3a4ab | JackLee404/CompetitivePrograming | Book1/c4-4-3.cpp | #include <iostream>
#include <cstring>
#define F(i, j, k) for (int i = j; i <= k; ++ i)
using namespace std;
int n, m, k;
void solve(){
bool vis[30];
memset(vis, 0, sizeof(vis));
int tot = 0, foot1 = 1, foot2 = n;;
while (tot < n){
F(i, 1, k){
if (vis[foot1]) i --;
if (i != k){
foot1 ++;
if (foot1 ... | ALGO | 0.999808 | 3.189791 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2022-07-10T08:35:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e60083dc3e... |
1b2d19d5-ad57-4950-8aed-f2ccfc8519c3 | huanggangfeng/Leetcode | Cpp/链表/面试题 02.01. 移除重复节点.cpp | // 编写代码,移除未排序链表中的重复节点。保留最开始出现的节点。
// 示例1:
// 输入:[1, 2, 3, 3, 2, 1]
// 输出:[1, 2, 3]
// 示例2:
// 输入:[1, 1, 1, 1, 2]
// 输出:[1, 2]
// 提示:
// 链表长度在[0, 20000]范围内。
// 链表元素在[0, 20000]范围内。
// 进阶:
// 如果不得使用临时缓冲区,该怎么解决?
// 来源:力扣(LeetCode)
// 链接:https://leetcode-cn.com/problems/remove-duplicate-node-lcci
// 著作权归领扣网络所有。商业转... | ALGO | 0.999966 | 5.637504 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2020-09-07T02:52:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d8ce747a... |
91493d64-c991-4a1b-a7d8-f5057d81c7e1 | ishandutta2007/codeforces-f | flashmt/normal/75/B.cpp | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#define fr(a,b,c) for (a=b;a<=c;a++)
using namespace std;
struct rec { string s; int d;};
string s;
rec a[222];
int m,n,d[222];
int find()
{
int i;
fr(i,1,n)
if (a[i].s==s) return i;
return 0;
}
bool cmp(rec i,rec j)
{
re... | ALGO | 0.999133 | 3.341617 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7615f576536... |
b06a0f55-27f5-4efe-8a39-cb3fc720688f | aajjbb/contest-files | Notebook/src-bkp/Maximum Flow.cpp | const int MAXN = 101010;
const int INF = 101;
struct edge {
int to,rev;
Int cap;
edge(int to, Int cap, int rev): to(to), cap(cap), rev(rev) {}
};
vector<edge> G[MAXN];
Int level[MAXN];
int iter[MAXN];
void init(int N) {
for (int i = 0; i < N; i++) {
G[i].clear();
}
}
void add_edge(int fr... | ALGO | 0.996007 | 3.791504 | {
"github_metadata": {
"branch": "master",
"commit_count": 892,
"repo_created_at": "2016-03-02T13:05:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2569d51d... |
b2d04edd-7752-495e-abb2-37d3bc4df725 | sam-mcanelly/homecoming_timer | db_sort.cpp | #include "db_sort.h"
void DB_Sort::sort(Student *s_ptr, int student_count, sort_by attribute)
{
sort(s_ptr, attribute, 0, student_count - 1);
}
void DB_Sort::sort(Student *s_ptr, sort_by attribute, int low, int high)
{
if (high <= low)
return; //if done, exit
int j... | ALGO | 0.999374 | 5.298245 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2015-05-24T18:23:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c88a5391a... |
e3d7d43f-ba28-4e44-a3ad-ac1a354cc141 | nievesnu/FAL | 1. ITERATIVOS/EJ4/04plantilla.cpp | // Nombre del estudiante.
// Usuario <NAME>.
#include <iostream>
#include <fstream>
#include <vector>
// Explicación del algoritmo utilizado
// Coste del algoritmo utilizado
std::vector<int> resolver(std::vector<int>const& v1, std::vector<int>const& v2) {
// Declaración de variables
// Codigo del alumno
... | ALGO | 0.999993 | 3.86004 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-11-23T17:11:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1812d6ec6900... |
db86a0da-5631-438c-abd2-67eb941e2026 | Pankajcoder1/Competitive_Programming | LeetCode/2447.Number_of_Subarrays_With_GCD_Equal_to_K.cpp | /*
written by <NAME>.
country:-INDIA
*/
typedef long long ll ;
/* ascii value
A=65,Z=90,a=97,z=122
*/
/* --------------------MAIN PROGRAM----------------------------*/
// to run ctrl+b
const ll INF=1e18;
const ll mod1=1e9+7;
const ll mod2=998244353;
// Techniques :
// divide into cases, brute force, pattern... | ALGO | 0.999797 | 5.347429 | {
"github_metadata": {
"branch": "master",
"commit_count": 537,
"repo_created_at": "2020-06-07T13:07:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f091c3... |
323edbcd-beb3-4912-b028-1f97dbd9ab61 | hmyld/Codes | 导论作业二分搜索.cpp | // 如果不能使用STL,希望您能告知我
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
// 这个函数用来快速读入int
int read() {
int x = 0, w = 1;
char ch = 0;
while (ch < '0' || ch > '9') {
if (ch == '-') w = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') {
x = x * 10 + ... | ALGO | 0.999931 | 3.786579 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-04T13:52:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5eee6b371b3d... |
4ebf5789-a24b-41e0-bdd1-57b30b0205b6 | sachuverma/DataStructures-Algorithms | DSA Crack Sheet/solutions/Minimum number of jumps.cpp | /*
Minimum number of jumps
=======================
Given an array of integers where each element represents the max number of steps that can be made forward from that element. Find the minimum number of jumps to reach the end of the array (starting from the first element). If an element is 0, then you cannot move thro... | ALGO | 0.999997 | 5.279169 | {
"github_metadata": {
"branch": "master",
"commit_count": 1430,
"repo_created_at": "2020-10-07T10:08:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2049,
"forks": 541,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f... |
d218022b-31a9-4989-a0d2-cd1e9d697ac2 | gun0317/Algorithm-Problems | BaekJoon/12100 2048(Easy).cpp | #include <iostream>
#include <string.h>
using namespace std;
int N, map[22][22], localMap[22][22], localArr[22][22], path[6], ans;
void copy() {
for (int r = 0; r < N; r++)
for (int c = 0; c < N; c++)
localMap[r][c] = map[r][c];
}
int calculate() {
int localVal = 0;
for (int r = 0; r < N; r++)
for (int c = 0... | ALGO | 0.999904 | 4.081831 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2018-08-04T11:35:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d87587fa... |
36746617-2c25-48e0-84e4-8b0dbdebc17c | CypherKingdom/Leetcode | prob88.cpp | /*
Easy: Merge Sorted Array
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n,
representing the number of elements in nums1 and nums2 respectively.
Merge nums1 and nums2 into a single array sorted in non-decreasing order.
The final sorted arra... | ALGO | 0.999991 | 6.62098 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-04-09T10:54:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d89e1212552... |
2f935b3a-a5a9-4769-8164-75a6cb22e094 | live-clones/gmsh | contrib/hxt/Combine/src/combine_quality.h | #ifndef HXT_COMBINE_QUALITY
#define HXT_COMBINE_QUALITY
#include "basic_types.h"
#include "cell_types.h"
#include <float.h>
/**
* \file combine_quality.h Fast evaluation of H1 cells at corners
*/
namespace HXTCombine{
/**
* Approximate quality of a cell computed from the quality at its corners.
* \pre The numb... | ALGO | 0.99629 | 6.289622 | {
"github_metadata": {
"branch": "master",
"commit_count": 21787,
"repo_created_at": "2017-03-24T07:32:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 107,
"forks": 44,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcc8... |
80c745fb-6479-448e-b254-54f821e7ae93 | DEVANGBAJPAI23/DS-LAB-WORK-DEVANG-BAJPAI | 46 height of tree.cpp | #include <iostream>
#include <queue>
#include <bits/stdc++.h>
using namespace std;
class node{
public:
int data;
node* left;
node* right;
node(int d){
this -> data = d;
this -> left = NULL;
this -> right = NULL;
}
};
node* buildingtree(node*root){
int data;
cout <... | ALGO | 0.99983 | 4.217536 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2023-10-14T16:17:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8d075a1a4... |
c5a3cf00-e39a-40eb-8c53-b6bf342c96cb | microsoft/EdgeML | tools/SeeDot/seedot/compiler/codegen/dlx/src/main.cpp | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#include "dlx.h"
#include <string>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
DLX* solver;
int numElements;
int numToBeCovered;
int numSubsets;
cin >> numElements;
cin >> num... | ALGO | 0.998188 | 5.032408 | {
"github_metadata": {
"branch": "master",
"commit_count": 890,
"repo_created_at": "2017-08-02T11:27:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1632,
"forks": 381,
"issues": 14,
"pull_requests": 22
},
"file_meta": {
"content_id": "95... |
c4126394-8c38-42ad-a25b-2a754b92a4d2 | thinant/SchoolProjects | IntroductionToCode/Chapter04/PracticesAdvanced/TASK02/Task02.cpp | #include <stdio.h>
void nhapSoNguyen(unsigned int&, char, unsigned int);
bool kiemtraTangDan(unsigned int, unsigned int);
bool kiemtraThuTu(unsigned int);
int main()
{
unsigned int n = 0, gioiHan = 100000;
nhapSoNguyen(n, 'n', gioiHan);
bool coThuTu = kiemtraThuTu(n);
if (coThuTu) printf("%u la so co thu tu.", ... | ALGO | 0.995862 | 3.048958 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2024-03-04T11:17:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38e77aaffd0... |
0c444879-9f86-492e-bf2c-33a6f0138ea5 | ishandutta2007/codeforces-i | interestinglsy/normal/1305/D.cpp | // InterestingLSY
// codeforces&github: interestingLSY, qq: 2659723130
//
#ifdef intLSY
#include <intlsy/stdc++.h>
#else
#include <bits/stdc++.h>
#endif
#include <bits/c++0x_warning.h>
using namespace std;
#define il inline
#define elif else if
// Type
#define ld double
#define ll long long
#define ull unsigned ll
/... | ALGO | 0.999798 | 3.44426 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0131b2ffb0e9... |
b00a84b6-9b1b-4074-aed5-ccb5184844d9 | shapnesht/Graph-Algorithms | Graphs/topologicalSortBFS14KahnsAlgo.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> toposort(vector<int> adj[],int n) {
queue<int> q;
int inDegree[n+1];
memset(inDegree, 0, sizeof(inDegree));
vector<int> ans;
for (int i = 0; i <= n; i++)
{
for(auto it : adj[i]) {
inDegree[it]++;
}
}
... | ALGO | 0.999996 | 5.027369 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-01-25T17:48:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b5f6fceccc6... |
b3258ad7-5499-45fa-afcd-d6b96ae2fac0 | lanahuong/ips-prod | src/Basis.cpp | #include "Basis.h"
#include "Poly.h"
#include "constants.h"
Basis::Basis(double BR, double BZ, int N, double Q)
: br(BR), bz(BZ), mMax(calcMMax(N, Q)), nMax(calcNMax()), n_zMax(calcN_zMax(N, Q)) {}
Basis::Basis(double BR, double BZ, int N, double Q, const arma::vec &rVals, const arma::vec &zVals)
: Ba... | ALGO | 0.984837 | 5.971819 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2021-02-16T18:14:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1060141e... |
78c38abf-c5cd-459e-8f82-b32496c1f158 | sachuverma/DataStructures-Algorithms | Leetcode Daily Challenge/May-2021/16. Binary Tree Cameras.cpp | /*
Binary Tree Cameras
===================
Given a binary tree, we install cameras on the nodes of the tree.
Each camera at a node can monitor its parent, itself, and its immediate children.
Calculate the minimum number of cameras needed to monitor all nodes of the tree.
Example 1:
Input: [0,0,null,0,0]
Output: 1
... | ALGO | 0.999992 | 6.790736 | {
"github_metadata": {
"branch": "master",
"commit_count": 1430,
"repo_created_at": "2020-10-07T10:08:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2049,
"forks": 541,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba... |
02a61751-7e44-4ec5-80e5-b17eb23f6c99 | EmptyDust/Algorithm-Codes-and-writeups | codes/-0x30_competition/-0x39_xcpc/ccpc_2024_online/I.cpp | #include <bits/stdc++.h>
#define ranges std::ranges
#define views std::views
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;
using pii = std::pair<int, int>;
using a3 = std::array<int, 3>;
using a4 = std::array<int, 4>;
const int N = 1e6;
const int MAXN = 1e6 + 10;
const int inf = 1e9;
... | ALGO | 0.999979 | 4.267339 | {
"github_metadata": {
"branch": "main",
"commit_count": 172,
"repo_created_at": "2023-11-03T02:38:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0301d75e86... |
c498d444-44e4-407b-8772-0901fe6cd09d | GQH123/Renatus-ACM-Codes | 2020 China Collegiate Programming Contest Weihai Site/H.cpp | #pragma GCC optimize(3)
#include <bits/stdc++.h>
#define rep(i, l, r) for (register int i = l; i <= r; i++)
#define per(i, r, l) for (register int i = r; i >= l; i--)
#define srep(i, l, r) for (register int i = l; i < r; i++)
#define sper(i, r, l) for (register int i = r; i > l; i--)
#define erep(i, x) for (register in... | ALGO | 0.999956 | 3.837878 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-08-17T06:57:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "426ffa4ddd... |
4d820b03-5391-492e-a6cf-7065ec4fad98 | hillstoneUnited/hillstoneUnited | hillstoneUnited/MakeWalk/legvelocity.cpp | // Copyright (c) 2012 Team ODENS,
// Masutani Lab., Osaka Electro-Communication University
// Author: <NAME>
// Date: 2012/09/07
#include"makewalk.hpp"
/*---------------------------------------------------------------------------------------------------------------*/
//@brief 各関節のシミュレータへ送る指令値を作成する
//@param[in] doub... | TOOL | 0.966286 | 4.227003 | {
"github_metadata": {
"branch": "master",
"commit_count": 238,
"repo_created_at": "2012-05-17T08:10:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "55126e829... |
3ed7f374-8115-404d-beb2-257f78218c73 | damian0390/Extended-stack | Program.cpp | #include <iostream>
#include <stack>
template<class T>
class MyStack : public std::stack<T>{
public:
void push_to_down(T new_elem){
reverse_to_temp();
this -> push(new_elem);
reverse_back();
}
void pop_from_down(){
if (this -> empty()){
std::cout<<"stack is empty"<<std:... | ALGO | 0.986019 | 4.721169 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-02T11:52:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66a0b377915d... |
b15fe413-943b-4ac7-bfb8-8398315eed33 | ROCm/OpenFOAM_HMM | src/fvOptions/sources/derived/actuationDiskSource/actuationDiskSource.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-----------------------------------... | ALGO | 0.960284 | 6.588867 | {
"github_metadata": {
"branch": "suyash/hmm",
"commit_count": 25733,
"repo_created_at": "2022-10-27T12:31:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b8... |
ce463a46-0bcd-4059-9214-c6999be6c52a | GalaxyIgor/C04-AlgoritmosIII | C04 - Algoritmos III/Modelos/DFS/Modelo, Lista Adj.cpp | #include<iostream>
#include<list>
#define MAX_V 100
using namespace std;
struct Aresta {
int origem, destino;
};
// Função DFS utilizando lista de adjacência
void dfsLista(list<Aresta> grafo[], int vertices, int origem, bool visitado[]) {
visitado[origem] = true;
list<Aresta>::iterator it;
// Percor... | ALGO | 0.999949 | 5.54755 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-08-09T01:52:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e017fa3a753... |
ab7c4747-db87-4935-9ff0-fdcf16112f21 | GRAYCN/DiskSpa | src/compute/array/arraystomerge.h | #ifndef ARRAYSTOMERGE_H
#define ARRAYSTOMERGE_H
#include "../../common.h"
#define _CAPACITY_VALUE 8 // TODO: modify this number
#define CAPACITY_VALUE 8 // TODO: modify this number
namespace myarray {
class ArraysToMerge {
/* turn vector<vector> to 1D array
* faster and smaller(RAM)
*/
private:
vertexid_t... | ALGO | 0.969527 | 4.280272 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-01-23T06:47:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "618f1bc28b... |
78a7b923-0cf9-4576-89ac-eb47b16a91c4 | Gun777veer/LeetCode | Daily_Ques/maximum_count.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int maximumCount(vector<int>& nums) {
int n = nums.size();
// Find the first positive number using binary search
int left = 0, right = n - 1, firstPositive = n;
while (left <= right) {
... | ALGO | 0.99999 | 6.103502 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2023-03-21T13:48:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98405d4c99... |
7434cfb7-ba5b-437c-bf7c-482ad3f9b44e | protik0939/BeeCrowd-Problem-Solving | Array_Simple_Data_Structure/BeeCrowd_1184_Below_the_Main_Diagonal.cpp | #include <bits/stdc++.h>
#define somoy \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
typedef long long int ll;
using namespace std;
int main()
{
somoy;
double a[12][12];
char c;
cin >> c;
double sum = 0;
for (int i = 0;... | ALGO | 0.998547 | 3.569034 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-07-04T14:39:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3fd3d174444... |
f44034ef-5875-453b-a99d-fb97837183f0 | adriantiron/Licenta2019TironAdrian | code/Six-Hump Camel Back/Univariate marginal distribution/main.cpp | #include <iostream>
#include <string>
#include <stdio.h>
#include <fstream>
#include "Converter.h"
#include "Evaluations.h"
#include "Random_Generator.h"
#include "Formulas.h"
#pragma warning (disable:4996)
using namespace std;
ofstream write("plot.csv");
#define POP_SIZE 120
#define SELECT_SIZE 30
#define MAX_ITER... | ALGO | 0.999906 | 4.732791 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-06-24T15:57:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad792af1c... |
13bfc72f-bbb6-4716-b5d0-14a8ce996aba | HisShadow85/SoftUni-Algo | week4_DynamicProgramming/homework/MinimumEditDistance/MinimumEditDistance.cpp | #include<iostream>
#include<string>
#include<vector>
#include<sstream>
using namespace std;
class EditDistance {
public:
typedef short cost;
static vector<string> editDistance(string &toConvert, string &convertTo,vector<cost> &costs){
//here we are going to calculate the cost of the operations
vector<vector<... | ALGO | 0.999722 | 3.864964 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-12-03T18:36:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa0055ebf9... |
f175661a-fe70-49b2-95ac-9e3b711987c2 | wjezxujian/WildMagic4 | LibFoundation/Intersection/Wm4IntrBox3Sphere3.h | // Geometric Tools, Inc.
// http://www.geometrictools.com
// Copyright (c) 1998-2006. All Rights Reserved
//
// The Wild Magic Version 4 Foundation Library source code is supplied
// under the terms of the license agreement
// http://www.geometrictools.com/License/Wm4FoundationLicense.pdf
// and may not be copied ... | ALGO | 0.987865 | 5.645085 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-12-06T03:06:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "622b44d2dc... |
bbc31667-d35c-44a0-82ea-d37c77828d3c | tmsm1999/Competitive-Programming | Hackerrank/Problem Solving/Kangaroo.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main() {
int x1, v1, x2, v2 = 0;
cin >> x1 >> v1 >> x2 >> v2;
if(x1 > x2 && v1 >= v2) {
cout << "NO" << endl;
}
else if(x1 < x2 && v1 <= v2) {
cout << "NO" << endl;
}
else if(x1 == x2 && v1 == v2) {
cout << "YES" << endl;
}
else {
if(x1 ... | ALGO | 0.999963 | 3.457825 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-10-14T12:45:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3d5a72ef... |
a367a22b-23ab-4f4b-903d-64ef0637cacc | msung99/Algorithm_AND_Implementation | 백준/Gold/4803. 트리/트리.cc | #include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> adj_list[502];
bool visited[502];
int treeCnt;
bool isTree;
void dfs(int cur, int prev) {
for(int next : adj_list[cur]) {
// next가 부모(prev)일 경우 건너뜀
if(next == prev) {
continue;
}
// 트리일 경우 자식은 반드시 이전에 ... | ALGO | 0.99998 | 4.850349 | {
"github_metadata": {
"branch": "main",
"commit_count": 964,
"repo_created_at": "2022-03-05T04:18:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e9baec4c0... |
165de22b-f58d-4027-b8ba-e219850a9a71 | howlong93/code | zerojudge/c543.cpp | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
long long int table[100001][10] = {0};
void build_table() {
for (int i = 1; i <= 100000; i++) {
table[i][9] = 1;
for (int j = 8; j > 0; j--) {
table[i][j] = (table[i-1][j] + table[i][j+1]) % MOD;
}
}
}
int main () {
cin.tie(0);
ios_b... | ALGO | 0.999947 | 4.478437 | {
"github_metadata": {
"branch": "master",
"commit_count": 349,
"repo_created_at": "2020-08-21T02:49:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1f1447a... |
248a614c-d882-4b7f-9eaf-95e8a4166166 | CookiesChen/CFLP | main.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <stdio.h>
#include <ctime>
#include "type.h"
#include "greed.h"
#include "hill_climb.h"
#include "SA.h"
using namespace std;
vector<facility> facilities;
vector<customer> customers;
int customerNum = 0;
int facilityNum = 0;
void get... | ALGO | 0.999766 | 3.714955 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-12-20T07:00:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1edebf28c... |
b16a1555-dd57-4145-8a24-9c11fdfa636c | BlakeBrown/HackerRank-Solutions | Algorithms/Dynamic Programming/The Coin Change Problem.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string.h>
using namespace std;
// Good explanation of the solution: http://www.geeksforgeeks.org/dynamic-programming-set-7-coin-change/
int main() {
// Read input
int N, M;
cin>>N;
cin>>M;
int *coi... | ALGO | 0.999991 | 4.085634 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2015-09-28T03:50:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 571,
"forks": 331,
"issues": 1,
"pull_requests": 16
},
"file_meta": {
"content_id": "0f8... |
ceb91f3c-6064-4aa4-a6aa-3222d64df16d | busebd12/InterviewPreparation | LeetCode/C++/General/Easy/UglyNumber/main.cpp | #include <iostream>
#include <vector>
using namespace std;
/*
* Approaches:
*
* 1) Brute force, TLE (time limit exceeded): generate all prime factors of the input number.
* Then, check if a prime that is not 2, 3, or 5 is in the vector.
*
* 2) While the number is divisible by two, repeatedly divide it by two.
*... | ALGO | 0.999808 | 5.514562 | {
"github_metadata": {
"branch": "master",
"commit_count": 218,
"repo_created_at": "2015-12-15T14:19:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de45ce8f... |
110c5f2c-a147-4611-a158-6954c2ae1422 | dbetm/cp-history | HackerRank/Implementation/8_Library_Fine.cpp | #include <bits/stdc++.h>
// https://www.hackerrank.com/challenges/library-fine/problem
using namespace std;
int main(int argc, char* argv[]) {
int day, month, year, _day, _month, _year;
int fine;
// the respective day, month and year on which the book was returned.
cin >> day >> month >> year;
// ... | ALGO | 0.999754 | 4.31355 | {
"github_metadata": {
"branch": "main",
"commit_count": 384,
"repo_created_at": "2019-01-09T04:13:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25bfab4869... |
1bad2c9f-fe07-4779-ab9d-50a8b55bf9d6 | Tabeeb1/Online-Judge | Codeforce/Round 859/find and replace.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
bool solve(string s){
for(int i = 1;i<s.length();i++){
if(s[i] == s[i-1])
return false;
}
string f = "";
map<char,char>mp;
for(int i = 0;i<s.length();i++){
if(mp.find(s[i])== mp.end()){
if(i ... | ALGO | 0.999947 | 4.012559 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2022-11-29T07:29:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b547edc4f... |
4fd1cc87-16a4-49d0-b6a4-4d125a8932c7 | juarezpaulino/coderemite | problemsets/Live Archive/Northwestern Europe - 2013/competition/A.cpp | /**
*
* Author: <NAME>(coderemite)
* Email: <EMAIL>
*
*/
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <map>
using namespace std;
typedef pair<int,int> pii;
const int MAX_SET = 2020;
int up[MAX_SET];
... | ALGO | 0.99932 | 3.247905 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-12-12T21:51:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1eff24921d7d... |
bef605fc-0a9b-455c-b172-873e6bd9b1da | Apress/modern-x86-assembly-language-programming-2e | Chapter07/Ch07_03/Ch07_03a.cpp | //------------------------------------------------
// Ch07_03a.cpp
//------------------------------------------------
#include "stdafx.h"
#include <iostream>
#include "XmmVal.h"
using namespace std;
extern "C" void AvxPackedMulI16_(XmmVal c[2], const XmmVal& a, const XmmVal& b);
// Test function to ge... | TEST | 0.988321 | 4.172215 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-11-13T14:10:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 116,
"forks": 44,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "f7070bf0... |
75397110-8de1-49e3-bb3a-2fcd6a16e08e | RickeyLee09/Udacity-Kidnepped-Vehicle | src/particle_filter.cpp | /**
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: <NAME>
*/
#include "particle_filter.h"
#include <math.h>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <random>
#include <string>
#include <vector>
#include "helper_functions.h"
using std::string;
using ... | ALGO | 0.909582 | 5.958 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2019-12-05T07:32:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3410603ed... |
2bbaaf61-64ee-43bd-94cf-8b62ddd71ecd | vcode11/spoj-solutions | RENT.cpp | #include <bits/stdc++.h>
typedef long long ll;
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define pii pair<int,int>
#define pll pair<ll,ll>
using namespace std;
struct flight{
ll start;
ll time;
ll cost;
};
flight arr[10005];
ll n;
bool comp(flight &A, flight &B){
return A.start < B.start;
}
ll dp[10... | ALGO | 0.999817 | 3.824558 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-09-06T16:16:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f94701461... |
3389cc4f-24f2-4b5b-8eb0-2154f979f834 | Faheem-SundarSTEM/Codes | Classic_Codes/Others/merge_ite.cpp | # include <iostream>
# include <vector>
# include <algorithm>
using namespace std ;
void merge(vector <int> & a, int p,int q, int r){
int n1 = q - p + 1 ;
int n2 = r - q ;
vector <int> l ; vector <int> R ;
for(int i = 1 ; i <= n1 ; i++){
l.push_back(a[p + i - 2]) ;
}
for (int j = 1 ; j <= n2 ; j++){
R.push_... | ALGO | 0.999988 | 3.520264 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-08-09T13:23:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d901c1ff64... |
e0d1336e-9698-4aad-945b-b3ef1fb143ba | Mayer-Yang/CS246-OOP-Final-Project | command.cc | #include "command.h"
#include <sstream>
#include <vector>
#include <string>
#include <iostream>
using namespace std;
Command::Command(std::string cmd): cmd{cmd}{}
bool Command::hasInteger() {
istringstream iss{cmd.substr(0, 1)};
int n;
if (iss >> n) {return 1;}
else {return 0;}
}
int Command::times() {
string s... | TOOL | 0.932681 | 4.023849 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-09-13T15:12:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "874f84775f... |
b6c859ff-64aa-4c0a-8553-26834de0346d | johndpjr/Modern_CPP_Problems | Chapter01_Math_Problems/problem11.cpp | /*
* 11. Converting numerical values to Roman
* Print the Roman numeral equivalent given a number.
*/
#include <iostream>
#include <map>
#include <string>
int main() {
// Define Roman numeral table
std::map<unsigned, std::string> units {
{1, "I"}, {2, "II"}, {3, "III"}, {4, "IV"}, {5, "V"},
... | TOOL | 0.996106 | 5.861154 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-01-10T04:36:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac5216f59... |
b2c27f81-69e6-4f92-867d-0d05689eb9a2 | rtake/atcoder | agc031/b.cpp | # include <bits/stdc++.h>
# include <atcoder/all>
typedef long long ll;
using namespace std;
using namespace atcoder;
#define rep(i,n) for (ll i=0; i<(ll)(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define dump(x) cerr << #x << " = " << (x) << endl;
#ifdef LOCAL
#define dump(x) do{} while(0)
#endif
// ll gcd(l... | ALGO | 0.99999 | 4.260667 | {
"github_metadata": {
"branch": "master",
"commit_count": 671,
"repo_created_at": "2020-05-09T03:18:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51355aad... |
2e719052-1573-4959-88e5-01a07fceea89 | CDD1029/CS452 | Class Code/mpisum2.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
#include "mpi.h" // message passing interface
using namespace std;
// New compile and run commands for MPI!
// mpicxx -o blah file.cpp
// mpirun -q -np 32 blah
int main (int argc, char * argv[]) {
int my_rank; // my CPU number for this process
int p; ... | ALGO | 0.999856 | 4.071017 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2019-03-14T17:13:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bc261c0f... |
b1bd9cdf-4145-4661-bde7-c5167d227895 | RamadoriVladimir/SOLID | OCP/OCPExamples.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <typeinfo>
#include <cstring>
// Ejemplo 1: Diseño que no cumple con OCP
class Circle1 {
public:
void draw() { std::cout << "Dibujando circulo\n"; }
};
class Square1 {
public:
void draw() { std::cout << "Dibujando cuadrado\n"; }
};
// Esta f... | TOOL | 0.947737 | 6.847847 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-09-26T18:08:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fde07893710c... |
59e961cc-5c5c-4579-80aa-3211fda7c740 | chandanws/mooc_book | CppByDissection/genericQuicksort.cpp | #include<iostream>
using namespace std;
template <class T>
inline void swap(T& x, T& y)
{
T t;
t = x;
x = y;
y = t;
}
template <class T>
inline void order(T& x, T& y)
{
if (x > y) swap(x, y);
}
//Forward declarations of auxiliary functions
template <class T>
bool find_pivot(T *left, T *right, ... | ALGO | 0.999956 | 5.34427 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2020-01-29T13:26:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc21ee7a... |
53db0c55-49b2-40a6-b828-0e6b61b7b915 | GarciaBarreiro/PAH | fpga/CODE/2D_conv.cpp | #include "2D_conv.h"
void func(const dt w[K], const dt data_IN[N][N], dt data_OUT[N][N]) {
// cache kernel, eliminating memory access on PIPE_LOOP
const dt w0 = w[0], w1 = w[1], w2 = w[2]; // top row
const dt w3 = w[3], w4 = w[4], w5 = w[5]; // middle row
const dt w6 = w[6], w7 = w[7], w8 = w[8]; ... | ALGO | 0.997505 | 4.742788 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-11-18T22:13:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ce1ede2a4d... |
19b6c328-a705-4224-90a0-f27d22ef27e9 | nermeenwageh10/Leetcode-Solutions | Solutions/C++/0103-binary-tree-zigzag-level-order-traversal/0103-binary-tree-zigzag-level-order-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999998 | 6.110974 | {
"github_metadata": {
"branch": "main",
"commit_count": 652,
"repo_created_at": "2023-02-16T12:25:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 315,
"forks": 83,
"issues": 3,
"pull_requests": 3
},
"file_meta": {
"content_id": "e6722a8... |
0c3c85f4-298a-4678-a836-5a29bed50876 | ChenBingWei1201/Alg | PA/PA2/src/maximum_planar_subset.cpp | // **************************************************************************
// File [maximum_planar_subset.cpp]
// Author [<NAME>]
// Synopsis [The body of MaxPlanarSubset]
// Date 2024/04/27
// **************************************************************************
#include "maximum_planar_... | ALGO | 0.997976 | 5.584851 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-03-02T11:14:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1181714dba... |
32455e8e-1b07-4532-ac3c-0fb110ce3540 | shuvo37/numerical | newton_divide_defference.cpp | #include <iostream>
#include <vector>
using namespace std;
// Function to calculate divided difference table
vector<vector<double>> dividedDifferenceTable(const vector<double>& x, const vector<double>& y) {
int n = x.size();
vector<vector<double>> table(n, vector<double>(n, 0));
// Fill first column with... | ALGO | 0.999939 | 5.787525 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-11-27T18:19:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a17d0952de5... |
959d6930-422e-45d6-a697-13df7b914d62 | rohan-shah/networkReliability | methods/exhaustiveSearchImpl.cpp | #include "exhaustiveSearchImpl.h"
#include "graphAlgorithms.h"
#include <boost/graph/adjacency_matrix.hpp>
#include <omp.h>
namespace networkReliability
{
void exhaustiveSearch(exhaustiveSearchArgs& args)
{
bool countDisconnected = args.countDisconnected;
const std::size_t nEdges = boost::num_edges(args.graph);
... | ALGO | 0.99742 | 6.466063 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2016-05-03T03:09:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fdb6fd7... |
6ac1cbcc-2350-4f3f-9698-b99c7f0f6c2d | MalenQuilla/DSA | Labwork5/Ex2.cpp | #include<iostream>
#include<math.h>
using namespace std;
struct list
{
int size;
int element[10000];
};
void init(list *l)
{
l -> size = 0;
}
int isEmpty(list *l)
{
return(l -> size == 0);
}
void create(list *l, int n)
{
l -> size = n;
for (int i = 0; i < n; ++i)
{
cout << "Input el... | ALGO | 0.999562 | 4.085795 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-21T16:35:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e61d52c2d44b... |
bbbcf95e-4a26-4dce-b54d-64c8a1bfef6f | mxsg/programmieren-cpp-klausuren | 2012ss-nr1/a5-zerlegung-in-primzahlen.cpp | /*
* Programmieren fuer Physiker: C++
* Sommersemester 2012, Klausur 1
*
* Aufgabe 5
* Zerlegung in zwei Primzahlen
*/
#include <iostream>
using namespace std;
bool istPrim(int z) {
// ueberpruefe alle Zahlen zwischen 2 und sqrt(z) darauf,
// ob z durch sie teilbar ist
for(int i=2; i*i <= z; i++) ... | ALGO | 0.999441 | 4.367914 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2014-07-16T22:39:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e44cc5c5b... |
ca001801-1125-485d-b3c8-3684eec22f78 | tsanislavgatev/SDP | Homework2/main.cpp | #include <iostream>
#include "Maze.h"
#include "FindReachablePoints.h"
#include <vector>
#include "FindPathsFromXtoY.h"
using namespace std;
int main()
{
size_t rows, cols;
std::cout << "Enter count of rows : ";
std::cin >> rows;
std::cout << "\nEnter count of columns : ";
std::cin >> cols;
Ma... | ALGO | 0.99277 | 3.966303 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2015-11-30T19:33:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "684c750d9... |
4994350d-27e4-44de-a181-0786e4b3a5dc | AbdelrahmanKhaledd/ProblemSolving | UVA/10000.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb(i) push_back(i)
#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()
#define ff first
#define ss second
#define debug(x) cout<<(#x)<<": \""<<x<<"\""<<endl
#define debugVec(vec) cout<<(#vec)<<": "; for (auto& i: vec) cout<<i<<" "; cout<<endl
templ... | ALGO | 0.997188 | 3.612202 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2020-10-21T08:19:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06aa4df9bbb... |
6e198765-f28a-4168-b93d-8a7bb0968caf | BGI-shenzhen/PopLDdecay | src/tmpsrc/ProMethod1.h | #ifndef processV3_H_
#define processV3_H_
using namespace std;
int PairWiseComV1( In3str1v * paraFA04, Para_18 * para_18 , map <string,map <llong, vector <BaseType> > > & SNPList , StarRsult * All_Stat , int & Flag_for_pro )
{
map <string,map<llong, vector <BaseType> > > :: iterator key1_it ;
int bin_count=in... | ALGO | 0.997111 | 4.253577 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-05-20T08:03:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 193,
"forks": 53,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad0bbccc... |
0582aed4-b87d-4221-9962-80b6b1a2cbfc | alesapin/xtok | library/grid_creator/binarization.h | #pragma once
#include <util/generic/vector.h>
#include <util/generic/map.h>
#include <util/generic/hash_set.h>
enum class EBorderSelectionType {
Median = 1,
GreedyLogSum = 2,
UniformAndQuantiles = 3,
MinEntropy = 4,
MaxLogSum = 5,
Uniform = 6
};
THashSet<float> BestSplit(
TVector<float>& ... | ALGO | 0.974843 | 6.906586 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-01-21T19:16:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2f35f74f6... |
8916a604-0495-4382-a995-651d5f367159 | Diegores14/CompetitiveProgramming | Uva/10315 - Poker Hands/solution.cpp | #include <bits/stdc++.h>
using namespace std;
map<char, int> order;
void firstRule(map<char, int> values[2]){
vector<int> v[2];
for(int i=0; i<2; i++){
for(auto j: values[i]){
for(int k=0; k < j.second; k++)
v[i].emplace_back(order[j.first]);
}
}
sort(v[0].b... | ALGO | 0.999627 | 4.28557 | {
"github_metadata": {
"branch": "master",
"commit_count": 718,
"repo_created_at": "2018-06-08T22:15:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91cdd99b... |
b79e2758-c807-49cd-9f83-579b5ddd7bfe | yirzhou/UVa | Internet_bandwidth_820.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAXV 100
#define INF 1000000000
typedef vector<int> vi;
int res[MAXV + 1][MAXV + 1];
vi p;
int s, t, c, n, mf, f;
void augment(int v, int min_edge)
{
if (v == s) {
f = min_edge;
return;
} else if (p[v] != -1) {
augment(p[v], min(... | ALGO | 0.999638 | 3.784573 | {
"github_metadata": {
"branch": "main",
"commit_count": 381,
"repo_created_at": "2022-11-03T03:11:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c867482e26... |
a50a6ebf-0c4e-4d02-95de-ce882f90532d | rohakdebnath/CodeForces-Solutions | laregstsubsequence.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define UNSYNC ios::sync_with_stdio(false); cin.tie(nullptr);
#define sci(x) static_cast<int>(x)
#define all(x) x.begin(), x.end()
#define rep(i, ini, x) for (int i = ini; i < x; ++i)
#define per(i, fin, x) for (int i = fin; i >= x; --i)
#define VI ... | ALGO | 0.999754 | 3.782721 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-07-17T12:11:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c2f02298d9... |
104f9bec-cff6-4d8c-a24e-07bbecb79cda | yoraish/fibers_compressor | src/compressor/compressor.cpp | // Yorai for MIT RLE. 2019.
#include <string>
#include<iostream>
#include <vector>
#include "compressor.hpp"
Compressor::Compressor(const std::string compression_method, const std::size_t decimals_to_keep, const std::size_t keep_one_out_of):compression_method_(compression_method),decimals_to_keep_(decimals_to_keep), ... | ALGO | 0.997884 | 6.873794 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-11-20T15:54:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ffa19cad... |
3029a221-5b16-40d3-ba00-2d7444b23638 | ws0407/LeetCode | Graph/并查集/684.冗余连接.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int find(vector<int>& father, int x) {
return x == father[x] ? x : father[x] = find(father, father[x]);
}
void join(vector<int>& father, int x, int y) {
x = find(father, x);
y = find(father, y);
... | ALGO | 0.999898 | 5.153966 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2024-08-14T04:10:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83a5384ff... |
55d68b77-15f6-4aca-8e94-0ae035b2414a | mejibyte/competitive_programming | UVa/10897 - Travelling Distance/10897.2.cpp | /*
Accepted
This is a cleaner version of 10897.cpp
*/
using namespace std;
#include <iostream>
#include <cmath>
const long double rho = 6371.01;//km
const long double pi = 2*acos(0.0);
struct Vector{
//A geometrical vector
long double x, y, z;
long double dot(const Vector &t) const{
return x*t.x + y*t... | ALGO | 0.99775 | 4.16122 | {
"github_metadata": {
"branch": "master",
"commit_count": 355,
"repo_created_at": "2011-10-27T01:25:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 196,
"forks": 66,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "75c0c... |
9d2946ab-870f-48fe-afdc-fb5d6e05050b | cephalsystems/drc | super_teleop/src/chainiksolverpos_nr_jl_we.cpp | // Copyright (C) 2007 <NAME> <ruben dot smits at mech dot kuleuven dot be>
// Copyright (C) 2008 <NAME>
// Copyright (C) 2008 <NAME>
// Version: 1.0
// Author: <NAME> <ruben dot smits at mech dot kuleuven dot be>
// Maintainer: <NAME> <ruben dot smits at mech dot kuleuven dot be>
// URL: http://www.orocos.org... | ALGO | 0.995032 | 4.695493 | {
"github_metadata": {
"branch": "master",
"commit_count": 264,
"repo_created_at": "2013-05-04T01:41:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5f11e1f9... |
9fb60e5b-cbe8-448f-a10c-0b2360fdbc51 | CGAL/cgal | Kernel_23/include/CGAL/determinant.h | // Copyright (c) 1999
// Utrecht University (The Netherlands),
// ETH Zurich (Switzerland),
// INRIA Sophia-Antipolis (France),
// Max-Planck-Institute Saarbruecken (Germany),
// and Tel-Aviv University (Israel). All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Id... | ALGO | 0.999954 | 5.745469 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
e5adcbcf-a227-4b0a-ae11-eecb5b3859cc | zwenyuan1/PaddleOCRv2_rk3566 | src/main.cpp | # include "det.h"
# include "rec.h"
/*
int camera_ocr(){
// det and rec init
TextDetect* td = new TextDetect();
td->Model_Init("./model/qua_det.rknn");
TextRec*tr_3 = new TextRec();
tr_3->Model_Init("./model/ch_rec_3.rknn");
TextRec*tr_5 = new TextRec();
tr_5->Model_Init("./model/ch_rec_5... | DATA | 0.96834 | 4.193019 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2022-07-20T06:20:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 3,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "089a7a01... |
616183d9-72fb-4321-9653-77abe51b1750 | chinchinz/algorithm | Graph/boj_2570_s.cpp | #include <iostream>
#include <vector>
#define MAX_N 100
using namespace std;
vector<int> adj[MAX_N*MAX_N];
int aMatch[MAX_N*MAX_N], bMatch[MAX_N*MAX_N];
bool visited[MAX_N*MAX_N];
int map[MAX_N][MAX_N], Left[MAX_N][MAX_N], Right[MAX_N][MAX_N];
int N, M;
void fillLeft() {
int y = 0, x = N - 1, cnt = 1;
for... | ALGO | 0.999967 | 3.668243 | {
"github_metadata": {
"branch": "master",
"commit_count": 308,
"repo_created_at": "2020-08-20T01:24:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db86c93d3... |
303d1c65-4a8b-4368-85ce-9653e4510866 | ledpear/algorithm | BAEKJOON/11000~/11054_가장 긴 바이토닉 부분 수열/Source.cpp | #include <vector>
#include <iostream>
#include <limits>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
int main()
{
int nVal;
cin >> nVal;
vector<int> vArr(nVal);
for (int i = 0; i < nVal; i++)
cin >> vArr[i];
vector<int> vUpDp(nVal), vDownDp(nVal), vDp(nVal);
for (int i = 0; ... | ALGO | 0.999982 | 4.404568 | {
"github_metadata": {
"branch": "master",
"commit_count": 781,
"repo_created_at": "2018-06-07T03:14:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd07ea2c... |
66af4a5e-cdae-4360-8d63-05beb1c34f8d | zukun/rcc | vxl/vxl-1.13.0/core/vnl/algo/vnl_generalized_schur.h | // This is core/vnl/algo/vnl_generalized_schur.h
#ifndef vnl_generalized_schur_h_
#define vnl_generalized_schur_h_
#ifdef VCL_NEEDS_PRAGMA_INTERFACE
#pragma interface
#endif
//:
// \file
// \brief Solves the generalized eigenproblem det(t A - s B) = 0.
// \author fsm, <NAME>
// \date 2 Oct 2001
#include <vnl/vnl_ma... | ALGO | 0.997137 | 5.701387 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2013-02-21T15:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06de2bf... |
ee6d7b56-47d6-4f4b-9872-fcfb148346d4 | MereyPolatkhan/Algorithms_and_Data_Structures | ADS_2021/w4_BST/lab4/basic/D.cpp | #include <bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node *right;
Node *left;
Node(int dt){
data = dt;
right = NULL;
left = NULL;
}
};
class BST {
public:
Node *root;
BST() {
root = NULL;
}
Node *insert(Node *node, int valu... | ALGO | 0.999991 | 4.993865 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2022-08-07T17:40:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4daf98c4e... |
8ac938aa-6fe3-40a4-a967-6228d2f6fba1 | iamFarukh/SdeSheetChallenge | Day 22/distinctSubstring.cpp | struct Node{
Node* children[26];
//returns, child present or not
bool containsKey(char ch){
return ( children[ch - 'a'] != NULL);
}
//return child node(reference child node)
Node* get(char ch){
return (children[ch - 'a']);
}
//set the chilld
... | ALGO | 0.999992 | 4.626266 | {
"github_metadata": {
"branch": "main",
"commit_count": 186,
"repo_created_at": "2022-06-07T14:08:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "656d53fe4f... |
1c50752a-0ec0-4f5d-8b2c-6d62b09c91c0 | flameshimmer/leet2022 | RemoveAllOnesWithRowandColumnFlipsII.cpp | #include "stdafx.h"
//You are given a 0-indexed m x n binary matrix grid.
//In one operation, you can choose any i and j that meet the following conditions:
//0 <= i < m
//0 <= j < n
//grid[i][j] == 1
//and change the values of all cells in row i and column j to zero.
//Return the minimum number of operations needed t... | ALGO | 0.99993 | 6.138501 | {
"github_metadata": {
"branch": "newMain",
"commit_count": 113,
"repo_created_at": "2022-05-31T18:51:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a1bf9e... |
6809a505-79a5-4ca7-a058-542f7d54f147 | yxymit/banshee | src/lookahead.cpp | /** $lic$
* Copyright (C) 2012-2015 by Massachusetts Institute of Technology
* Copyright (C) 2010-2013 by The Board of Trustees of Stanford University
*
* This file is part of zsim.
*
* zsim is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as publishe... | ALGO | 0.9975 | 6.418258 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-08-25T18:48:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 7,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "89ad51b35a... |
35a53e06-1ab7-41b5-989d-3be1138e0bce | rajasekhar0001/learning | Problem Solving/Trie/problem1_xor.cpp | /**
* Problem link:
* https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/
*/
class Node {
Node* links[2]; // Each node has 2 links: one for bit 0 and one for bit 1
public:
Node() {
links[0] = links[1] = nullptr;
}
// Check if there is a child node corresponding to the giv... | ALGO | 0.999944 | 6.062767 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2023-11-17T07:30:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2c8fe4e1c... |
78072d09-7522-4480-89dc-ba56f7ea9d8e | TaoSama/ICPC-Code-Library | OJ - Codeforces/#343/C.cpp | //
// Created by TaoSama on 2016-02-22
// Copyright (c) 2016 TaoSama. All rights reserved.
//
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#i... | ALGO | 0.999938 | 3.731683 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2016-03-24T05:56:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6e0b577... |
d0515aa4-d950-4e3e-9604-1af5faa36d73 | dinhluanbmt/LeetCode150InterviewQuestion | QuestionInterview150s/QuestionInterview150s/PowXN.h | #pragma once
#include <iostream>
using namespace std;
// 50. Pow(x, n)
/*Implement pow(x, n), which calculates x raised to the power n (i.e., xn).
*/
// recursive solution
class Recursive_Solution {
public:
double calc(double x, int n) {
if (n <= 2) return x * x;
if (n % 2 != 0) return x * calc(x, n... | ALGO | 0.999928 | 5.98109 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-06-12T02:21:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "914186af446... |
3a225452-ee28-460e-a202-a584bf614b2b | PaulDoessel/appleseed | src/appleseed/renderer/kernel/lighting/imagebasedlighting.h |
//
// This source file is part of appleseed.
// Visit http://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2010-2013 <NAME>, Jupiter Jazz Limited
// Copyright (c) 2014-2016 <NAME>, The appleseedhq Organization
//
// Permission is h... | ALGO | 0.933174 | 7.07683 | {
"github_metadata": {
"branch": "master",
"commit_count": 7563,
"repo_created_at": "2016-12-26T12:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88ee770... |
a583049f-b7f2-48ca-aa37-2867529faef1 | KDH5706/Study_Cpp | Study/Cpp_day5/Cpp_day5/EmployeeManager1.cpp | //#define _CRT_SECURE_NO_WARNINGS
//#include <iostream>
//#include <cstring>
//using namespace std;
//
//class PermanentWorker
//{
//public:
// PermanentWorker(const char* name, int money):salary(money)
// {
// strcpy(this->name, name);
// }
// int GetPay() const
// {
// return salary;
// }
// void ShowSalaryInfo() c... | TOOL | 0.947395 | 3.391165 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-03-24T00:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f5313a8c22... |
5f655f54-4565-4690-9f58-97435cd638f6 | Unknownmaster0/learning_DSA_concept | Linked_list_DSA/Floyds_Algorithm_for_loop_detection_in_linked_list.cpp | #include<iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node() {}
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
/*
Floyd's Loop Detection Algorithm -> Time complexity: O(n)- as the loop is traversed once.
... | ALGO | 0.999957 | 5.474475 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-08-17T03:59:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5dcf1ae72cd... |
0cd3d862-b79e-454e-ba7c-50fd56897f8a | JeffreyPWagner/HW6 | main.cpp | // matmult.cc: implements integer matrix multiplication C = A x B
// for simplication, assumes A and B are both n x n matrices
//
// gw
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <chrono>
#include "omp.h"
using namespace std;
using namespace std::chrono;
void read_matrix(int*, int, char*);
voi... | ALGO | 0.999806 | 4.641002 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-08T02:07:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b96b7644f2... |
d62c1a41-4324-498b-a62a-ae227112a805 | miaodi/linearAlgebra | sparse_mat_op/permutation.hpp | #pragma once
namespace matrix_utils {
/**
* These functions are for permuting a vector based on a permutation vector
* ---------------------------------------------------------------
*/
/** @brief Permute a vector based on a permutation vector
* @param rows Number of rows in the vector
* @param base Base ind... | TOOL | 0.983191 | 7.396367 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2023-12-12T17:30:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0dc8f07... |
d5e00569-c84f-45e2-b987-2a2963e64d10 | shitangdama/leetcode | algorithms/137.Single_Number_II/Single_Number_II.cpp | <<<<<<< HEAD
#include <bits/stdc++.h>
using namespace std;
class Solution {
class Solution {
public:
int singleNumber(vector<int>& nums) {
const int W = sizeof(int) * 8; // 一个整数的bit数,即整数字长
int count[W]; // count[i]表示在在i位出现的1的次数
fill_n(&count[0], W, 0);
for (int i = 0; i < nums.siz... | ALGO | 0.999994 | 4.422156 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2015-04-07T06:47:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac18cde0c... |
423870cf-79fa-4c40-be97-841e0ab98180 | AllenPaul-2005/Daily_Programming_Challenge_2024 | SlidingWindowMaximum.cpp | #include <iostream>
#include <vector>
#include <deque>
using namespace std;
vector<int> maxSlidingWindow(vector<int> &nums, int k)
{
vector<int> result;
deque<int> dq;
for (int i = 0; i < nums.size(); ++i)
{
// Remove elements out of the current window
if (!dq.empty() && dq.front() ==... | ALGO | 0.999986 | 6.899891 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-09-09T05:48:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1374ffe45d1... |
a3279645-08ac-48ef-9404-a0db5cfba7f1 | jliu10/CS-2124 | HW/HW06/hw06.cpp | /*
bigUnsigned_begin.cpp
<NAME>
*/
#include <iostream>
#include <vector>
#include <string>
using namespace std;
// Put your class and all function definitions here.
// BigUnsigned class
class BigUnsigned {
friend ostream& operator<<(ostream& os, const BigUnsigned& big) {
for (size_t i = big.digits... | ALGO | 0.977807 | 5.095423 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-02-15T03:37:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb69cf9e4d28... |
74510732-3e70-41fd-8a63-fddb32621fc1 | nayujin-dev/Algorithm_please_Level_up | 백준/Silver/13251. 조약돌 꺼내기/조약돌 꺼내기.cc | #include <cstdio>
#define MAX (50+3)
using namespace std;
int M, K; // M - 조약돌 색상 종류 / K - 랜덤뽑기 개수
double stoneByColor[MAX];
double percent[MAX];
double total, ans;
int cnt;
int main() {
// 1. 입력
//freopen("input.txt", "r", stdin);
scanf("%d", &M);
// 2. 컬러별 돌 개수 입력받을때 전체 개수 카운트
int input;
for (int i = 0;... | ALGO | 0.999079 | 3.520998 | {
"github_metadata": {
"branch": "main",
"commit_count": 227,
"repo_created_at": "2022-12-31T05:45:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c61ff039c... |
82aade9a-5154-48b9-8a80-3af0989bfc2d | ank809/Cpp-Codebase | OOPS/DMA_Palindrome.cpp | #include <iostream>
#include <cstring>
// Function to check if a string is a palindrome
bool isPalindrome(const char* str) {
int len = strlen(str);
for (int i = 0; i < len / 2; i++) {
if (str[i] != str[len - 1 - i]) {
return false;
}
}
return true;
}
// Function to reverse ... | ALGO | 0.973482 | 6.23594 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2023-08-07T20:15:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a2395873... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.