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 |
|---|---|---|---|---|---|---|---|
a1b99b88-a43c-42b1-80f6-a724a0faa3ea | dhruvrajput1/cppcodes | Stack/03_generalise_stack.cpp | #include<iostream>
#include<vector>
using namespace std;
// templates
// program generalize
template<typename T>
class stack {
vector<T> v; // we don't keep it in public because if it is in public, we can acess middle elements, which is not the property of stack
public:
// top
T top(){
return ... | ALGO | 0.99599 | 4.045513 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2024-01-22T07:40:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "167be1a7ea... |
19f0533a-1e9b-45b7-acf3-ca36de9d6434 | RudrakshaSingh/DSA_MCA | problem15AVLtree.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
struct Node {
int key;
Node * left;
Node * right;
int height;
};
int height(Node * node) {
return (node == nullptr) ? 0 : node -> height;
}
int max(int a, int b) {
return (a > b) ? a : b;
}
Node * createNode(int key) {
Node * ... | ALGO | 0.999911 | 5.084182 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-09-24T17:09: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": "4455e5e89e4... |
0ba97e8d-aa25-4af3-9ecc-900413155d02 | timthirion/Quasi | src/sampling/adaptive_integrator.cpp | #include "adaptive_integrator.hpp"
#include <algorithm>
#include <cmath>
namespace Q {
namespace sampling {
// Using alias for commonly used type
using Color = Q::radiometry::Color;
AdaptiveIntegrator::AdaptiveIntegrator(std::unique_ptr<SamplePattern> pattern, int base_samples,
... | ALGO | 0.998507 | 6.894448 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-06-11T18:53: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": "af2f4094fc3... |
42c6b8c2-d944-4dde-a0ec-fa447f709c30 | jpablolucero/neo | source/Neo.cc | #include <Neo.h>
#ifndef BENCHMARKS
std::unique_ptr<dealii::TimerOutput> timer ;
std::unique_ptr<MPI_Comm> mpi_communicator ;
std::unique_ptr<dealii::ConditionalOStream> pcout ;
double eps = 1. ;
double abs_rate = 0 ;
double max_energy = 1. ;
double flux_guess = 1. ;
double temp_guess = 1. ;... | ALGO | 0.930048 | 6.033153 | {
"github_metadata": {
"branch": "master",
"commit_count": 337,
"repo_created_at": "2019-11-28T15:36:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfff0937... |
b55702f5-96fd-45ce-8c9b-67b578d5efcc | axelbatista/RowEchelonFormCalculator | RowEchelonFormCalculator/RowEchelonFormCalculator.cpp |
#include <iostream> //printing
#include <vector> //container for values to be stored
#include <algorithm> //just for std::swap as it has the proper move semantics that we need/right implementation without doing anything myself
//does the required operation for the rest of the values in the c... | ALGO | 0.999447 | 4.67832 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-06-15T20:49: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": "32cfabf7fe... |
04e539df-569f-4c9b-ae49-5b48aab1298c | Strand2013/siguoya | AC_history/[面试题 10.01]合并排序的数组.cpp | //给定两个排序后的数组 A 和 B,其中 A 的末端有足够的缓冲空间容纳 B。 编写一个方法,将 B 合并入 A 并排序。
//
// 初始化 A 和 B 的元素数量分别为 m 和 n。
//
// 示例:
//
// 输入:
//A = [1,2,3,0,0,0], m = 3
//B = [2,5,6], n = 3
//
//输出: [1,2,2,3,5,6]
//
// 说明:
//
//
// A.length == n + m
//
// Related Topics 数组 双指针
// 👍 73 👎 0
//leetcode submit region begin(Prohibi... | ALGO | 0.999923 | 5.40713 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-09-11T03:17:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a26e2d752a0f... |
817beb09-f236-4eff-a943-e9d4561d5c97 | passion-Infinity/Exercise-in-FPTU | LAB CC++/Bai_giai/CSP0040.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
char getUserChoice() {
int c;
printf("MENU\n"
"----------------------"
"\n1- Quadratic equation"
"\n2- Bank deposit problem"
"\n3- Quit"
"\nEnter your choice: ");
fflush(stdin);
scanf ("%c", ... | TOOL | 0.96374 | 3.185484 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-10-01T05:50: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": "920459848... |
ba3cfb5f-25c9-4afa-ab0f-f6ca91106ae3 | pixmeo/osirixplugins | _help/MyNewPluginTemplate/OsiriXAPI.framework/Versions/A/Headers/vtkBoostExtractLargestComponent.h | /*=========================================================================
Program: Visualization Toolkit
Module: vtkBoostExtractLargestComponent.h
Copyright (c) <NAME>, <NAME>, <NAME>
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is di... | ALGO | 0.969799 | 7.202993 | {
"github_metadata": {
"branch": "develop",
"commit_count": 585,
"repo_created_at": "2013-02-25T15:33:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 71,
"forks": 67,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c6b830... |
bc275e51-2162-4dfe-bc54-4eb8882eaf60 | Kolash2003/Striver-DSA | 47. first and last occurance in array/simple_BS.cpp | #include <bits/stdc++.h>
using namespace std;
int first_element(int a[], int n, int k) {
int l = 0;
int h = n-1;
int ans = -1;
while(h>=l){
int m = (l+h)/2;
if(a[m]==k){
h=m-1;
ans = m;
}
else if(a[m]<k){
l=m+1;
}
els... | ALGO | 0.999971 | 5.421917 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-05-19T15:00: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": "8dc7d0550230... |
5d814168-bcd5-4b11-8969-d8764c9c3d7c | johandy12/Programming-Challenges-Chapter-4 | 4.cpp | #include <iostream>
using namespace std;
int main() {
double rectangle1;
double rectangle2;
double length1;
double width1;
double length2;
double width2;
cout << "Enter the length of rectangle 1: ";
cin >> length1;
cout << "Enter the width of rectangle 1: ";
cin >> width1;
cout << "Enter the length... | ALGO | 0.998962 | 3.645695 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-10-15T16:39: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": "e93df2f946... |
acc78652-f757-45e1-9423-6f96400d1221 | moqsad/solved-problems | LightOJ/1183 – Computing Fast Average.cpp | #include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int x, y, v, i, sum[500010], latest[500010], man[500010];
void update(int node, int s, int e, int pre, int value)
{
if(s >= x && e <= y)
{
sum[node] = (e - s + 1) * v;
latest[node] = i;
m... | ALGO | 0.999725 | 3.607712 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-08-05T12:29:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99296a68df... |
bff6830b-83f4-4561-9de8-ab99487e454e | ibudiselic/contest-problem-solutions | tc 160+/CandyGame.cpp | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
using namespace std;
bool G[50][50], A[50][50];
int n;
long long dp[50][51][51];
long long go(int x, int p, int d) {
long long &ret = dp[x][p][d];
if (ret != ... | ALGO | 0.999976 | 4.455683 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2011-08-14T11:43:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "796a311fc... |
a8c3ae2d-1ed8-43b0-af06-65c4e05a34f0 | abypun/PATtest | Code/Basic_Level/1014.cpp | #include <iostream>
using namespace std;
string days[] = {"MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
int main ()
{
string str[4];
int cnt = 0;
cin >> str[0] >> str[1] >> str[2] >> str[3];
for (int i = 0; i < str[0].length(); i++) {
if(str[0][i] >= 'A' && str[0][i] <= 'G' && str[0][i] ==... | ALGO | 0.999486 | 3.018886 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-07-19T06:37: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": "ca95c9ea95... |
cb6cc48d-c454-4613-8c9b-3b47f5042743 | bachev93/leetcode | medium/remove_nth_element.cpp | #include <iostream>
#include <vector>
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) {}
};
// BEST approach
ListNode* ... | ALGO | 0.999933 | 6.635784 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2020-11-18T11:11: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": "d9ace322d... |
b219eb20-c69d-4824-915b-726cf6db2acd | adithyabhat99/competitive_coding | microsoft_prep/merge_bsts.cpp | //https://practice.geeksforgeeks.org/problems/merge-two-bst-s/1
struct Node {
int data;
Node* right;
Node* left;
Node(int x){
data = x;
right = NULL;
left = NULL;
}
};
/*
Naive method:
void Inorder(Node *root,multiset<int>&s)
{
if(!root) return;
Inorder(root->lef... | ALGO | 0.999999 | 5.572674 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2018-11-23T17:24:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "319506ac7... |
5cea6060-1275-4631-aa4d-c828a5dbde78 | zyx4843/leetcode | src/Path_Sum_II.cpp | // Source : https://oj.leetcode.com/problems/path-sum-ii/
// Author : <NAME>
// Date : 2014-12-19
/**********************************************************************************
*
* Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
* For example:
* Given t... | ALGO | 0.999982 | 5.246435 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2014-11-21T05:44:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6182db92f... |
4afd280f-7660-484f-87dd-0bc2ceb1cd34 | Shahraaz/CP_S4 | codeforces/practice/DIV2_525C.cpp | //Optimise
#include <bits/stdc++.h>
using namespace std;
// #define multitest 1
#ifdef Debug
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__);
template <typename Arg1>
void ZZ(const char *name, Arg1 &&arg1)
{
std::cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void ZZ(const char *nam... | ALGO | 0.999943 | 4.801838 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2019-05-19T15:08:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d4db7efa... |
a4e2cc5a-8158-41bf-8796-eae3fd9ba475 | abhishek2x/Leetcode | Medium/78.cpp |
/*
! => [0,0,1,1,0,1,0,0,1,0]
! => [1,1,0,1,1,0,1,1,1,0]
! => [1,0,1,1,1,0,0,1,1,0]
! => [0,1,1,0,0,0,0,1,0,1]
! => [0,0,0,0,0,0,1,1,1,0]
! => [0,1,0,1,0,1,0,1,1,1]
! => [1,0,1,0,1,1,0,0,0,1]
! => [1,1,1,1,1,1,0,0,0,0]
! => [1,1,1,0,0,1,0,1,0,1]
! => [1,1,1,0,1,1,0,1,1,0]
*/
// Flood Fill approach
class Solution... | ALGO | 0.999982 | 6.208281 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2021-01-29T11:50:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d609a1183... |
4be62a71-4601-41a0-8315-0051de9ccffc | loganjzt/data2Probability | data2Probability.cpp |
#include <stdio.h>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <string>
#include <math.h>
#include <fstream>
#include <malloc.h>
#include <cstdio>
using namespace std;
int main(int argc, char *argv[]){
if(argc < 2){
printf("Need the name of input file (*.dat)...\n");
ret... | DATA | 0.992184 | 3.629199 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-05-26T19:57: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": "8d9b447510... |
574498d9-d910-4162-ab74-7abcc6ed86d8 | ConchFeng/quick_start_webrtc_native | deps/webrtc/include/third_party/WebKit/Source/core/editing/InlineBoxTraversal.h | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef InlineBoxTraversal_h
#define InlineBoxTraversal_h
#include "platform/wtf/Allocator.h"
namespace blink {
class InlineBox;
// This class provide... | TOOL | 0.961077 | 7.862107 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-10-01T05:47:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5daed07fa9... |
75ac3730-bea7-451b-ab46-de4b6311d1c5 | ishandutta2007/codeforces-a | acrush/normal/1090/F.cpp | #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <i... | ALGO | 0.999819 | 3.19315 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "898b41699b2e... |
cd2af507-61a4-4de1-9387-126f412c65a4 | SirjanSingh/CP-CF | cpp/A_Cut_Ribbon.cpp | #include<bits/stdc++.h>
using namespace std;
#define f(i, x, y) for (int i = x; i < y; i++)
#define int long long
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define all(vector) vector.begin(),vector.end()
#define nl cout << "\n"
#define x first
#define y second
#define mapii map<int,int>
#define mapci map<c... | ALGO | 0.999842 | 3.418181 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-10-18T04:36:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f81dc80e5... |
a3cd1ba9-b295-4519-a9a7-221dded5ff52 | ehnryx/acm | geometry/l.cpp | #include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
typedef long double ld;
typedef complex<ld> pt;
// define an epsilon for floating point comparisons
const ld EPS = 1e-11;
namespace CodeArchive {
typedef vector<pt> pol;
// cross product
ld cp(const pt& a, const pt& b) { return imag(conj(a)*b... | ALGO | 0.999771 | 4.867388 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2018-05-03T04:18:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12331b9f7... |
dfe142c1-2468-4cc6-bf58-5612368bc3f2 | LIUHUANUCAS/next_journey | leetcode/queue/346-moving-average-from-data-stream.cpp | #include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "../header/data_type.h"
using namespace std;
class MovingAverage {
queue<int> que;
int n;
... | ALGO | 0.999597 | 5.27107 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-07-04T08:35: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": "7f230eb83f4... |
01a34471-581e-456b-9fd8-30a63ef8c101 | wwwwodddd/Zukunft | luogu/P7289.cpp | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > a[100020];
int p[100020];
int v[100020];
int c[100020], cnt;
int z[100020];
int n;
long long m, l;
int main()
{
scanf("%d%lld%lld", &n, &l, &m);
for (int i = 1; i <= n; i++)
{
p[i] = i;
a[i].push_back(make_pair(i, 0));
}
for (int i = 1; i <=... | ALGO | 0.999981 | 3.15794 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2018-12-31T17:17:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af52b72... |
dde9cf63-bdef-4aa6-b5db-4e6c5bf81120 | FangGet/BundleFusion_Ubuntu_Pangolin | include/FreeImage/include/CGAL/convexity_check_2.h | // Copyright (c) 1999 Max-Planck-Institute Saarbruecken (Germany).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, o... | ALGO | 0.998903 | 6.785333 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-06-29T03:53:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 34,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba3e61a... |
f9b22746-ab0b-440a-8a70-698157a55dbe | wy1054101356/ClassCode | 追赶法求解线性方程组/AppMain.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
freopen("1.txt", "r", stdin);
int row, col;
cin >> row >> col;
vector< vector<double> > mtx(row + 1, vector<double>(col + 1, 0));
vector<double> b(col + 1, 0);
vector<double> y(col + 1, 0);
vector<double> x(col + 1, 0);
// 读取数据
for (int i... | ALGO | 0.999915 | 3.732142 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-10-20T12:14: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": "d44d745615... |
b4612cbc-c6a4-409d-878d-62c812bf677d | deanbodenham/cppgammat | gammatest/src/utils.cpp | #ifndef GUARD_utils_cpp
#define GUARD_utils_cpp
#include "utils.h"
//just multiplying a number by two
double timesTwo(double x){
return x*2;
}
/*-------------------------------------------------------------------*/
//Gamma functions
//computation of gamma function from
//Numerical Recipes, Chapter 6.2
/*-----... | TOOL | 0.932013 | 5.131735 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-07-20T10:16:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38d9da2acc... |
1fdd61d6-2ed0-4d22-938e-1355333e9759 | kronicler/cs2040_DSnA | PSes/TTG/ps2A.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int numInputs=1,i,type,value,stack_flag = 1,queue_flag=1;
do{
stack_flag = 1;
queue_flag = 1;
vector<int> storage_s;
vector<int> storage_q;
scanf("%d",&numInputs);
if (numInputs==0) return 0;
for ... | ALGO | 0.999295 | 3.500815 | {
"github_metadata": {
"branch": "master",
"commit_count": 346,
"repo_created_at": "2018-01-12T10:39:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6e6aeb8... |
8ca9a995-0935-436a-97ad-3a2dc1baa17d | allmazee/3DViewer_v1.0-1 | src/3D_Viewer_1_0/centermodel.cpp | #include "centermodel.h"
void center_model(filedata_t *file_data) {
double minX, maxX, minY, maxY, minZ, maxZ;
find_min_max_coords(file_data, &minX, &minY, &minZ, &maxX, &maxY, &maxZ);
double centerX = minX + (maxX - minX) / 2;
double centerY = minY + (maxY - minY) / 2;
double centerZ = minZ + (maxZ - minZ)... | TOOL | 0.945344 | 4.24787 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-04-17T19:05: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": "aa797b1fe748... |
823b539c-7537-4bda-af99-82f4376cd427 | BackupTheBerlios/streamlister-svn | trunk/configuration.h | /* Copyright (C) 2004 crass <<EMAIL>>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is dist... | CONFIG | 0.94953 | 4.885155 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2015-08-16T05:52: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": "c78e43716... |
c8c1fd3d-e1f5-4cdd-85ba-520364fd9d32 | cunbidun/competitive_programming | archive/CodeChef - February Challenge 2020 Division 1/Chef and Railway Stations/gen.cpp | #include "bits/stdc++.h"
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define watch(x) out << (#x) << " = " << (x) << endl
#define rf(i, a, b) for (int(i) = (a); (i) <= (b); (i)++)
#define rb(i, b, a) for (int(i) = (b);... | ALGO | 0.999892 | 4.103306 | {
"github_metadata": {
"branch": "master",
"commit_count": 189,
"repo_created_at": "2020-07-14T13:10: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": "b0219c01... |
15187b8c-3ccf-4e52-9598-8bef3479f5c3 | ScriptsOfTribute/ScriptsOfTribute-Core | Bots/ExternalLanguageBotsUtils/Cpp/utils.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
std::pair<std::vector<std::string>, int> get_patrons_to_pick() {
std::string data;
std::getline(std::cin, data);
std::istringstream iss(data);
std::string patrons_str;
... | TOOL | 0.957532 | 4.69475 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2022-09-19T10:12:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13,
"forks": 4,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "3517fd55... |
b94e698d-631e-47c8-a839-eb384f29f61d | lijwen2748/aaltaf | ltlfchecker.cpp | /*
* File: ltlfchecker.cpp
* Author: <NAME>
* Note: SAT-based LTLf satisfiability checking
* Created on June 26, 2017
*/
#include "ltlfchecker.h"
#include "formula/olg_formula.h"
#include <iostream>
using namespace std;
namespace aalta
{
bool LTLfChecker::check ()
{
if (verbose_)
{
cout << "Checking... | ALGO | 0.994997 | 5.282177 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-08-23T22:16:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "60ecab9fd0... |
c51e0955-267e-41ae-8cfa-0f5e18c4aa16 | pnjha/APS_Assignment2 | Q2_2018201013.cpp | #include <bits/stdc++.h>
#define maxDegree 4
#define minDegree 2
using namespace std;
struct btreeNode{
int value[maxDegree+1];
int currSize;
struct btreeNode *childPtr[maxDegree + 1];
};
struct btreeNode *root;
struct btreeNode * createNode(int value, struct btreeNode *child){
struct btreeNode *n... | ALGO | 0.999952 | 4.146503 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-11T12:03: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": "1fe038b52b... |
83f50c68-1c6d-4108-9ed4-9a3e5714f73f | SakshamSoni-code/100-Days-of-DSA- | Day-01/B-Shifting Sort.cpp | #include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0); cin.tie(0)
#define ll long long
const ll mod = 1000000007; //10^9+7
#ifdef ONLINE_JUDGE
#define debug(...) void(0);
#else
#include "debug.hpp"
#endif
void heySaksham() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen... | ALGO | 0.999951 | 3.962776 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-03-21T04: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": "3261c8902cf... |
221fc060-2eb7-4453-9cb2-e6cbe31c6daf | l0uvre/short-travel-oj | Linked List/Oj1029A.cpp | /***
Description:
Cuperman has a machine which can travel among different planets. ItakEjgo used this machine and arrived the Linked List Planet. Linked List Planet was controlled by an evil guy “Huang Bo”, who raises hard problems to the island citizens, and forces them to write programs to solve. The planet citizens ... | ALGO | 0.999991 | 3.870284 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2017-10-12T10:59: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": "eb03fc360... |
b11f2717-9169-45fe-b5f1-d387899fa1d5 | 3088364856/Template-Algorithm | segemnt tree___lazy tag.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5+10;
#define endl '\n'
int n , m;
vector<ll> a(N);
vector<ll> tag(4*N);
struct node{
int l, r;
ll val;
};
node tree[4*N];
void addtag(int x, ll d){
tag[x] += d;
tree[x].val += (tree[x].r - tree[x].l +1)*d;
}
void up(in... | ALGO | 0.99988 | 5.690517 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-04-08T03:55:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2ab296417e... |
41328402-3807-48fe-bfc4-8eb1cb054650 | msmn1729/Algorithm | BOJ/GraphTheory(GT)/GT_01753_최단경로(2).cpp | #include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <climits>
#include <cstring>
#include <iomanip>
#include <bitset>
#include <string>
#include <vector>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <list>
#include <map>
#include <set>
#de... | ALGO | 0.999941 | 4.376069 | {
"github_metadata": {
"branch": "master",
"commit_count": 1104,
"repo_created_at": "2020-07-24T13:24: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": "a712327... |
88fe2389-6c92-4f9c-8d45-f46ce19d8b18 | Pilse/Study_log | baekjoon/baekjoon9465.cpp | #include <iostream>
#include <string.h>
using namespace std;
int map[2][100001];
int dp[2][100001];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int tc;
cin >> tc;
while(tc--)
{
int n;
cin >> n;
memset(dp, 0, sizeof(dp));
f... | ALGO | 0.999938 | 3.665667 | {
"github_metadata": {
"branch": "master",
"commit_count": 351,
"repo_created_at": "2021-01-04T07:28:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "15c0ea7d... |
dc5b36ff-4908-485f-bc1c-b6330760db95 | NadineAB/MPC-Meshing_Point_Clouds | include/CGAL/AABB_polyhedron_segment_primitive.h | // Copyright (c) 2009 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at your op... | ALGO | 0.909358 | 6.351712 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2015-12-18T21:22:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4476ba62... |
ba7aca73-660c-4f3e-b213-3e63d9d4017e | bansal1999/LeetCode_Solutions | subsets-ii/subsets-ii.cpp | class Solution {
public:
vector<vector<int>> res;
void f(vector<int>& nums, int start, int end, vector<int>& contri) {
// Base case.
// Empty suffix subarray.
if (start > end) {
res.push_back(contri);
return;
}
// Recursive case.
... | ALGO | 0.999857 | 5.96464 | {
"github_metadata": {
"branch": "main",
"commit_count": 1427,
"repo_created_at": "2021-07-04T08:06: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": "59e4ad20b... |
c18c7250-de2c-4a18-b2f3-50b2ef4d0242 | kotunde/SourceFileAnalyzer_featureSearch_and_classification | GCJ_Dataset/Data/ADJA/3014486_5721094409420800_ADJA.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <cassert>
#include <utility>
#include <iomanip>
using namespace std;
const i... | ALGO | 0.999395 | 3.752737 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2019-11-30T16:39:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "958e91a0f... |
362beb67-456f-4787-b61e-8a749e5cb645 | LLNL/Kripke | src/Kripke/Kernel.h | //
// Copyright (c) 2014-25, Lawrence Livermore National Security, LLC
// and Kripke project contributors. See the Kripke/COPYRIGHT file for details.
//
// SPDX-License-Identifier: (BSD-3-Clause)
//
#ifndef KRIPKE_KERNEL_H__
#define KRIPKE_KERNEL_H__
#include <Kripke.h>
#include <Kripke/Core/DataStore.h>
#include <ut... | ALGO | 0.986933 | 6.135902 | {
"github_metadata": {
"branch": "develop",
"commit_count": 495,
"repo_created_at": "2017-11-02T22:07:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 40,
"forks": 38,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "b12ebb... |
0fff8f49-278b-401c-ae67-0b12ad8091d1 | PonizhenDoRyadovogo/932221b | laba7_TopologicalSort/laba7_TopologicalSort/Topological.cpp | #include<iostream>
#include<vector>
#include "TopologicalSort.h"
void PrintArray(std::vector<int> a)
{
std::cout << "[";
for (int i = 0; i < a.size(); i++)
std::cout << a[i] << " ";
std::cout << "]";
}
void PushVertex(std::vector<int>& res, BoolVector& bool_vec)
{
const int size = bool_vec.Length();
for (int i... | ALGO | 0.99986 | 5.087346 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2023-09-06T09:15:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "134ff4cbb56... |
4ad33898-a12e-4a60-8ba8-4c8966245d84 | coderguy57/UVa-Online-Judge | 10654_TheUxuhulVotingSystem/main.cpp | #include <fstream>
#include <iostream>
#include <iomanip>
#include <array>
#include <cstring>
std::array<std::array<int, 8>, 101> pref;
std::array<std::array<int, 8>, 101> results;
uint8_t get_result(int m, int current) {
if (results[m][current] != -1)
return results[m][current];
if (m == 0) {
... | ALGO | 0.99997 | 4.439695 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2023-02-22T21:23: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": "a7168b4ae... |
d7af454f-d073-4e01-9c53-b0d3ca71bef3 | SamyakJain2002/Coding-Solutions | Zero Sum Subarrays - GFG/zero-sum-subarrays.cpp | // { Driver Code Starts
//Initial function template for C++
#include<bits/stdc++.h>
using namespace std;
#define ll long long
// } Driver Code Ends
//User function template for C++
class Solution{
public:
//Function to count subarrays with sum equal to 0.
ll findSubarray(vector<ll> arr, int n ) {
... | ALGO | 0.999699 | 5.36846 | {
"github_metadata": {
"branch": "main",
"commit_count": 672,
"repo_created_at": "2022-02-24T12:06:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd587b9520... |
dc0eac26-52ce-410f-b658-33471ba532a3 | svaze30/CompetitiveProgramming | 1955/1955B.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long ll;
#define loop0(i, n) for (ll i = 0; i < n; i++)
#define loop1(i, n) for (ll i = 1; i <= n; i++)
#define mp make_pair
#define F first
#define S second
#define pb push_back
#define yes cout << "YES" << endl
#define no cout << "NO" << e... | ALGO | 0.999839 | 4.304218 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-04-14T14:01:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "427525abe5b... |
e09d5fca-9930-4ae8-93d4-4ba191e03460 | omarkashif/omarkashif | MergeSort.cpp | #include <bits/stdc++.h>
using namespace std;
void Merge(int *arr, int s, int e)
{
int mid = (s + e) / 2;
// lengths of 2 lists
int l1 = mid - s + 1;
int l2 = e - mid;
int a1[l1];
int a2[l2];
// copying elements of lists in 2 smaller lists
for (int i = 0; i < l1; i++)
{
a1[i... | ALGO | 0.999946 | 5.292322 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-09-24T06:27:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3b5b057a8c... |
485ca445-b49a-4776-b0ef-1d44cac2bce7 | yxsu/ComplexNet | NetworkFun/firefly_algorithm.hpp | #pragma once
#include <vector>
#include <memory>
using std::vector;
using std::shared_ptr;
class FireflyAlgorithm
{
public:
struct Firefly
{
double intensity;
vector<double> position;
};
typedef shared_ptr<Firefly> ptFirefly;
public:
FireflyAlgorithm(size_t numberOfFirefly, size_t dimens... | ALGO | 0.999526 | 5.533398 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-03-19T07:11:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f0d681307... |
138ad55b-67be-4afa-83ce-4d1c00894729 | maksonchik20/Codeforces | Ethflow Round 1 (Codeforces Round 1001, Div. 1 + Div. 2)/tempCodeRunnerFile.cpp | /**
* author: maksonchik20
* created: 26.01.2025 19:32:01
**/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend();
#define for0... | ALGO | 0.999963 | 5.375685 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2023-05-07T09:50:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae7cc53d5... |
2b12d694-3664-45aa-8c40-ced06bc2a353 | YanikusGG/Huffman-archiver | coder.cpp | #include "coder.h"
#include <optional>
namespace Huffman {
Encoder::Encoder(std::ostream& out) : writer_(out) {
first_file_ = true;
}
Encoder::~Encoder() {
if (!first_file_) {
writer_.Write(archive_end_code_, archive_end_code_.size());
}
}
void Encoder::Encode... | TOOL | 0.927835 | 5.451232 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-03-21T16:37: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": "76d506406f38... |
d078dfc1-5430-4c98-8c58-9fc23dc58bf2 | yplusplus/LeetCode | FrogJump.cpp | class Solution {
public:
bool canCross(vector<int>& stones) {
int n = stones.size();
if (stones[1] != 1) return false;
map<int, unordered_set<int> > dp;
for (int i = 1; i < n; i++) {
dp[stones[i]];
}
dp[1].insert(1);
int target = stones.back();
... | ALGO | 0.999917 | 5.780067 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2016-12-26T12:11:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ddd56a55... |
84fa477c-fa2f-4d5b-b080-7970a430a01a | Coccoexe/Food-Recognition-and-Leftover-Estimation | src/Segmentation.hpp | #pragma once
#include <vector>
#include <opencv2/opencv.hpp>
class Segmentation
{
public:
/**
* @brief Construct a new Segmentation object, segmenting the plate into the different dishes.
* @param p The plate image.
* @param l The labels of the dishes.
*/
Segmentation(cv::Mat& p, std::vector<int> l);
cv::... | ALGO | 0.925596 | 5.022466 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2024-04-15T17:49:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "080149579... |
b7994aa8-7dd3-4c58-9cef-17ab161b6bad | Rajdip789/DAA | Trie/02_Trie.cpp | /**
* insert, countWordsEqualTo, countWordsStartingWith and erase word in Trie. TC - O(m)
* m = length of word to insert / countWordsEqualTo string / countWordsStartingWith string
* As we have to iterate through each character of the word (length m) and Checking or inserting each character
* at a node is... | ALGO | 0.999424 | 5.092083 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2022-03-11T06:13: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": "08f81fd7e95... |
82b92f76-8ac4-4ae3-91b3-922d3aa04fbc | Vipul999ujawane/-Image_Processing | Mirror_Image.cpp | #include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\core\core.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main()
{
int opt;
cout << "Enter 1 for Reflection alonf y-axis\nEnter 2 for refleciton along x-axis" << endl;
cin >> opt;
Mat a = imread("Te... | ALGO | 0.988074 | 3.570387 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-12-11T09:09:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67838d0c88... |
b8852ff8-f27b-408c-81a3-e1fae1a8ad54 | Elijah-24/Operating-Systems-SP24 | assignment1/elijah_miranda1.cpp | /* <NAME> (ID: 1970884) COSC 3360 Assignment 1: Process Scheduling*/
#include <iostream>
#include <vector>
#include <string>
#include <queue>
using namespace std;
struct processes { // object that will be in the queues
int PID;
float time;
string command;
int logicalReads;
int physicalReads;
i... | ALGO | 0.976905 | 4.579265 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-19T23:29:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "923d4cf688e2... |
c69779a2-177e-48d3-9a95-ebf5b6353e2d | moxcodes/spectre | src/Elliptic/Systems/Xcts/Equations.cpp | // Distributed under the MIT License.
// See LICENSE.txt for details.
#include "Elliptic/Systems/Xcts/Equations.hpp"
#include <algorithm>
#include <cstddef>
#include <functional>
#include <optional>
#include <string>
#include "DataStructures/DataVector.hpp"
#include "DataStructures/Tags/TempTensor.hpp"
#include "Dat... | ALGO | 0.996118 | 6.59187 | {
"github_metadata": {
"branch": "develop",
"commit_count": 8541,
"repo_created_at": "2018-09-07T20:39:07.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "sxs-collaboration/spectre",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
... |
c24a92c0-1089-4d48-874a-fa0eabb50bf1 | SubodhShil/DSA-Problem-Solving | Algorithms/⭐⭐ Algorithm Fundamental/Week 07/Module 27 - LCS Variations/Minimum_number_of_deletions_and_insertions.cpp | /*
* link1: https://leetcode.com/problems/delete-operation-for-two-strings/
* link2: https://practice.geeksforgeeks.org/problems/minimum-number-of-deletions-and-insertions0209/1?
*/
#include <bits/stdc++.h>
using namespace std;
int dp[1005][1005];
int lcs(string a, int n, string b, int m)
{
if (n == 0 || m == ... | ALGO | 0.999977 | 5.082839 | {
"github_metadata": {
"branch": "main",
"commit_count": 433,
"repo_created_at": "2023-03-09T15:45:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8900d0c440... |
22af8b41-5558-4c46-8884-1f75b73bc37a | tim1207/UVA_Online_Judge | UVA/uva10193_All_You_Need_Is_Love.cpp | // uva10193_All_You_Need_Is_Love.cpp
// bin to dec than check gcd !=1
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
int main() {
int N;
string S1, S2;
cin >> N;
for (int Case = 1; Case <= N; Case++){
cin >... | ALGO | 0.999725 | 4.212409 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-03-24T09:23: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": "423244187e3... |
6c4f0b13-ad7e-4edd-a03c-d9ff19a4234d | ishandutta2007/codeforces-b | boook/normal/629/D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define REP(i,j,k) for(int i = j ; i < k ; ++i)
#define RREP(i,j,k) for(int i = j ; i >=k ; --i)
#define A first
#define B second
#define mp make_pair
#define pb emplace_back
#define PII p... | ALGO | 0.997852 | 4.021279 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "469d8d9a5bd5... |
d4097b3a-2b85-4531-84de-3f41c79831cf | EpsAvlc/GreenScreenMatting | src/trimap_generator.cpp | #include "trimap_generator.h"
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
Mat TrimapGenerator::Process(const cv::Mat& ori_img)
{
vector<Mat> frame_bgrs;
split(ori_img, frame_bgrs);
Mat background_mask = M... | ALGO | 0.913778 | 4.270975 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-12-20T14:33:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "62d0b1ee9... |
1a04330f-a4d1-4851-8aae-7c152d03e33d | mayankbisht123/c-code | Tree/BFS_Zig_Zag.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
struct Node{
int val;
Node* left;
Node* right;
Node(int val)
{
this->val=val;
this->left=NULL;
this->right=NULL;
}
};
Node* createTree(int k,Node* root)
{
int val;
if(k==-1)
{
return NULL;
}
... | ALGO | 0.99998 | 4.028979 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-09-10T15:22:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6a92d6306ca... |
0fd1d871-9bb0-4165-af38-a9807d89783d | AdiInfiniteLoop/Data-Structures-and-Algorithms | Tries/trie1.cpp | #include <iostream>
using namespace std;
struct Node {
Node* links[26];
bool flag = false;
bool contains(char &ch) {
return (links[ch - 'a'] != NULL);
}
void put(char &ch, Node* t) {
links[ch - 'a'] = t;
return;
}
Node* get(char &ch) {
return links[ch - 'a'];
}
void setEnd() {
... | ALGO | 0.999484 | 4.060651 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2023-09-03T05:46:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92531422f4... |
fdb11384-b0f0-47e8-9773-48903323df4c | snoopdoggy322/practice-PI-20 | Задание 3/Вариант 7/task3_main.cpp | #include <stdio.h>
#include <iostream>
#include <iomanip>
using namespace std;
struct student {
int id;
string name;
int math;
int history;
int physics;
};
struct list_t {
student data;
list_t *next;
};
const int size_d = sizeof(student);
list_t *head,*tail;
// Ввод данных с клавиатур... | TOOL | 0.974648 | 3.404247 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2021-07-02T07:48:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b07d06650... |
7d62ad54-efae-400f-bdb5-f98e04c1486b | KeyAsDa/C | SinhVien.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#define SO_MON 3
using namespace std;
struct SinhVien
{
string MSSV;
string hoTen;
char queQuan[50];
double diem[SO_MON];
};
struct DanhSach
{
SinhVien *sv;
int n;
};
void nhap1SinhVien(SinhVien& sv)
{
cout << "MS... | TOOL | 0.942273 | 3.446661 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-03-06T15:16: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": "9c3c969f9eb... |
33cff3b1-7297-4753-87c1-ac8e8891ab30 | DrhF/ACM | Timus/T1202.cpp | #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
#include <bitset>
#include <functional>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
using namespace std;
class Rect{
public:
int ... | ALGO | 0.999699 | 3.309253 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-10-18T14:41:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "771750e294... |
6e3370b6-f404-47de-abbc-ba13929e7452 | Mengsen-W/algorithm | cpp/1669_merge_in_between/merge_in_between.cpp | /*
* @Date: 2023-01-30
* @LastEditors: <EMAIL>
* @LastEditTime: 2023-01-30
* @FilePath: /algorithm/cpp/1669_merge_in_between/merge_in_between.cpp
*/
#include <cassert>
#include <cstddef>
#include <iostream>
struct ListNode {
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) :... | ALGO | 0.999054 | 5.483239 | {
"github_metadata": {
"branch": "main",
"commit_count": 1562,
"repo_created_at": "2021-01-17T11:54: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": "2c7d0dcec... |
d00fd7a8-0cc4-4abf-b05a-90eb5dcbf7e6 | Kylefc64/Personal-Projects | ProjectEuler/C++ (P1-25; 67)/P14/Source14.cpp | /*
The following iterative sequence is defined for the set of positive integers:
n ? n/2 (n is even)
n ? 3n + 1 (n is odd)
Using the rule above and starting with 13, we generate the following sequence:
13 ? 40 ? 20 ? 10 ? 5 ? 16 ? 8 ? 4 ? 2 ? 1
It can be seen that this sequence (starting at 13 and finishing at 1) co... | ALGO | 0.999991 | 4.947453 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2016-04-10T01:01: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": "282808407... |
5d1e022a-9cad-4a5f-b04a-d5a4584bf38e | DishaSharma-dev/leetcode | leetcode/Medium/partition_list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* partition(L... | ALGO | 0.999995 | 5.425332 | {
"github_metadata": {
"branch": "main",
"commit_count": 299,
"repo_created_at": "2021-10-19T12:18: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": "62a99aa784... |
4c88392c-4346-4b4c-92f6-353cd4c12fd6 | jackielwu/Hashtable | HashTableTemplate.h |
//
// CS251 Data Structures
// Hash Table
//
#include <assert.h>
#include <stdlib.h>
#include <string.h>
// Each hash entry stores a key, object pair
template <typename Data>
struct HashTableTemplateEntry {
const char * _key;
Data _data;
HashTableTemplateEntry * _next;
};
// This is a Hash table that maps str... | ALGO | 0.975969 | 5.642702 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2017-10-30T05:17: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": "bd88d9835... |
467dc015-592c-41d5-b72c-7d6669f48820 | MrSingh710/Programs | C++/DSA_(Course_Practice)/45_Arrays/4.cpp | // Column Sum
#include <iostream>
using namespace std;
void colWiseSum(int arr[][3], int rows, int cols) {
for(int i = 0; i < rows; i++) {
int sum = 0;
for(int j = 0; j < cols; j++) {
sum = sum + arr[j][i];
}
cout << "Sum of " << i << " column = " << sum << endl;
... | ALGO | 0.99969 | 5.680322 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2023-12-13T14:11:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c78524af1b9... |
0833d54b-7c3e-4e66-83e5-9ad1486a067d | SvistNrr/mirea-progs | Solves/Practice3_Nasledovanie.cpp | #include<iostream>
using namespace std;
class A1
{
protected:
int a1;
public:
A1(int n = 0) { a1 = n; cout << "\nКонструктор класса 'A1'"; }
virtual void print() { cout << "\nИмя класса: A1"; }
virtual void show() { cout << "\na1 = " << a1; }
};
class B1 : virtual public A1
{
protected:
int b1;
public:
B1(int ... | TOOL | 0.966929 | 4.613112 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-09-17T22:41: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": "4a409c2d8aa... |
2571f54e-4d6d-4b08-a53e-05aa4258643d | bae-sh/BOJ | 2638/2638/2638.cpp | #include<iostream>
#include<algorithm>
#include<queue>
#include<string.h>
using namespace std;
int dx[] = { -1,0,1,0 };
int dy[] = { 0,1,0,-1 };
int N, M, time;
int map[100][100];
int cheese;
void outAir(int x, int y) {
queue<pair<int, int>> q;
q.push({ x,y });
while (!q.empty()) {
auto cur = q.front(); q.pop();
... | ALGO | 0.999983 | 3.543473 | {
"github_metadata": {
"branch": "master",
"commit_count": 719,
"repo_created_at": "2018-08-31T05:22: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": "ebab7025... |
57823dfb-0bc8-4b44-9757-943c579f53c8 | vegedoge/leetcode_repo | cpp/647.回文子串.cpp | /*
* @lc app=leetcode.cn id=647 lang=cpp
*
* [647] 回文子串
*/
#include<vector>
#include<string>
using namespace std;
// @lc code=start
class Solution {
public:
// 1. dp
// int countSubstrings(string s) {
// int n = s.size();
// // dp[i][j] 代表从i到j是回文
// vector<vector<bool>> dp(n, vector... | ALGO | 0.999996 | 6.691341 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2024-02-14T05:31: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": "10d4b2bff1... |
76db6494-9e26-433a-98ea-8028aa5b5d2a | omteja04/LeetCode | 0893-all-nodes-distance-k-in-binary-tree/0893-all-nodes-distance-k-in-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
void findParents(TreeNode* root, unordered_map<TreeNode* , TreeNode* > &mp) {
queue<TreeNod... | ALGO | 0.999986 | 5.679882 | {
"github_metadata": {
"branch": "main",
"commit_count": 1088,
"repo_created_at": "2024-08-17T06:11: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": "378bf0124... |
aea4d9f2-86cf-43a0-93cc-448cd81f9203 | xsun89/MenTou | 0507/滑动窗口.cpp | //
// Created by <NAME> on 2021-05-12.
//
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Solution {
public:
int getMaxIndex(vector<int> &nums, int i, int k){
int maxIndex = i;
for(int j = i - k + 1; j < i; ++j)
if(nums[j] > nums[maxIndex]){
... | ALGO | 0.999978 | 6.504702 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2021-03-07T20:05:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8f5e9c45... |
5f673cd7-7ee3-48dd-adac-82821629bde6 | joeykuhn/College | 1570CS/cs1570_hw10/workspace/hw10_townF.cpp | /*
Programmers: <NAME> and <NAME>
Teacher: Dr. Leopold
Section: 1D
Date: 11/18/2016
Description: This program simulates an activist and a polluter fighting for
world domination within a town designated by different character
identifiers. This program works by spawning a activist in the
... | ALGO | 0.988344 | 4.403522 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2016-11-17T21:54:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67a7aece0... |
283e0375-e216-4837-96cd-9a59c6d84cbe | edwardwang618/Luogu-ACWing-CodeForces | Luogu/P5662 纪念品/main.cc | #include <iostream>
#include <cstring>
using namespace std;
const int N = 110, M = 1e4 + 10;
int t, n, m;
int p[N][N], f[M];
int main() {
scanf("%d%d%d", &t, &n, &m);
for (int i = 1; i <= t; i++)
for (int j = 1; j <= n; j++)
scanf("%d", &p[i][j]);
for (int i = 1; i < t; i++) {
fill(f, f + m + 1,... | ALGO | 0.999865 | 3.32059 | {
"github_metadata": {
"branch": "master",
"commit_count": 756,
"repo_created_at": "2021-02-03T18:10:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f9acc4f... |
6c362113-ad4b-49f5-8618-bf2a05f87260 | shas9/codehub | Codeforces/Round/Round 483/New folder/28th may/A-011.cpp | #include <bits/stdc++.h>`
#define slld(longvalue) scanf("%d", &longvalue)
#define plld(longvalue) printf("%d\n", longvalue)
#define ll int
#define pb(x) push_back(x)
#define bug printf("BUG\n")
#define maxn 500005
using namespace std;
bool check(ll N,ll pos)
{
return (bool)(N & (1<<pos));
}
ll Set(ll n, ll p... | ALGO | 0.999971 | 4.146929 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-25T17:32: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": "f977bbed6f... |
7b5bf335-0944-4ac7-aad5-96d055f47a3e | DWITAAMELIAPUTRI00/tugas2 | TUGAS 2.cpp | //Dibuat oleh <NAME>
//Tanggal dibuat 11 september 2024
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int minpenjualan = 500000; //Penjualan minimum untuk mendapatkan komisi
int komisi = 0, penjualan = 0;
cout << "Total Penjualan salesman; "; cin >> penjualan;
//komisi pertama
if(pen... | ALGO | 0.957051 | 4.282739 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-15T10:02:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aceae0f4f952... |
467800bc-8df8-428a-8509-3f8907d9ee18 | Hawstein/cracking-the-coding-interview | 10.4.cpp | #include <iostream>
using namespace std;
const int INF = ~(1<<31);
void swap(int &a, int &b){
a = a^b;
b = a^b;
a = a^b;
}
int flipsign(int a){
int d = a < 0 ? 1 : -1;
int opa = 0;
while(a != 0){
a += d;
opa += d;
}
return opa;
}
int abs(int a){
if(a < 0) a = flipsi... | ALGO | 0.999887 | 3.728862 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2013-01-26T08:48:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1473,
"forks": 642,
"issues": 2,
"pull_requests": 5
},
"file_meta": {
"content_id": "b83c... |
c422920c-a770-4206-aaaa-7e71ef4a38c8 | minh47857/CPlusPlus | 21.22-HSGQG/CoHuong/1-11/latxu_codemau.cpp | #include <bits/stdc++.h>
#define TASK "latxu"
using namespace std;
#define free __free
#define int long long
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int N = 34;
const int inf = (int)1e9+7;
int m, n, rez = inf;
string infor[N];
vector < vector < int > > a, c;
vector < int > b;
int dirx[6] ... | ALGO | 0.999826 | 3.765249 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-10-16T15:16:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "656ddbb6d4... |
b773ef30-5fa6-476f-8970-d56bba7ce100 | zrmacc/MatrixOps | src/LinReg.cpp | // [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>
//' Ordinary Least Squares
//'
//' Fits the standard OLS model.
//'
//' @param y Nx1 Numeric vector.
//' @param X NxP Numeric matrix.
//'
//' @return List of model components.
//' @export
// [[Rcpp::export]]
SEXP FitOLS(
const arma::colvec y,
co... | ALGO | 0.997413 | 6.497473 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-09-11T18:46:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "947e8b3f2... |
7aa21603-43a9-40f3-8016-2d28b7643137 | qiushan996/helloalgorithm | LeetcodeTop100/12_technique/136_SingleNumber.cpp | /* 题目描述: 136_只出现一次的数字
Given a non-empty array of integers nums, every element appears twice except for one. Find that single one.
给定一个非空整数数组 nums,除一个元素外,其他每个元素都出现了两次。找出那个元素。
You must implement a solution with a linear runtime complexity and use only constant extra space.
您必须实现具有线性运行时间复杂度的解决方案并且仅使用恒定的额外空间。
Example 1:... | ALGO | 0.998463 | 5.767683 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2024-07-04T09:11: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": "42daf2d8... |
20321e76-3f73-4ab2-886b-088cc44a329c | stegua/binpacking | src/multibinpacking.cc | /// My typedefs
#include "dag_pack.hh"
/// Boost Timer
#include <boost/progress.hpp>
using boost::timer;
using namespace boost;
#include <fstream>
using namespace boost;
#include <map>
using std::map;
///------------------------------------------------------------------------------------------
/// Main function
i... | ALGO | 0.998789 | 3.811459 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2012-10-29T10:07:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4117a853... |
a074d056-a6d5-4680-827f-30b2fd0c0159 | CGAL/cgal | Linear_cell_complex/examples/Linear_cell_complex/linear_cell_complex_3_with_colored_vertices.cpp | #include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <iostream>
#include <algorithm>
struct Average_functor
{
template<class CellAttribute>
void operator()(CellAttribute& ca1, CellAttribute& ca2)
{ ca1.info()=(ca1.info()+ ca2.info())/2; }
};
struct Myitem
{
template<class Refs>
struct Dart_w... | ALGO | 0.90514 | 6.529957 | {
"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... |
5bdf4ee4-1fed-4aab-a774-d051fb25e17b | divyanshujain9196/DSA | Ass4/N-Queen.cpp |
#include<bits/stdc++.h>
using namespace std;
int grid[10][10];
int k=1;
void print(int n) {
for (int i = 0;i <= n-1; i++) {
for (int j = 0;j <= n-1; j++) {
cout <<grid[i][j]<< " ";
}
cout<<endl;
}
cout<<endl;
cout<<endl;
}... | ALGO | 0.999978 | 5.168177 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-10-27T18:39:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e783d8635f7a... |
c4acfeb7-99e0-44eb-b2be-56e44729fe0e | godinezseba/Proyecto-IAA-TS | src/Movements/SwapMatchRounds.cpp | #include <vector>
#include "../Entities/TabuList.cpp"
#include "../Entities/Tournament.cpp"
#include "../Entities/AuxiliarTabuEntities.cpp"
using namespace std;
/**
* Auxiliar movement to change the rivals for a team in two rounds
*/
void SwapTeamRival(vector<vector<int>> &scheduling, int roundA, int roundB, int tea... | ALGO | 0.999971 | 4.849925 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2020-06-13T19:13: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": "6163ff7cb... |
c55400f2-8f82-4523-9d73-2c221a564319 | AndanteKim/LeetCode_Practice | 0543-diameter-of-binary-tree/0543-diameter-of-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999764 | 6.401041 | {
"github_metadata": {
"branch": "main",
"commit_count": 13165,
"repo_created_at": "2022-12-31T06:32:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab8bad6a... |
41dd3b2c-f1f4-47ad-a30e-6819265a94e5 | ishandutta2007/codeforces-a | arayi/normal/1204/C.cpp | #include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <vector>
#include <cstring>
#include <ctime>
#include <set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <ctime>
#define fr first
#def... | ALGO | 0.999787 | 3.337298 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "b65560e26572... |
cc3cf2c5-5a49-4066-b7b9-cb05860f72e4 | gbernich/GridPark | ip.h | //-----------------------------------------------------------------------------
// File: ip.h
// Author: <NAME>
// Function: Provide functions to do the low level image processing.
//-----------------------------------------------------------------------------
#ifndef IP_H
#define IP_H
#include <stdio.... | TOOL | 0.93223 | 3.207407 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2017-02-10T00:08: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": "81db22a6... |
a5177a2b-9cfa-431c-8781-038a5692e6e6 | kamyu104/LeetCode-Solutions | C++/minimum-number-of-primes-to-sum-to-target.cpp | // Time: O(min(mlogm, n) + nlog(log(min(mlogm, n))) + m * n) = O(nlog(log(min(m, n))) + m * n)
// Space: O(n)
// number theory, knapsack dp
class Solution {
public:
int minNumberOfPrimes(int n, int m) {
static const int INF = numeric_limits<int>::max();
vector<bool> is_prime(n + 1, true);
... | ALGO | 0.999985 | 5.257299 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
f9e2bd8e-2fb4-40cc-ab02-aa00d9fd4a71 | preyansraval/cp_journey | A_Divide_and_Conquer.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(vector<int> v, int n) {
int oddCnt = 0;
for(auto num : v) {
if((num & 1) != 0)
oddCnt++;
}
if((oddCnt & 1) == 0) {
cout << 0 << "\n";
return;
}
int minOps = INT_MAX;
for(int num : v) {
int... | ALGO | 0.999937 | 4.698268 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-04-05T17:43: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": "3fcb9d4fa8d... |
ecf532dd-0940-4ffa-bcf8-52230ef8fdb0 | GHzbq/nowcoder | 5.twoStackOneQueue.cpp | // 用两个栈实现一个队列
#include <iostream>
#include <stack>
using namespace std;
// 2019.6.5 更新
class Solution
{
public:
void push(int node) {
/**
* 先考虑栈和队列的特性
* 栈: FILO 先进后出
* 队列:FIFO 先进先出
*
* push:入队列操作,我们不妨让所有的元素都入 stack1
*/
stack1.push(node);
... | ALGO | 0.999887 | 4.870901 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2018-10-05T14:21: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": "49e128299... |
89c00292-4a3e-4602-adc4-39c0c4f20182 | M-Rodrigues/Programming | Competitive Programming/gym/contests/#8/c.cpp | #include<bits/stdc++.h>
using namespace std;
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define cl(x, v) memset((x), (v), sizeof(x))
#define db(x) cerr << #x << " == " << x << endl
#define dbs(x) cerr << x << endl
#define _ << ", " <<
typedef long long ll;
typedef long double ld;
typ... | ALGO | 0.999938 | 4.458108 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2019-01-13T14:53:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c553dfcf4... |
46e7f8f2-4510-4327-ba7f-81c6459abb3c | emerencia/topcoder | SRMs/N-Z/TheBrickTowerMediumDivTwo.cpp | #include <string>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <utility>
#include <climits>
#include <cstring>
using namespace std;
// 554 500
class TheBrickTowerMediumDivTwo {
public:
int mindist;
vector<int... | ALGO | 0.999999 | 5.102123 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-12-03T23:20: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": "a7a208a1e5fb... |
444fece4-7d77-4e36-9f0b-9fb9c5230b65 | kaushikacharya/cpp_practise | online_judge/timus/1664_pipeline_transportation.cpp | // http://acm.timus.ru/problem.aspx?space=1&num=1664
#include <iostream>
#include <algorithm>
#include <fstream>
#include <queue>
#include <limits>
#include <vector>
#include <cassert>
const bool READ_FROM_FILE = false;
template<typename T1, typename T2>
class FlowEdge
{
public:
FlowEdge(T1 vertex1, T1 vertex2, T2 c... | ALGO | 0.99981 | 4.016441 | {
"github_metadata": {
"branch": "master",
"commit_count": 105,
"repo_created_at": "2016-04-17T13:57: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": "a37dea4b... |
3d15580d-627c-4206-a0ea-39b19220c837 | valpo-DylanBrown/projectEuler | c++/project05.cpp | /*QUESTION
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
*/
//SOLUTION
#include <iostream>
#include<math.h>
using namespace std;
int main(){
long long num;... | ALGO | 0.999889 | 5.396209 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-03-29T03:44:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d35b4bebd76... |
5f588e2e-e7b5-4d9f-b867-2a050911ca9c | Magikarp4000/comp-prog | USACO/bovine_genomics_SILVER.cpp | #include <bits/stdc++.h>
using namespace std;
#define OPTM ios_base::sync_with_stdio(0); cin.tie(0);
#define INF int(1e9+7)
#define ln '\n'
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define FOR(i,s,n) for (int i = s; i < n; i++)
#define FORR(i,n,s) for (int i ... | ALGO | 0.999935 | 3.726831 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-18T21:12: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": "ae88abfe6a8b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.