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 |
|---|---|---|---|---|---|---|---|
9b79eebb-aa4c-4905-bf3c-a5372d83dfd4 | RutvijDv/Competitions | CodeForces/Codeforces Round #767 (Div 2)/C.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> p... | ALGO | 0.999995 | 4.60378 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-06-12T17:25:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "419dabbd6ce... |
613aee61-a0e1-4451-9ebd-ba7afe4fbe18 | AI1379/OILearning | BlogCode/Sort/HeapSort.hpp | #include <bits/stdc++.h>
#include "./Define.h"
#ifndef HEAPSORT_HPP
#define HEAPSORT_HPP
using std::swap;
class heap {
private:
int h[n + 1];
int _size;
void up(int pos);
void down(int pos);
public:
heap() { _size = 0; }
int top() { return h[1]; }
void push(int val) {
h[++_size] = val;
up(_... | ALGO | 0.999753 | 4.521631 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2019-05-17T23:54: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": "33e4b5b2... |
44f2a586-1c7b-4669-8031-8c85c8d0810e | KuchaD/vsb-FIDBS | Tables/cHashTable.h | //
// Created by <NAME> on 27.02.2022.
//
#pragma once
#include "cHashTableNode.h"
#include "cMemory.h"
template<class TKey, class TData>
class cHashTable
{
private:
int mSize;
cHashTableNode<TKey,TData>** mHashTable;
int mItemCount = 0;
int mNodeCount = 0;
cMemory* mMemory = NULL;
bool mWitho... | TOOL | 0.933027 | 5.215535 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-02-27T07:15:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a14844446... |
327afe73-c60c-4cd5-86ff-2ae644ed5853 | danielprinceD/myCpp | Algorithms/Array/Set Matrix Zeros.cpp | #include<bits/stdc++.h>
using namespace std;
void printer(auto v)
{
for(auto row : v)
{
for(auto ele : row)
cout<<ele<<" ";
cout<<endl;
}
}
void brute(int n , int m, vector<vector<int>> &v)
{
auto set_row_zero = [&](int i , int j){
for(int i=0;i<n;i++)
if(v[i][j... | ALGO | 0.999924 | 4.382192 | {
"github_metadata": {
"branch": "main",
"commit_count": 473,
"repo_created_at": "2024-01-04T12:18: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": "43d15f3137... |
bf40ba0f-b445-462d-a8ca-bbe4a7c4831d | Illicitus25/Coding | CPP/neocolab/q1.cpp | /*Emily is developing a simple chat application where messages are represented as single characters. She needs to create a program that allows her to insert new messages into a max heap.
Write a program to assist Emily in inserting new chat messages (each represented by a single character) into a max heap.After inse... | ALGO | 0.99978 | 5.545571 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-09-11T20:14:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7da87115567... |
437a0a78-8c3d-42b3-928b-7f29aa46a672 | Qrtsaad/CDFmethod | src/PELT.cpp | #include <Rcpp.h>
using namespace Rcpp;
double cost_bernoullicpp2(NumericVector v)
{
double res = 0, n = v.length(), a = sum(v), b = n - sum(v);
if(mean(v) == 0 | 1.0 - mean(v)==0 ) {
res = 0;
}
else {
res = -(a*log(a/n) + b*log(1.0-a/n));
}
return res;
}
// [[Rcpp::export]]
List myPELTcpp(Num... | ALGO | 0.999814 | 5.686286 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2022-01-15T10:09:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c21616e44... |
f95f8360-59cc-4a8f-998a-364563946687 | LavenderQAQ/code | acm/hdu1556.cpp | #include <iostream>
using namespace std;
const int maxn=100010;
struct node{
int l,r,sum,lazy;
void update(int x){
sum+=x;
lazy+=x;
}
}tree[maxn*4];
void push_up(int x){
tree[x].sum=tree[x<<1].sum+tree[x<<1|1].sum;
}
void push_down(int x){
int val=tree[x].lazy;
if(val){
... | ALGO | 0.999914 | 3.728098 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2021-12-10T01:25:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ac23c0e3d8a... |
7dc507e1-b34c-4a54-b74b-b15734d04f23 | FalseF/Problem-Solving | UVa/10369 Arctic Network.cpp |
/*######## IN THE NAME OF ALLAH ##########*/
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define pa pair<ll,ll>
#define mem(a,b) memset(a,b,sizeof(a))
#define MIN -99999999999999999
#define READ(f) freopen(f,"r",stdin)
#define WRITE(f) freopen(f,"w",stdout)
#defin... | ALGO | 0.999823 | 3.652837 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-09-06T11:47:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfc99161c... |
c8b879ee-6ead-471c-9927-e1621b0f1fa4 | Deepakgaddam/Advanced_Algorithms | vertex.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> Vertex;
struct CompareVertices {
bool operator()(const Vertex& v1, const Vertex& v2) const {
return v1.second > v2.second;
}
};
vector<int> shortestPathDistances(const vector<vector<int>>& graph, int s... | ALGO | 0.999946 | 5.657037 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-10-29T22:48: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": "c1db55b0ba0... |
8635f287-5061-49eb-816b-dd0c42cbf997 | YeoEunSeong/problem-solving | Brute Force/programmers42840.cpp | // 문제 및 풀이: https://velog.io/@e7838752/programmers42840
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> answers) {
int size = answers.size();
vector<int> v1(size);
vector<int> v2(size);
vector<int> v3(size);
for (int i = 0; i < si... | ALGO | 0.999881 | 5.055879 | {
"github_metadata": {
"branch": "master",
"commit_count": 285,
"repo_created_at": "2021-08-02T09: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": "6699153b... |
80fabbde-d52d-484c-a4bb-0854a007c190 | crazy-kid/Games101 | Assignment7/Scene.cpp | //
// Created by <NAME> on 2019-05-14.
//
#include "Scene.hpp"
void Scene::buildBVH() {
printf(" - Generating BVH...\n\n");
this->bvh = new BVHAccel(objects, 1, BVHAccel::SplitMethod::NAIVE);
}
Intersection Scene::intersect(const Ray& ray) const
{
return this->bvh->Intersect(ray);
}
// 在场景的所有光源上按面积 uni... | ALGO | 0.934108 | 4.453109 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-08-26T12:16: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": "27a567452bb... |
4521769f-4a92-4593-89dd-f99394a0f424 | hellobrother1472/Leetcode-Practice | Postfix to Prefix Conversion.cpp | #include <bits/stdc++.h>
using namespace std;
// Similar to prefix to postfix just in it we are reversing in last
class Solution {
public:
string postToPre(string s) {
// Write your code here
string helper = "";
stack<string>st;
for(int i = 0 ; i < s.size(); i++){
if(... | ALGO | 0.999941 | 4.774595 | {
"github_metadata": {
"branch": "master",
"commit_count": 368,
"repo_created_at": "2022-07-16T15:32: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": "8ece1458... |
bbbdbcd6-e046-467a-8173-78af9026abbc | BelfordZ/cpsc3200 | awesome-o/2001/prob4.cc | #define PROBLEM 4 /* The problem # here */
#define TEAM 0 /* Your team # here */
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstdio>
using namespace std;
ifstream in;
ofstream out;
void solve_problem();
int main(void)
{
char filename[64];
sprintf(filename, "prob%d.d... | ALGO | 0.999688 | 3.583926 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2013-04-10T05:34: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": "fbf3e3fd57... |
7f211cdb-3d34-4777-925c-118abf439b28 | CameronR7/Traffic-Report-cpp | 15412350_FP.cpp | //Author: <NAME>
/*References:
* 1)C++ Programming. Publisher: Cengage. Author: <NAME>.
* 2)StackOverflow.com
* 3)CodeCamp.com
*/
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
using namespace std;
// Structure to hold traffic data
s... | TOOL | 0.958084 | 5.83204 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-04-29T10:23: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": "bdcdff3f7b... |
ec8a4946-6f10-482d-926b-3b40af219625 | acmeism/RosettaCodeData | Task/Sort-disjoint-sublist/C++/sort-disjoint-sublist-2.cpp | #include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>
template <typename ValueIterator, typename IndicesIterator>
struct DisjointSubsetIterator :
public std::iterator<std::random_access_iterator_tag,
typename std::iterator_traits<ValueIterator>::value_type> {
typedef typename std:... | ALGO | 0.999881 | 5.547414 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2013-04-08T20:08:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 518,
"forks": 177,
"issues": 12,
"pull_requests": 3
},
"file_meta": {
"content_id": "67df525... |
5e0cecec-167a-4203-b8c2-890f6e41b880 | gostefan/imageSynthesis | RenderApp/Shader/PhongLobeShader.cpp |
#include "PhongLobeShader.h"
#include "LambertShader.h"
#include "../Scene/LightRay.h"
#include "Sampling/Sampler/RandomSampler.h"
#include "Sampling/Warping/PhongHemisphereWarping.h"
#include "../Scene/EnvironmentMap.h"
PhongLobeShader::PhongLobeShader(const Math::Color3f& kd, float mirrorPercentage_in, int maxRecur... | ALGO | 0.963059 | 6.45323 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2016-03-16T22:29:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8894ed59ee... |
00c8d951-8bbe-4587-881e-c0436ec49b67 | Interactml/iml-unreal | Plugins/InteractML/Source/3rdParty/RapidLib/src/seriesClassification.cpp | /**
* @file seriesClassification.cpp
* RapidLib
*
* @author <NAME>
* @date 08 Jun 2017
* @copyright Copyright © 2017 Goldsmiths. All rights reserved.
*/
#include <vector>
#include <cassert>
#include <limits>
#include <algorithm>
#include <thread>
#include <stdexcept>
#include "seriesClassification.h"
#ifde... | ALGO | 0.94364 | 6.063787 | {
"github_metadata": {
"branch": "master",
"commit_count": 269,
"repo_created_at": "2021-05-11T16:53:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 60,
"forks": 17,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "81f2ba... |
08db5ca9-f5d7-44d0-851d-cbadea08aa0a | samiunblack/phitron | semester 2/basic data structure/week 2/module 6.5/3.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node* next;
Node(int val, Node* next = NULL)
{
this->val = val;
this->next = next;
}
};
int main()
{
Node* head = NULL;
Node* temp;
int a;
int count = 0... | ALGO | 0.999942 | 3.937607 | {
"github_metadata": {
"branch": "main",
"commit_count": 272,
"repo_created_at": "2023-03-24T02:43:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fd80080a... |
54f4b72b-a2e9-4a5d-b7d6-7ff979e6ae09 | polossk/Code-Archive | LightOJ/13/lightoj1383.cpp | // <!--encoding UTF-8 UTF-8编码--!>
/*****************************************************************************
* ----Stay Hungry Stay Foolish---- *
* @author : Shen *
* @name : LightOJ 1383 ... | ALGO | 0.999647 | 3.662202 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2014-08-03T14:23:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd9f91401... |
139c75b4-12ff-4ab7-8ad3-c2637961782e | Prashant8722/Prashant8722 | Number of occurrence - GFG/number-of-occurrence.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
/* if x is present in arr[] then returns the count
of occurrences of x, otherwise returns 0. */
int firstOccurance(int nums[], int n,int target)
{
int low = ... | ALGO | 0.999893 | 5.845631 | {
"github_metadata": {
"branch": "main",
"commit_count": 161,
"repo_created_at": "2022-08-24T14:17:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9e6ebb773... |
f1fbb633-2e17-4d1c-8853-b914e9c648eb | LineYK/Algorithm | 백준/Silver/23246. Sport Climbing Combined/Sport Climbing Combined.cc | /*
Sport Climbing Combined
시간 제한 메모리 제한
1 초 (추가 시간 없음) 1024 MB
문제
스포츠 클라이밍은 1986 년에 시작된 실내 암벽 등반 스포츠이다.
선수들은 원래 리드 클라이밍 종목에서만 겨루었는데,
1989 년에 스피드 클라이밍이 추가되었고, 10 년 후인 1999 년에 볼더링 종목이 추가되었다.
올림픽 게임에서는 금, 은, 동메달을 결정하기 위하여 선수들은 세 종목에서 겨루어 종합 순위를 매긴다.
종합 순위는 세 종목에서 거둔 순위를 곱한 점수로 결정된다.
예를 들어, 어떤 선수가 리드에서 1 위, 스피드에서 ... | ALGO | 0.999977 | 4.31011 | {
"github_metadata": {
"branch": "main",
"commit_count": 869,
"repo_created_at": "2022-03-12T10: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": "ce850517a6... |
315db728-18d1-4a1b-878e-1602a7456d9c | Festison/GameAcademy | C++/6주차/4. 링크드 리스트 실습 (08-08) .cpp | #include<iostream>
#include<list>
using namespace std;
class Node
{
public:
Node(int value)
{
this->value = value;
}
public:
Node* next = nullptr;
Node* prev = nullptr;
int value;
};
class LinkedList
{
private:
Node* start = nullptr;
Node* end = nullptr;
int size = 0;
public:
bool IsEmpty()
{
return... | ALGO | 0.992965 | 4.272422 | {
"github_metadata": {
"branch": "main",
"commit_count": 261,
"repo_created_at": "2023-07-03T09:46:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43851ad867... |
0a91e08f-6356-4126-9334-83155c11660e | ismdeep/ICPC | hdu/1025/main.cpp | /*
* Project : 1025
* File : main.cpp
* Author : iCoding
*
* Date & Time : Sat Aug 25 15:34:29 2012
*
*/
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <map>
#include <queue>
#include <set>
using namespace std;
///////////////////////////////////////////////... | ALGO | 0.99988 | 3.442274 | {
"github_metadata": {
"branch": "master",
"commit_count": 141,
"repo_created_at": "2013-04-30T07:19:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f0cfafa... |
0051dde6-530f-4f0d-b5ca-2366577d0023 | Bicocca/UserCode | HiggsAnalysis/VBFHiggsToWWto2l2nu/bin/Drawer_H4j.cpp |
#include <iostream>
#include <cmath>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <sstream>
#include "TTree.h"
#include "TChain.h"
#include "TCanvas.h"
#include "TClonesArray.h"
#include "TString.h"
#include "TGraph.h"
#include "TFile.h"
#include "TLorentzVector.h"
#include "TP... | DATA | 0.945662 | 3.064327 | {
"github_metadata": {
"branch": "master",
"commit_count": 2538,
"repo_created_at": "2013-06-25T16:10:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9df9ae74... |
a4df52fd-35fb-42ea-83c0-576f72bf1468 | Svetlin12/data-structures-and-algorithms | Heap/Heap.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef vector<int> vi;
void swap(int& a, int& b)
{
int temp = a;
a = b;
b = temp;
}
class MaxHeap
{
private:
vi arr;
const int parent(int ind)
{
return (ind - 1) / 2;
}
const int left(int ind)
{
return... | ALGO | 0.99927 | 4.539401 | {
"github_metadata": {
"branch": "master",
"commit_count": 254,
"repo_created_at": "2019-08-26T18:57:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75add509... |
24a3e907-3cda-4120-bb92-56b67ad35a22 | duck-falcon/atcoder | past-abc/abc167/c.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(long long i = 0; i < (n) ; ++i)
#define orep(i,n) for(long long i = 1; i <= (n); ++i) // one rep
#define drep(i,n) for(long long i = (n)-1; i >= 0; --i) // down rep
#define srep(i,s,t) for(long long i = (s); i < (t); ++i) // set rep
#define rng(x) (x).begin(),(x)... | ALGO | 0.999948 | 3.831965 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-04-01T05:10: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": "f920405f8df... |
28c47b7b-34c2-49f8-b9b2-c2d1415183eb | NithinChepuri/Tic-Tac-Toe | tic_tac_toe.cpp | Note- Codes for mXn and 3X3 are provided respectively.
CODE FOR mXn code:
#include<iostream>
using namespace std;
int checkrow(char[][100],int,int,int);
int checkcoloumn(char[][100],int,int,int);
int checkrupdiagonal(char[][100],int,int,int);
int checkrdowndiagonal(char[][100],int,int,int);
int checklupdiagonal... | ALGO | 0.99826 | 3.55599 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-09-13T16:34: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": "8a53fd5560aa... |
9640d214-aef5-428f-80ea-1ff196a4a717 | renanabfreire/Kit | MLP/src/Perturbacao.cpp | #include "Ils.h"
Solution Perturbacao(Solution s, Data &d, vector<vector<Subsequence>> &SubsequenceMatriz)
{
// Gerando aleatoriamente blocos para troca
int tam, stam;
if(s.sequence.size() <20 && s.sequence.size()>=10)
{
tam =2;
stam =2;
}
else
{
tam = 2+rand()%(int)... | ALGO | 0.999699 | 4.486232 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-11-27T23:51: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": "b64fa3d04ab... |
75653cf1-4fb2-4bf9-8f56-49a37b86365d | HirenJoshi16/Self_dsa | nonSheet5-delete_consequtiveNodes_withSum_zero_.cpp | // Program to delete consequtive nodes with zero sum in list ~ coded by vHiren
#include <bits/stdc++.h>
using namespace std;
// Basic Template
struct node{
long data;
struct node* next;
};
// Creates node to list
struct node* createNode(long data){
struct node* n = new node;
n->data = data;
n->nex... | ALGO | 0.999798 | 5.41201 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-04-05T17:28: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": "ac2de172a461... |
714e8b18-bac4-4023-9690-eca85730e478 | hasanali112/Data-Structure-Algorithm | Assignment-02/tempCodeRunnerFile.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
void insert_at_tail(Node *&head, Node *&tail, int val)
{
Node *newnode = new Node(val);
if (head == NULL)
{
head = n... | ALGO | 0.999914 | 4.755332 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-06-15T18:28: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": "82e02c705e2... |
0e101cd2-def8-4389-ad84-6c3c615277e4 | nibosea/atcoder | pastproblem/arc140/a.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
typedef pair<int,int> P;
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
#define For(i, a, b) for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n) For(i, ... | ALGO | 0.999994 | 3.809464 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2021-07-24T14:54:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a797fd83371... |
6c37b7f3-e170-4679-89ef-b7571f9da706 | ishandutta2007/codeforces-b | benq/normal/1082/D.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
typedef long long ll;
typedef long double ld;
typedef complex... | ALGO | 0.99983 | 3.469034 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ae282fd8d46... |
4600801e-f960-48da-8099-d7b964f993e4 | Lartsev-Artem/RadRHD_solver | solvers/hllc/src/hllc_flux.cpp |
#if defined SOLVERS && defined HLLC
#include "hllc_flux.h"
#include "global_value.h"
#include "hllc_utils.h"
#include "linear_alg.h"
void hllc::GetConvValue(const flux_t &W, flux_t &U) {
const Type v = W.v.dot(W.v);
const Type d = W.d;
U.d = d;
U.v = d * W.v;
U.p = W.p / (kGamma1 - 1) + d * v / 2;
}
voi... | ALGO | 0.999617 | 5.129337 | {
"github_metadata": {
"branch": "master",
"commit_count": 151,
"repo_created_at": "2023-09-17T10:05: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": "8a3d2ccb... |
a36e5d53-9517-48ea-9b2c-8ab853109666 | kwdx/LeetCode-Practise | Cpp/2024.考试的最大困扰度.cpp | /*
* @lc app=leetcode.cn id=2024 lang=cpp
*
* [2024] 考试的最大困扰度
*/
#include <iostream>
#include <string>
using namespace std;
// @lc code=start
class Solution {
public:
int maxConsecutiveAnswers(string answerKey, int k) {
this->answer = answerKey;
this->n = (int)answer.size();
this->k =... | ALGO | 0.999961 | 6.696311 | {
"github_metadata": {
"branch": "master",
"commit_count": 379,
"repo_created_at": "2019-11-29T10:20:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3cee53c... |
998e1617-cd37-4e9e-aa4b-893f9ca35e57 | kanikachouhan0027/DSA | 65_QueBT_3/5_kth_Ancestor.cpp | // Kth Ancestor in a Tree
// Difficulty: MediumAccuracy: 35.06%Submissions: 110K+Points: 4
// Given a binary tree of size N, a node, and a positive integer k., Your task is to complete the function kthAncestor(), the function should return the kth ancestor of the given node in the binary tree. If there does not exist ... | ALGO | 0.999989 | 4.94154 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-08-01T12:02: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": "bcca0a9a386... |
f9b13fdc-1bcc-47fb-a4e5-c335dca554e4 | anpl-technion/anpl_mrbsp | da/src/da/da_icp_laser.cpp | /* ---------------------------------------------------------------------------
*
* Autonomous Navigation and Perception Lab (ANPL),
* Technion, Israel Institute of Technology,
* Faculty of Aerospace Engineering,
* Haifa, Israel, 32000
* All Rights Reserved
*
* See LICENSE for the license information
*
* -----... | TOOL | 0.934793 | 6.02138 | {
"github_metadata": {
"branch": "gtsam4",
"commit_count": 68,
"repo_created_at": "2021-04-22T11:36:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7e3b43cbd... |
8964f704-19f9-4d1a-887f-5d55fb6b7a63 | MingyeGao/CodeInterviewGuide | CH3/3.19*Tarjian/main.cc | ///用Targan算法和并查集解决二叉树节点间最近公共祖先问题
#include <iostream>
#include <map>
#include <vector>
#include <list>
#include <initializer_list>
using namespace std;
struct Node{
int val;
Node *lchild;
Node *rchild;
Node(int x = 0):val(x), lchild(nullptr), rchild(nullptr){}
};
struct DisjoinSet{
map<Node*, Node*... | ALGO | 0.999997 | 4.808404 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-07-10T07:24:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93e9edfd00... |
36accc1b-3182-4a33-bb89-5693c6f91f69 | JatinGarg19/Leetcode-Coding-Problems | 0109-convert-sorted-list-to-binary-search-tree/0109-convert-sorted-list-to-binary-search-tree.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
/**
* Definition for a binary tree node.
* struc... | ALGO | 0.999995 | 6.396488 | {
"github_metadata": {
"branch": "main",
"commit_count": 737,
"repo_created_at": "2022-11-26T11:11: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": "8db17597b5... |
8e32882f-d0cb-41ec-9838-dceb7c873bbd | CMemeletzoglou/HPC_exercises | Ex3b - OpenACC and Ant Colony/ant_colony_serial.cpp | #include <iostream>
#include <tuple>
#include <vector>
#include <algorithm>
#include <string>
#include <fstream>
#include <assert.h>
#include "timer.hpp"
typedef struct ant_s
{
std::tuple<int, int> position; // the ant position's global index
} ant_t;
typedef struct grid_cell_s
{
std::tuple<int, int> ... | ALGO | 0.999814 | 5.861877 | {
"github_metadata": {
"branch": "main",
"commit_count": 206,
"repo_created_at": "2022-10-30T12:52: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": "74204740a4... |
f7eeb5d9-f52e-4e98-bd14-4ab4916ba5d2 | nhatminh4401/Programming-Technique | W06/19127469_W06_05/Assignment 1/Function.cpp | #include "Function.h"
int fibo(int n){
if(n == 0 || n == 1)
return 1;
else
return fibo(n-1) + fibo(n-2);
}
int xn_yn_1(int n){ //x(n) 2. x(n), y(n)
if(n == 0 )
return 1;
return xn_yn_1(n-1) + xn_yn_2(n-1);
}
int xn_yn_2(int n){ //y(n) 2. x(n), y(n)
if(n == 0)
return 0;
return 3*xn_yn_1(n-1) + ... | ALGO | 0.999014 | 3.806927 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-05-18T09:18: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": "2758fc62dd... |
e89feec6-6cf9-4bc1-8b31-6222793afe3b | Karthik-Nayak98/Codeforces | Codeforces Div. 2, A/67-soroban.cpp | /* CREATED BY
* <NAME>
* DATE : 28-May-20
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cstring>
#include <cstdio>
#include <climits>
#include <cmath>
typedef long long int lli;
typedef unsigned int ui;
typedef unsigned long long ull;
#define mod 1e9+7
#defin... | ALGO | 0.999775 | 3.947271 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-06-02T07:30:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "004db8e9af... |
45d28795-1f8b-42fa-b8a9-55823f10d3dc | MuhammadHamada/Maze-Solver | Solve.ino |
void correctionErrorToRight(){
AW(RB_PIN,TURN_CORRECTION_SPEED);
AW(RF_PIN,0);
AW(LB_PIN,0);
AW(LF_PIN,0);
//event1 =t1.after(10,move180_right);
while(!(digitalRead(SCR_PIN) == LINE && digitalRead(SCL_PIN) == LINE)){
//t1.update();
}
stoop();
//t1.stop(event1);
delay(REST_DELAY);
}
void move18... | ALGO | 0.995854 | 3.927034 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-12-08T11:11: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": "0b3c474234dc... |
711f6620-dcae-4ad9-b722-767d58aac9c3 | BrettKriz/MTU-C | CS3331 - prog5/thread-main.cpp | // -----------------------------------------------------------
// NAME : <NAME> User ID: bakriz
// DUE DATE : 12/2/2016
// PROGRAM ASSIGNMENT #5
// FILE NAME : thread-main.cpp
// PROGRAM PURPOSE :
// Handles the primary code paths of the project
// ... | TOOL | 0.984625 | 3.46012 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-08-09T15:21: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": "a8cea50feb... |
a102b984-5310-4006-9036-03fe145233f2 | Aviral1-jain/CP_DSA | 100gfg/w17_59E.cpp | #include<bits/stdc++.h>
#include <iostream>
using namespace std;
#define int long long
vector<int> adj[100005];
void shortestpath(){
int n,m,k;
cin>>n>>m>>k;
for(int i = 0;i<m;i++) {
int u, v;
cin >> u >> v ;
adj[u].push_back(v);
adj[v].push_back(u);
}
... | ALGO | 0.999993 | 4.381506 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2023-07-12T17:50: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": "f24314eec15... |
e82a17d7-bec9-4e86-ad2a-cc73383deea8 | HKUST-Aerial-Robotics/FINT | tunnel_planner/include/hough/hough_circle.hpp | /*******************************************************
Copyright (C) 2025, Aerial Robotics Group, Hong Kong University of Science and Technology
This file is part of FINT.
Licensed under the GNU General Public License v3.0;
you may not use this file except in compliance with the License.
*****************************... | ALGO | 0.992325 | 6.010919 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-11-18T11:27:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8bca18d89922... |
1f46175f-68f1-4f75-943f-c17f0d19fac8 | monkeynova/advent-of-code | advent_of_code/2021/day02/day02.cc | #include "advent_of_code/2021/day02/day02.h"
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/log/log.h"
#include "absl/strings/numbers.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"
#include "advent_of_code/... | ALGO | 0.998653 | 6.967218 | {
"github_metadata": {
"branch": "main",
"commit_count": 2025,
"repo_created_at": "2020-11-27T20:26:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "f81de155a... |
d644d165-3d1d-4c9f-9c8e-e77486770542 | metaphysis/Code | UVa Online Judge/volume111/11113 Continuous Fractions/program.cpp | // Continuous Fractions
// UVa ID: 11113
// Verdict: Accepted
// Submission Date: 2017-07-23
// UVa Run Time: 0.050s
//
// 版权所有(C)2017,邱秋。metaphysis # yeah dot net
#include <bits/stdc++.h>
using namespace std;
// 十进制下的四则运算。
const int BASE = 10;
// 移除计算结果的前导0。
void zeroJustify(string &number)
{
while (number.fro... | ALGO | 0.999368 | 4.553287 | {
"github_metadata": {
"branch": "master",
"commit_count": 1710,
"repo_created_at": "2016-03-07T13:28:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 229,
"forks": 50,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7627... |
57c12c8e-fc9a-4a5a-8999-b264d632eed2 | deviant7/SoC-CP | Reg_BS.cpp | #include <iostream>
#include <string>
#include <stack>
using namespace std;
bool isBalanced(string &str) {
stack<char> s;
for (auto& c : str) {
if (c == '(') {
s.push(c);
} else {
if (!s.empty() && s.top() == '(') {
s.pop();
} else {
... | ALGO | 0.999961 | 4.641112 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-06-07T17:09: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": "330cde1aa04... |
357c4a0e-fe9d-436b-b403-e90fe8f3fdb4 | dietmarkuehl/adventofcode | 2022/ad05-1.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <iterator>
#include <string>
#include <unordered_map>
#include <vector>
#include <cctype>
std::istream& skip(std::istream& in) {
std::string aux;
return in >> aux;
}
int main() {
std::vector<std::vector<char>> stacks;
for (std::strin... | ALGO | 0.999745 | 4.585152 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2022-12-03T21:04:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48b1b7f0542... |
ec3c8422-24e3-4fd2-9a2f-efac6dfcd398 | edwardne/CS475 | p3/p3fix2.cpp | /*********************************************************************
** Program Filename: dynamicArray.c
** Author: <NAME>
** Date: 4/23/17
** Description: Dynamic Array implmentation.
** Input: none
** Output: none
*********************************************************************/
#include <omp.h>
#incl... | TOOL | 0.935966 | 4.523636 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-05-17T01:04: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": "0fcb5656f... |
c5feda5f-bdb9-4031-b297-011f8205c8f4 | mutharibayub/Competitive_Programming | ICPC/2023/prelim/day1/phrases.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <map>
#include <set>
#include <queue>
#include <array>
#include <algorithm>
#include <functional>
#include <numeric>
#include <limits>
#include <string>
using namespace std;
typedef long long ll;
template<typename T> using minPQ = priority_queue<T, v... | ALGO | 0.999523 | 3.870056 | {
"github_metadata": {
"branch": "main",
"commit_count": 279,
"repo_created_at": "2022-08-05T04:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a05a007788... |
70869421-baf3-418a-b77b-91785bec558f | Toha-Hossain28/Algo-code | UndirectedGraphCycle.cpp | // https://www.geeksforgeeks.org/problems/detect-cycle-in-an-undirected-graph/0
class Solution {
private:
bool detectCycle(int src, vector<vector<int>>& adj, int vis[]) {
queue<pair<int, int>> q;
q.push({ src, -1 });
vis[src] = 1;
while (!q.empty()) {
int node = q.front().first;
int pare... | ALGO | 0.999941 | 5.868167 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-17T07:23: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": "2aa2ebb42789... |
6256dc8c-e8af-4eb8-a6ea-3e0e63c7af23 | SirusnakJR1872000/Advanced-Algorithms-cpp | sliding_window_variablesize.cpp | // now lets understand sliding window algorithm where the window is of variable size
// lets consider an example in this case :
// we have to find the length of longest subarray with the same value in each position
// that is we need to make sure that we do not have any holes in the subarray or the window
# include <... | ALGO | 0.999762 | 5.84743 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-08-18T18:03: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": "c5c2697194b... |
93c6fd78-1bde-4ffd-998b-8e9c13c65bd5 | bsc-wdc/compss | tests/sources/local/performance/1_matmul_objects_c/Matmul_obj.cc | /*
* Copyright 2002-2015 Barcelona Supercomputing Center (www.bsc.es)
*
* 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
*
* Unl... | ALGO | 0.997045 | 4.004757 | {
"github_metadata": {
"branch": "stable",
"commit_count": 8603,
"repo_created_at": "2018-03-05T16:44:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 55,
"forks": 23,
"issues": 8,
"pull_requests": 5
},
"file_meta": {
"content_id": "791405... |
e7308fff-aa26-4fca-b144-32232a42b67b | cogsys-tuebingen/csapex_core_plugins | csapex_vision_features/src/match_descriptors.cpp | /// HEADER
#include "match_descriptors.h"
/// PROJECT
#include <csapex/model/node_modifier.h>
#include <csapex/msg/io.h>
#include <csapex/param/parameter_factory.h>
#include <csapex/utility/register_apex_plugin.h>
#include <cslibs_vision/data/matchable.h>
#include <cslibs_vision/utils/hough_peak.h>
#include <cslibs_vi... | ALGO | 0.996978 | 4.327768 | {
"github_metadata": {
"branch": "master",
"commit_count": 2426,
"repo_created_at": "2016-08-09T22:50:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16eade6f... |
b16fa485-4d30-4a53-b8cd-24022b46f94b | lleviackermann/CpCodes | codeforces/E_MEXimize_the_Score.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;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define endl "\n"
#define fo(i, n) for (i = 0;... | ALGO | 0.999873 | 4.454145 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2023-04-28T10:03: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": "3bd2527d... |
48b41d7f-8cc4-4f56-b9ee-b81ca732dea5 | gustavo-mj/estrutura | aula1.cpp | // Copyright 2025 <NAME>
#ifndef STRUCTURES_LINKED_LIST_H
#define STRUCTURES_LINKED_LIST_H
#include <cstdint>
namespace structures {
//! ...
template<typename T>
class LinkedList {
public:
//! ...
LinkedList(); // construtor padrão
//! ...
~LinkedList(); // destrutor
//! ...
void clear();... | ALGO | 0.994027 | 6.257341 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-08T17:50: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": "e34a71d83c9c... |
613992ad-7952-4518-9c19-1485d51329e4 | subhasish/Algo | 07.LinkedList/00.ListSTL.cpp | /*
* 00.ListSTL.cpp
*
* Use STL list
*
* Created on: Oct 28, 2017
* Author: subha
*/
#include <bits/stdc++.h>
using namespace std;
// Assume: non-cyclic
//void PrintList(Node<int>* L)
void PrintList(std::list<int> L)
{
std::list<int>::iterator it = L.begin();
cout << "List: ";
while(it != L.end()) {... | ALGO | 0.9764 | 4.925139 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-10-23T17:03: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": "e104e5f0d8... |
dbc1fdb3-36f9-460b-be8a-c3334e590f78 | Monyreak/Soccer-league-simulation | queue_ADT.cpp | #include "queue_ADT.h"
template <typename T>
void queue<T>::enQueue(T *data) {
LinkedList<T>::setSortType(3);
// std::cout << "Adding '" << data << "' to the queue..." << std::endl;
LinkedList<T>::addData(data);
}
template <typename T>
void queue<T>::deQueue() {
if (isEmpty()) {
std::cout << "T... | TOOL | 0.989005 | 4.463357 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-07-12T17:26: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": "4017e99f9d... |
7e5201f5-f0ee-4a2c-a293-cba0544dfc02 | assembly-seal/group-project-cs1430 | src/main.cpp | /*
* Author: <NAME>, <NAME>,
* <NAME>, <NAME>
* Assignment Title: Group Project
* Assignment Description: Version of Falling Balls
* Due Date: 12/08/2024
* Date Created: 11/01/24
* Date Last Modified: 12/06/2024
*/
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <chron... | TOOL | 0.920494 | 3.370839 | {
"github_metadata": {
"branch": "main",
"commit_count": 207,
"repo_created_at": "2024-10-23T21:08:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9d531d0bc... |
12ebe893-f9e2-4777-baab-cf6857adb414 | izhang05/Competitive-Programming | cf/contest/1566/e/e.cpp | /* Author: izhang05
* Time: 09-14-2021 23:47:15
**/
#include <bits/stdc++.h>
using namespace std;
//#define DEBUG
void setIO(const string &name) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cin.exceptions(istream::failbit);
#ifdef LOCAL
freopen(("in" + name + ".txt").c_str(), "r", stdin);
... | ALGO | 0.999842 | 4.674454 | {
"github_metadata": {
"branch": "master",
"commit_count": 691,
"repo_created_at": "2021-01-21T17:58:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7d8eeed... |
9089a3a6-69a4-4b26-9a98-9e2faed0830d | bespoke-silicon-group/hb_hammerbench | apps/legacy/spgemm/src/host/spmm_solve_row_main.cpp | #include "bsg_manycore_regression.h"
#include "CommandLine.hpp"
#include "EigenSparseMatrix.hpp"
#include "SparseMatrix.hpp"
#include "Solver.hpp"
#include "HammerBlade.hpp"
#include <iostream>
#include <memory>
using namespace spmm;
using namespace dwarfs;
using namespace hammerblade::host;
int SpGEMM(int argc, char ... | ALGO | 0.975102 | 5.32866 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2022-07-25T18:12:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "08c9fcb5c89... |
328de05e-1f11-4e0c-9e99-511dd04d9380 | bakerinc420/Algorithms | 7.6.cpp | #include <iostream>
#include <cmath>
#include <limits>
using namespace std;
struct Array{
int*arr;
int i;
};
Array fill_array();
int *reverse_array(struct Array res);
int main() {
Array res = fill_array();
reverse_array(res);
for (int b = 0; b < res.i;b++) {
cout << res.arr[b] << endl... | ALGO | 0.996889 | 3.346778 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-04T18:51: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": "16d92cc365d2... |
2d5a5ec3-661c-4d96-9a0b-199ed0061f1c | homedory/codetree-TILs | 240130/최소 에너지 비용/minimum-energy-cost.cpp | #include <iostream>
#include <vector>
using namespace std;
#define MAX_N 100005
int charge_cost[MAX_N], move_energy[MAX_N];
long long prefix_sum[MAX_N];
vector <int> stop_point;
int main() {
int n;
cin >> n;
for (int i = 2; i <= n; i++) {
cin >> move_energy[i];
}
for (int i = 1; i ... | ALGO | 0.999973 | 3.488558 | {
"github_metadata": {
"branch": "main",
"commit_count": 1038,
"repo_created_at": "2024-01-12T16:08: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": "e08b36e43... |
3baa7231-e738-47fa-9b24-110681598142 | khanhkhmt/PYTHON_PRIVATE_2024 | tempCodeRunnerFile.cpp | # include <bits/stdc++.h>
using namespace std;
void permuteRec(vector<int>& nums, int begin, vector<vector<int>>& result) {
if (begin == nums.size()) {
result.push_back(nums);
return;
}
for (int i = begin; i < nums.size(); i++) {
swap(nums[begin], nums[... | ALGO | 0.999995 | 6.212863 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-10-14T12: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": "a6ee3690b62... |
be8379f6-0983-4fb3-9ce6-b3303cd6057b | gem5-graphics/gem5-graphics | gpgpu-sim/intersim/wavefront.cpp | #include "booksim.hpp"
#include <iostream>
#include "wavefront.hpp"
#include "random_utils.hpp"
Wavefront::Wavefront( const Configuration &config,
Module *parent, const string& name,
int inputs, int outputs ) :
DenseAllocator( config, parent, name, inputs, outputs )
{
//... | TOOL | 0.951616 | 5.22991 | {
"github_metadata": {
"branch": "master",
"commit_count": 340,
"repo_created_at": "2016-09-30T09:43:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 57,
"forks": 30,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "55908d7... |
0c664e44-0448-400f-aed0-52e16f0b1655 | draget/SAEAuto | TestCode/RoadFind/findroad3.cpp | /*
*
* Test code for finding the edges of the road...
* <NAME> 2013
*/
#include "linear.h"
#include <iostream>
#include <fstream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <boost/algorithm/string.hpp>
#includ... | ALGO | 0.988165 | 4.044239 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2013-04-20T07:35:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0668b5a0... |
d5edc9e8-8a7c-459b-a0e4-826f439d6bc8 | jackieooikk/codeforce | 1100/divbytwo.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
int line[n];
for (int i = 0; i < n; i++) {
cin >> line[i];
}
sort(line, line + n);
for (int i = n; i > 0; i--) {
for (i... | ALGO | 0.999935 | 4.468257 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2023-09-01T01:10: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": "8335452fcc3... |
2208bd22-3f88-46fa-92f3-8cb0329e394a | rasinhas/Maratona | codeforces/gym/training1-8/f.cpp | #include <iostream>
#include <fstream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cassert>
using namespace std;
long long p[2222222];
const long long M=1000000000000000001ll;
int main()
{
int t, l;
long long n;
ifstream in("ar... | ALGO | 0.999818 | 3.636253 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2013-05-02T18:32:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e32a12903... |
206b02b1-5e37-4dd4-8779-32b8c87365b7 | sakiib/competitive-programming-code-library | DS & Algo Implementation/Graph Theory/LCA/Shortest Path With Only One Cycle.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
const int N = 1e5 + 5;
const LL INF = 1e18;
int n , q;
struct data {
int u , v;
LL w;
data(){}
data( int u , int v , LL w ) : u(u) , v(v) , w(w){}
bool operator <( const data &q ) const {
r... | ALGO | 0.999956 | 4.776096 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2019-09-12T18:37:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05952c7d... |
e1dc14a5-28f3-4df9-a03a-41e9bcaaf9e2 | ishandutta2007/codeforces-w | wzyyn/normal/1336/E1.cpp | #include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)... | ALGO | 0.99998 | 3.725528 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34: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": "1c2b3869e3bc... |
20d771ab-657a-4eed-b892-99ab1840b637 | LuckfoxTECH/luckfox-pico | project/app/rk_smart_door/smart_door/common/face/algo_dual_ir/include/face_unlock.hh |
#ifndef __FACE_UNLOCK_HH__
#define __FACE_UNLOCK_HH__
#include "rknn_api.h"
//value is real int value
typedef struct BBoxRect
{
float score;
int xmin;
int ymin;
int xmax;
int ymax;
int xkey_point[5];
int ykey_point[5];
float point18_x[18];
float point18_y[18];
float yaw;
float pitch;
float roll;
float ... | TOOL | 0.909633 | 4.10988 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2023-08-07T12:16:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 471,
"forks": 218,
"issues": 105,
"pull_requests": 4
},
"file_meta": {
"content_id": "5e7bae... |
2fc6e00a-7232-4691-ad30-1af5c5aaf065 | PowersPope/adventOfCode | 2024/day2/extraSafe.cpp | #include <fstream>
#include <iostream>
#include <regex>
#include <vector>
using namespace std;
pair<vector<int>, bool> checkKeepIncreasing(vector<int> vec) {
bool out = true;
int removal = 0;
vector<int> newOut;
for (int i = 0; i < vec.size() - 1; i++) {
if (vec[i + 1] < vec[i] && removal >= 1) {
o... | ALGO | 0.999775 | 4.794543 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-11-27T02:54: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": "8f07315de44... |
7a8f6122-c125-4015-ac97-17c9fb98874a | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/0_0_9603.cpp | #include <iostream>
#include <vector>
using namespace std;
bool checkPiece(const vector<string>& puzzle, const vector<string>& piece, int x, int y) {
int h = piece.size();
int w = piece[0].size();
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (y + i >= puzzle.size() ||... | ALGO | 0.999916 | 5.036742 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b5e49e5ea8... |
b0334aee-7f8c-497a-9722-92cd3b856c08 | pika96/wootech3_algorithm_study | BFS, DFS/코다/BFS_Baek7576.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main() {
int n;
int m;
cin >> n >> m;
vector<vector<int> > start;
int x[4] = {1, -1, 0, 0};
int y[4] = {0, 0, 1, -1};
vector<vector<int> > box;
box.resize(m, vector<int>(n, 0));
fo... | ALGO | 0.999941 | 3.299323 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2021-07-28T09:37: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": "e9be63465... |
967e24e8-4b15-46f8-b71e-21ae6431fd6b | BrunoVilela/FARM | src/new_tip.cpp | #include <Rcpp.h>
using namespace Rcpp;
// This is a simple example of exporting a C++ function to R. You can
// source this function into an R session using the Rcpp::sourceCpp
// function (or via the Source button on the editor toolbar). Learn
// more about Rcpp at:
//
// http://www.rcpp.org/
// http://adv-r.had... | TOOL | 0.960746 | 6.41916 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2016-08-18T17:46:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5bf77cf7... |
0ff25111-e9ec-4178-ba0f-a82888465a85 | daninworksap/OCRusLitton | src/textDetect/textorient.h | /*
* textorient.h
*
* Created on: May 4, 2015
* Author: litton
*/
#ifndef TEXTORIENT_H_
#define TEXTORIENT_H_
#include "textarea.h"
using namespace std;
using namespace cv;
enum TextDirection {NOCHANGE, NINETY, OPPOSITE, R_NINETY};
double textorient = -10;
int INTERVAL = 45;
int dIntegral(vector<int> n... | ALGO | 0.977386 | 4.086633 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-11-17T06:50: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": "2804c0335d... |
439d1793-fa27-480a-b864-12df0aa16a87 | paulmathai01/Pupil-Interfaced | pupil_src/shared_modules/pupil_detectors/singleeyefitter/CircleEvaluation3D.h | #ifndef singleeyefitter_CircleEvaluation3D_h__
#define singleeyefitter_CircleEvaluation3D_h__
#include "common/types.h"
#include "math/distance.h"
#include "common/constants.h"
#include "geometry/Sphere.h"
namespace singleeyefitter {
template<typename Scalar>
class CircleEvaluation3D {
public:
... | TOOL | 0.997698 | 6.999127 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-28T19:16: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": "37cfa52fc5... |
f581dfb2-0d21-4908-b875-9a757570a5c2 | udaykumargupta/Synthetic-Pair-Deviation-Engine | src/arbitrage/VolatilityArbitrage.cpp | #include "arbitrage/VolatilityArbitrage.hpp"
#include <iostream>
#include <cmath>
namespace VolatilityArbitrage {
// Black-Scholes pricing (Call Option)
double blackScholesCall(double S, double K, double T, double r, double sigma) {
double d1 = (std::log(S / K) + (r + 0.5 * sigma * sigma) * T) / (sigm... | ALGO | 0.918806 | 7.046052 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-07-06T22:37:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ba8a079be64... |
b2684915-ba68-49a3-94df-1d9a9def9066 | sachuverma/DataStructures-Algorithms | DSA Crack Sheet/solutions/Clone a linked list with next and random pointer.cpp | /*
Clone a linked list with next and random pointer
===================================================
You are given a special linked list with N nodes where each node has a next pointer pointing to its next node. You are also given M random pointers , where you will be given M number of pairs denoting two nodes a an... | ALGO | 0.999611 | 4.847425 | {
"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": "0d... |
d69c6445-df68-4cb1-840f-3e559205a933 | Blacksocks/SystemC_video | tests/pgcd.cpp | #include <systemc.h>
// Calculate greatest common divisor between x and y
unsigned int pgcd_compute(unsigned int x, unsigned int y)
{
int min = (x < y) ? x : y;
int max = (x < y) ? y : x;
if(max == min)
return min;
return pgcd_compute(min, max - min);
}
// Calculate greatest common divisor bet... | ALGO | 0.999804 | 6.688771 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2017-08-28T20:54: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": "b269c5a03... |
d04abe2f-910f-4cc0-b821-0b45924d7443 | freebsd/freebsd-ports | science/qcl/files/patch-extern.cc | --- extern.cc.orig 2014-03-27 17:24:43.000000000 +0400
+++ extern.cc 2014-09-04 21:37:03.000000000 +0400
@@ -81,7 +81,7 @@
dim=(1 << n);
if(!loc->getRef(sdec(dim-1,"u%ld")+sdec(dim-1)) || loc->getRef(string("u")+sdec(dim)+sdec(dim)))
EXTERR("illegal register size for matrix operator");
- tComplex u[dim][dim... | TOOL | 0.930316 | 4.7962 | {
"github_metadata": {
"branch": "main",
"commit_count": 713138,
"repo_created_at": "2011-05-26T11:15:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1066,
"forks": 794,
"issues": 0,
"pull_requests": 54
},
"file_meta": {
"content_id": "72... |
82062b2b-e3cb-4fdb-a28b-8c31678fe5ff | SpikeyAndy/COMP2012 | Home/lab6/VigenereCipher.cpp | #include "VigenereCipher.h"
#include "Utility.h"
// TODO #1
// Initialize the static data member alphabetSize here
const int VigenereCipher::alphabetSize = 26;
// TODO #2
// Implement the encrypt member function according to the given algoirthm.
string VigenereCipher::encrypt(string plaintextMsg) const {
int leng... | ALGO | 0.997363 | 5.714028 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-03-13T13:49: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": "1054edacc960... |
ccb7faba-e0ee-4c8c-99ce-d4a3dc7420e5 | OwenHelios/algo | knapsack/LC1774.cpp | // https://leetcode.cn/problems/closest-dessert-cost/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int closestCost(vector<int>& baseCosts, vector<int>& toppingCosts, int target) {
vector<int> tc = {0};
for (int &t : toppingCosts) {
auto tmp = tc;
f... | ALGO | 0.999961 | 5.352355 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-08T12:01: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": "470a1b5cc18c... |
4fec102e-b18b-4f2d-bc98-dc099d6f931b | Goldent00thbrush/Basic_Algos_DStructs | linked_list/linked_list.cpp | #include "linked_list.h"
#include "node.cpp"
#include <iostream>
using namespace std;
template <typename t>
linked_list<t>::linked_list()
{
head = nullptr;
curr = nullptr;
s=0;
}
template <typename t>
int linked_list<t>::size(){ // returns number of data elements in list
return s;
}
template <typename... | TOOL | 0.987607 | 3.995009 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2021-01-10T17:53: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": "cf104651b51... |
b474ef0e-d1ae-4602-a7b3-387a1c7a3109 | caoash/competitive-programming | problems/COCI/2010/COCI10-Kolo.cpp | /*
* Simulate the problem forwards to find the final position of the first guy who jumps, then you know the final positions of the last guys (i - 1, i + 1).
*
* Then we can run the process in reverse to find the final values of the adjacent guys because we know their final position.
*/
#include <bits/stdc++.h>
us... | ALGO | 0.999986 | 4.170313 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2018-12-23T04:19:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa9f07fc8... |
000293bf-08e3-4de9-a08c-744178193cfa | M4MD24/Algorithms-and-Problem-Solving-Level-5-by-Programming-Advices | src/_3_stack_data_structure/Main.cpp | #include <iostream>
#include "stack_data_structure/Stack.h"
using namespace std;
int main() {
Stack<short> values;
cout << "■ After Push:" << endl;
values.push(
10
);
values.push(
20
);
values.push(
30
);
values.push(
40
);
values.push(
... | TOOL | 0.902476 | 5.361702 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2025-05-30T18:33:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adefff430... |
ae61cefe-4039-45b7-8d08-227ecf31a1c1 | Tduderocks/PracticeProblems | Ch_5/Ch5_Rev19_22.cpp | //The game of 21 using functions. Review 23 works:) Review 24 works:) Review 25 works:) and works:) done:)
#include <iostream>
using namespace std;
#include <stdlib.h>
#include <chrono>
#include "Utility.h"
void Introduction()
/*Gives the rules of 21*/
{
cout << "Rules: Decide how many cards you want.\n";
cout ... | ALGO | 0.979394 | 4.135626 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-05-21T17:51:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37afbe069c... |
06cf51ce-9895-437c-be92-23eb004f4561 | jheiser81/Schoolwork | 8 - C/Functions Practice/Functions Practice/Functions Practice.cpp | // Functions Practice.cpp : This file contains the 'main' function. Program execution begins and ends there.
#include <stdio.h>
///Notes on functions:
//In C, functions are made using the following syntax:
//return_type function_name( parameter list ) {
// body of the function
//}
//
//The return_type is the data t... | TOOL | 0.94133 | 3.870339 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2023-02-04T23:15: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": "a601798a2... |
ce5d83ec-85d8-463a-a0c0-dea60d8aae13 | ishandutta2007/codeforces-k | kal013/normal/1538/E.cpp | /*/ Author: kal013 /*/
// #pragma GCC optimize ("O3")
#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;
template<class T>
using ordered_set = tree<T, null_type,less<T>, rb_tree_tag, tree_order_statistics_node_update>... | ALGO | 0.994306 | 4.184483 | {
"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": "46063662418f... |
7d2b3d25-0179-4215-9400-ee7c89361906 | H4R1B0/Algorithm | 백준/Gold/21608. 상어 초등학교/상어 초등학교.cc | #include <iostream>
#include <algorithm>
#include <cstring>
#include <queue>
#include <cmath>
using namespace std;
#define MAX 21
#define endl '\n'
int xd[] = { 0,0,1,-1 };
int yd[] = { 1,-1,0,0 };
struct STUDENT
{
int num;
int like[4];
};
struct POSITION
{
int x, y, nearly_empty, nearly_friend;
};
STUDENT Stude... | ALGO | 0.999578 | 4.184615 | {
"github_metadata": {
"branch": "main",
"commit_count": 433,
"repo_created_at": "2023-03-04T07:07: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": "be105d4a2b... |
439bd962-0683-4dcc-9e6c-9f00bdc0e16a | Shikhar6027/cmptetive | C_Mocha_and_Hiking.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * b) / gcd(a, b)
#define inf (long long)1e18
#define lcm(a, b) (a * b) / gcd(a, b)
#define GOLD ((1 + sqrt(5)) / 2... | ALGO | 0.999921 | 3.704813 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-02-11T14:49: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": "4c5d0a38a3... |
186eefa8-df2e-4e79-9f42-ae7aad1f2ac3 | Tsili123/Algorithmic-Problems-Project1 | algo/LSH_main.cpp | #include "./LSH_Folder/LSH.hpp"
using namespace std;
LSH *Lsh;
int main(int argc, char *argv[]) {
store_LSH_data(argc, argv);
read_file(Lsh->queries_data, Lsh->query_file);
LSH_Insert_Points_To_Buckets(Lsh);
int queries = Lsh->queries_data.size();
int N = Lsh->get_N();
ofstream Output;
... | ALGO | 0.995678 | 3.840025 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2021-11-19T14:57:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "094909b1d1... |
52a3983c-3abe-47d7-9852-4a7ab4c00832 | ex-surreal/contest-programming | codeforces/18a.cpp | #include <iostream>
#include <cstdio>
#include <bitset>
#include <vector>
#include <numeric>
#include <string>
#include <algorithm>
#include <map>
#include <cmath>
#include <set>
#include <queue>
#include <stack>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <cassert>
using namespace std;
#define me... | ALGO | 0.999817 | 3.831528 | {
"github_metadata": {
"branch": "master",
"commit_count": 239,
"repo_created_at": "2016-08-02T14:15: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": "741936b0... |
2590fb15-00cd-4c11-93b0-7aa1dbecab4d | Elitedj/codeforces_sloved | Edu103/b.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3f
#define IO ios::sync_with_stdio(0)
#define DEBUG(x) cout << "--->" << (x) << '\n';
const double eps = 1e-9;
const double PI = acos(-1);
const... | ALGO | 0.999862 | 3.625126 | {
"github_metadata": {
"branch": "master",
"commit_count": 148,
"repo_created_at": "2020-01-15T11:33: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": "1117e4c8... |
ab665e51-f738-424f-a43b-7b8d6a6322b6 | abhishek1997/CSN-212 | Assignment-3/bellman-ford.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF 1000000011
#define sws ios_base::sync_with_stdio(false); cin.tie(0)
#define io_file freopen("D:/Coding Problems/Contest/input_file.in", "r", stdin);freopen("D:/Coding Problems/Contest/output_file.out", "w", stdout)
const int N = 100009;
in... | ALGO | 0.999814 | 4.057676 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2017-02-16T17:04: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": "b1eef880d... |
5251d07b-106e-4345-9ec6-705148240b4f | Imrann-Khan/CP-Codes | Assignment01_202114084.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;
int partition(vector<int>& nums, int left, int right) {
int pivot = nums[right];
int store_index = left;
for (int i = left; i < right; ++i)
{
if (nums[i] > pivot)
{
swap(num... | ALGO | 0.999944 | 4.691665 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-16T22:04: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": "bc11ade0582f... |
c66ddb99-8c57-4a00-84d1-bab80493f56d | sarum90/cpp_web_framework | modules/reax-ssl/http_client.hpp | #pragma once
#include "reactor.hpp"
#include "net.hpp"
#include "mestring.hpp"
#include "buffered_reader.hpp"
namespace http {
struct response {
std::string protocol;
std::string version;
int status_code;
std::string status;
std::vector<std::pair<std::string, std::string>> headers;
std::string content;
... | WEB | 0.939618 | 6.175801 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-10-28T14:19:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22b78a7ed... |
8b996660-99e7-41cc-a6bb-2761020fd2f1 | wangcy6/weekly_read | code_reading/oceanbase-master/src/sql/engine/sort/ob_in_memory_topn_sort.cpp | /**
* Copyright (c) 2021 OceanBase
* OceanBase CE is licensed under Mulan PubL v2.
* You can use this software according to the terms and conditions of the Mulan PubL v2.
* You may obtain a copy of Mulan PubL v2 at:
* http://license.coscl.org.cn/MulanPubL-2.0
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BAS... | ALGO | 0.993202 | 6.238801 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2020-09-07T07:42:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "352d132817... |
0e7cef13-fdf5-4862-b66f-849c28f3c1e8 | lychees/ACM-Training | Workspace/Cpp/Template/几何2.cpp | struct Triangle; struct Circle;
typedef const Triangle&cTriangle; typedef const Circle&cCircle;
const int Disjoint = -2, Exscribe = -1, Cross = 0, Inscribe = 1, Contain = 2;
Po getX3(cPo a, cPo b, cPo c){ // 外接圆圆心
Po v0=b-a,v1=c-a;DB l0=v0.len2(),l1=v1.len2(),d=2*det(a,b,c);
return Po(l0*v1.y-l1*v0.y,l1*v0.x-... | ALGO | 0.999576 | 4.431836 | {
"github_metadata": {
"branch": "master",
"commit_count": 307,
"repo_created_at": "2015-09-15T06:34:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 109,
"forks": 20,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "07b40... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.