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 |
|---|---|---|---|---|---|---|---|
e592fdc4-28a6-40db-955c-b5471242ec0e | arneish/kdtree | kdtree.h | #include <iostream>
#include <stdio.h>
#include <set>
using namespace std;
class Node
{
//int ID;
public:
int split_dim; //which dimension does this node split on
int pivot; //arg {data[i]} which is stoed in the node
double median; //data[i][split_dim]: value of the dimension at which sp... | ALGO | 0.999334 | 4.736719 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-03-31T01:30:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4fadebe56... |
5e3b9489-473b-40d1-b9ba-536a3427c6be | ReactiveDrop/reactivedrop_public_src | src/public/XZip.cpp | //========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
// XZip.cpp Version 1.1
//
// Authors: <NAME> et al. (see below)
//
// Modified by: <NAME>
// ... | TOOL | 0.931244 | 3.060047 | {
"github_metadata": {
"branch": "reactivedrop_beta",
"commit_count": 4556,
"repo_created_at": "2022-04-24T18:18:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 161,
"forks": 38,
"issues": 246,
"pull_requests": 2
},
"file_meta": {
"conten... |
a85366f8-9880-4848-b366-f269ac7eaf9d | panwaria/ProjectEuler | 10_Summation_Primes.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main()
{
long num;
cout << "Enter the number: ";
cin >> num;
// if(num <= 0)
// {
// cout << "Invalid Input. Exiting!";
// return 1;
// }
// if(num == 1)
// {
// cout << "Ans: 2\n";
// ... | ALGO | 0.999984 | 3.533549 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-03-08T00:05:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adf570d22f... |
29b45246-8035-4519-b8f7-5e0588caa417 | xSeanliux/CompetitiveProgramming | TIOJ/1677/1677.cpp | #include <iostream>
#define int long long int
using namespace std;
int cnt[50], T, N, K;
bool get(int N, int K){
//cout << "Getting " << K << "th char of a_" << N << endl;
if(N <= 2) return (N - 1);
return (K > cnt[N - 2] ? get(N - 1, K - cnt[N - 2]) : get(N - 2, K));
}
inline void solve(){
cin >> N ... | ALGO | 0.999134 | 3.800239 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-11-18T06:45: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": "786921177... |
bafc5290-1ecf-48f1-a491-58507adb8449 | drewirvine/student141 | in-class/0305/minMaxFinished.cpp | /*************************************************************************
*
* In-Class Exercise and Demo: Reading and Writing Files
*
* File Name: minMax.cpp
* Course: CPTR 141
*
* Assignment:
* 1. Prompt user for both an input and output file name
* and do error checking.
* 2. Print the smallest... | TOOL | 0.918504 | 5.385768 | {
"github_metadata": {
"branch": "master",
"commit_count": 223,
"repo_created_at": "2022-11-25T09:02: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": "65772435... |
0a70b746-c0cf-411c-8eae-16625179ba71 | Splinter1984/algorithm_archive | codewars/cpp/MinesweeperNeighboringCells.cpp | /*We started implementing the minesweeper game, we already have a module for filling a SIZExSIZE matrix that places the mines (character 'o'), empty cells (character ' '), cells that are not revealed (character 'D') and cells that must be filled with a number that the represents the number of mines in the neighboring c... | ALGO | 0.998253 | 5.747963 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2021-02-25T11:46: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": "f3a512120b... |
0ff0772d-8686-4498-927e-78c85a74d128 | kamyu104/LintCode | C++/expression-evaluation.cpp | // Time: O(n)
// Space: O(n)
class Solution {
public:
/**
* @param expression: a vector of strings;
* @return: an integer
*/
int evaluateExpression(vector<string> &expression) {
stack<int> operands;
stack<string> operators;
if (expression.empty()) {
return 0;... | ALGO | 0.999907 | 5.613707 | {
"github_metadata": {
"branch": "master",
"commit_count": 1293,
"repo_created_at": "2015-02-16T16:25:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 631,
"forks": 261,
"issues": 1,
"pull_requests": 3
},
"file_meta": {
"content_id": "5ba... |
c826c560-995e-4443-92c5-29dfc6ce6a4a | Mungrun/Section_02 | BullCowGame/main.cpp | /* This is the console excutable, that makes use of the BullCow class
This acts as the view in a MVC pattern, and is responsible for all
user interaction. For game logic see the FBullCowGame */
#include <iostream>
#include <string>
#include "FBullCowGame.h"
using int32 = int;
using FText = std::string;
void PrintI... | TOOL | 0.90496 | 4.904697 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-12-12T22:52: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": "22f2599ac0... |
0291179b-a9da-4e5b-b9a7-37e6a1bbf374 | carrtesy/Problem-Solvings | bkj/1915/1915_dbg.cpp | #include <iostream>
using namespace std;
int main(void){
int n, m;
cin >> n >> m;
bool **arr = new bool*[n];
bool only_zeros = true;
for(int i = 0; i < n; i++){
arr[i] = new bool[m];
string s;
cin >> s;
for(int j = 0; j < m; j++) {
bool is_one = (s[j] ... | ALGO | 0.999973 | 3.895538 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2020-04-02T12: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": "6eebfebf4... |
90c6512f-b064-4e6a-b280-e824319e4a4f | Muneeb147/Data-Structures | PA4/sorts.cpp | #ifndef __SORTS_CPP
#define __SORTS_CPP
#include "sorts.h"
#include "list.h"
#include "list.cpp"
#include "HashC.cpp"
#include <time.h>
//=====================================================================================
ListItem<long> * merge (ListItem<long> *a ,ListItem<long> *b)
{
ListItem<long> * node=NULL;
i... | ALGO | 0.999877 | 4.053232 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-03-07T00: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": "31dea1122b... |
81695b40-1e28-47be-8141-740c59413f45 | Robegr42/RNG-Tests | MUS Test/mus.cpp | #include <iostream>
#include <cmath>
#include <math.h>
#include <bits/stdc++.h>
using namespace std;
/**
Expected (precomputed) value of parameter L.
*/
double varianceL [16] = {
0.690, 1.338, 1.901,
2.358, 2.705, 2.954,
3.125, 3.238, 3.311,
3.356, 3.384, 3.401,
3.410, 3.416, 3.419,
3.... | ALGO | 0.999323 | 4.574021 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-06-08T02:56:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b1b2dd27a7... |
30bf1a41-982f-4594-8aeb-b4baa6f7e855 | ayman-eltemsahi/problem-solving | cpp/leetcode/problems/lru-cache.cpp | #include <algorithm>
#include <cassert>
#include <cctype>
#include <iostream>
#include <unordered_map>
#include <vector>
typedef long long int ll;
typedef std::vector<int> vi;
using std::pair;
using std::string;
using std::vector;
#define FORN(i, n) for (int i = 0; i < (n); i++)
#define FORN1(i, n) for (int i = 1; i <... | ALGO | 0.998357 | 5.209509 | {
"github_metadata": {
"branch": "master",
"commit_count": 218,
"repo_created_at": "2019-01-08T09:17:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6bb08c4f... |
bcbae887-826c-4520-8b2b-c8289db39cbd | prakhar8922/Data-structures-and-algoritms-INTERVIEW-QUESTIONS | leetcode/dp/Jump Game.cpp | // You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.
// Return true if you can reach the last index, or false otherwise.
// Example 1:
// Input: nums = [2,3,1,1,4]
// Output: true
// Explan... | ALGO | 0.999986 | 6.110494 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2022-08-26T09:55:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8cbc993... |
754b129e-3e5d-404b-b49d-d4ba1dca2bdf | shah-zx/plus-plus-C | codechef/chefsubarr.cpp | #include <bits/stdc++.h>
#include <stack>
#include <queue>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
using namespace std;
#define vi vector<int>
#define vii vector<pair<int, int>>
#define pii pair<int, int>
#define rep(i, a, b) for (int i = a; i < b; i+... | ALGO | 0.99983 | 4.261022 | {
"github_metadata": {
"branch": "master",
"commit_count": 425,
"repo_created_at": "2021-09-05T16:01:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4132de19... |
5c73cdf9-092c-42d5-a67a-67c0281be4dd | andavarapulikith/CrackYourPlacement | Travelling_salesman_problem.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int min_value(vector<vector<int>>& cost, vector<vector<int>>& dp, int mask, int city) {
int n = cost.size();
if (mask == (1 << n) - 1) {
return cost[city][0];
}
... | ALGO | 0.999951 | 5.732226 | {
"github_metadata": {
"branch": "main",
"commit_count": 235,
"repo_created_at": "2024-07-17T03:53: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": "cfb6c9b9f3... |
6f17062e-e105-4433-b19e-f77e22aa88d0 | ankit-singh-dungriyal/Coding | Codeforces/1355E_Restorer Distance.cpp | // E. <NAME> (Codeforces Round #643 (Div. 2))
// Concepts used: Ternary search, Two Pointer, Basic Mathematic.
// 'By Anki'
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define wr(i) cout<<#i<<" = "<<i<<", ";
#defin... | ALGO | 0.999968 | 4.51946 | {
"github_metadata": {
"branch": "master",
"commit_count": 593,
"repo_created_at": "2020-05-13T17:12:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "265b445a... |
658718a7-1098-412c-a269-c83e6b1fb06a | HIITMetagenomics/dsm-framework | libcds/src/static_sequence/wt_node.h | /* wt_node.h
* Copyright (C) 2008, <NAME>, all rights reserved.
*
* wt_node
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your opti... | ALGO | 0.948277 | 5.299937 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2013-08-21T13:05:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "674926b972... |
592d1931-c2ee-48c9-ade0-77e016d90e64 | hasan2733/DSA_Practice_Problems | Graphs/LeetCode_Class_Schedule.cpp | class Solution {
public:
// here use DFS and topological sort
void DFS_visit(int u,vector<vector<int>>&adj,vector<int>&visited,vector<int>&d,vector<int>&f,int &timer,bool &cycle)
{
visited[u] = 1;
timer++;
d[u]=timer;
for(auto v:adj[u])
{
if(visited[v]==0)
... | ALGO | 0.999967 | 5.917753 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2025-05-03T16:17: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": "0b7f96168df... |
672f1b89-1323-4f85-9c3e-b148c5addc31 | sudsj/comp-new | fbhr1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define Debug(x) cout << "> " << #x << " : " << x << "\n";
#define DebugArr(a,n) For(i,0,n) cout << i << " : " << a[i] << "\n";
#define For(i,a,b) for(int i=(a);i<(b);i++)
#define ForD(i,a,b) for(int i=(a);i>(b);i--)
#define tests int t; cin>>t; while(... | ALGO | 0.999981 | 3.509894 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-11-07T20:13:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcadcb91a... |
059f85d3-98fe-4d8f-8f4a-f7e770f952ac | udemegane/rtcamp9 | tmp/path_trace.cpp | #pragma once
#include "path_trace.hpp"
#if USE_HLSL
#include "_autogen/ray_query_computeMain.spirv.h"
const auto &comp_shd = std::vector<char>{std::begin(ray_query_computeMain), std::end(ray_query_computeMain)};
#elif USE_SLANG
#include "_autogen/ray_query_computeMain.spirv.h"
const auto &comp_shd = std::vector<uint32... | TOOL | 0.965651 | 6.80737 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2023-08-08T08:51: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": "22a2506c91e... |
8a8a80b6-f777-4e67-a989-e89a76dfb01c | leoses/MARP_20_21 | Ejercicios/MARP_Ej_52/MARP_Ej_52/2.Centinela.cpp |
/*@ <answer>
*
* Nombre y Apellidos:
*
*@ </answer> */
#include <iostream>
#include <fstream>
#include <queue>
using namespace std;
/*@ <answer>
Escribe aquí un comentario general sobre la solución, explicando cómo
se resuelve el problema y cuál es el coste de la solución, en función
del tamaño del problema.... | ALGO | 0.999917 | 4.636499 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-05-30T19:20: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": "b1e16aebb196... |
022d17b0-ed76-4fb5-a331-34da857ba8e1 | adarshdbg/LeetCode | Leetcode_binary_search/count-negative-numbers-in-a-sorted-matrix.cpp | static const auto _____ = []()
{
// fast IO code : this I understand
ios::sync_with_stdio(false);
cin.tie(0);
return 0;
}();
class Solution {
public:
int binary(vector<int>&v,int l,int r,int n)
{
if(l==r)
{
if(v[l]<0)
return l;... | ALGO | 0.999993 | 5.349123 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2020-04-28T14:04:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36d14d3b... |
d3793a3e-326e-4be5-8ff2-afd6ff6acb87 | KhalidSyntax/Algorithm-and-Problem-Solving-Series | Algorithm-and-Problem-Solving-Level-2/Problem-26/Problem-26.cpp | #include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int RandomNumber(int From, int To)
{
int RandNum = rand() % (To - From + 1) + From;
return RandNum;
}
void FillArrayWithRandomNumbers(int arr[100], int& arrLength)
{
cout << "Enter number of elements :\n";
cin >> arrLength;
cout << "... | TOOL | 0.920986 | 4.174507 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-05-18T14:22: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": "ba02db22b645... |
73a7daef-da31-4314-b597-bf19fb2c5c11 | Ishita1604/Striver-s-SDE-Sheet | Day 2 - Arrays Part II/01_RotateImage.cpp | /**** LeetCode 48 - Rotate Image ****/
#include <bits/stdc++.h>
using namespace std;
/**** Brute Force Approach: ****/
// Time: O(n * n)
// Space: O(n * n)
vector<vector<int>> rotate(vector<vector<int>> &matrix)
{
int n = matrix.size();
vector<vector<int>> rot_matrix(n, vector<int>(n));
for (int i = 0; i ... | ALGO | 0.999992 | 6.448118 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-03-01T16:49: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": "594261b006b2... |
3ddb95d2-14f3-44be-a616-a3caaa2f02b8 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1243/Standings5/29765165_64393743.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <random>
#include <vector>
#include <assert.h>
#include <set>
#include <unordered_set>
#include <numeric>
#include <map>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <iomanip>
#include <bitset>
#include <sstream>
#pragma warning(disa... | ALGO | 0.999985 | 4.164498 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40: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": "470476d04... |
8908b318-3c1d-4de4-b853-fc984989bebd | linfanps/leetcode | AddBinary.cpp | /**
* Source : https://oj.leetcode.com/problems/add-binary/
* Author : linfan
* Date : 2015-02-11
*
* Given two binary strings, return their sum (also a binary string).
* For example,a = "11" b = "1" Return "100".
*/
class Solution {
public:
string addBinary(string a, string b) {
/* 特殊处理,a或b为空 *... | ALGO | 0.999967 | 5.611844 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-02-03T11:52:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c84aa0571d... |
57ec18e3-6381-4c4a-b8ec-3f00f9383acd | shreyaschavhan/100-days-of-code | Day 054 - 24th November 2020/Day-023-BST-Level-Order-Traversal.cpp | #include <iostream>
#include <cstddef>
#include <queue>
#include <string>
#include <cstdlib>
using namespace std;
class Node{
public:
int data;
Node *left,*right;
Node(int d){
data=d;
left=right=NULL;
}
};
class Solution{
public:
Node* insert(Node* ro... | ALGO | 0.999979 | 4.913601 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2020-10-02T15:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c2f3949c99... |
f53b8c2e-b988-4f5d-9d2b-149f85af1064 | cosinehere/Crypto-Methods | CryptoMethods/Twofish.cpp | #include "pch.h"
#include "Twofish.h"
#include "CryptoTemplates.h"
namespace CryptoMethods {
#define M_TABLE
#define MK_TABLE
#define ONE_STEP
/* finite field arithmetic for GF(2**8) with the modular */
/* polynomial x^8 + x^6 + x^5 + x^3 + 1 (0x169) */
constexpr uint16_t G_M = 0x0169;
constexpr... | ALGO | 0.999764 | 5.705206 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2021-06-23T08:43: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": "a4cf6bcb2b... |
8f7b7fe9-629f-4b0d-9bf4-dba7d2ad0d40 | Sevyyy/CVPR-course | 14301027+Ex5/canny.cpp | #include <cstdlib>
#include <iostream>
#include "canny.h"
#include "CImg.h"
using namespace cimg_library;
using namespace std;
#define ffabs(x) ( (x) >= 0 ? (x) : -(x) )
#define GAUSSIAN_CUT_OFF 0.005f
#define MAGNITUDE_SCALE 100.0f
#define MAGNITUDE_LIMIT 1000.0f
#define MAGNITUDE_MAX ((int) (MAGNITUDE_SCALE * MAGN... | ALGO | 0.994556 | 4.903325 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-09-04T05:13: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": "109d76eb52... |
ad93406e-2fc5-4148-b30b-85f9bbe90c66 | sjy234sjy234/KinectFusion-ios | KinFu-ios/KinFu-ios/Utility/Math/MathUtilities/MathUtilities.hpp | #include <simd/simd.h>
#include "Eigen.hpp"
using namespace simd;
typedef struct
{
float4 position;
float2 texCoords;
} TextureVertex;
/// Builds a translation matrix that translates by the supplied vector
float4x4 matrix_float4x4_translation(const float3 &t);
float4x4 matrix_float4x4_translation(const floa... | ALGO | 0.963222 | 5.821964 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-03-18T04:31:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 46,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fbabbfa... |
088e0805-5599-496a-91b9-e531c913295e | lixiaodongcq/Data-structure-algorithm | c/tongji.cpp | /*
定义一个month的数组,表示每个月份的天数。在程序中对闰年进行单独处理。
定义一个result的数组,表示星期一到星期天17号落在每个星期的个数。
根据提示 2017年1月17日是星期二,可以对应调整数组的位置。
*/
#include<iostream>
using namespace std;
int main()
{
int isLeap,month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31},result[7];
int n =1;
int i,j,sum=0;
for(i=2017;i<=2017+n-1;i++)
... | ALGO | 0.999293 | 3.272129 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-09-03T12:56:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac8e5ceee2... |
cc695ae6-27c3-4bf7-baa8-cc85d005e54a | sony-string/beakjoon | Beakjoon/16978-seqAndQuery.cpp | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <algorithm>
#include <assert.h>
using namespace std;
typedef long long li;
typedef pair<pair<int, int>, pair<int, int>> SumQuery;
typedef vector<SumQuery> SumQueries;
typedef pair<int, int> Query;
typedef vector<Query> vq;
typedef vect... | ALGO | 0.999832 | 4.607155 | {
"github_metadata": {
"branch": "master",
"commit_count": 284,
"repo_created_at": "2023-03-28T10:33: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": "ae132fe2... |
2b4cad46-a518-42d8-8641-f67b1f21b4c3 | DQSSSSS/Algorithm-Competition-Code | 计蒜客/3870/D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef pair<LL,int> pli;
typedef pair<LL,LL> pll;
const int SZ = 2e6 + 10;
const int INF = 1e9 + 10;
const int mod = 100003;
const LD eps = 1e-8;
LL read() {
LL n = 0;
char a = getchar();
... | ALGO | 0.999966 | 3.899872 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-11-02T16:48: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": "3336bec0c7... |
dbca3f37-cb9b-4f28-a1e1-d153b6e6029d | checkoutb/atmf | cf/ge1700/CF1721_D_1800_2022-09-03_Maximum_AND.cpp |
//#include <time.h>
//#include <windows.h>
//#include <sstream>
//#include <climits>
//#include <fstream>
//#include <cstdio>
//#include <cstring>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
//#include <cstdlib>
//#include <cmath>
//#include <stack>
//#includ... | ALGO | 0.99996 | 4.532894 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-08-31T13:21: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": "e3af0d1eaf6... |
a2fdd9f0-7d5a-4ab8-a1fc-756357f8ea21 | Arpit-Khandelwal/CPP-Practice | DSA450/Arrays/10.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
int minJumps(int arr[], int n)
{
// Your code here
int count = 0;
// logic -1 -> jump as per array element - logical error
/*
for (int i = 0; i < n - 1;)
{
if (arr[i] == 0)
return -1;
... | ALGO | 0.999963 | 4.732989 | {
"github_metadata": {
"branch": "master",
"commit_count": 503,
"repo_created_at": "2021-05-23T07:21: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": "190b1f35... |
258c0815-211b-433d-a4fa-655142ba0c80 | Reshu-Bhatt3429/DSA | merge.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<vector<int>> merge(vector<vector<int>>& intervals) {
if (intervals.empty()) return {};
sort(intervals.begin(), intervals.end(), [](const vector<int>& a, const vector<int>& b) {
return a[0] < b[0];
... | ALGO | 0.999991 | 6.112735 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2025-03-22T05:41: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": "dd4c7db9e4d... |
360e50c4-b95f-4b5e-9b46-fd6aa10f22ed | yshshrm/Data-Structures-And-Algorithms-Hacktoberfest18 | cpp/algorithms/SudokoSolver.cpp | #include<iostream>
using namespace std;
///N=9;
int n=9;
bool isPossible(int mat[][9],int i,int j,int no){
///Row or col nahin hona chahiye
for(int x=0;x<n;x++){
if(mat[x][j]==no||mat[i][x]==no){
return false;
}
}
/// Subgrid mein nahi hona chahiye
int sx = (i/3)*3;
... | ALGO | 0.999784 | 5.247004 | {
"github_metadata": {
"branch": "master",
"commit_count": 1148,
"repo_created_at": "2018-10-01T16:19:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 203,
"forks": 1092,
"issues": 7,
"pull_requests": 847
},
"file_meta": {
"content_id": "... |
18cd46c7-0fa7-4fbd-b8cc-e199f3a4077a | Jarkyc/COSC-220 | Homework/Homework08/Part 5/PriorityQueue.h | #ifndef PRIORITYQUEUE_H
#define PRIORITYQUEUE_H
#include <iostream>
#include <vector>
using namespace std;
template<class T>
class PQNode {
public:
T data;
int priority;
PQNode(T Data) {
data = Data;
priority = 1;
}
PQNode(T Data, int Priority) {
data = Data;
if ... | TOOL | 0.978018 | 5.633467 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2023-01-31T15:55: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": "df56d66f6... |
5a7e446e-398e-4b14-a831-159bc79baaa0 | NOVAZHOU2/RealisticEval-Data-1 | all/t260/c&cpp/answer.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <boost/algorithm/string.hpp>
struct Row {
std::vector<std::string> cells;
};
bool has_two_or_more_empty_columns(const Row& row) {
int count = 0;
for (const auto& cell : row.cells) {
if (cell.empt... | DATA | 0.963563 | 7.413082 | {
"github_metadata": {
"branch": "main",
"commit_count": 164,
"repo_created_at": "2024-10-02T09:07:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "635da69110... |
87f8adea-53e7-43c6-a41d-12660509794e | PakinDioxide/temp | cses/1652.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, q;
cin >> n >> q;
int sum[n+1][n+1];
for (int i = 0; i <= n; i++) {
sum[0][i] = sum[i][0] = 0;
}
for (int i = 0; i < n; i++) {
string s;
cin >> s;
for (int j = 0; j < n; j++) {
s... | ALGO | 0.999629 | 4.426817 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-10T10:36: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": "082b44ea515... |
178bfe77-eb1c-4ebf-9c7a-36be06c10414 | 17Ved/Cpp | procedureoriented/funcandfuncnprototype.cpp | #include<iostream>
using namespace std;
// Function prototype
// type function-name (arguments);
int sum(int a, int b); // This is function prototype
// int sum(int, int); // This line is also acceptable while declaring function prototype
// The above line is telling compiler that function named as sum()... | TOOL | 0.986224 | 4.116108 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-08-13T05:29: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": "2200998bd591... |
5534c279-84ad-42f3-88f0-5c2a47eb2897 | QuwsarOhi/CodeTree | catagory/string processing/hashing/Prefix Suffix Matches binary search Password.cpp | // Codeforces
// <NAME>
// http://codeforces.com/problemset/problem/126/B
// Generate all Prefix and Suffix Match
// Then Binary search for the longest Match string using that Hash values
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
const ll mod1 = 1e9+9, mod2 = 1e9+7,... | ALGO | 0.999954 | 3.717957 | {
"github_metadata": {
"branch": "master",
"commit_count": 816,
"repo_created_at": "2016-12-02T12:39:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3345dcc8... |
33384fb2-cfd3-4290-81b6-264711af4ddc | dh434/leetcode | tree/110. 平衡二叉树.cpp | /*
给定一个二叉树,判断它是否是高度平衡的二叉树。
本题中,一棵高度平衡二叉树定义为:
一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过1。
示例 1:
给定二叉树 [3,9,20,null,null,15,7]
3
/ \
9 20
/ \
15 7
返回 true 。
示例 2:
给定二叉树 [1,2,2,3,3,null,null,4,4]
1
/ \
2 2
/ \
3 3
/ \
4 4
返回 false 。
*/
class Solution {
public:
bool isB... | ALGO | 0.999884 | 6.013356 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-06-18T07:21:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39b987dd80... |
60911ed4-95fa-4078-96de-b6e863cc6bab | Johniel/contests | atcoder/abc092/B/main.cpp | // atcoder/abc092/B/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/
#include <bits/stdc++.h>
#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))
using namespace std;
typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;
template<typename... | ALGO | 0.999761 | 4.265022 | {
"github_metadata": {
"branch": "master",
"commit_count": 2608,
"repo_created_at": "2015-12-28T16:38: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": "e358f68... |
5eebf7f7-2845-40b1-a714-44825b027924 | nihaljn/algorithms | network-flow/main.cpp | /**
* @file main.cpp
* @brief driver file for Ford Fulkerson algorithm and calculation of min st cut
*/
#include <iostream>
#include "fordfulkerson.hpp"
int main(int argc, char* argv[])
{
char* path = (char*)"data/test1.txt";
// the path to the data can also be passed as an argument
if (argc > 1)
... | ALGO | 0.997657 | 3.929588 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-04-24T23:08: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": "b40f71551... |
59dcf2ee-e70b-47c8-beb2-7ae6d03a7446 | Julig1/Ant-Colony | Version_6.cpp | #include <SFML/Graphics.hpp>
#include <Windows.h>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
//Global variables
#define RAD_PER_DEG (float)(0.01745329238F)
#define SPEED (float)(2.0F)
#define MAX_X 1000
#define MAX_Y 1000
#define NUMBER_OF_ANTS 10
#define SENSERANGE ... | TOOL | 0.978724 | 3.739902 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-04-03T20:20: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": "c0ffd3603eeb... |
da43edfb-af2e-4be4-9058-7f637f28e424 | arshpreet8051/Graphs | 37_Kruskal_algorithm_1.cpp | #include<iostream>
#include<priority_queue>
using namespace std;
/*
Note :
- This is Kruskal Algo approach to find min weight of MST
- Uses Disjoint Set - Union by size
- Uses Priority Queue to sort weights
*/
class disjoint_set{
vector<int> size,parent;
p... | ALGO | 0.999983 | 5.103006 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2024-02-17T14:42: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": "77d80eaf997... |
873f1939-2722-4bf3-93e6-c0310a340403 | SokolovaNastya/HSE-2D-image-processing-course | ww6/main.cpp | #include <vector>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/objdetect.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include "opencv2/imgcodecs.hpp"
#include <opencv2/tracking.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/vi... | TOOL | 0.971258 | 4.963414 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-04-30T07:08:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e611a05c7ee1... |
3c9c5395-3637-4cd6-a41f-32eb4d5f5e26 | NgTienHungg/PTIT-Source | SPOJ PTIT/ITWEEK3C.cpp | // https://code.itptit.com/problems/100051
// Bí kíp luyện rồng
#include <bits/stdc++.h>
using namespace std;
int main()
{
int s, n;
cin >> s >> n;
int a[n][2];
for (int i = 0; i < n; i++)
{
cin >> a[i][0] >> a[i][1];
}
// Sort
for (int i = 0; i < n - 1; i++)
{
for ... | ALGO | 0.999998 | 3.7669 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2021-07-04T02:14:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 130,
"forks": 36,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "791d69f... |
a732183c-7b32-4023-824a-4ff828dd5282 | RohitBishla/LeetCode_Practice | Maximum Sub Array - GFG/maximum-sub-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
vector<int> findSubarray(int a[], int n) {
// code here
int ans1 = INT_MIN;
int start = 0;
int end = 0;
int tempStart = 0;
// int tempEnd = ... | ALGO | 0.999208 | 5.459312 | {
"github_metadata": {
"branch": "master",
"commit_count": 665,
"repo_created_at": "2022-10-12T11:14:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96a3197b... |
57420fd8-e001-40ab-82da-5bf81d644919 | jpalmeidaalves/CPP09 | ex02/PmergeMe.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PmergeMe.cpp :+: :+: :+: ... | ALGO | 0.996248 | 5.813948 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-12-01T17:47: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": "44cabb557275... |
a31725a8-32a2-4464-9db3-1df682f73f9c | sonalkr132/algos | VOTERS.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int compare(const void *a, const void *b)
{
return *((int *)a) - *((int *)b);
}
int main(){
int n1, n2, n3;
cin >> n1 >> n2 >> n3;
int total = n1+n2+n3, input;
int arr[total], ans[50000];
for(int i=0; i < total; i++){
cin >> input;
... | ALGO | 0.999994 | 3.762529 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2015-11-27T09:28:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db44b6ea3... |
84b31922-5885-4bb0-8266-831ff309d950 | KCL-BMEIS/niftyreg | reg-lib/cpu/_reg_mrf.cpp | #include "_reg_mrf.h"
//DEBUG
#include <iostream>
#include <fstream>
#include "_reg_ReadWriteBinary.h"
//DEBUG
/*****************************************************/
reg_mrf::reg_mrf(int _discrete_radius,
int _discrete_increment,
float _reg_weight,
int _img_dim,
... | ALGO | 0.998023 | 4.535193 | {
"github_metadata": {
"branch": "master",
"commit_count": 1069,
"repo_created_at": "2018-05-21T16:34:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 159,
"forks": 45,
"issues": 39,
"pull_requests": 4
},
"file_meta": {
"content_id": "0144... |
cc00aa9b-a345-4d15-8c7f-c5f52188889a | otaviosouza/programming-datastructures-nyu | cpp-prg-2/module5/01-1_primality-testing.cpp | /*************************************************
* 01-1_primality-testing.cpp - Module 5 *
* Write a program that reads from the user *
* an integer and and determines whether the *
* number is prime or not. *
* Assume that the value is greater than two. *
* History: ... | ALGO | 0.991971 | 4.957735 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2021-03-16T00:45: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": "1f3c2aaaf41... |
f4a4c6be-30ef-4389-b480-534f54f71920 | AleksandraYanum/RitchieKerniganC | Ex_2.5/Ex_2.5.cpp | #include <stdio.h>
#include <stdlib.h>
/*
Program returns the first location in the string s1 where any character from the string s2 occurs,
or-1 if s1 contains no characters from s2
*/
//###########################################################################
// functions
// #####################################... | ALGO | 0.962018 | 4.586188 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2021-04-23T10:59:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e1eab18... |
464fa12b-5dfe-414a-a9e5-f30f9f8444d9 | Tomoki-Kikuta/atcoder | atcoder過去問/m-solutions-3.cpp | #include<iostream>
#include<algorithm>
#define MOD 1000000000 + 7
#define MAX 100000 + 5
using namespace std;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit(){
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++){
fac[i] = fac[i - 1] * i % MO... | ALGO | 0.99994 | 4.337497 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2019-04-29T04:50: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": "a54572e1... |
3aee23a3-8512-47ef-a1cb-a46eb2e5f135 | wdjpng/soi | workshop 2020/Graph contest/knights/main.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
#define int long long
using namespace std;
bool isValidPosition(int x, int y, int& n){
if(x < 0 || y < 0 || x >= n || y >= n){
return false;
}
return true;
}
signed main() {
cin.tie(0);
ios_base::sync_with_stdio(f... | ALGO | 0.999918 | 3.620493 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2019-02-17T10:35:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7795f171d... |
4c309a14-eff7-4df5-80b1-9c40a2e9d3f3 | rodneydup/Pisces | source/FFT.cpp | #include "AudioPlatform/FFT.h"
#include <cmath>
namespace ap {
void FFT::setup(unsigned size) {
this->size = size;
init(size);
magnitude.resize(audiofft::AudioFFT::ComplexSize(size), 0);
phase.resize(audiofft::AudioFFT::ComplexSize(size), 0);
}
void FFT::forward(const float* data) {
// make aliases for the... | ALGO | 0.963469 | 6.230212 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2018-03-01T08:18:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e06ae6e... |
feacf815-2d0b-4311-918b-91ed541acd10 | bruce1408/Alogrithm_Datastruct | DFS/46_permutation.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Given an array nums of distinct integers,
* return all the possible permutations.
* You can return the answer in any order.
*
* Example 1:
* Input: nums = [1,2,3]
* Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
... | ALGO | 0.999983 | 5.346609 | {
"github_metadata": {
"branch": "master",
"commit_count": 1617,
"repo_created_at": "2018-04-04T09:28:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3daf50... |
9eef8118-46a4-47be-a0f6-c205fb07718d | Hamsik2rang/Today-I-Solved | Problems/Dynamic_Programming/2618.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <cstring>
#include <utility>
#include <queue>
using namespace std;
#define MAXN 1001
int n, w;
vector<pair<int, int>> crime;
int memo[MAXN][MAXN];
int distance(const pair<int, int>& p1, const pair<int, int>& p2)
{
return (abs(p2.first -... | ALGO | 0.999894 | 3.459664 | {
"github_metadata": {
"branch": "main",
"commit_count": 310,
"repo_created_at": "2021-03-05T00:53:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12628ab49a... |
f78b72d3-5da4-4b33-ae60-0b9b3d8ffd8e | kamyu104/LeetCode-Solutions | C++/check-for-contradictions-in-equations.cpp | // Time: O(e + q)
// Space: O(n)
// union find
class Solution {
public:
bool checkContradictions(vector<vector<string>>& equations, vector<double>& values) {
static const double EPS = 1e-5;
UnionFind uf;
for (int i = 0; i < size(equations); ++i) {
if (!uf.union_set(equations[i]... | ALGO | 0.999593 | 6.062781 | {
"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": ... |
f7f6816f-e0e9-4985-9467-710ea8f3b6e3 | rafaels100/Algoritmos-3-LCD-UBA | Ejercicios_interesantes/LIS_LDS/longest_increasing_subseq.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
/*
IDEA:
La idea es pararme en un lugar j del array y ver si puedo extender un LIS a partir de todos los i elementos anteriores a j.
Puedo extender si para algun i perteneciente a [0 -> j), ocurre que s[j] > s[i]. Extiendo agarrando la sol... | ALGO | 0.999954 | 4.769893 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-08-11T21:38: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": "2e3839f5949... |
4e324c0d-aef5-4872-ba1c-3b9865a47855 | zm-reborn/zmr-game | src/game/server/npcr/npcr_path_follow.cpp | #include "cbase.h"
#include "npcr_motor.h"
#include "npcr_path_follow.h"
ConVar npcr_debug_path_avoid( "npcr_debug_path_avoid", "0" );
ConVar npcr_debug_path_stuck( "npcr_debug_path_stuck", "0" );
// 80 degrees
#define STUCK_ANGLE_START 1.39626f
class CAvoidTraceFilter : public CTraceFilterSimple
{
public:... | ALGO | 0.972919 | 3.590195 | {
"github_metadata": {
"branch": "dev",
"commit_count": 1723,
"repo_created_at": "2017-08-03T13:16:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 44,
"forks": 12,
"issues": 32,
"pull_requests": 0
},
"file_meta": {
"content_id": "df9bba03... |
612be341-40f8-4fe1-82c4-4e43a1ec60ae | tmusale/Coding | linked list/delete_in_sll.cpp | /*
Delete a Node in Single Linked List
Delete xth node from a single linked list. Your task is to complete the method deleteNode
which takes two arguments: the address of the head of the linked list and an integer x.
The function returns the head of the modified linked list.
Input:
The first line of input conta... | ALGO | 0.999305 | 5.2532 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-30T18:15: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": "7d3869485a... |
a831390a-8975-476f-9004-1848b037877d | Gosstik/PD2023 | mpi/main.cpp | #include <iostream>
#include <fstream>
#include <cstddef>
#include <cstdlib>
#include <climits>
#include <vector>
#include <mpi.h>
//MPI_Send(
// void* /* указатель на начало данных */,
// int /* количество элементов */,
// MPI_INT/MPI_DOUBLE/... /* тип элементов (из списка стандартных MPI) */,
// int /* ... | ALGO | 0.9999 | 4.878151 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-05-26T15:26: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": "b8349635a6... |
f4fc26aa-3513-42a4-a901-3844807a7556 | Jaewoook/algorithm-study | baekjoon/4949/solution.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
void clear_stack(stack<char> &s) {
stack<char> empty;
swap(s, empty);
}
int main() {
cin.tie(0);
ios::sync_with_stdio(0);
string s = "";
stack<char> stack;
int size = 0;
bool is_pair = fal... | ALGO | 0.999967 | 4.491355 | {
"github_metadata": {
"branch": "master",
"commit_count": 333,
"repo_created_at": "2020-01-05T08:28:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74739911... |
e854d5a9-232f-4958-8cdc-a9b7e13346e3 | leo950413/Codeforces | Codeforces/Unknown/2126E/2126E.cpp | #include <iostream>
#include <vector>
#include <numeric>
using namespace std;
int gcd(int a, int b) {
while (b) {
a %= b;
swap(a, b);
}
return a;
}
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> p(n), s(n);
for (int i = ... | ALGO | 0.999897 | 4.590985 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2025-07-13T16:14:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35e9c2666... |
a5b85dfe-0e32-4361-aa6a-a59bde1d742a | min103jun/Algorithm | 백준/[4485]젤다.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
using namespace std;
int N, dir[4][2] = { {-1, 0}, {0, 1}, {1, 0}, {0, -1} };
int map[125][125];
int dp[125][125];
queue<pair<int, int>> Q;
int solution()
{
int i, j;
int tx, ty, nx, ny;
for (i = 0; i < N; i++) {
for... | ALGO | 0.999875 | 3.963647 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2019-08-31T07: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": "60933e44... |
07d568e7-04a1-4b60-b61f-c6217016b25c | ishandutta2007/codeforces-f | for_the_love/normal/374/C.cpp | #include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <stack>
#include <queue>
#include <cstdio>
#include <string>
#include <vector>
#include <cstring>
#include <sstream>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 1111;
const int dx[] = {0, 1, 0, -1};
const int dy[] =... | ALGO | 0.999663 | 3.401751 | {
"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": "8fe6b2644355... |
9775d2ae-2cd6-443e-a6f9-e5814669f01d | summerKK/data_structure_and_algorithms | 栈和队列/链栈.cpp | #include <iostream>
using namespace std;
//
// Created by 陈思贝 on 2019/12/10.
//
typedef char DatType;
typedef struct stacknode {
DatType data;
struct stacknode *next;
} StackNode;
typedef StackNode *LinkStack;
int StackEmpty(LinkStack top) {
return top == nullptr;
}
// &top :top是一个指针变量,最后 top = p 如果传递的... | ALGO | 0.979813 | 3.20799 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-12-28T06:20: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": "b3d1f44ce9... |
6f5a039f-a840-408a-9925-1368a492ba14 | lement3864/codetree-TILs | 241226/작은 구슬의 이동/small-marble-movement.cpp | // 1. 1초에 한 칸씩 이동
// 2. 배열의 끝에 닿으면 방향 전환(전환하는데 1초)
// 3. t초가 될때까지 반복
// 4. 마지막 위치 출력
#include <iostream>
using namespace std;
int n, t;
int r, c;
char d;
int arr[50][50];
int dy[4] = {0, 1, 0, -1};
int dx[4] = {1, 0, -1, 0};
// 이동하는 좌표가 배열 범위를 벗어나는지 체크하는 함수
bool Checked(int x, int y) {
return (1 <= x && x <=... | ALGO | 0.999921 | 4.253284 | {
"github_metadata": {
"branch": "main",
"commit_count": 1320,
"repo_created_at": "2024-07-29T02:34: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": "07351b962... |
51de6502-24f5-4816-93b1-53acef92f449 | kumarsgoyal/LeetCode | Stack/Validate Stack Sequences.cpp | class Solution {
public:
bool validateStackSequences(vector<int>& pushed, vector<int>& popped) {
stack<int> stk;
int i = 0; // pushed index
int j = 0; // poped index
int flag = 1;
while(i < pushed.size() || j < popped.size() && flag) {
if(i < pushed.size(... | ALGO | 0.999585 | 6.389086 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2020-02-22T17:19: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": "0e8faea9... |
953f4ea8-0a82-441c-a463-b7e0b717f1ff | mtao/MSc | src/solvers/linear/gauss_seidel/gauss_seidel.hpp | #ifndef GAUSS_SEIDEL_H
#define GAUSS_SEIDEL_H
#include "../linear.h"
/*
* Ax=b
*/
template <typename MatrixType, typename VectorType>
struct DenseGaussSeidelCapsule: public SolverCapsule<MatrixType, VectorType>
{
typedef MatrixType Matrix;
typedef VectorType Vector;
typedef SolverCapsule<Matrix,Vector> C... | ALGO | 0.999414 | 5.471728 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2012-12-17T23:09: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": "eaf7d2736c... |
e08641f7-e916-4180-8e75-b47b6dfe20d6 | tushargarg17/HACKTOBERFEST-2021 | code1.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long
#define loop(i, l, r) for (lli i = l; i < r; i++)
#define rev(i, r, l) for (lli i = r; i >= l; i--)
#define itr(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define endl "\n"
#define inputarray(arr, start, size) \
loop(i, start, size) { c... | ALGO | 0.99989 | 3.406276 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2021-10-01T08:24:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 27,
"issues": 0,
"pull_requests": 20
},
"file_meta": {
"content_id": "c83a02c... |
b3c5d10b-97e1-43b2-a376-7a82824c3b86 | raincross7/code-similarity | codes/train_code/problem085/problem085_412.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); rit... | ALGO | 0.999922 | 3.878668 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07: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": "0d2d994b0c1c... |
a9fbbeaa-8c3d-4348-b247-758047702a80 | SOUMITRO-SAHA/DSA-Data-Structure-and-Algorithms | 02. DSA Theory/002. DSA in CPP/01_Array_ADT/Practice Questions Set/CodeHelp Practice Questions/04-Array_Intersection.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int arr1[] = {4, 9, 5};
int arr2[] = {9, 4, 9, 8, 4};
int n = sizeof(arr1) / sizeof(int);
int m = sizeof(arr2) / sizeof(int);
vector<int> v;
set<int> s;
int i = 0, j = 0;
while (i < n && j < m)
{
if (arr1[i] == arr2... | ALGO | 0.999746 | 3.532338 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2022-08-08T18: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": "467e6682579... |
51941468-891e-4bef-85cd-36ea438c4329 | VVVofka/MultiAmp | WinDxDLL/AMPEng2.cpp | #include "pch.h"
#include "AMPEng2.h"
void AMPEng2::initialize_data(){
int seed = model.options.seedRnd();
if(seed >= 0)
gen.seed(seed);
else
gen.seed(rd());
distLastAY = std::uniform_int_distribution<int>(0, model.sizeY() - 1);
distLastAX = std::uniform_int_distribution<int>(0, model.sizeX() - 1);
nlastlay =... | ALGO | 0.96863 | 3.994734 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-12-12T14:43:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39bd641e4... |
8b799161-7f6e-415a-bdd3-231facb88f55 | tec-csf/tc2017-t1-primavera-2020-equipo-1-2 | sources/oeAnalyzer.cpp | #include "oeAnalyzer.h"
#include "printers.h"
#include "simplificacion.h"
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <vector>
#include <queue>
using namespace std;
int vr, flag; //saves first line of while, for and if
int lineaF; //saves last line of while, for and if
string Pf[]={"for", "whil... | ALGO | 0.951734 | 3.27703 | {
"github_metadata": {
"branch": "master",
"commit_count": 257,
"repo_created_at": "2020-02-21T13:20:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c40820870... |
a4b07ef5-398a-485b-9fe5-e5f742b7d8b5 | anuragrajpoott/DSA | graph/bfsGraph.cpp | #include <iostream>
#include <queue>
#include <unordered_map>
#include <set>
#include <list>
using namespace std;
void prepareAdjList(unordered_map<int, list<int>> &adjList, vector<pair<int, int>> &edges)
{
for (int i = 0; i < edges.size(); i++)
{
int u = ed... | ALGO | 0.999984 | 4.909797 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2025-02-07T10:56: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": "cf43626ba9b... |
71b80f5d-ff69-4412-ae24-41e9421e8cf3 | ryancoleman/lotsofcoresbook2code | Pearls2_Chapter09/Dependencies/src/qdpxx/examples/mesplq.cc | // $Id: mesplq.cc,v 1.17 2006-01-12 02:17:39 bjoo Exp $
/*! \file
* \brief Plaquette measurement
*/
//
#include "examples.h"
using namespace QDP;
// Primitive way to indicate the time direction
static int tDir() {return Nd-1;}
//! Return the value of the average plaquette normalized to 1
/*!
* \param u -- gauge ... | ALGO | 0.985335 | 4.414393 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2015-08-31T00:21:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 38,
"forks": 24,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6a3e9a... |
4e979278-f5d1-493e-b268-b570d7f5cf32 | hetp111/Algorithms | codingblocks/segment_trees_Query_Bits_LazyProp.cpp | #include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD 1000000007
#define eps 1e-8
#define FASTER ios_bas... | ALGO | 0.999939 | 4.976111 | {
"github_metadata": {
"branch": "master",
"commit_count": 277,
"repo_created_at": "2018-10-20T11:25:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8555d375... |
90de8e24-7fff-4813-93fb-571baa1300f3 | OpenMagnetics/MKF | src/physical_models/InitialPermeability.cpp | #include "physical_models/InitialPermeability.h"
#include "physical_models/AmplitudePermeability.h"
#include "support/Utils.h"
#include <cmath>
#include <filesystem>
#include <fstream>
#include <iostream>
#include "spline.h"
#include <magic_enum.hpp>
#include <numbers>
#include <streambuf>
#include <vector>
#include ... | TOOL | 0.948306 | 7.497586 | {
"github_metadata": {
"branch": "main",
"commit_count": 529,
"repo_created_at": "2022-07-30T23:12:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 27,
"pull_requests": 0
},
"file_meta": {
"content_id": "384e83222... |
75913f43-deb4-4cc4-bae4-f637ff92e321 | musfiqurR661/SadiaS-AIUB-Folder | Data Structure Assignment (3)/Data Structure Assignment/Assignment/4.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <string>
using namespace std;
// Structure to store point data
struct Point {
string name;
int x;
int y;
};
// Function to calculate the distance from the origin
double calculateDistance(int x, int y) {
return sqrt(x * x + y * y); // Euc... | ALGO | 0.999763 | 5.225749 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-12T07:57: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": "eb0e37f5d9d4... |
988f0aac-b51d-4302-85ba-6036bede1a22 | ixray-team/ixray-1.6-stcop | src/3rd party/MagicSoftware/Sdk/Include/MgcMinimizeND.h | // Magic Software, Inc.
// http://www.magic-software.com
// Copyright (c) 2000-2002. All Rights Reserved
//
// Source code from Magic Software is supplied under the terms of a license
// agreement and may not be copied or disclosed except in accordance with the
// terms of that agreement. The various license agreemen... | ALGO | 0.999477 | 5.114635 | {
"github_metadata": {
"branch": "default",
"commit_count": 2678,
"repo_created_at": "2019-06-29T15:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 232,
"forks": 47,
"issues": 43,
"pull_requests": 2
},
"file_meta": {
"content_id": "794... |
28c50b25-b806-4383-b479-bfd54f98af7e | agadhitya/Mujoco-RL | ros_ws/src/projects/conveyor_grasping/conveyor_picking/src/main.cpp | #include <stdlib.h>
#include <string>
#include <math.h>
#include <random>
#include <chrono>
#include <ros/ros.h>
#include <trajectory_msgs/JointTrajectoryPoint.h>
#include <trajectory_msgs/JointTrajectory.h>
#include <moveit_planner/MoveCart.h>
#include <moveit_planner/MovePose.h>
#include <moveit_planner/MoveAway.h>... | ALGO | 0.941337 | 5.962044 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-17T18:43:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3c344b70a2d... |
373c4a99-37f8-403d-a53a-3477633f7a91 | cda-tum/mqt-limdd | extern/qfr/test/main.cpp | /*
* This file is part of MQT QFR library which is released under the MIT license.
* See file README.md or go to https://www.cda.cit.tum.de/research/quantum/ for more information.
*/
#include "QuantumComputation.hpp"
#include "algorithms/Grover.hpp"
#include "algorithms/QFT.hpp"
#include "dd/Export.hpp"
#include "d... | ALGO | 0.965886 | 4.883229 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-08-18T12:41:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15,
"forks": 1,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "4fa7d703632... |
0b75dbeb-846b-4ffd-8124-7d20aae09f21 | turneja123/competitive-programming-library | Problem/Dynamic Programming/Equalization.cpp | //https://codeforces.com/contest/2075/problem/D
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define endl "\n"
#define ll long long
#define IOS ios_base::sync_with_stdio(false); cin.tie(nullptr);
const int K = 60;
const int S = 120;
const long lo... | ALGO | 0.999942 | 5.039241 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2024-03-11T08:36:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d5b7b6fe... |
3c939aef-b11e-470a-8099-68bc0009c28f | HJW-storage/CodingTest_Cplusplus | BAKEJOON/Simulation/14888.cpp | // https://www.acmicpc.net/problem/14888
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define PLUS 0
#define MINUS 1
#define MULTIPLE 2
#define DIVIDE 3
// 최대 < 11! : 완전탐색 가능.
// 주어진 수의 순서를 바꾸면 안 된다.
// 나눗셈은 정수 나눗셈으로 몫만 취한다.
// 음수를 양수로 나눌 때는 C++14의 기준을 따른다. 즉, 양수로 바꾼 뒤 몫을 취하고, 그 몫... | ALGO | 0.999978 | 4.6211 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2023-12-14T13:02: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": "ff6df47f... |
106f79a5-9fc9-43c2-9190-31671232d15a | c437yuyang/DayliExcercise_Old | 2016校招真题/京东_01_年终奖.cpp | /*
小东所在公司要发年终奖,而小东恰好获得了最高福利,他要在公司年会上参与一个抽奖游戏,游戏在一个6*6的棋盘上进行,上面放着36个价值不等的礼物,每个小的棋盘上面放置着一个礼物,他需要从左上角开始游戏,每次只能向下或者向右移动一步,到达右下角停止,一路上的格子里的礼物小东都能拿到,请设计一个算法使小东拿到价值最高的礼物。
给定一个6*6的矩阵board,其中每个元素为对应格子的礼物价值,左上角为[0,0],请返回能获得的最大价值,保证每个礼物价值大于100小于1000。
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>... | ALGO | 0.999113 | 4.635462 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-04-05T07:30: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": "56d01de48... |
e9bd92ab-84b8-4c53-9feb-6bea93429215 | Rurril/IT-DA-3rd | study/C++1/Week6/BOJ_1747_박건열.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <queue>
#include <string>
#include <map>
#include <iomanip>
#include <list>
#include <stack>
#include <cstring>
#include <cmath>
#include <set>
#define ll long long
using namespace std;
//https://www.acmicpc.net/problem/1747 소수&팰린드... | ALGO | 0.999838 | 5.131965 | {
"github_metadata": {
"branch": "master",
"commit_count": 1611,
"repo_created_at": "2020-08-20T10:49:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13491c... |
ec5e341d-a8de-441a-bbb8-bca249913d2d | etri/mw-nfd | tools/ndn-autoconfig-server/main.cpp | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2014-2019, Regents of the University of California,
* Arizona Board of Regents,
* Colorado State University,
* University Pierre & <NAME>ie, Sorbonne Un... | WEB | 0.908654 | 5.857833 | {
"github_metadata": {
"branch": "main",
"commit_count": 353,
"repo_created_at": "2020-12-22T01:06:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66b58e31bd... |
255036ea-fb34-4b44-bee5-592c54774967 | vdalessa/eikonal | eikonal-OF_v2112/eikonal.cpp | #include "fvCFD.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
simpleControl simple(mesh);
// ... | ALGO | 0.996694 | 3.150602 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2020-03-15T17:32:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7315d440b... |
0011e7ae-13e2-4a71-bddf-3a1d31cad72e | LE2B08/GE3 | Project/EngineLayer/Math/Vectors/Vector3.cpp | #include "Vector3.h"
#include "Matrix4x4.h"
Vector3 Vector3::Add(const Vector3& v1, const Vector3& v2)
{
Vector3 result{};
result.x = v1.x + v2.x;
result.y = v1.y + v2.y;
result.z = v1.z + v2.z;
return result;
}
Vector3 Vector3::Subtract(const Vector3& v1, const Vector3& v2)
{
Vector3 result{};
result.x = v1.x... | TOOL | 0.995245 | 6.278393 | {
"github_metadata": {
"branch": "master",
"commit_count": 390,
"repo_created_at": "2024-07-03T08:19:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "47178aa6... |
992ae8f6-b172-4b16-abe3-a597ffad00de | onglu1/acm | codelist/gym/The 16th Heilongjiang Provincial Collegiate Programming Contest/tH.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5+10;
int parent[MAXN];
long long counter = 0;
int find(int x) {
while (x != parent[x]) {
if (x < parent[x]) {
// Merge-by-rank and Path-compression
parent[x] = parent[parent[x]];
}
x = parent[x];
... | ALGO | 0.999894 | 3.897805 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2022-03-07T10:49:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e41e10f0d... |
ceabd140-9fd0-4edc-8565-5ffcca28e659 | dabufano44/CS1 | final_exam.cpp | // Final Exam
// <NAME>
// 12/15/17
#include <iostream>
#include <iomanip>
#include <ctime>
#include <vector>
using namespace std;
const int SIZE = 52;
int cards[SIZE] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,... | ALGO | 0.916787 | 3.602219 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-09-07T04:39:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2248818c8b... |
4a9c0121-ae8c-4d48-80ed-b32dffa11a12 | Pragnesh2208/LeetCode-Solution | Trie/#720 Longest Word in Dictionary.cpp | /**
* Optimal Solution to Solve Longest Word in Dictionary
* Time Complexity = O(N)
* Space Complexity = O(N)
*/
struct Trie {
Trie* link[26] = {NULL};
bool isEnd = false;
};
class Solution {
private:
Trie* root = new Trie();
void insert(string word) {
Trie* obj = root;
int n = word... | ALGO | 0.99995 | 5.853878 | {
"github_metadata": {
"branch": "main",
"commit_count": 572,
"repo_created_at": "2021-08-25T12:49:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b2faf725e... |
fe1859cd-1996-4e0c-a604-de5ae54ad7a9 | LroseC/OI | AtCoder/Beginner_236/F/main.cpp | #include <cctype>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
const char endl = '\n';
struct FastStreamInputOutput
{
using FSIO = FastStreamInputOutput;
template<typename T>
FSIO& operator>>(T &res)
{
res = 0; T f = 1; char ch ... | ALGO | 0.999997 | 4.061115 | {
"github_metadata": {
"branch": "main",
"commit_count": 914,
"repo_created_at": "2021-04-05T03:53:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ce6e39d87... |
1ae321b4-4297-4142-b6fb-46339150d010 | Isabela-Silverio-Cardoso-Pereira/soma-linhas-matriz | main (8).cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run a... | ALGO | 0.999745 | 4.616742 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-04-21T01:32:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fe5957c3c... |
7425e5e8-e276-446b-9488-306ff50b8b1f | RuthgerD/SRU | src/util/regex.cpp | #include "regex.h"
namespace sru::re {
auto re2_search(const std::string& pattern, const std::string_view str, int limit = -1) -> std::optional<std::vector<std::vector<std::string_view>>> {
std::string wrapped_pattern = "(" + pattern + ")";
const re2::RE2 re{wrapped_pattern};
if (!re.ok()) {
return... | TOOL | 0.932898 | 6.095776 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2021-01-22T18:38:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "446b56bc... |
60511763-d573-41d7-99a4-f1c26b45fc88 | mwashief/step | Codeforces/1251-1500/1320/1320B.cpp | /*
<NAME>
22 February 2021
1320 1320B
*/
#ifndef DEBUG
#pragma GCC optimize("O2")
#endif
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define fastio ios_base::sync_with_stdio(0)
#define untie cin.tie(0)
#define rep(i, n) for (int i = 0; i < n; i++)
... | ALGO | 0.999936 | 4.039913 | {
"github_metadata": {
"branch": "master",
"commit_count": 1440,
"repo_created_at": "2020-06-25T20:48:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d1f168... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.