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 |
|---|---|---|---|---|---|---|---|
d13e4b14-0c8e-4fc2-864c-760e7a07a6a6 | xuefarmer/GL-cache_reproduction | libCacheSim/traceAnalyzer/experimental/probAtAge.h | #pragma once
/* plot the probability of access vs access age and create age,
* and calculate the entropy of random variables X_ProbAtAge and X_createAge
* which follow probability distribution P(R_ProbAtAge) and P(R_createAge)
*/
#include <unordered_map>
#include <vector>
#include "../../include/libCacheSim/reader... | ALGO | 0.929694 | 5.459235 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2023-12-14T04:38: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": "df3228f15... |
6ccb5dd6-1339-43b7-99f9-7e84e1324a46 | GeometryCollective/fieldgen | src/Vertex.cpp | #include <vector>
#include <math.h>
#include <cassert>
using namespace std;
#include "Vertex.h"
#include "Mesh.h"
#include "HalfEdge.h"
#include "Quaternion.h"
namespace DDG
{
// returns the vertex normal
void Vertex::updateNormal( void ) {
Vector N(0,0,0);
HalfEdgeCIter h = he;
// PS: bugfix
d... | ALGO | 0.996136 | 4.741053 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-06-04T06:27:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 170,
"forks": 15,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "012ca6... |
0164a034-6ed3-42bc-a204-e7f4214ce300 | abhiXsliet/Solved-DSA-Problems | Pratice Problems Topic Wise/Line Sweep Algo/001-attend-all-meetings-ii.cpp | // https://www.geeksforgeeks.org/problems/attend-all-meetings-ii/1
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
private:
// TC : O(N*log(N))
// SC : O(N)
int approach_1(vector<int>& start, vector<int>& end) {
// minimum no. of mee... | ALGO | 0.999939 | 5.665318 | {
"github_metadata": {
"branch": "main",
"commit_count": 2156,
"repo_created_at": "2023-07-29T13:17:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab8b85d2c... |
b49231a1-d3bf-4899-8400-c970eefe3c8f | pranab99/MyCompetetiveSolutions | cps.cpp | #include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
void solve()
{ int
sort(deno, deno + n);
// Initialize result
vector<int> ans;
// Traverse through all denomination
for (int i = n - 1; i >= 0; i--) {
// Find denominations
while (V >= deno[i]) {
... | ALGO | 0.999961 | 4.727381 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-06-30T01:14: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": "9401291929b... |
6ed592cc-3240-4dbf-af4e-d73d9c63dfe1 | Omarak9120/CPP_modules | CPP_module09_all/CPP_module09/src/PmergeMe.cpp | #include "../includes/PmergeMe.hpp"
#include <algorithm>
#include <map>
#include <iterator>
// Generate Jacobsthal-based insertion order
std::vector<int> PmergeMe::generate_insertion_order(size_t pending_size) {
std::vector<int> order;
if (pending_size == 0) return order;
std::vector<int> jacob;
jacob... | ALGO | 0.999922 | 6.041841 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-12-10T10:53: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": "cc6066fff5a... |
899fe223-1121-4d3a-9a57-1b204b1e53c6 | muhajirochu/Question.practise | Qc.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
struct stackNode {
double data;
struct stackNode* next;
};
struct stackNode* top = NULL;
void push(double value) {
struct stackNode* newnode = (struct stackNode*)malloc(sizeof(struct stackNode));
newnode->data = value;
newnode->next = top;
... | ALGO | 0.999918 | 4.645389 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-24T17:57: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": "2ada19e46c7f... |
237c77e7-b00e-49f6-9f3a-28d868918fd5 | rousse101/tricks-of-the-3d-game-programming-gurus | Engine/Source/t3dlib8.cpp | // T3DLIB8.CPP - clipping, terrain, and new lighting
// I N C L U D E S ///////////////////////////////////////////////////////////
#define DEBUG_ON
#define WIN32_LEAN_AND_MEAN
#include "CommonHeader.h"
#include <ddraw.h> // needed for defs in T3DLIB1.H
#include "T3DLIB1.H"
#include "T3DLIB4.H"
#include "T... | ALGO | 0.989449 | 5.464109 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-01-30T20:47:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 62,
"forks": 28,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccf6e39f... |
68e28a42-2845-4d1b-9da1-c74a2abc2000 | ishandutta2007/codeforces-a | alireza_kaviani/normal/575/B.cpp | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author alireza_kaviani
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template<class T> using Tree = tree<T, null_t... | ALGO | 0.999978 | 4.772684 | {
"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": "62a181534d28... |
d9104085-9bf9-48fe-8635-50d6c209e0e3 | ishandutta2007/codeforces-r | ronnie007/normal/1027/E.cpp | #include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<queue>
using namespace std ;
#define MAXN 507
#define MOD 998244353
int n , k ;
long long dp[ MAXN ][ MAXN ] ;
long long h[ MAXN ] ;
long long row[ MAXN ][ 2 ] ;
void input... | ALGO | 0.999956 | 4.535583 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "62a6f22334b4... |
d415c1a4-3310-4f0f-a890-a969c8272b3c | KaHIP/KaHIP | app/global_multisection.cpp | /******************************************************************************
* qap.cpp
*
* Source of KaHIP -- Karlsruhe High Quality Partitioning.
*
*****************************************************************************/
#include <argtable3.h>
#include <iostream>
#include <math.h>
#include <regex.h>
#i... | TOOL | 0.960484 | 4.433194 | {
"github_metadata": {
"branch": "master",
"commit_count": 648,
"repo_created_at": "2013-10-16T15:25:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 442,
"forks": 101,
"issues": 13,
"pull_requests": 8
},
"file_meta": {
"content_id": "9c79... |
db4f54f2-797c-4248-916f-547747c8b068 | GGDEEBOR/CPD-Lab1 | version_por_bloques.cpp | #include <iostream>
#include <ctime>
using namespace std;
void multiplicarMatricesPorBloques(int** A, int** B, int** C, int N, int blockSize) {
for (int iBlock = 0; iBlock < N; iBlock += blockSize) {
for (int jBlock = 0; jBlock < N; jBlock += blockSize) {
for (int kBlock = 0; kBlock < N; kBlock... | ALGO | 0.999447 | 5.130566 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-24T04:32: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": "dc718295f153... |
f817cf29-df76-4561-b860-5912631f47e4 | savlat1133/w3_C- | For-Loops/Exercise59.cpp | // 59. Frequency of Each Digit in an Integer
#include <iostream>
using namespace std;
bool prime(int n);
int length;
int main()
{
cout << "Frequency of each digit in an integer" << endl;
cout << "-------------------------------" << endl;
int number;
cout << "Input any number: ";
cin >> number;
... | ALGO | 0.999548 | 5.575744 | {
"github_metadata": {
"branch": "main",
"commit_count": 240,
"repo_created_at": "2025-02-16T12:24: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": "0af947189a... |
d91f6e25-e4b3-4dcc-8a16-99570a5060ab | Patatje19/Procedural-Programming-in-C | Week 3/Exercise 3.10 - Som/Exercise 3.10 - Som.cpp | // Schrijf een functie die van een gegeven vector<vector<float> > de som per rij berekent
// en teruggeeft.
#include <iostream>
#include <vector>
std::vector<std::vector<float> > sumVector (const std::vector<std::vector<float> > & numbers) {
float value = 0;
std::vector<std::vector<float> > calcVector;
for (int ... | ALGO | 0.999204 | 4.949543 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-09-09T10:45: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": "d57829f08c... |
117598c4-0ea6-4f27-bc61-991ec09d8b02 | Nupur18/CPP-Launchpad | May 22/rod_cutting.cpp | /*
Given a rod of length n inches and an array of prices that contains prices of all pieces of size
smaller than n. Determine the maximum value obtainable by cutting up the rod and selling the pieces.
For example, if length of the rod is 8 and the values of different pieces are given as
following, then the maximum... | ALGO | 0.999918 | 5.455857 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2021-03-01T18:34: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": "9c7afa310... |
03938a7d-cb25-49a4-89fe-99f676ba66ef | jooseeun/BackJoonStudy | Vector_Doubly_linked 구현/Vector_Doubly_linked 구현/code.cpp | #include "code.h"
ArrayVector::ArrayVector()
:capacity(0), n(0), A(NULL)
{
}
int ArrayVector::size() const
{
return n;
}
bool ArrayVector::empty() const
{
return size() == 0;
}
int& ArrayVector::operator[](int i)
{
return A[i];
}
int& ArrayVector::at(int i) throw(out_of_range)
{
if (i < 0 || i >= n)
throw ... | ALGO | 0.996447 | 3.906195 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-09-20T08:07:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a375a6bd48e... |
9c3815f4-8c90-48ab-a1c6-4284471a4a39 | manandraj20/Connecting-the-first-Search | Assignments/Assignment3/DSU_kruskal.cpp | #include <bits/stdc++.h>
using namespace std;
class DSU
{
int n;
vector<int> par;
vector<int> rank;
vector<int> size;
public:
DSU(int NN)
{
this->n = NN;
this->par = vector<int>(n, -1);
this->rank = vector<int>(n, -1);
this->size = vector<int>(n, 0);
for ... | ALGO | 0.999957 | 4.723378 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-05-12T13:12: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": "3d461830e17... |
719e34ea-6f90-4957-8bc7-a070bfe25afd | fsjhhh/acm_title | cpp/nk/牛客周赛 Round 3/游游的水果大礼包.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
//priority_queue 优先队列
#define IOS \
std::ios::sync_with_stdio(f... | ALGO | 0.999565 | 3.308284 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-10-30T10:57: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": "822c01b19fe... |
fd808c76-bdaf-4518-9494-d2a6f14fc1b4 | Gautam-2002/leetcode_ques | Flood fill Algorithm - GFG/flood-fill-algorithm.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void dfs(int r, int c,vector<vector<int>> &ans,vector<vector<int>>& image,
int newColor,int dr[],int dc[],int oldColor,int n,int m){
ans[r][c]=newColor;
for(int i=0;i<4;... | ALGO | 0.998958 | 6.08141 | {
"github_metadata": {
"branch": "main",
"commit_count": 1516,
"repo_created_at": "2022-05-23T13:42:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "deb7da8bc... |
0e818abc-c793-435d-bd79-7ec8fefd5200 | 511172176/uva | 10090.cpp | #include<stdio.h>
#include<string.h>
#include<math.h>
long long x, y;
long long ex(long long a, long long b)
{
if(b==0)
{
x = 1;
y = 0;
return a;
}
else
{
long long ans = ex(b, a%b);
long long tmp = y;
y = x - a/b * y;
x = tmp;
return ans;
}
}
long long c1, n1, c2, n2, n;
int main()
{
while(~s... | ALGO | 0.999829 | 3.420484 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-04-21T09:50: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": "920307be2e3... |
dbde6313-5511-4013-ae77-e902185fdd24 | ariloc/CompetitiveProgrammingCodes | CodeForces/1041B.cpp | #include <bits/stdc++.h>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#define forn(i,n) for(int i = 0; i < int(n); i++)
#define forsn(i,s,n) for(int i = int(s); i < int(n); i++)
#define dforn(i,n) for (int i = int(n)-1; i >= 0; i--)
#define dforsn(i,s,n) for(int i = int(n)-1; i >= int(s); i--)... | ALGO | 0.999222 | 3.515707 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2020-08-19T01:48:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e4ecd71... |
9b0be78e-3cad-4d00-bf8e-078367e51b60 | alexvelea/competitive | infoarena/invazia/invazia.cpp | //Problem invazia from Infoarena
// "We are drowning in information and starved for knowledge."
#include <cassert>
#include <cmath>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <stack>
using namespace std;
#define int64 long long
const int inf = 0x3f3f3f3f,... | ALGO | 0.999903 | 3.404245 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2015-02-28T21:56:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc39a721e... |
2d932d72-ff32-41f4-ab85-c0c6ad81ccd5 | Pursottam6003/DSA_Practice | crack_your_internship/Day48/subtree_of_another_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.999731 | 5.984146 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2022-12-18T04:44:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1777b842b... |
e2fda065-17b2-4146-961e-a531eb4b65c6 | ishandutta2007/codeforces-r | rama_pang/normal/1399/E1.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int T;
cin >> T;
while (T--) {
int n;
cin >> n;
long long S;
cin >> S;
vector<vector<pair<int, int>>> adj(n);
for (int i = 0; i + 1 < n; i++) {
int u, v, w;
cin >>... | ALGO | 0.999901 | 4.076933 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "564cff4fb888... |
8b5e4ab2-7f03-4900-8768-8a76fefeefd1 | FP-Leo/Snake-Game-Open-GL | openGlProjectOne - Snake Game/openGlProjectOne/main.cpp | #include"glew.h"
#include"freeglut.h"
#include<iostream>
#include <vector>
using namespace std;
//Function prototypes for the Snake Game
void resetBoard();
void editSnakeBodyCell(int, int, int);
void growSnake();
int detectCollision(int, int);
void display();
void drawLevelOne();
void drawSnake();
void changeDirectio... | TOOL | 0.996498 | 6.065108 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-05T16:28: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": "269426596add... |
d87d80e9-7d5e-4b78-b0c4-ac5efd0110d5 | NebulusIO/Data-Structures | 223summer17/HW5/Trees223.h | /**
*<NAME>
CS223 - Summer 2017
HW5
**/
#ifndef TREES223_H
#define TREES223_H
struct Node{
Node* leftChild;
Node* rightChild;
<T> data;
}
//<template>class BST
template<class T>
class BST
{
public:
BST(){
//implement!
}
virtual ~BST(){
//implement!
}
... | ALGO | 0.994761 | 3.170609 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2017-07-12T18:15:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "296234a04... |
f7782c71-0054-4071-abe0-5946c2b3986a | hongjunliao/cpp-test | deps/sfslite-1.2/rctree.h |
// -*-c++-*-
#ifndef _ASYNC_RCTREE_H_INCLUDED_
#define _ASYNC_RCTREE_H_INCLUDED_ 1
#include "itree.h"
/*
* rctree_t
*
* This class allows a itree.h-like interface to reference-counted objects,
* so that as long as the object is in the list, its refcount is at least
* 1.
*
*/
template<class T>
struct rct... | ALGO | 0.954681 | 6.217924 | {
"github_metadata": {
"branch": "master",
"commit_count": 347,
"repo_created_at": "2023-07-16T01:39: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": "ac6ab3ad... |
1b19becf-7856-49a5-b633-84b042784a92 | ayush-sah/Data-Structures | Queue/johnson.cpp | #include<iostream>
using namespace std;
class queue{
int **table, num, rear, rev_rear, min, **copy, *q;
public:
queue(){
cout << "Enter the no. of processes: ";
cin >> num;
cout << endl;
rear = -1;
rev_rear = num;
table = new int*[num];
for(int i = ... | ALGO | 0.999822 | 3.738081 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2020-01-28T18:12:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "914d45f54... |
c6d7ad1b-3a44-498a-aa8c-13d71d1feb90 | axelerator/occluder3000 | acceleration/bihcompact.h | //
// C++ Interface: bihcompact
//
// Description:
//
//
// Author: <NAME> <<EMAIL>>, (C) 2008
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef OCCLUDERBIHCOMPACT_H
#define OCCLUDERBIHCOMPACT_H
#include "accelerationstructure.h"
#include "bihnode.h"
namespace Occluder {
/**
B... | ALGO | 0.973031 | 5.808163 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2010-12-28T19:00:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ba9fd472... |
97e956c9-7740-4259-97d8-bc9bdde8be1f | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03958/s513884332.cpp | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <cmath>
#include <numeric>
#include <iterator>
#include <fs... | ALGO | 0.99981 | 4.015474 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "9839c7985b... |
bc35a83f-025b-4210-99fc-ecc026acd4db | honey766/Algorithm | 백준/Silver/24445. 알고리즘 수업 - 너비 우선 탐색 2/알고리즘 수업 - 너비 우선 탐색 2.cc | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
vector<vector<int>> graph;
int* visited;
int cnt;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
int n, m, r, u, v;
cin >> n >> m >> r;
graph.resize(n);
visited = new int[n]();
cnt ... | ALGO | 0.999987 | 4.313663 | {
"github_metadata": {
"branch": "main",
"commit_count": 530,
"repo_created_at": "2024-01-18T15:30: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": "36eff3f446... |
1f93cf94-4c35-413b-958f-a4dc851a2185 | ttzztztz/leetcodeAlgorithms | 整体二分/1102. Path With Maximum Minimum Value.cpp | class Solution {
public:
int maximumMinimumPath(vector<vector<int>>& A) {
if (A.empty()) return 0;
grid_ = A;
n_ = A.size(), m_ = A[0].size();
int l = numeric_limits<int>::max(), r = numeric_limits<int>::min();
for (auto& i : A) {
for (auto& j : i) {
... | ALGO | 0.999991 | 5.994866 | {
"github_metadata": {
"branch": "master",
"commit_count": 872,
"repo_created_at": "2019-09-03T06:57:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9cc9e10... |
d5a39aa3-5184-41bd-a61c-86e55db48606 | AhmedBinhamim/graph-algorithms-and-dynamic-programming-algorithms | Planet.cpp | // Planet.cpp -- class for planet in map
#ifndef PLANET_CPP
#define PLANET_CPP
#include <iostream>
#include <list>
#include "Edge.cpp"
using namespace std;
class Planet
{
public:
int planet_num; // Unique planet identifier
string planet_name; // planet name
int x,y,z; ... | ALGO | 0.95066 | 4.817987 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-02-27T05:28: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": "986207bf3414... |
e41127d6-2bc2-4e40-b656-d004b6dbd1ca | itzelacev/logica-para-programacion | matrices.cpp | #include <iostream>
using namespace std;
void llenar(int m[][5],int nr);
void llenarInverso(int m[][5],int nr);
void mostrar(int m[][5],int nr);
void mostrarDP(int m[][5],int nr);
void mostrarDS(int m[][5],int nr);
void mostrarArrDP(int m[][5],int nr);
void mostrarAbDP(int m[][5],int nr);
void mostrarArrDS(int m[][5],... | ALGO | 0.998011 | 4.100902 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-08-29T16:17: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": "7cd8befe0... |
991a64c8-77e2-41bc-aa59-a58a3b57e3d5 | sachuverma/DataStructures-Algorithms | Leetcode Top Interview Questions/solutions/Happy Number.cpp | /*
Happy Number
============
Write an algorithm to determine if a number n is "happy".
A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or ... | ALGO | 0.999914 | 5.671692 | {
"github_metadata": {
"branch": "master",
"commit_count": 1430,
"repo_created_at": "2020-10-07T10:08:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2049,
"forks": 541,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "29... |
d406f29b-55ab-44a7-a2fe-c8a16d81b425 | noogler-eng/noob-dsa | potd/9.findMinimumTimeToReachLast.cpp | // Find Mimimum Time To Reach Last Room 1
#include<iostream>
using namespace std;
// There is a dungeon with n x m rooms arranged as a grid.
// You are given a 2D array moveTime of size n x m,
// where moveTime[i][j] represents the minimum time in seconds when you can
// start moving to that room. You start from th... | ALGO | 0.999983 | 5.648995 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-05-16T02:45: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": "ab70c864869a... |
090bf5ca-a9b0-412f-88e3-393eb4947f93 | faizan346/Ds-Algo-Cplusplus | graphs/16bellmonFord.cpp | #include<bits/stdc++.h>
using namespace std;
class Edge {
public:
int src;
int nbr;
int wt;
Edge(int src, int des, int wt) {
this->src = src;
this->nbr = des;
this->wt = wt;
}
};
void shortestPathBellmonFord(vector<Edge>& graph, vector<int>& path) {
// the path to i... | ALGO | 0.999993 | 5.112062 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2021-04-24T18:17: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": "e5312528... |
7d9323c1-12ba-4ef3-b3ec-2de4a236b704 | tdk8823/atcoder | lib/union_find.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for (int i = 0; i < (a); i++ )
typedef pair<int,int> P;
typedef long long ll;
const int INF = 1001001001;
const int MOD = 1000000007;
const double PI=acos(-1);
//---------------------------------------------
struct UnionFind {
vector<int> par;
... | ALGO | 0.99994 | 4.464683 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-04-20T10:02: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": "915f726c2c10... |
d1876be9-0e78-436b-b1a0-6f5d749d212a | mayankagg9722/Placement-Preparation | leetcode/**superPow.cpp | /*
372. Super Pow
Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array.
Example1:
a = 2
b = [3]
Result: 8
Example2:
a = 2
b = [1,0]
Result: 1024
TLE
class Solution {
public:
int mod=1337;
int findPow(int n,int k){
... | ALGO | 0.999952 | 5.656287 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2018-02-02T14:49:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 156,
"forks": 53,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bcce3... |
7716db86-b2a9-4742-b4ee-9b38b4e6c044 | contaconta/neurons | c++/research/steerableFilters2D/tools/imageDerivatives.cpp |
/////////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or //
// modify it under the terms of the GNU General Public License //
// version 2 as published by the Free Software Foundation. //
// ... | ALGO | 0.997361 | 4.730793 | {
"github_metadata": {
"branch": "master",
"commit_count": 1446,
"repo_created_at": "2015-07-29T07:17: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": "6e5ce37... |
6dc448b6-adb3-4ffa-9f9b-0576cb7f0bb6 | ishandutta2007/codeforces-z | zscoder/normal/1307/F.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair... | ALGO | 0.999985 | 4.268834 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "28c63d1b2f96... |
731be71c-ce4d-4f61-b984-9833989d28e3 | Arthurx-07/dsa-in-c- | lecture15-recursion/002part2/011inversioncount.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
using namespace std ;
// time compexity = 7
int genratepair( int arr[], int n ){
int count = 0 ;
for(int i = 0 ; i<=n-2; i++ ){
for ( int j = i+1; j<=n-1; j++ ){
// cout << "(" << arr[i] << "," << arr[j] << ")" << endl ;
... | ALGO | 0.999503 | 4.334134 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2025-03-13T11:57:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7aa1f9201bb... |
33559dbf-24ec-449c-b234-c981a72da14d | MohamedBOUTOUGOUMAS/ALGAV | cle.cpp | #include <stdlib.h>
#include <stdio.h>
#include "cle.h"
//fonctionne, ne pas toucher
cle* parse_cle(char* s) {
s += 2;
cle* res =(cle *) malloc(16);
char temp[2] = {0};
for(int i = 0;i<16;i++){
temp[0] = s[2*i];
temp[1] = s[2*i + 1];
sscanf(temp, "%x", res + i);
}
return res;
}
int eg(cle* a, cl... | ALGO | 0.912308 | 3.085792 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2018-11-04T22:48: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": "5b01f1691... |
dfbfe525-1679-45cc-9f43-e04b0b3e54ec | ishandutta2007/codeforces-k | keko37/normal/1242/B.cpp | #include<bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n, m, sol;
int par[MAXN], bio[MAXN];
vector <int> v[MAXN], r;
int nadi (int x) {
if (x == par[x]) return x;
return par[x] = nadi(par[x]);
}
void spoji (int x, int y) {
par[nadi(y)] = nadi(x);
}
int main () {
ios_base::sync_w... | ALGO | 0.999613 | 3.74642 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "cf636aacdcca... |
9df73ba8-a111-445e-82c4-b2b5a7df7027 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/09/0930/personal_submission/cf935d_WanderOvO.cpp | /*
枚举从第 i 位开始,s1 字典序严格大于 s2
*/
LL n, m;
LL a[N], b[N], zero_cnt[N];
void solve1() {
cin >> n >> m;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
for (int i = 1; i <= n; i++) {
cin >> b[i];
}
LL larger_cnt = 0;
LL tot_cnt = 1;
int mod = MOD1;
for (int i = 1; i <= n; ... | ALGO | 0.999983 | 3.904406 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "e57d... |
1652f1e2-79ee-4469-9682-e8bbd9dc8ee1 | Katrinnk/lab3.4 | Source.cpp | // Lab_03_4.cpp
// <NAME>
// Лабораторна робота № 3.4
// Розгалуження, задане плоскою фігурою.
// Варіант 12
#include <iostream>
using namespace std;
int main()
{
double x; // вхідний аргумент
double y; // вхідний параметр
double R; // вхідне значення змінної
cout << "x = "; cin >> x;
cout << "y = "; cin >> y;
co... | ALGO | 0.967742 | 3.633811 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-10-18T10:10:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7004c97bc... |
4c575664-a458-4895-9641-f54c37777737 | Yuvraj883/CPP-DSA | Arrays/08_KthSmallestElement.cpp | #include <iostream>
using namespace std;
//Sorts the array in the ascending order
void selectionSort(int *arr, int n)
{
for (int i = 0; i < n; i++)
{
int temp;
for (int j = i + 1; j < n; j++)
{
if (arr[i] > arr[j])
{
temp =arr[j];
... | ALGO | 0.999977 | 5.094657 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-01-17T17:23:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53acec9e481... |
528f0ede-e811-46f1-a637-203a64b6c5a7 | rishiVC20/competitive_programming | sale.cpp | // <NAME>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll maxElement(vector<ll> &arr)
{
ll maxi = 0;
for (ll i=0; i<arr.size(); i++)
{
maxi = max(maxi,arr[i]);
}
return maxi;
}
int main() {
ll t;
cin>>t;
while (t--)
{
ll n;
cin>>n;
... | ALGO | 0.999667 | 3.027634 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-07-24T05:22:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9007bdec3eb... |
e0fd135c-17fb-4e06-9c51-dd6ba2f206de | coancea/locref-exercises-uio | mmm/spatial-only-opt.h | #ifndef SPATIAL_OPT
#define SPATIAL_OPT
/**
* Computes matrix multiplication C = A*B
* Semantically the matrix sizes are:
* A : [heightA][widthA]ElTp
* B : [ widthA][widthB]ElTp
* C : [heightA][widthB]ElTp
* for some numeric type ElTp.
**/
template<class ElTp>
void spatialOpt(ElTp* A, ElTp* B, ElTp* C... | ALGO | 0.998366 | 5.647193 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-02-13T13:42:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e24f4f5a76... |
1b87d810-fa82-45d6-9c7a-50d5bc3e260f | kasalica/reversiAI | board.cc | #include <iostream>
#include "board.hh"
#include <algorithm>
#include <iterator>
#define updateUnit(old,unit)
/* initilize board */
Board::Board(){
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
myBoard[i][j] = new Empty();
}
}
delete myBoard[3][3];
delete myBoard[4][4];
de... | ALGO | 0.932386 | 4.40348 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-01-12T00:11: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": "6ae05ae130... |
afad94c6-35af-491f-a0c4-d27b51ca2174 | caokhacmanh/ICT_Teacher_Vong | week11/MoveLeftRight.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
freopen("MoveLeftRight.inp", "r", stdin);
freopen("MoveLeftRight.out", "w", stdout);
long long x, k, d;
cin >> x >> k >> d;
// x = abs(x);
// if(x / d >= k){
// k -= x / d;
// x = x % d;
// }
// for(long long i =... | ALGO | 0.999915 | 3.82919 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2021-08-05T00:24: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": "8f25dec1b... |
5c8ca2b4-f13f-40ef-bb46-2e027ed7c264 | coder2hacker/Explore-open-source | C++/STL C++/STL_LEC_3_Algorithms_7.cpp | // next_permutation()
// it will return a boolean value if the next_permutation is possible then it will
// replace the original string with the next permutation string and return true or else false
#include<bits/stdc++.h>
using namespace std;
// to print next permutations
void perm(string s){
cout << "Next Permu... | ALGO | 0.998102 | 4.561369 | {
"github_metadata": {
"branch": "main",
"commit_count": 2176,
"repo_created_at": "2020-12-19T14:27:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 54,
"forks": 363,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26360b8... |
3f7154e3-835c-449e-a634-640cdcc9f87b | Jeeukrishnan/DataStructures | lowestcommonancestor.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int key;
node* left;
node* right;
};
struct node* root=NULL;
struct node* createnode(int k)
{struct node* temp=new node();
temp->key=k;
temp->left=NULL;
temp->right=NULL;
return temp;}
struct node* insert(struct node* root,int k)
{if(root==NULL)
{return cre... | ALGO | 0.999988 | 5.173443 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-22T10:24: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": "9ee965c593... |
36386b9d-fc87-410b-80da-5e90b4de50e2 | SRR23/XPSC | Week_9/Day_1/Codeforces_276C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[200005], mp[200005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i++)
{
cin >> a[i];
}
while (m--)
{
int l,... | ALGO | 0.999995 | 4.814896 | {
"github_metadata": {
"branch": "main",
"commit_count": 199,
"repo_created_at": "2023-06-16T15:59: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": "bcc6150b08... |
fc27d4a2-b5f1-4bc0-ad49-cbb698d172eb | wiwitrifai/competitive-programming | codechef/cook96/ormatrix.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1024;
char a[N][N];
int row[N], col[N];
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n, m;
scanf("%d %d", &n, &m);
for (int i = 0; i < n; ++i)
scanf("%s", a[i]);
memset(row, 0, sizeof row);
memset(col, 0, sizeof co... | ALGO | 0.999979 | 3.703381 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2016-05-21T12:11:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "073c50c... |
ebb57598-327e-425f-926b-0f1687592fc1 | YhgzXxfz/leetcode | graph_valid_tree.cpp | // union-find
class Solution {
public:
bool validTree(int n, vector<pair<int, int>>& edges) {
vector<int> roots(n, 0);
for (int i = 0; i < n; ++i) roots[i] = i;
for (auto edge : edges) {
int x = find(roots, edge.first);
int y = find(roots, edge.second);
... | ALGO | 0.999979 | 6.298477 | {
"github_metadata": {
"branch": "master",
"commit_count": 824,
"repo_created_at": "2015-05-01T15:51: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": "5929074f... |
4f5c40fd-8c01-4afa-8c87-0bda7ae7dd28 | tensorflow/minigo | cc/symmetries.cc | // Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | ALGO | 0.965983 | 7.089267 | {
"github_metadata": {
"branch": "master",
"commit_count": 1434,
"repo_created_at": "2018-01-29T23:29:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3500,
"forks": 562,
"issues": 73,
"pull_requests": 4
},
"file_meta": {
"content_id": "a9... |
725ca27b-d328-44f3-a746-6656090375f0 | akimasanishida/Hopfield_network | memorize.cpp | #include <iostream>
#include <vector>
#include <random>
#include <fstream>
#include <opencv2/opencv.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <zlib.h>
#include "Hopfield_model.hpp"
#if defined(MSDOS) || defined(OS2) || define... | ALGO | 0.998549 | 5.202721 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-11-05T19:10: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": "5d7756ed31a0... |
3509b1ce-7806-49f5-b7a4-ba16b2fb4a85 | ccahilla/ProjectEuler | Problem_13.cpp | /*
Find the first 10 digits of the sum of 100 given 50-digit numbers
*/
#include <iostream>
#include <fstream>
#include <cmath>
#include <vector>
using namespace std;
int main() {
int answer = 0;
int number_size = 50;
int number_amount = 100;
vector<vector<int> > a;
vector<int> temp;
ifstream file;
fi... | ALGO | 0.998476 | 4.226588 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-05-11T21:01: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": "1c1e2bb0d8... |
d1883680-b019-4bc9-952e-8bcf0b4675b7 | xuwakao/aosp_debug_host | app/aosp/source/system/connectivity/wificond/server.cpp | /*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | TOOL | 0.902847 | 7.063739 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-07-17T06:36:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63b58866e... |
04e6dc12-6fa1-4fb9-b760-c821b4940a82 | Waznop/Project-2.1---Snake | snake_helper.cpp | /** Contains helper functions for the snake game.
@file snake_helper.cpp
@author YOUR NAME HERE
*/
// TODO: Fill in your name above.
#include "snake_helper.h"
#include <iostream>
#include <set>
#include <vector>
#include "lib/snake.h"
using namespace std;
void draw_walls(char board[HEIGHT + 2][WIDTH + 2]) {
// TODO... | TOOL | 0.984988 | 6.119288 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-10-27T06:10: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": "df2a32db6b3a... |
794c7f1d-99e9-4e0f-9625-ed289140b248 | Yuran-7/vsag_commented | src/index/hnsw.h |
// Copyright 2024-present the vsag project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... | ALGO | 0.982301 | 6.113142 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-04-09T06:35:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "faf779151b9f... |
ba6fe6bc-70d4-43e6-bd46-aecec6785d19 | snowyoneill/CTCI | 4.6/4.6.cpp | #include <iostream>
using namespace std;
#include "BinaryTree.h"
template <class T>
class NodeWithParent
{
public:
NodeWithParent<T> *left, *right, *parent;
T val;
NodeWithParent(T d)
: left(NULL)
, right(NULL)
, parent(NULL)
, val(d)
{}
};
template <class T>
void print_in_order_with_levels(NodeWithPar... | ALGO | 0.999923 | 3.514975 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-07-31T22:23:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc0a2c55fe... |
c6c76f4a-d626-4b28-b02e-14fc2b27a1e6 | nifraz/computer-programming | assignment-2/2.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
cout << "Word Counter\n"
<< setfill('=') << setw(13) << "\n";
const int MAX_CHARS = 1024;
//read the text
cout << "Enter the text (" << MAX_CHARS << " characters max): ";
char s[MAX_CHARS];
cin.getli... | ALGO | 0.994465 | 3.927489 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2022-07-03T07: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": "a7a0decaef... |
0853af1a-850d-4be8-9551-275dd55475f8 | yandex/CMICOT | library/grid_creator/median_in_bin_binarization.cpp | #include "binarization.h"
#include <util/generic/queue.h>
#include <util/generic/algorithm.h>
#include <util/generic/ymath.h>
#include <util/generic/yexception.h>
namespace NSplitSelection {
class TFeatureBin {
private:
ui32 BinStart;
ui32 BinEnd;
yvector<float>::const_iterator FeaturesStart;
yvector<f... | ALGO | 0.992422 | 6.449656 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2016-12-13T15:19:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 45,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "371d5a30... |
02867bbf-f007-41c2-bda4-de9fb7d49305 | Adarsh097/LEETCODE-Daily | 0744-network-delay-time/0744-network-delay-time.cpp | class Solution {
public:
typedef pair<int,int> P;
int networkDelayTime(vector<vector<int>>& times, int n, int k) {
unordered_map<int,vector<pair<int,int>>> adjlist;
// /pahla int pair ka v store karegea dusara weight karega
for(int i=0;i<times.size();i++){
vector<int> temp=t... | ALGO | 0.999976 | 5.273263 | {
"github_metadata": {
"branch": "main",
"commit_count": 1329,
"repo_created_at": "2024-09-16T06:34: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": "9d8ea28e7... |
54cd12ff-b835-4033-91ad-fa5356079d8b | PlasmaSimUQ/cerberus | Source/actions/MFP_CTU_Braginskii.H | #ifndef CTU_H
#define CTU_H
#ifndef AMREX_USE_EB
#include "MFP_action.H"
#include "MFP_field.H"
#include "MFP_hydro.H"
class BraginskiiCTU : public Action
{
public:
BraginskiiCTU();
BraginskiiCTU(const int idx, const sol::table& def);
~BraginskiiCTU();
virtual std::string get_tag() cons... | ALGO | 0.93392 | 5.775536 | {
"github_metadata": {
"branch": "develop",
"commit_count": 70,
"repo_created_at": "2021-03-27T13:38:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "33440c9c0... |
ccba92e0-6780-4fbc-ab2d-da2b126757c3 | andrekorol/CPlusPlus | sandbox/cpp/matrix.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
#if __cplusplus >= 201103L
typedef unsigned long long ul;
typedef vector<ul> vl;
typedef vector<vl> vvl;
auto maxim = ULLONG_MAX;
#else
typedef unsigned long ul;
typedef vector<ul> vl;
typedef vector<vl> vvl;
auto maxim = ULONG_MAX;
#endif
#i... | ALGO | 0.998932 | 3.191625 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-07-15T00:06:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5c18c5d97... |
cff0b402-1615-490a-952f-b95b8ab2566a | jchengai/gpir | gp_planner/thirdparty/gtsam-4.1rc/gtsam/3rdparty/Spectra/LinAlg/UpperHessenbergQR.h | // Copyright (C) 2016-2019 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
#ifndef UPPER_HESSENBERG_QR_H
#define UPPER_HESSENBERG_QR_H
#include ... | ALGO | 0.994272 | 6.815052 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-07-01T05:24:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 244,
"forks": 54,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ced4caff... |
e4ac59f0-f6f0-444d-9ca9-561f46b3613a | tt6-mzn/AtCoder | practice/ABC/177/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
/* union-find木を実装 */
int root(int x, vector<int> &par, vector<int> &rank) {
if(par.at(x) == x) {
return x;
}
par.at(x) = root(par.at(x), par, rank);
return par.at(x);
}
bool same(int x, int y, vec... | ALGO | 0.999886 | 3.804606 | {
"github_metadata": {
"branch": "master",
"commit_count": 279,
"repo_created_at": "2021-01-17T08:03:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4a340ac... |
007e9577-2f11-4d6e-82e3-f504cbc6d584 | blackberry/Boost | libs/regex/performance/time_greta.cpp | /*
*
* Copyright (c) 2002
* <NAME>
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include "regex_comparison.hpp"
#if defined(BOOST_HAS_GRETA)
#include <cassert>
#... | TEST | 0.948544 | 5.984768 | {
"github_metadata": {
"branch": "1_48_0-gnu",
"commit_count": 151,
"repo_created_at": "2011-10-18T14:25:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 234,
"forks": 123,
"issues": 11,
"pull_requests": 3
},
"file_meta": {
"content_id": "... |
ccbf5e9e-4725-43ef-a206-99e5857819a8 | NateGyory/SGPR | src/main.cpp | #include <iostream>
#include <thread>
#include <chrono>
#include <sstream>
#include <fstream>
#include <random>
#include <cmath>
#include <pcl/common/centroid.h>
#include <pcl/io/ply_io.h>
#include <pcl/conversions.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/kdtree/... | DATA | 0.976891 | 4.951924 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-10-16T00: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": "6a077a3a7d2... |
b84ad7f6-529f-455b-a951-f2697f857e45 | iAryanK/Data-Structures-and-Algorithms | Stack/ImplementUsingLL.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *next;
Node(int value)
{
this->data = value;
this->next = NULL;
}
};
void traverseLL(Node *head)
{
cout << "\nPrinting the elements of the list...\n";
Node *temp = head;
while (temp != NULL)
... | ALGO | 0.99698 | 5.210623 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-01-24T16:21: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": "1ca2498fef37... |
b31ef2a0-17a3-4663-b75f-3f3f30a96ec8 | andreshungbz/CMPS1232 | csbs/longestSortedSequence/main.cpp | #include <iostream>
int longestSortedSequence(const int array[], int length) {
int sequence{0};
int longestSeq{0};
for (int i{0}; i < length; ++i) {
if (i == 0) {
++sequence;
longestSeq = sequence;
continue;
}
if (array[i] >= array[i - 1]) {
... | ALGO | 0.999765 | 5.966872 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-06-14T15:50:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ab2fab08201... |
880055b7-d6e0-45e7-8534-ea279fe4a5c3 | yplusplus/OnlineJudge | Lightoj/LightOJ 1362 Electricity Connection - 状态压缩 + dp + 分层转移.cpp | #include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
#include "vector"
#include "queue"
#include "stack"
#include "cmath"
#include "string"
#include "cctype"
#include "map"
#include "iomanip"
#include "set"
#include "utility"
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,... | ALGO | 0.999608 | 3.691711 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-23T18:32:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "229f58344894... |
23d32e30-45d2-4e9f-b068-8ae791ef9199 | netweel/Parallel-programming-OpenMP_TBB_std-thread | Std_thread/main.cpp | // Copyright 2021 <NAME>
#include <gtest/gtest.h>
#include <omp.h>
#include <time.h>
#include <vector>
#include <complex>
#include "./umnrazr.h"
TEST(CCR_UMN, razm1030x100_100_10000) {
int na = 1030;
int ma = 100;
int nb = 100;
int mb = 100;
int nza = 4;
int nzb = 8;
ComplexMatr a = rand(na... | TEST | 0.916227 | 5.989557 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-08-10T07:54: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": "e32b190e81a5... |
886d1ed8-c7e5-43b4-abaa-890e2aa44b58 | organicmaps/organicmaps | search/keyword_matcher.hpp | #pragma once
#include "search/common.hpp"
#include "base/string_utils.hpp"
#include <string>
#include <vector>
namespace search
{
class KeywordMatcher
{
public:
class Score
{
public:
Score();
// *NOTE* m_nameTokensLength is usually used as a late stage tiebreaker
// and does not take part in the ... | TOOL | 0.95146 | 6.68879 | {
"github_metadata": {
"branch": "master",
"commit_count": 42613,
"repo_created_at": "2020-12-27T19:02:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11487,
"forks": 1128,
"issues": 2796,
"pull_requests": 182
},
"file_meta": {
"content_i... |
2f3785b1-7168-43ab-8965-fc892cdbc66c | esraalmaeeni/DATA-STRUCTURE-PROGRAMs | EXPT36 - Postfix representation.cpp | #include <iostream>
#include <stack>
#include <string>
#include <sstream>
using namespace std;
// Function to evaluate a postfix expression
int evaluatePostfixExpression(string expression) {
stack<int> operandStack;
istringstream iss(expression);
string token;
while (iss >> token) {
if (isdi... | ALGO | 0.999919 | 6.658 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-10-26T00: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": "d49f341442a3... |
22dcc5ac-aaa3-43eb-baef-fce4c6724f9f | marine5575/BOJ | 2933 미네랄.cpp | /*******************/
// <<< 한참 해멤 >>>
// BOJ 2933 미네랄
// 핵심: Flood Fill & 문제 파악
// => 각 '열'의 맨 아래 부분 중 하나가 떨어짐
// => 몽땅 찾아볼 것
/*******************/
#include <stdio.h>
#define MAX 110
int r, c, n; // 동굴의 세로, 가로, 막대 던진 횟수
int rod[MAX]; // 던진 높이
int dx[] = {1, 0, -1, 0}; // right, down, left, up
int dy[] = {... | ALGO | 0.999821 | 3.531076 | {
"github_metadata": {
"branch": "master",
"commit_count": 227,
"repo_created_at": "2018-10-04T04:52: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": "740415c6... |
b23edc37-2335-4309-820b-ad53e50a4598 | coldEr66/online-judge | CF/1107E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define RST(i,n) memset(i,n,sizeof i)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define X first
#define Y second
... | ALGO | 0.999955 | 3.493369 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2018-04-07T03:54: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": "961a01f63... |
6e344e78-c6e6-4797-8abb-e242886d8071 | yuxng/3DVP | 3rd_party/vrippack-0.31/src/plytools/plyplanecrop.cc | /*
plyplanecrop:
crop away all points in a ply file below a specified plane.
<NAME>, 2005.
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <strings.h>
#include <ply.h>
float A,B,C,D;
/* user's vertex and face definitions for a polygonal object */
typedef struct Vertex {
float x,y,z;
int ... | TOOL | 0.923054 | 5.17103 | {
"github_metadata": {
"branch": "master",
"commit_count": 358,
"repo_created_at": "2014-06-03T01:18:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 38,
"forks": 17,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "eaee07... |
22375674-d4d3-4130-a0ab-f3ca3e469071 | kuitang/fwmatch-public | thirdparty/pmtk3-master/pmtksupportCopy/mplp-1.0/cmplp/matrix.h | #include <iostream>
#include <fstream>
class Matrix;
class Vec
{
public:
int m_size;
double *m_dat;
double *m_ep;
Vec(int size)
{
m_size = size;
if (size==0) return;
m_dat= new double[size];
m_ep = &m_dat[size];
}
~Vec();
inline int size() {return m_size;}
double & operator[](in... | ALGO | 0.968341 | 3.827802 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-04-18T19:49:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8426c6266a... |
d60a48da-5736-473a-9499-2fdcfaab7f4b | Jacobsky98/IMN1_WFIIS_2019 | lab04/main.cpp | #include <cstdio>
#include <cstdlib>
#include <cmath>
const int nx = 150.0;
const int ny = 100.0;
const int maxIt = 1000;
const double epsilon = 1.0;
const double delta = 0.1;
const double V1 = 10.0;
const double V2 = 0.0;
const double xmax = delta*nx;
const double ymax = delta*ny;
const double sigmaX = 0.1*xmax;
con... | ALGO | 0.999837 | 3.883567 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-01-11T13:06:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d140c99c15... |
06e15213-10ec-4fe9-a55e-63cc1f1c26ca | dariakhaetskaya/Parallel-Programming | Cluster/cluster.cpp | #include <iostream>
#include <pthread.h>
#include <unistd.h>
#include <cmath>
#include <mpi.h>
#include <cstdlib>
#include <fstream>
#include "utils.h"
#define L 1000
#define LISTS_COUNT 500
#define TASK_COUNT 2000
#define MIN_TASKS_TO_SHARE 2
pthread_t threads[2];
pthread_mutex_t mutex;
int *tasks;
std::ofstream *Lo... | ALGO | 0.999308 | 4.585585 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2021-03-06T07:16:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "410e835d558... |
c30c3c9d-88e6-42fa-b60e-69c278047dd4 | dgpk/agent-secure-scheduler | global_fun.cpp | //#include <cstdlib>
//#include <stdio.h>
//#include <stdlib.h>
//#include <unistd.h>
//#include <cstdio>
//#include <fstream>
//#include <iostream>
//#include <time.h>
//#include <openssl/ssl.h>
//#include <math.h>
#include "global_fun.h"
#define ulong unsigned long int
using namespace std;
void init_logs(int nu... | DATA | 0.918844 | 3.514208 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2015-12-22T15:55: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": "e0562744e... |
f219164f-0ba1-4452-9f22-3cd4464be703 | TengFeiyang01/Algorithm | casual/DP/liner dp/P4084.cpp | #include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
using i64 = long long;
void solve() {
int n, k;
std::cin >> n >> k;
std::vector<std::vector<int>> adj(n);
std::vector<int> color(n);
std::vector dp(n, std::vector<i64>(3, 1));
for (int i = 1; i < n; ++i) {
int u, v;
std::cin >> u >... | ALGO | 0.999967 | 5.054911 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2024-07-12T15:01:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "509cf53da... |
503d5f4e-a3f5-4a04-9fc8-ce1b6e1c90e5 | VivekSharma1103/POTD-LeetCode-GFG | April2025/25.LC_2845. Count of Interesting Subarrays.cpp | class Solution {
public:
long long countInterestingSubarrays(vector<int>& nums, int modulo, int k) {
unordered_map<int, long long> countMap;
countMap[0] = 1; // base case: prefix sum is 0
long long result = 0;
int prefixCount = 0;
for (int num : nums) {
// incre... | ALGO | 0.999911 | 6.306232 | {
"github_metadata": {
"branch": "main",
"commit_count": 222,
"repo_created_at": "2025-01-14T16:02: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": "12438122dc... |
5ddb2cc1-a923-4752-9908-db4c59c18c4c | TzhMonster/Coding-Interview-practice | practice06.cpp | /*
输入一个链表的头结点,从尾到头反过来打印每个节点的值
*/
#include<iostream>
#include<stack>
using namespace std;
struct ListNode
{
int m_nKey;
ListNode* m_pNext;
};
/*递归实现*/
void PrintList(ListNode* Head);
/*重载非递归实现*/
void PrintList(ListNode* Head, int a);
/*测试*/
void test1();
void test2();
/*创建链表*/
ListNode* CreateList(int* a, int si... | ALGO | 0.999623 | 4.566872 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-03-08T06:00: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": "60bf77153... |
85c1ebc5-d29f-4fb6-8390-f04f83fbb40f | esmf-org/esmf | src/Superstructure/Mapper/include/ESMCI_PolyDer.h | #ifndef ESMCI_PolyDer_H
#define ESMCI_PolyDer_H
#include "ESMCI_Macros.h"
#include <vector>
#include "ESMCI_Poly.h"
#include "ESMCI_PolyUV.h"
#include "ESMCI_PolyTwoV.h"
#include "ESMCI_LPolyMV.h"
#include "ESMCI_PolyTwoDV.h"
namespace ESMCI{
namespace MapperUtil{
/* Find the derivative of a Univariate polynom... | ALGO | 0.99021 | 6.449483 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28124,
"repo_created_at": "2020-02-03T17:42:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 184,
"forks": 85,
"issues": 89,
"pull_requests": 10
},
"file_meta": {
"content_id": "3... |
3039e0e3-9ffb-4428-a8d4-76951571f642 | athelare/SourceCode-ACM | 2017-2018s_Summer_Acm/SegmentTree_Model.cpp | #include<cstdio>
#include<iostream>
#define MAXN 1000010
#define inf 0x3f3f3f3f
using namespace std;
struct node{
int l,r;//区间[l,r]
int add;//区间的延时标记
int mn; //区间最小值
}tree[MAXN<<2];//一定要开到4倍多的空间
void pushup(int index){
tree[index].mn = min(tree[index<<1].mn,tree[index<<1|1].mn);
} ... | ALGO | 0.999995 | 3.113579 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-07-27T13:10: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": "18bfbbece... |
e5ed9f09-1c09-4396-a562-94b2b8deaa1e | Veipin/webrtc-src | system_wrappers/source/rtp_to_ntp_estimator.cc | /*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | TOOL | 0.92352 | 7.213699 | {
"github_metadata": {
"branch": "master",
"commit_count": 19912,
"repo_created_at": "2017-11-27T09:17: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": "8ec5d2... |
66897ba5-f973-45af-945d-3eebb768df06 | mobina0717/AP | کارگاه3/aval.cpp | #include "aval.h"
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
using namespace std;
int add(int a, int b) {
return a + b;
}
int subtract(int a, int b) {
return a - b;
}
int multiply(int a, int b) {
return a * b;
}
int divide(int a, int b) {
if (b =... | ALGO | 0.975992 | 4.561676 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-06-13T08:43: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": "c3e77e00c869... |
bbc6624d-9793-4bde-a864-03bb9a783548 | Akarshkushwaha/CPP-DSA | STRING/intro.cpp | #include<iostream>
using namespace std;
char toLowercase(char ch){
if(ch >= 'a' && ch<= 'z'){
return ch;
}
else{
char temp = ch -'A' + 'a';
return temp;
}
}
int reverse(char Name[], int n){
int s = 0;
int e = n-1;
while(s<e){
swap(Name[s++], Name[e--]);
}
... | ALGO | 0.999666 | 3.851043 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-08-24T10:18:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9045087ca4d... |
67764a4b-55d5-4b02-a7f4-e91969a48bb7 | atul411/codeforces | cf1359D.cpp | #include <bits/stdc++.h>
using namespace std;
void test_case() {
int a, b, c;
cin >> a >> b >> c;
map<int, int> mp1, mp2;
int i = 2;
while (i * i <= a) {
if (a % i) {
mp1[i]++;
a /= i;
} else {
i++;
}
}
if (a > 1) {
mp1[a]+... | ALGO | 0.999959 | 4.832789 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2021-07-19T11:49: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": "395d2aa8... |
af734c1b-6517-4c92-b509-5a05a7a89416 | mghirsch42/CMSC858D-Sp22-HW2 | querysa.cpp | #include "suffix_array.hpp"
using namespace std;
void print_help() {
cout << "HELP:" << endl;
cout << "This program four required arguments in the following order:" << endl;
cout << "index : the path to the binary file containing the suffix array." << endl;
cout << "queries : the pth to a FASTA file c... | ALGO | 0.960239 | 4.926818 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-04-14T13:31: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": "c4b86b3ed2f8... |
c886366a-60ae-4f2b-b0a7-e126bf6c1f84 | Lan-ce-lot/overflow | PAT/2020-12/2.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;
ll n;
ll f[maxn];
string s, p;
int str[maxn];
//vector<int> str;
int dep[maxn];
string tree[1005];
vector<int> G[maxn];
int fa[maxn];
int qqq;
void findf(int now) {
if (now == 0) {
printf("%04d->", now);
return;
}
fin... | ALGO | 0.999821 | 3.791683 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2020-07-12T14:35: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": "eae7f688a... |
d881d0cb-4da7-415e-ba3e-2f31966a7705 | JustinDrake/LigeroRSA | include/protocol/WeightedUnionFind.hpp | #pragma once
#include <cstdint>
#include <vector>
/** union finds where the id-representative is of the highest weight
* only guaranteed correct if changing weights for top-level nodes
*/
class weightedUnionFind {
public:
weightedUnionFind(size_t size);
size_t id(size_t a);
void change_weight(size_t a, uint8_... | ALGO | 0.996962 | 5.991968 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-06-02T21:21:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a60a2ce41... |
38d79dbc-9ff3-4d31-a62b-d46fffb4a1e8 | AbhineetJain/Algorithmic-Programming | SPOJ/HORRIBLE.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<LL> VLL;
#define SI(n) scanf("%d", &n)
#define SLL(n) scanf("%lld", &n)
#define SULL(n) scanf("%llu", &n)
#define sortv(v) sort(v.begin(), v.end())
#define pb(x) push_back(x)
#de... | ALGO | 0.999396 | 4.471851 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-11-04T18:35: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": "32de74024... |
9a74d2b0-d09d-421a-aee1-89bef7d87bd4 | WEN1WE/PAT | A1098.cpp | /*
* 1. 选择排序时,直接使用sort
* 2. 注意不要比较刚开始时的序列,序列一定是中间序列
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int N;
vector<int> initial;
vector<int> partially;
vector<int> tempInitial;
bool insertionSort() {
bool flag = false;
for (int i = 2... | ALGO | 0.999974 | 3.816249 | {
"github_metadata": {
"branch": "master",
"commit_count": 307,
"repo_created_at": "2019-08-01T12:17:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5fb94b0... |
19c73425-1300-4541-a9ec-c27bc1eb619f | markynich/schoolAssignments | Desktop/school/Fall2017/CS124/Lab6/morse.cpp | #include "morse.h"
Morsecode Telegraph::table[] = {
{'A', ".-"}, {'B', "-..."}, {'C', "-.-."}, {'D', "-.."},
{'E', "."}, {'F', "..-."}, {'G', "--."}, {'H', "...."},
{'I', ".."}, {'J', ".---"}, {'K', "-.-"}, {'L', ".-.."},
{'M', "--"}, {'N', "-."}, {'O', "---"}, {'P', "... | ALGO | 0.962609 | 3.709065 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-12-16T23:28: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": "9a0d6b815... |
f2ac4870-4fc5-494f-b9f6-1bcd4b1aecf7 | r6mez/Problem-Solving | Problems/B_Make_It_Permutation.cpp | /*
But when every equation was solved all that remained
were fields of dreamless solitude.
*/
// B. Make It Permutation
// URL: https://codeforces.com/contest/2118/problem/B
// Time: 6/13/2025, 1:53:46 PM
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define p... | ALGO | 0.999632 | 4.779491 | {
"github_metadata": {
"branch": "main",
"commit_count": 206,
"repo_created_at": "2024-03-24T15:43:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9340cc929... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.