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 |
|---|---|---|---|---|---|---|---|
43cc1f34-87d6-40d2-8c6c-fce3a151a691 | axxonite/algorithms | EPI/Problems/25_HonorRoll/25.20_shortest_unique_prefix.cpp | // Copyright (c) 2015 Elements of Programming Interviews. All rights reserved.
#include "stdafx.h"
#include "Shared.h"
// #define TEST
string FindShortestPrefix( const string& s, const unordered_set<string>& d )
{
return "";
}
#pragma region Test
string FindShortestPrefixCheckAns( const string& s, unordered_set<s... | ALGO | 0.988312 | 5.88817 | {
"github_metadata": {
"branch": "master",
"commit_count": 399,
"repo_created_at": "2020-01-05T03:34: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": "f573959d... |
65ece7b4-ae31-4557-bea5-2adc1d70cda5 | cenariusxz/ACM-Coding | teaching/2018普及组热身赛/Day1/T3 cake/cake-60.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 5005;
const ll INF = 0x3f3f3f3f3f3f3f3f;
int a[maxn],b[maxn];
int main(){
freopen("T3-10.in","r",stdin);
freopen("T3-10-s.out","w",stdout);
int n;
scanf("%d",&n);
for(int i = 1 ; i <= n ; ++ i)scanf("%d",&a[i]);
... | ALGO | 0.999993 | 3.330021 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2019-05-08T08:45: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": "b6b078fc3... |
d7b6e1fc-510d-4778-b3f0-55f65d6f3f97 | FarukIb/My-Competitve-Programming-Solutions | CSES/task_assignment/main.cpp | #include <bits/stdc++.h>
#define mp make_pair
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const ll INF = 1e18;
vector<vector<ll> > capacity, graph, cost;
void add_edge(int f, int t, int cst, int cap) {
graph[f].push_back(t);
graph[t].push_back(f)... | ALGO | 0.999522 | 3.332096 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2021-06-18T12:21: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": "604962b4e4a... |
2de94340-7155-459b-ba9b-62683160d2e6 | LiranBratt2121/projectsb4ShinShin | circulerPrime/program.cpp | #include <iostream>
#include <cstdint>
#include <cmath>
bool IsPrime(uint32_t n) {
for (int i = 2; i <= n / 2; i++) {
if (n % i == 0) return false;
}
return true;
}
uint32_t GetDigits(uint32_t n) {
return (uint32_t)(log10(n)) + 1;
}
uint32_t GetNextPermutation(uint32_t n) {
uint32_t fact... | ALGO | 0.999555 | 5.136089 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-05-24T22:10: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": "414e9f1ecf6... |
c41c0b7b-bd4f-4d42-b378-8b67ea095545 | qbaocaca/data_structure | array_main.cpp | #include <iostream>
#include "array_class.cpp"
#include "array.h"
using namespace std;
void input(Array &, int &);
int main()
{
Array a;
int x;
while (true)
{
cin >> x;
if (x == 0)
break;
a.insert(x);
}
a.print();
// int m;
// cin >> m;
// Arra... | ALGO | 0.996301 | 4.018875 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-03-07T15:01: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": "8b18e0aa6f9... |
f20231fc-69d7-45a2-9ef8-4f674531448d | Mi-Kram/HseCpp-Course1 | 01/contest/m/main.cpp | ////////////////////////////////////////////////////////////////////////////////
/// \file
/// \brief
/// \author <NAME>
/// \version 0.1.0
/// \date 09.04.2024
///
/// Последовательностью Фибоначчи называется последовательность чисел
/// a0, a1,…, an, …, где a0 = 0, a1 = 1, ak = ak-1 + ak-2 (k > 1).
/// Н... | ALGO | 0.999991 | 5.290861 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-07-02T10:38: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": "8b407a7478... |
00b29708-f0f1-42d7-a93b-9b17e2c14bfd | minhthuan86/CTDL_GT | DSLK_vong/Bai14_ChenMSapXep.cpp |
#include<iostream>
#include<conio.h>
using namespace std;
struct Node{
int Data;
Node *Next;
};
typedef Node* DS;
Node * Tao_Nut(int a)
{
Node * p;
p=new Node;
p->Data=a;
p->Next=p;
return p;
}
void Chen_Cuoi_Vong(DS &pHead,int a)
{
DS p=Tao_Nut(a),q;
if(pHead==NULL) pHead=p;
else
{
for(q=pHead;q->Next... | ALGO | 0.999993 | 3.798149 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-01-03T12:06: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": "7db656541dbb... |
79c0a680-e66d-47dc-9979-48ed6ef2d42a | liuyubobobo/Play-Leetcode | 1501-2000/1580-Put-Boxes-Into-the-Warehouse-II/cpp-1580/main.cpp | /// Source : https://leetcode.com/problems/put-boxes-into-the-warehouse-ii/
/// Author : liuyubobobo
/// Time : 2020-10-16
#include <iostream>
#include <vector>
using namespace std;
/// Sorting and Greedy and Two Pointers
/// Time Complexity: O(nlogn + mlogm + (n + m))
/// Space Complexity: O(1)
class Solution {
... | ALGO | 0.999997 | 5.862039 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee... |
145752a8-100b-4c40-a691-6758f77d20ec | vhirtham/GDL | gdl/math/solver/internal/luDenseSmall.h | #pragma once
#include "gdl/base/fundamentalTypes.h"
#include "gdl/base/simd/x86intrin.h"
#include "gdl/base/simd/utility.h"
#include "gdl/math/solver/pivotEnum.h"
#include <array>
#include <type_traits>
namespace GDL
{
namespace Solver
{
//! @brief Support class for LU solver.
//! @tparam _type: Data type
//... | ALGO | 0.995443 | 7.588254 | {
"github_metadata": {
"branch": "master",
"commit_count": 926,
"repo_created_at": "2017-10-20T17:03:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 17,
"pull_requests": 0
},
"file_meta": {
"content_id": "924b581... |
7d2266ab-99bb-4401-a71f-623d45099b5f | vanderlin/ofxBox2d | src/ofxBox2dPolygonUtils.h | /*
* ofxBox2dPolygonUtils.h
* ofxBox2d
*
* Created by <NAME> on 1/18/11.
* Copyright 2011 Interactive Design. All rights reserved.
*
*/
#pragma once
#include "ofMain.h"
class TriangleShape {
public:
TriangleShape() {
color.set(ofRandom(255), ofRandom(255), ofRandom(255));
}
int index[3];
ofColor colo... | ALGO | 0.998632 | 6.398646 | {
"github_metadata": {
"branch": "master",
"commit_count": 244,
"repo_created_at": "2011-01-14T16:25:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 324,
"forks": 124,
"issues": 3,
"pull_requests": 7
},
"file_meta": {
"content_id": "e6e5... |
d165d151-fe84-40e2-9b07-46199a731d47 | Wizmann/ACM-ICPC | LightOJ/1408.cc | #include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define print(x) cout << x << endl
#define input(x) cin >> x
const int SIZE = 55;
const double eps = 1e-8;
double p;
int a, b;
int main() {
int T;
input(T... | ALGO | 0.999361 | 3.818787 | {
"github_metadata": {
"branch": "master",
"commit_count": 3480,
"repo_created_at": "2011-12-19T02:04:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 63,
"forks": 29,
"issues": 97,
"pull_requests": 0
},
"file_meta": {
"content_id": "975c... |
3e598d97-7d2e-40d2-a469-cf0ebd962306 | MakerFace/leetcode | src/Oct/10.23/746.cpp | /**
* @file 746.cpp
* @brief
* @author chenqi (<EMAIL>)
* @version 1.0
* @date 2022-10-23
*/
#include <bits/stdc++.h>
#include "common/Vector.hpp"
#include "common/utils.hpp"
using namespace std;
class Solution {
public:
int minCostClimbingStairs(vector<int> &cost) {
int n = static_cast<int>(cost.size())... | ALGO | 0.999223 | 5.539943 | {
"github_metadata": {
"branch": "main",
"commit_count": 161,
"repo_created_at": "2022-02-24T06:13:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b79009ce2... |
9f15b61a-9eb4-4454-8efc-ceb29f927b01 | RishabhRD/450DSA | btree/22.cc | #include <algorithm>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <unordered_set>
#include <vector>
using namespace std;
struct Node {
int data;
Node *left;
Node *right;
};
inline bool is_leaf(Node* root){
return (root->left == nullptr && root... | ALGO | 0.998651 | 3.971241 | {
"github_metadata": {
"branch": "master",
"commit_count": 371,
"repo_created_at": "2021-03-17T05:14: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": "8bb661b0... |
1fb235fa-4040-4367-a3d5-ef2131c07eb5 | suyash-purwar/DSA-Practice | bitwise/powerOfTwo.cpp | /**
* @name 231. Power of Two
* @brief Given an integer n, return true if it is a power of two. Otherwise, return false. An integer n is a power of two, if there exists an integer x such that n == 2x.
* @link https://leetcode.com/problems/power-of-two
* @author <NAME> (github.com/suyash-purwar)
* @date 14-06-23
*... | ALGO | 0.989963 | 6.637724 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2022-08-26T07:36: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": "33c4427e... |
f3256c00-e9fa-4a4d-8237-a10dddd2c524 | ManiRaj129/DungeonFire | FetchPath.cpp |
#include "FetchPath.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
typedef int16_t pair_t[num_dims];
#define getType(pair) (d->grid[pair[dim_y]][pair[dim_x]].type)
#define getTypeAt(x, y) (d->grid[y][x].type)
#define getHard(pair) (d->grid[pair[dim_y]][pair[dim_x]].hardness)
#define getHardAt(x, y) (d-... | ALGO | 0.995339 | 3.361609 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-02-02T16:59: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": "b58ef701f770... |
66c8c1f6-8a2c-431b-a5e3-1977acb3de68 | wisdompeak/LeetCode | Others/1538.Guess-the-Majority-in-a-Hidden-Array/1538.Guess-the-Majority-in-a-Hidden-Array.cpp | /**
* // This is the ArrayReader's API interface.
* // You should not implement it, or speculate about its implementation
* class ArrayReader {
* public:
* // Compares 4 different elements in the array
* // return 4 if the values of the 4 elements are the same (0 or 1).
* // return 2 if three eleme... | ALGO | 0.999815 | 5.034466 | {
"github_metadata": {
"branch": "master",
"commit_count": 8912,
"repo_created_at": "2017-03-01T10:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6018,
"forks": 1314,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "a... |
323076cd-6393-4088-a582-d16f538f11ca | scottie33/mcmc | cmc.cpp | //cmc.cpp
#undef SEEK_SET
#undef SEEK_END
#undef SEEK_CUR
#define HAVE_NO_VARIABLE_RETURN_TYPE_SUPPORT 1
//#include <mpi.h>
#include "cmc.h"
///////////////////////////xxxxxx
cmc::cmc() {
ee=0.0; ff=0.0; dd=0.0;
dd_sqrt=0.0;
tc=NULL; ec=NULL; //fc=NULL;
dc=NULL;
vecDC=NULL; coorRES=NULL;
len_vecDC=0.... | ALGO | 0.981926 | 3.427854 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2013-06-18T17: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": "0ec84bf67... |
f6789791-dcd7-4cee-adad-cc0d426141c8 | mritunjay583/Programs | CODING/number_theory/efficient_power_check.cpp | #include<bits/stdc++.h>
using namespace std;
// power function to calulate power of x^y
long long int power(int x,int y)
{
long long int res=1;
while(y)
{
if(y&1)
{
res*=x;
}
x*=x;
y/=2;
}
return res;
}
int main()
{
int x=3,y=729;
int temp=x... | ALGO | 0.999933 | 4.790942 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-04-20T12:19: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": "5293cfb757... |
86ba9f08-419d-4fcb-9ede-3a6c460781b9 | Altu-Bitu-7/Altu-Bitu-JayKim | week05/2075.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <functional>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
priority_queue<int, vector<int>, greater<int>> pq; // 오름차순으로 넣어주는 힙 생성
for (int i = 0; i < n; i++) {
for (... | ALGO | 0.999762 | 3.946962 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-08-18T08:38:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "038492a4fdc4... |
f4fab44e-27f3-4cd8-98b9-070346c4368d | ssungho/study-coding-test | 프로그래머스/lv1/42862. 체육복/체육복.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(int n, vector<int> lost, vector<int> reserve)
{
int answer = 0;
sort(lost.begin(), lost.end());
sort(reserve.begin(), reserve.end());
vector<int>lost_stu;
vector<int>reserve_stu;
answer += n;
for... | ALGO | 0.999879 | 4.14339 | {
"github_metadata": {
"branch": "main",
"commit_count": 686,
"repo_created_at": "2023-03-01T10:05:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69d1f8b753... |
75718f89-59fa-4aa9-986b-2add2931e0d7 | MrQuba/cpp-exercises | 2/2.46.cpp | #include <algorithm>
#include <fstream>
#include <ios>
#include <iostream>
#include <string>
void save_to_file(const std::string text, const std::string path,
const bool nline = false,
const std::ios_base::openmode mode = std::ios_base::out) {
std::fstream f(path, mode);
for (cha... | TOOL | 0.905362 | 3.431094 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2024-10-05T08:12:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "149e8945fb7... |
930603f4-5b38-4f64-9094-12fd0c2b4322 | hsheric0210/Algorithm-Coding | cpp/AJIT-new/경시대회-2/80030/80030.wrong-2.cpp | /*
서로 다른 소수들의 합
https://43.200.211.173/contest/18/problem/80030
FIXME
512 10
prev[0].size=97
prev[1].size=2741
prev[2].size=37287
prev[3].size=295615
prev[4].size=1532706
prev[5].size=5410537
prev[6].size=13804679
prev[7].size=25502458
prev[8].size=35221526
691729
*/
#include<iostream>
#include<algorithm>
#include... | ALGO | 0.999843 | 4.1336 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2022-08-21T16:23: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": "2319c9d9ad... |
480c80ab-607d-4a67-8468-0f7c253dc2c3 | lubodilov/learning_git | lca_binarylifting.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int>adj[10000];
vector<vector<int> >up;
vector<int> tin, tout;
int n, m, l;
int timer=0;
void dfs(int v, int p)
{
tin[v] = ++timer;
up[v][0] = p;
for(int i=1; i<l; ++i)
{
up[v][i]=up[up[v][i-1]][i-1];
}
for(int u : adj[v])
{
... | ALGO | 0.999986 | 3.958456 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-07-03T12:28: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": "8805cbec128... |
e5bcfe28-87ec-4982-9c7b-fa1d65ad2a0e | GONGRYONGWANG/ProblemSolving | 백준/Diamond/17607. 수열과 쿼리 31/수열과 쿼리 31.cc | //#pragma warning(disable:4996)
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long ll;
#define INF (1<<32)
typedef unsigned int uint;
typedef pair<int, int> pii;
struct node {
node* l; node* r; node* p;
int cnt;
int val;
int ls, rs, mxs;
bool rv;
node() : l(nullpt... | ALGO | 0.999954 | 4.653252 | {
"github_metadata": {
"branch": "main",
"commit_count": 2553,
"repo_created_at": "2024-02-24T14:04:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd3453e46... |
8d691518-ba6d-4678-a05d-0a5a7879dc8e | Alex2097-BDT/CS253-19F-Temp | week7/TwentySeven.cpp | //
// Created by alex on 11/16/19.
//
#include <iostream>
#include <fstream>
#include <string.h>
#include <functional>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
struct cmp{
bool operator()(const pair<string, int> &p1, const pair<string, int> &p2){ return p1.second > p2.second;}
};... | ALGO | 0.995648 | 4.000814 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-11-10T08:27: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": "805c175eca... |
5e4934e9-f06a-4724-82f3-63dd711d4b29 | ishandutta2007/codeforces-u | uestc_nocturne/normal/121/D.cpp | #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<iostream>
using namespace std;
typedef long long LL;
const LL ooo=1000000001;
const LL oo=ooo*ooo;
const int V=100100;
struct Node{LL l,r;}q[V];
bool LE(Node x,Node y)
{return x.l<y.l;}
bool RI(Node x,Node y)
{return x.r<y... | ALGO | 0.999223 | 3.277879 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "f2225d2f5137... |
3a741eff-9bef-4308-9a40-cc382f920e03 | Evbw/NYU-Tandon-Bridge-Summer-2023 | Week 8/hw8_q1.cpp | #include <iostream>
using namespace std;
//Initialize constant
const int ARRAYSIZE = 20;
//Initialize functions
int minInArray(int arr[ARRAYSIZE], int arrSize);
//Precondition: The array is correctly filled with int values.
//Postcondition: The smallest integer is determined and returned.
void indexLocations(int arr[AR... | ALGO | 0.999626 | 5.288179 | {
"github_metadata": {
"branch": "main",
"commit_count": 260,
"repo_created_at": "2023-08-24T02:37:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0baaf6438... |
73dc4c99-176a-45fb-bce8-13ad32ee9244 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1248/all/29140430_63005181.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const int MAXN = 1e5 + 10;
const ll mod = 1e9 + 7;
ll dp[MAXN][5];
ll dp2[MAXN][5];
int main()
{
int n,m;
cin>>n>>m;
dp[1][0] = 1;
dp[1][1] = 1;
dp[2][0] = 1;
dp[2][1] = 1;
dp[2][2] = 1;
dp[2][3] = 1;
for (int i = 3... | ALGO | 0.999995 | 3.788148 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "693e77602... |
9822272e-21c1-403a-afea-77500f48b05a | wojiaxiaoguan/sort | sort/sort.cpp | //
// sort.cpp
// sort
//
// Created by Wojiaxiaoguan on 2017/5/8.
// Copyright © 2017年 Wojiaxiaoguan. All rights reserved.
//
#include "sort.hpp"
//template <class Record,class Compare>
//void Sorter<Record,Compare>::swap(Record array[],int i,int j)
//{
// Record temp = array[i];
// array[i] = array[j];
/... | ALGO | 0.999118 | 5.093998 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-05-09T00:28:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0f62d9a6d... |
7bf55f36-25a5-4b01-a6d9-cae90a6732a7 | JachinLin123/student | PTA/dp/leet_064.cpp | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
using std::vector;
int minPathSum(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
if (m <= 0 || n <= 0)
{
return 0;
}
int dp[m][n] = {0}; //
// 初始化
... | ALGO | 0.999699 | 4.293202 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2019-03-26T12:11:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 6
},
"file_meta": {
"content_id": "d41213dc7... |
18271495-085c-4bf3-a8b7-589d78b02e80 | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/13_10660_115.cpp | #include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <... | ALGO | 0.997644 | 4.08566 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00: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": "9f62b9a20... |
31e4fd98-671a-4f0a-9575-a14ec0cd3261 | google-research/google-research | explainable_routing/residual_problem.h | // Copyright 2025 The Google Research Authors.
//
// 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... | ALGO | 0.999493 | 7.178882 | {
"github_metadata": {
"branch": "master",
"commit_count": 4832,
"repo_created_at": "2018-10-04T18:42:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 36026,
"forks": 8143,
"issues": 1061,
"pull_requests": 576
},
"file_meta": {
"content_id... |
27b13179-d31a-461a-916a-cb9554c22be0 | smenaquispe/ADA | SEMANA2/funciones.cpp | #include<iostream>
using namespace std;
void funcion1(int N) {
int c = 0;
for(int i = 0; i <= N; i++) {
c++;
if(i % 2 == 0) {
c++;
cout<<i<<" ";
}
c++;
}
c++;
cout<<endl<<"contador: "<<c<<endl;
}
void funcion2(int N) {
int c = 0;
... | ALGO | 0.998749 | 3.889827 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2023-06-23T15:24: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": "bf4c6ac24... |
c8dcb11c-428c-4065-8d0f-ca4e69b5544c | dobby8282/cpp_course | chapter07/07_stl_algorithm_basic.cpp | /*
* STL 알고리즘 기초
* 파일명: 07_stl_algorithm_basic.cpp
*
* 컴파일: g++ -std=c++17 -o 07_stl_algorithm_basic 07_stl_algorithm_basic.cpp
* 실행: ./07_stl_algorithm_basic (Linux/Mac) 또는 07_stl_algorithm_basic.exe (Windows)
*/
/*
주제: STL 알고리즘 기초 (STL Algorithm Basics)
정의: 컨테이너에 적용할 수 있는 다양한 알고리즘 함수들
*/
#include <iostream>
... | ALGO | 0.99871 | 5.087467 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-06-20T12:38: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": "672bb40580... |
4b7e4d62-dc2a-4b90-9708-a5f9bc807e46 | hossiluc/PHY480 | Homework3/harmonic_oscillator.cpp | // file: harmonic_oscillator.cpp
//
// Functions to generate normalized harmonic oscillator wave functions
//
// Programmer: <NAME> <EMAIL>
//
// Revision history:
// 01/24/04 original version, translated from harmonic_oscillator.c
//
// Notes:
// * The potential is V(r) = (1/2)m \omega^2 r^2.
// * Th... | ALGO | 0.999067 | 5.089035 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2019-02-25T21:54: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": "d19e97947... |
8e9a8d7b-ec24-47a1-8c2d-91c9f20ba41c | TusharChugh/ctci-modern_cplusplus | include/arrays_strings/palindrome_permutation.h | /**
* @brief Palindrome Permutation
* Check if a string is a permutation of a palindrome.
* A palindrome is a word or phrase that is the same forwards and backwards.
* A permutation is a rearrangement of letters. The palindrome does not need to be limited to just
* dictionary words.
*
* EXAMPLE Input: Tacto... | ALGO | 0.998349 | 6.779634 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2018-03-25T03:15:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d4d309e... |
6ac28d51-f535-4d30-b948-ccc5c9713840 | Nourhan-Mahmoud/HPC_ParallelMedianFilterProject | HPC_ProjectTemplate/Source.cpp | #include <iostream>
#include <math.h>
#include <stdlib.h>
#include<string.h>
#include<msclr\marshal_cppstd.h>
#include <ctime>// include this header
#include "Seq_Median_Filter.h"
#include "ParallelMedianFilter.h"
#pragma once
#using <mscorlib.dll>
#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows... | ALGO | 0.999108 | 4.103326 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2022-04-27T20:48:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e309b53d... |
e37416ad-652f-434e-8421-33fac465200d | TallerDeLenguajes1/tpn2-Mike-ARG | Punto4.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
struct compu {
float velocidad; //entre 1 y 3 Ghz
int anio; //entre 200 y 2017
char cantidad; // entre 1 y 4
char *tipo_cpu; //valores del arreglo 'tipos'
};
typedef struct compu compu;
char tipos[6][10] = {"Intel", "AMD", "Celeron", "Athlon", ... | TOOL | 0.969757 | 3.659703 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-04-07T00:51:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73fd95b86f... |
a2c6b358-6955-48d0-863e-312c066197a6 | CatrielCarbonera/Utility | Wavelets/Haar/haar/FWT.h | #pragma once
#include <array>
template <size_t LOG_DATALENGTH = 6 , size_t wt_steps = LOG_DATALENGTH /* the largest scale level. Must be smaller or equal to LOG_DATALENGTH.*/>
struct FastWaveletTransform
{
typedef double scalar_type;
static size_t const data_length = 1<<LOG_DATALENGTH; // Must be power of ... | ALGO | 0.982021 | 5.951626 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-07-06T03:58: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": "ef82f24ba... |
fd4380e9-de33-43ac-9945-0dd141e08cf6 | jasonj2333/Python_SPP | informatykaEuropejczyka/Rozdzial2/prog2_36.cpp | //szyfrowanie metoda kolumnowa
#include <iostream>
#include <cstring>
using namespace std;
const int MAX=100;
string szyfruj (string tekst, int klucz[], int n)
{
string wynik;
char tablica[MAX][MAX];
int dl=tekst.size(), m;
if (dl%n) m=dl/n+1;
else m=dl/n;
int k=0;
for (int i=0;i<m;i++)
for (int j=0;j<n;j++)
... | ALGO | 0.999753 | 3.589581 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2021-11-04T11:09:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b573ff8b40... |
30b8e389-cbfe-45d4-83b8-e3727eb4e5b3 | HyeminBaek/Baekjoon-Online-Judge | 1000/1748.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
cin >> n;
long long d[10] = { 0, };
d[1] = 9;
for (int i = 2; i < 10; i++)
d[i] = d[i - 1] + 9 * pow(10, i - 1)*i;
if (n < 10)
cout << n;
else if (n < 100)
cout << d[1] + (n - 9) * 2;
else if (n < 1000)
cout << d[2] + (n... | ALGO | 0.99948 | 3.501038 | {
"github_metadata": {
"branch": "master",
"commit_count": 418,
"repo_created_at": "2019-09-16T07:39:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70df97a6... |
2581b44d-a40e-4f7a-ab4c-f4101d285902 | simhani1/BOJ | 백준/Silver/2504.괄호의 값/괄호의 값.cc | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <stack>
#include <queue>
#include <deque>
#include <time.h>
using namespace std;
int main(void) {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
stack <char> s;
stri... | ALGO | 0.999694 | 4.037402 | {
"github_metadata": {
"branch": "BOJ",
"commit_count": 1092,
"repo_created_at": "2022-02-05T18:55:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c27dfc8c6f... |
3823db49-a54a-4be3-a437-620b82640582 | johnhaxx7/myleet | 94 Binary Tree Inorder Traversal/94 Binary Tree Inorder Trversal.cpp | //
// 94 Binary Tree Inorder Trversal.cpp
//
//
// Created by Apple on 15/8/20.
//
//
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
... | ALGO | 0.999997 | 6.605081 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2015-06-26T08:38:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29ac0c61... |
61119337-0afa-41d7-aeb2-314f034eb2df | buniatyann/Hackerrank | One Month Preparation/Week3/ClimbingTheLeaderboard.cpp | #include <iostream>
#include <vector>
#include <algorithm>
/*
Time O(n + m * k)
Space O(n + m)
where n is the number of elements in the ranked list, m is the number of players, k is the number of distinct scores in ranked.
veranayel
*/
std::vector<int> climbingLeaderboard(std::vector<int> ranked, std::... | ALGO | 0.999994 | 6.554414 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-02-27T15:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e719f77093... |
7ffd41bb-06c0-4eff-bc78-422aa280bfa4 | SongHayoung/LeetCode | 3763-separate-squares-i/3763-separate-squares-i.cpp | class Solution {
const long double EPS = 1e-9;
long long helper(vector<vector<int>>& A, long double bar, long double area) {
for(auto& a : A) {
long double y = a[1], yy = a[1] + a[2];
if(y >= bar) continue;
area -= (min(yy,bar) - y) * a[2];
}
return ar... | ALGO | 0.999677 | 5.34366 | {
"github_metadata": {
"branch": "master",
"commit_count": 13354,
"repo_created_at": "2021-01-06T12:46:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14c4fb... |
b5f58845-9cdd-4c27-9b25-a166bcf7c798 | Asif3359/Practice_problems | C_Robin_Hood_in_Town.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
sort(a.begin(), a.end());
... | ALGO | 0.999916 | 3.907804 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-09-02T18:28:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8943f00d81... |
e0688afe-3267-4e8b-b5c9-6d645d2563eb | shelestvitru/competitive-programming | codeforces/cfround788/b.cpp | #ifdef ONPC
#define _GLIBCXX_DEBUG
#endif
// #include <bits/stdc++.h>
#include<algorithm>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<map>
#include<math.h>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<list>
#include<time.h>
#include<random>
#include<bitset>
#include<unorde... | ALGO | 0.999846 | 3.851213 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-04-24T18:37: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": "3de7ce03afe... |
0e2734da-3219-4f6f-9fcc-6c57dd3bede2 | drunkwater/leetcode | medium/cpp/c0306_654_maximum-binary-tree/00_leetcode_0306.cpp | // DRUNKWATER TEMPLATE(add description and prototypes)
// Question Title and Description on leetcode.com
// Function Declaration and Function Prototypes on leetcode.com
//654. Maximum Binary Tree
//Given an integer array with no duplicates. A maximum tree building on this array is defined as follow:
//The root is the m... | ALGO | 0.999929 | 5.406089 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-04-03T03:07:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30638e8ffe... |
7487aad9-98b5-4e88-8fb1-5f5f6ca34c08 | ishandutta2007/codeforces-g | geothermal/normal/1500/C.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<l... | ALGO | 0.999962 | 3.524985 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f205b75abdd2... |
d2c7bab4-56e9-4d0c-b0d7-2574d0c82167 | GlitchKraken/huntTheWumpus | htwAgentCowardTwo.cpp | // CS 4318, spring 2018
// Agent Challenge 6: Hunt the wumpus
//
// Here's an example agent function.
#include "htw.h"
action htwAgentCowardTwo(WumpusWorldSensor currentSensor, bool shouldReset)
{
// Declare all static variables.
static bool hasGold;
static int whereX, whereY;
static b... | ALGO | 0.944002 | 5.842828 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-05-21T21: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": "a223e98dab... |
65ada8ae-7c9b-477c-a5c7-8d7288887b50 | mistakk/c_code | c++_mycode/leetcode/l234. Palindrome Linked List.cpp | using namespace std;
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
template<typename T>
void show(vector<T> vec) {
for (int i = 0; i != vec.size(); i++)
cout << vec[i] << " ";
cout << endl;
}
void show(map<string, int> mp) {
std::map<st... | ALGO | 0.999978 | 4.995688 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-10-15T08:15: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": "9edde88540... |
08a7f533-38cc-447c-b9f1-a97cc0ab5be4 | js-platform/libwebrtc | chromium/src/net/quic/congestion_control/hybrid_slow_start.cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/quic/congestion_control/hybrid_slow_start.h"
#include <algorithm>
using std::max;
using std::min;
namespace net {
// Note(pwestin): ... | ALGO | 0.984183 | 7.663363 | {
"github_metadata": {
"branch": "master",
"commit_count": 7268,
"repo_created_at": "2014-12-29T01:54:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 57,
"forks": 29,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e6367... |
c36a7fac-8f0c-4d18-8a4e-f6cf07624e28 | yz1019117968/FSE-24-UniTrans | cleaned_data/transcoder_evaluation_gfg/cpp/FIND_THE_NUMBER_OCCURRING_ODD_NUMBER_OF_TIMES.cpp | // Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include... | ALGO | 0.9995 | 5.178209 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-04-06T11:00:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfe7f777d89... |
b39bb8c0-498e-42b4-95f3-c5cd7b348694 | alexandraback/datacollection | solutions_5686275109552128_0/C++/HenryLee/InfiniteHouseOfPancakes.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <stdio.h>
using namespace std;
#define MAXP 1010
int main(void)
{
int t;
cin >> t;
for (int i=1; i<=t; i++)
{
int d;
vector <int> p;
priority_queue <int> pqueue;
int time;
int hash[MAXP] = {0};
ci... | ALGO | 0.999912 | 3.169602 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b223a736... |
248acf13-c7cb-49a9-b896-7db0d8388e90 | sanket-arch/DSA_Practice | linked list/doubly/circular/CdublyLL.cpp | #include <iostream>
using namespace std;
class node
{
public:
node *prev; // this pounter will point on the previous node
int val; // store the value to be stored at that node
node *nxt; // this will point to the next node
};
// crating a doubly linked list
node *create(int A[], int size)
{
node *h... | ALGO | 0.999965 | 5.069061 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-07-27T12:42: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": "9a30b34bd20... |
f6aeb305-9246-4441-b508-d8325da50895 | shines77/StringMatch | src/main/algorithm/Rabin-Karp.h |
#ifndef STRING_MATCH_RABIN_KARP_H
#define STRING_MATCH_RABIN_KARP_H
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
#include "basic/stddef.h"
#include "basic/stdint.h"
#include <memory.h>
#include <assert.h>
#include <cstdint>
#include <cstddef>
#include "StringMatch.h"
#include "algorithm/Algorit... | ALGO | 0.997552 | 6.699479 | {
"github_metadata": {
"branch": "master",
"commit_count": 365,
"repo_created_at": "2017-03-29T16:23:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57799a34... |
fad775f6-ee3b-4f1c-a31f-bc8d92744987 | derektan95/sensor-fusion-projects-udacity-nanodegree | lidar/SFND_Lidar_Obstacle_Detection/src/quiz/cluster/cluster.cpp | /* \author <NAME> */
// Quiz on implementing simple RANSAC line fitting
#include "../../render/render.h"
#include "../../render/box.h"
#include <chrono>
#include <string>
#include "kdtree.h"
// Arguments:
// window is the region to draw box around
// increase zoom to see more of the area
pcl::visualization::PCLVisual... | ALGO | 0.998386 | 5.526554 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2020-07-05T15:05:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9679a7ed... |
7d17365d-b64e-4b4b-bfde-6525740fce10 | RMerl/asuswrt-merlin | release/src-rt-6.x.4708/toolchains/hndtools-arm-linux-2.6.36-uclibc-4.5.3/arm-brcm-linux-uclibcgnueabi/include/c++/4.5.3/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp | // -*- C++ -*-
// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License as published by the Free Software
// Foundation; either ve... | ALGO | 0.988487 | 6.698081 | {
"github_metadata": {
"branch": "master",
"commit_count": 5092,
"repo_created_at": "2012-06-16T06:10:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6766,
"forks": 1072,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "5... |
d5579109-9786-4ddc-b174-a15e8d95eb93 | tian-wei-jun/titan-ast | runtime/cpp/titan-ast-runtime-lib/BacktrackingBottomUpBranch.cpp | //
// Created by <NAME> on 2022/12/4 0004.
//
#include "BacktrackingBottomUpBranch.h"
#include <unordered_set>
BacktrackingBottomUpBranch::BacktrackingBottomUpBranch()
: reducingSymbols(std::list<ReducingSymbol *>()) {}
BacktrackingBottomUpBranch::~BacktrackingBottomUpBranch() {
for (auto reducingSymbol : redu... | ALGO | 0.957309 | 5.026229 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-11-02T09:34:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "976491ae772... |
3f351819-52aa-4ba6-8dbb-63a500c11808 | ttlast/ACM | 计算几何/poj 2318.cpp | #include <iostream>
using namespace std;
const int maxn = 5005;
struct Point
{
int x,y;
Point(int x1 = 0,int y1 = 0)
{
x = x1;y = y1;
}
};
int n,m,x1,y1,x2,y2,x,y;
struct Line
{
Point p1,p2;
Line(){};
Line(Point p3,Point p4)
{
p1 = p3;p2 = p4;
}
};
Line line[maxn];
int ans[maxn];
... | ALGO | 0.999931 | 3.57328 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-03-29T04:47:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b5294981e... |
778a8a6d-a939-4a87-8a78-8f7ea28d64cc | wangAlpha/leetcode | algorithms/1000267.FortPu/FortPu.cpp | class RandomizedSet {
public:
/** Initialize your data structure here. */
RandomizedSet() {
srand (time(NULL));
}
/** Inserts a value to the set. Returns true if the set did not already contain the specified element. */
bool insert(int val) {
bool result = false;
if (v... | ALGO | 0.973799 | 6.176356 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2021-12-15T12:03: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": "65bd5158e... |
31ea912b-4f81-4541-a187-cedad59472ea | iamar7/Algorithms | graph-algorithms/prim_minimum_spanning_tree/prim_minimum_spanning_tree.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Part of Cosmos by OpenGenus Foundation
const int MAXN = 1e4+5;
bool vis[MAXN];
int n, m;
vector<pair<ll, int> > adj[MAXN]; // for every vertex store all the edge weight and the adjacent vertex to it
ll prim(int x){
// start prim from xth vert... | ALGO | 0.999887 | 4.054898 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-10-15T18:45: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": "f7875934b0... |
5d0174bf-54d6-4ffd-a1e5-203cca817361 | eriktoger/Programming-problems | Project-Euler/PE68.cpp | #include <vector>
#include <iostream>
#include <memory>
#include <algorithm>
#include <numeric>
using namespace std;
vector<shared_ptr<int> > constructPointers();
vector<vector<shared_ptr<int> > > constructRing(vector<shared_ptr<int> > const &pointers);
void placeNumbers(string const &combinations, vector<shared_pt... | ALGO | 0.99969 | 3.361631 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2020-05-10T14:23:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4678499b... |
95368ce8-64e8-4744-bfe7-03e0a04335fe | krishna-gavas/Competitive-Coding | GeeksForGeeks/Linked_List/6.DetectLoopInLinkedList.cpp | // Detect Loop in linked list
// Question:
// Given a linked list of N nodes. The task is to check if the the linked list has a loop.
// Linked list can contain self loop.
// Example:
// Input:
// N = 3
// value[] = {1,3,4}
// x = 2
// Output: True
// Input:
// N = 4
// value[] = {1,8,3,4}
// x = 0
// Output: False... | ALGO | 0.999617 | 4.702641 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2020-02-04T12:37:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 19,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94d65e... |
702a870d-acb9-47c3-ae74-cab7bc77c044 | Orang123/ACMAlgorithmExercises | 图论/树分治/点分树(动态点分治)/洛谷P2056 ZJOI2007 捉迷藏 动态点分治模板.cpp | #include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<queue>
using namespace std;
const int N=200100;
/*
三个大根堆:
C[u]里装的是点分树中u的子树所有点到点分树中u的父亲的距离。
B[u]里装的是点分树中u的所有儿子的C的最大值。
A里装的是所有BB的最大值与次大值之和。
A的堆顶就是答案。
(我一开始一直以为两个堆就行,对第三个对表示疑惑,又懒得深入想,一直翻题解。千万不能犯懒不想啊)
我们找答案可以快速找到。问题是怎么维护?
因为我... | ALGO | 0.999968 | 3.869254 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-02-25T05:23:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "406ea504c0e... |
498089e0-e8ea-4912-b96d-bfee05617ea6 | Shriya-Jaiswal/DSA_POTD_Questions_solving | 624_Number_Complement_Leetcode_476.cpp | #include<iostream>
#include<vector>
#include<math.h>
using namespace std;
// // ▶️ Ask by : Apple ✯ Amazon ✯ Cloudera
// // ▶️ Approach-1 (Using bit magic of XOR)
// // ⏲️ Time Complexity : O(log2(num))
// // 🛢️ Space Complexity : O(1)
// int findComplement(int num) {
// int number_of_bits = (int)(log2(num)... | ALGO | 0.999973 | 5.373484 | {
"github_metadata": {
"branch": "main",
"commit_count": 768,
"repo_created_at": "2023-10-01T15:53:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f5aea8433... |
b10f2552-0f9c-486d-a612-970e3ea2ab0c | AounHaider133/CSC441_Compiler_Construction_Lab | MidTerm_Lab_Exam.cpp | //CSC441 - Compiler Construction
//Midterm Question no.01
//Name: <NAME>
//ID: FA21-BSE-133
//Submitted to: <NAME>
//Spring2024
#include <iostream>
#include <string>
using namespace std;
enum State { START, A, AB, ABA, DEAD };
State transition(State current, char input) {
switch (current) {
case START:
... | ALGO | 0.998724 | 5.635463 | {
"github_metadata": {
"branch": "Codes",
"commit_count": 2,
"repo_created_at": "2024-05-11T10:12: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": "f7ab325da63... |
8b89049f-a46d-4021-83b9-9f76de8e9220 | squaresLab/BatFix | results/transcoder/translations/py/DIFFERENCE_BETWEEN_HIGHEST_AND_LEAST_FREQUENCIES_IN_AN_ARRAY_1.cpp | int findDiff ( int arr [ ] , int n ) {
map < int , int > mp ;
for ( int i = 0 ;
i < n ;
i ++ ) mp [ arr [ i ] ] ++ ;
int maxCount = 0 ;
;
int minCount = n ;
for ( map < int , int > :: iterator it = mp . begin ( ) ;
it != mp . end ( ) ;
it ++ ) {
maxCount = max ( maxCount , it -> first ) ;
mi... | ALGO | 0.999826 | 4.552108 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-05-21T15:21:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3326a9129c13... |
1c475836-0016-49d5-999d-fc80445bf982 | SuryanarayanaY/tensorflow | third_party/xla/xla/service/cpu/ir_emitter.cc | /* Copyright 2017 The OpenXLA Authors.
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 writing, sof... | TOOL | 0.930731 | 3.503613 | {
"github_metadata": {
"branch": "master",
"commit_count": 160527,
"repo_created_at": "2022-11-09T06:06:51.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "tensorflow/tensorflow",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"c... |
51ec2ecc-50af-4591-a61d-2d9a70d3c829 | Fun-James/parallel-programming | pthreadopenMP/ivf&ivfpq/ivf_flat.h | #pragma once
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
//
// IVF 索引结构体
//
struct IVFIndex {
int nlist = 0; // 聚类中心个数
int dim = 0; // 向量维度
std::v... | ALGO | 0.997664 | 5.284936 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-03-26T11:53: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": "2600e39c6cd... |
badd289d-c99e-4a50-944a-d4d2c94bfd93 | shivamgupta002/DSA | Stack/Stack_Linklist_Implementation.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
class Stack
{
public:
Node *head;
int count;
Stack()
{
head = NULL;
count = 0;
}
// Push element ... | ALGO | 0.995246 | 4.640383 | {
"github_metadata": {
"branch": "main",
"commit_count": 172,
"repo_created_at": "2023-10-06T11:28:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bb86feeb6... |
d4362eca-db98-480a-a684-438bbcbfce53 | nafizfouad/CompetitiveProgramming | codeforces/1256/C.cpp | /// 月よ、今こそ月明かりとなって落ちて、俺の周りに落ち続けて、それから私はあなたのものになる
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define pi acos(-1)
#define pb push_back
#define pf push_front
#define mod 998244353
#define mod1 1000000009
#define cl c... | ALGO | 0.999933 | 3.527478 | {
"github_metadata": {
"branch": "master",
"commit_count": 1207,
"repo_created_at": "2023-11-13T22:22: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": "1a94db8... |
b8b57d30-594b-486e-9262-90c212d0e6a4 | coderZhou10496/Arithmetic | Array/63-UniquePathsII/63-UniquePathsII/main.cpp | //
// main.cpp
// 63-UniquePathsII
//
// Created by zhoujian on 2019/11/29.
// Copyright © 2019 zhoujian. All rights reserved.
//
#include <iostream>
#include "vector"
using namespace std;
/*
一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为“Start” )。
机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为“Finish”)。
现在考虑网格中有障碍物。那么从左上角到右... | ALGO | 0.999753 | 5.079497 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2019-11-15T03:50: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": "11feef682... |
654ef4bb-184a-4b34-bd84-cce7bceadb7a | iPhoring/PathPlanning | src/main.cpp | #include <uWS/uWS.h>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include "Eigen-3.3/Eigen/Core"
#include "Eigen-3.3/Eigen/QR"
#include "helpers.h"
#include "json.hpp"
#include "spline.h"
// for convenience
using nlohmann::json;
using std::string;
using std::vector;
int main(void) {
... | WEB | 0.902564 | 4.163585 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-03-21T02:55:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a4f38b82... |
0098ab2a-ba33-4585-b8f6-94ae7f43f364 | evergreen96/algorithm | backjoon/c++/bj_3221.cpp | #include <algorithm>
#include <iostream>
using namespace std;
struct arr {
int loc;
char dir;
};
bool cmp(arr a, arr b) {
if (a.loc < b.loc)
return true;
else
return false;
}
int main() {
int L, N, T;
cin >> N >> T;
cin >> L;
arr* node = new arr[L];
int num;
char cha;
for (int i = 0; i ... | ALGO | 0.999983 | 3.359746 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2020-08-01T03:35:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75bb15522... |
c5032244-7cad-4dd7-8f9e-07477c998693 | blender/blender | source/blender/editors/sculpt_paint/sculpt_pose.cc | /* SPDX-FileCopyrightText: 2020 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup edsculpt
*/
#include "BLI_enumerable_thread_specific.hh"
#include "BLI_math_geom.h"
#include "BLI_math_matrix.h"
#include "BLI_math_matrix.hh"
#include "BLI_math_rotation.h"
#include "BLI_math_vec... | ALGO | 0.98293 | 4.676968 | {
"github_metadata": {
"branch": "main",
"commit_count": 152123,
"repo_created_at": "2019-10-09T12:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15670,
"forks": 2395,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f... |
94df70cb-bf31-4cb0-acad-d5270194646c | daehokim/algorithm | baekjoon/1759_암호 만들기.cpp | #include <iostream>
#include <string>
#include <vector>
#include <set>
using namespace std;
int L, C;
char input;
bool chk[26];
vector<char> alpha;
set<string> ans;
int vowelCnt(string _tar)
{
int cnt = 0;
if (_tar.find('a') != string::npos) ++cnt;
if (_tar.find('e') != string::npos) ++cnt;
if (_tar.find('i') != ... | ALGO | 0.999937 | 3.449334 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2019-08-02T02:55:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78e4816e... |
4750a162-a6aa-4aa1-8626-bfba044b3751 | cryptobiu/MPC-Benchmark | LowCostConstantRoundShortKeysMPC/src/Utils.cpp | //
// Created by moriya on 24/04/17.
//
#include "../include/Utils.hpp"
Utils::Utils(){
hashSize = 32;
blake2b_init(S, hashSize);
}
void Utils::setParameters(int id, const vector<ProtocolPartyData*> & parties, PrgFromOpenSSLAES* prg, int numThreads, ofstream * outputFile){
//Sets the given arguments.
... | ALGO | 0.997821 | 5.295441 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2018-07-19T10:21:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 6,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "293d66c82... |
48d64841-a31b-4b5e-a667-e708e0035c82 | yukatan1701/Multigrid | source/main.cpp | #include <cmath>
#include "mgm.h"
double f(double x, double y) {
return -1;
return -2 * sin(x * y) * exp(x * y);
}
int main(int argc, char **argv) {
size_t ng = 2; // ng is a maximal grid level
size_t ncycles = 2;
if (argc > 2) {
ng = atoi(argv[1]);
ncycles = atoi(argv[2]);
}
... | ALGO | 0.999533 | 4.055079 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-07-07T17:09: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": "23cdb0eceb... |
74f003db-1a4f-482d-9635-c7c6cc972fc1 | VictoryKS/KPI-DiscreteStructures | lab2/tree.h | #include <iostream>
using namespace std;
class tree {
private:
struct Node {
double data;
Node *parent;
Node *left;
Node *right;
};
int count;
double sum;
Node *root;
public:
tree();
~tree();
void add(double data);
void add_node(Node *current, Node *elem... | ALGO | 0.99752 | 3.272314 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-02-19T20:56: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": "3b06960c2... |
2f990049-bcc8-4995-a032-1ce42829cdab | thanhbinh911/saved-code- | sum_left_leaves.cpp | #include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
//typedef struct Treenode{
// int data;
// struct Treenode*left,*right;
//}node;
//
//node*createNode(int data) {
// node*newNode=(node*)malloc(sizeof(node));
// newNode->left=NULL;
// newNode->right=NULL;
// newNode->data=data;
// return newNode;
//}
//
//bool... | ALGO | 0.99997 | 4.851485 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-04-23T08:07:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5355d01ddc... |
acc5223f-2147-480a-baaf-5b7418c27708 | LUCKYLI1997/GraphAgg-MT | algo/LabelPropagation/LabelPropagation.h | //
// Created by cave-g-f on 2019-05-17.
//
#pragma once
#ifndef GRAPH_ALGO_LABELPROPAGATION_H
#define GRAPH_ALGO_LABELPROPAGATION_H
#include "../../core/GraphUtil.h"
template <typename VertexValueType, typename MessageValueType>
class LabelPropagation : public GraphUtil<VertexValueType, MessageValueType>
{
public:... | ALGO | 0.99386 | 6.748362 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-11-18T08:36: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": "142dc12336... |
78b74211-8f12-41d0-9d4c-88f714910ec2 | TaeCV/Algorithm-Design | grader/DP/2 Side Billboard/2side.cpp | #include <bits/stdc++.h>
using namespace std;
int N, W, K, I[2][200005], M[2][200005][50];
int process(int i, int side, int quota) {
if (quota <= 0 || i > N)
return 0;
// side = 1 equals to right, side = 0 equals to left
if (M[side][i][0] > 0)
return M[side][i][0];
if (i == N)
... | ALGO | 0.999974 | 3.693028 | {
"github_metadata": {
"branch": "main",
"commit_count": 131,
"repo_created_at": "2022-01-17T02:54:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16a4c322bd... |
f3055a5c-8337-4ea1-9b20-d64d184f2969 | arka2752/Algorithm | LIS.cpp | // This is Arka's code.....
/*
Input :
abcdef
ayced
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
string str1, str2;
getline(cin, str1);
getline(cin, str2);
int m = str1.size(), n = str2.size();
str1 = '\0' + str1;
str2 = '\0' + str2;
int edit_dis[n + 1][m + 1];
... | ALGO | 0.999995 | 4.48637 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-08-28T06: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": "e4976bd8871... |
821e98b2-9169-4abb-984e-810bf23a66e9 | tony9402/baekjoon | solution/graph_traversal/2667/main.cpp | // Authored by : seastar105
// Co-authored by : -
// Link : http://boj.kr/64816e87e7c24254ae15748732036df3
#include <bits/stdc++.h>
using namespace std;
int dx[4] = {0, 0, -1, 1};
int dy[4] = {-1, 1, 0, 0};
int N;
string board[30];
bool vis[30][30];
bool valid(int x, int y) {
return 0 <= x && x < N && 0 <= y && y ... | ALGO | 0.999992 | 4.289497 | {
"github_metadata": {
"branch": "main",
"commit_count": 4450,
"repo_created_at": "2019-08-04T12:48:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6208,
"forks": 1199,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "4ed... |
cd878aa3-9f76-434a-8b16-e3ebf1c29d23 | weiyeecon/PhD-courses | 22Fall/CIS5006/lecture11-sorting/MergeSort.h | int const SIZE;
template <typename ItemType>
void Merge(ItemType values[], int leftFirst, int leftLast, int rightFirst, int rightLast)
{
ItemType tempArray(SIZE);
int index = leftFirst;
int saveFirst = leftFirst;
while((leftFirst <= leftLast) && (rightFirst <= rightLast))//index
{
if (value... | ALGO | 0.99998 | 5.17546 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-12-19T21:06: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": "743f846967a... |
5125ad92-7660-477d-8ed6-f6a26f248f28 | mnjkhtri/undergrad-code-dump | the-art-of-computer-programming/Algorithms/Sortings/12,5priorityqueueheap.cpp | #include <iostream>
using namespace std;
struct Node
{
int Key;
};
class PriorityQueueHeap
{
private:
Node* Recs;
int num;
public:
PriorityQueueHeap(int N)
{
num = N;
Recs = new Node[1+N];
Recs[1].Key = 15;
Recs[2].Key = 12;
... | ALGO | 0.99997 | 4.543612 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-06-11T19:58:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5283ee34a036... |
fb19103d-f43a-4179-9626-30dd9135d198 | abdelrahim-hentabli/featuresearch | featuresearch.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <set>
#include <sstream>
#include <time.h>
#include <math.h>
#include <cstring>
#include <ctime>
float accuracy_add(const std::vector<std::vector<float>> &data, const std::set<int> ¤t_set, int feature_to_add){
double running_to... | ALGO | 0.980275 | 4.684921 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-06-04T21:31: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": "a86a30776... |
81bb81df-7e5d-4e20-a4d0-4b78b4424502 | 201419/Programming-Training | 剑指Offer编程66题/036_两个链表的第一个公共结点.cpp | // 输入两个链表,找出它们的第一个公共结点。
// (注意因为传入数据是链表,所以错误测试数据的提示是用其他方式显示的,保证传入数据是正确的)
/*
struct ListNode {
int val;
struct ListNode *next;
ListNode(int x) :
val(x), next(NULL) {
}
};*/
class Solution {
public:
ListNode* FindFirstCommonNode( ListNode* pHead1, ListNode* pHead2) {
int length1=... | ALGO | 0.996382 | 4.480973 | {
"github_metadata": {
"branch": "master",
"commit_count": 195,
"repo_created_at": "2018-02-06T03:27:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d215aad... |
163fb8e7-b948-4368-8a1b-3c9ca19323f4 | sigman78/pocketheroes | pheroes/Common/SortArray.h | /*
* This file is a part of Pocket Heroes Game project
* http://www.pocketheroes.net
* https://code.google.com/p/pocketheroes/
*
* Copyright 2004-2010 by <NAME> and <NAME> (iO UPG)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Lice... | ALGO | 0.952997 | 4.992134 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-03-14T00:40:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "dec04bc591... |
e392a441-bac9-4c8a-9fb0-4f848344d30a | ishandutta2007/codeforces-n | neal/normal/1389/G.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T, size_t size... | ALGO | 0.999932 | 4.618186 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:35: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": "fc518c6a5938... |
89c2fc14-9a50-4a20-8e46-9a2bc866c07a | Alex367/Snake | Game.cpp | #include "Game.h"
#include <iostream>
#include <chrono>
#include <thread>
#include <conio.h>
#include "Wall.h"
#include "EnemySnakePart.h"
#include "windows.h"
Game::Game(int screenWidth, int screenHeight)
{
this->screenWidth = screenWidth;
this->screenHeight = screenHeight;
isGameOver = false;
rect = new char*[... | TOOL | 0.907149 | 4.03965 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-08-14T12:25: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": "8123dd935e... |
77c4550b-0477-44ac-b380-9fd4b5dd8349 | mushkul/Vanderbilt-CP | solutions/claude-3-5-sonnet-20241022/1746.cpp | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9+7;
int main() {
int n, m;
cin >> n >> m;
vector<int> x(n);
for(int i = 0; i < n; i++) cin >> x[i];
vector<vector<long long>> dp(n, vector<long long>(m+1, 0));
if(x[0] == 0) {
for(int i = 1; i <= m; i++) dp[0][i]... | ALGO | 0.999997 | 4.302239 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-09-18T17:07: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": "ed30e7a4e00... |
9856da2c-d170-455b-b191-d32b0926526a | Double-T1/leetcode | 2201-2400/2322. Minimum Score After Removals on a Tree/solution.cpp | class Solution {
private:
int n;
public:
int minimumScore(vector<int>& nums, vector<vector<int>>& edges) {
n = nums.size();
vector<int> adj[n];
for (auto& edge: edges) {
adj[edge[0]].push_back(edge[1]);
adj[edge[1]].push_back(edge[0]);
}
... | ALGO | 0.99998 | 5.680563 | {
"github_metadata": {
"branch": "main",
"commit_count": 1091,
"repo_created_at": "2021-11-22T09:27:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b5486701... |
540c542b-b259-4c6f-aacb-3d3a36d4b262 | temp3rr0r/N-Body | N-Body/ParticleHandler.cpp | #include <random>
#include "Settings.h"
#include "ParticleHandler.h"
#include <tbb/concurrent_vector.h>
#include "lodepng.h"
#include "TreeParticle.h"
#include "QuadParticleTree.h"
// Generate random particles
void ParticleHandler::allocate_random_particles(size_t particle_count, std::vector<Particle>& particles, size... | TOOL | 0.915017 | 5.109482 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2017-10-21T05:49:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f9c589bd... |
b6f41af2-7358-42d9-b174-635e4b5856ff | vgherard/algorithms | 5/Network Algorithms/airline_crews/airline_crews.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <memory>
#define MAX_CAPACITY 1e6
using std::vector;
using std::cin;
using std::cout;
#include <queue>
#include <unordered_map>
class FlowGraph {
public:
struct Edge {
int from, to, capacity, flow;
};
private:
/* List of all - forward and back... | ALGO | 0.999893 | 3.982092 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-12-22T15:09: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": "d883b66f8f... |
40381216-cc88-445e-9f89-43ec361ed256 | Kesharipappu/Data_Structure_Through_C_Programme | Count the number of nodes in single Link_List.cpp | //Count the number of nodes in single Link_List
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *next;
} *start;
void display();
void create(int n)
{
struct node *temp, *t;
temp = (struct node*)malloc(sizeof(struct node));
temp->data = n;
temp->next = NULL;
if(start == NULL)
{
star... | ALGO | 0.998785 | 3.97843 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-14T20:02: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": "abba5b5894a9... |
220f45a9-f260-485a-92b9-17e747d2936f | dimitar9/Algorithm_Collection | path_sum_2.cpp | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<vector<int> > allsol;
vector<int> sol;
void findSol(TreeNode* root, int sum){
if... | ALGO | 0.999968 | 5.172291 | {
"github_metadata": {
"branch": "master",
"commit_count": 1065,
"repo_created_at": "2011-07-27T08:13:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb78b8... |
46bc9d4e-7418-4792-8d67-70fba05eceaf | TeamWin/android_bootable_recovery | recovery_ui/screen_ui.cpp | /*
* Copyright (C) 2011 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.914932 | 7.578902 | {
"github_metadata": {
"branch": "android-12.1",
"commit_count": 12048,
"repo_created_at": "2019-12-09T23:59:06.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "omnirom/android_bootable_recovery",
"stars": 1518,
"forks": 461,
"issues": 295,
"pull_requests": 1
},
... |
f2962fe1-5ad1-4b90-ae3b-5b935beb0485 | Vxiros/algosNtua | particles.cpp | #include <iostream>
using namespace std;
class Element {
public:
int num;
float time;
Element() {}
Element(int n, float t) {
num = n;
time = t;
}
};
class Match {
public:
int a, b;
Match() {}
Match(int num_a, int num_b) {
a = num_a;
b = num_b;
}... | ALGO | 0.999133 | 3.215711 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-06-28T17:10: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": "0ab75affd1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.