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 |
|---|---|---|---|---|---|---|---|
7939f4ce-e9c5-49de-a2e8-ffd09575f98e | ayush15k1994/adventofcode2023 | day10/short.cpp | #include <string>
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
#include <numeric>
typedef long int ld;
typedef unsigned long int uld;
typedef long long int lld;
typedef unsigned long long int ulld;
typedef int const cd;
typedef long int const cld;
typede... | ALGO | 0.999835 | 4.581864 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-12-17T07:52:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fa39729443... |
9898ab77-1721-4eab-aea1-d6a5c6d9425e | simsunny22/leetcode | heap_sort.cpp | #include <iostream>
void build_heap(int *a, int len);
void sort_heap(int *a, int len);
void print_list(int *a, int len);
int main() {
int a[] = {4,6,1,57,52,54,6,24,13,41,4};
print_list(a, 11);
build_heap(a, 11);
print_list(a, 11);
sort_heap(a, 11);
print_list(a, 11);
}
void exchange(int &a, int &b) {
int tmp... | ALGO | 0.999663 | 4.261501 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-03-25T15:07: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": "88ee30c079... |
a847aa56-0647-46ec-9d2e-4825b39674c5 | facebook/hhvm | third-party/wangle/src/wangle/acceptor/ServerSocketConfig.h | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* 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 appl... | CONFIG | 0.934977 | 7.139681 | {
"github_metadata": {
"branch": "master",
"commit_count": 77511,
"repo_created_at": "2010-01-02T01:17:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18449,
"forks": 3043,
"issues": 407,
"pull_requests": 93
},
"file_meta": {
"content_id"... |
0995a240-7fc8-4ce8-90d0-03f7423f5617 | zhenrong1999/CPT113-A2 | main.cpp | #include "binary_tree_sorting.hpp"
#include "book_info.hpp"
#include "car_info.hpp"
#include "car_info_list.hpp"
#include "mystack.hpp"
#include "ordered_linked_list.hpp"
#include "queue.hpp"
#include <chrono>
#include <fstream>
#include <iostream>
#include <limits>
#include <sstream>
#include <string>
#include <thread... | TOOL | 0.956571 | 4.58622 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-05-06T04:22: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": "503a33624... |
af2c431a-3c92-4ba9-8379-adc95d5d61e6 | g-jindal2001/DS-Algorithms | quickSort.cpp | #include <bits/stdc++.h>
using namespace std;
int Partition(int *A, int start, int end)
{
int pivotElement = A[end];
int pIndex = start; //set partition index as start intially
for (int i = start; i < end; i++)
{
if (A[i] <= pivotElement)
{
swap(A[i], A[pIndex]); //swap if e... | ALGO | 0.999989 | 5.605549 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-08-29T08:04: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": "34abf28c4b... |
5468194d-3f0e-4d9a-ad1e-aa96fea9d87f | bootsielon/tol | tolsh/tests/matprod/partest.tol | /* -*- mode: c++ -*- */
/*
----------------------------------------------------------------------
Version paralela del producto de matrices
----------------------------------------------------------------------
*/
Set Include("config.tol");
Set Include("utils.tol");
Set Include("data.tol");
... | ALGO | 0.999829 | 5.16075 | {
"github_metadata": {
"branch": "master",
"commit_count": 3618,
"repo_created_at": "2024-09-22T20:59: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": "4b66a6f... |
ecf1cc76-7926-4a34-897d-5e1f37bc2c91 | jhizola18/C-Practice | program#6_creating_array_and_addingthem.cpp | #include<iostream>
using namespace std;
int main(){
int arraySize, arrayCont;
cout << "Enter the size of array: ";
cin >> arraySize;
//create/declare array that can hold n numbers of integers and assign to array pointer
int *arr = new int(arraySize);
cout<< "Enter " << arraySize << " items\... | TOOL | 0.904829 | 4.122104 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-02-18T18:34: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": "f1d22ff61c51... |
4307357b-ae26-422c-97e6-0876515609f8 | arafat-hasan/problem-solving | Contests/Codeforces/680/C/C.cpp | /*
* FILE: C.cpp
*
* @author: <NAME> <arafathasanjenin[at]gmail[dot]com>
*
* LINK:
*
* DATE CREATED: 29-12-17 19:26:20 (+06)
* LAST MODIFIED: 01-01-18 01:38:08 (+06)
*
* DESCRIPTION:
*
* DEVELOPMENT HISTORY:
* Date Version Description
* ---------------------------------------------------------... | ALGO | 0.999528 | 3.940873 | {
"github_metadata": {
"branch": "master",
"commit_count": 236,
"repo_created_at": "2017-10-16T19:27:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af20c8c3... |
92632377-a468-4996-a467-7a074ca4ecdd | Kwooley/CS01 | ch14/OperatorOverloading/OperatorOverloading1.cpp | // Overlaoding >, +, =
#include <iostream>
#include <iomanip>
using namespace std;
const int NUM_SCORES = 3;
class Student
{
private:
int sid;
string sname;
double *scores;
public:
Student() : sid(0), sname()
{
scores = new double[NUM_SCORES];
}
Student(int id, string s, double *sc)
{
sid = id;
sname = ... | ALGO | 0.989944 | 4.252079 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2020-01-24T20:39:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af68e6f... |
1a42e050-e574-4654-bf12-56f9baf96c25 | coin-or/Gravity | examples/MachineLearning/Supervised/Classification/NeuralNets/NeuralNet_main.cpp | //
// Stable_Set.cpp
// Gravity
//
// Created by <NAME> (Data61, Canberra City) on 6/12/17.
//
//
#include <stdio.h>
#include <iostream>
#include <string>
#include <stdio.h>
#include <cstring>
#include <fstream>
#include <gravity/Net.h>
#include <gravity/model.h>
#include <gravity/solver.h>
#include <stdio.h>
#inc... | ALGO | 0.977545 | 3.618809 | {
"github_metadata": {
"branch": "master",
"commit_count": 2332,
"repo_created_at": "2016-10-21T09:11:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 154,
"forks": 31,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bbc9... |
56aecf4b-abd7-4c52-b454-fa2f7b9f0d69 | Yashika118/CPP-FOLDER | 0_STRIVER_SHEET/7_GRAPH.cpp/11_KRUSKAL'S_ALGORITHM/1_MINIMUM_SPANNING_TREE.cpp | //{ Driver Code Starts
// first sort all the edges acc. to weight
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class DisjointSet{
vector<int>parent,size;
public:
DisjointSet(int n){
parent.resize(n+1,0);
size.resize(n+1,0);
for(int i=0;i<n;i++){
... | ALGO | 0.999952 | 5.38042 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-08-18T12:02:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee2d82baaf... |
d41c9e91-1698-44dc-bd73-284a11d0564a | BaaBBaBaI/Project_Mireacle | 1st-semester/Method5/sorts.h |
#ifndef SORTS_H
#define SORTS_H
#include <iostream>
#include <chrono>
#include <ctime>
using namespace std;
#define START_TIMER std::chrono::time_point<std::chrono::high_resolution_clock> start; start = std::chrono::high_resolution_clock::now();
#define STOP_TIMER std::chrono::time_point<std::chrono::high_resoluti... | ALGO | 0.994227 | 5.145731 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-09-04T14:26: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": "649f23fcb4d... |
354c956c-9ea0-4a0e-81da-bcb8453ee365 | gmaeuernaav/CodeMonk | solutions/hackerrank/30-more-exceptions.cpp | /**
* @author yangyanzhan
* @email <EMAIL>
* @homepage http://www.yangyanzhan.com
* @github_project https://github.com/yangyanzhan/CodeMonk
* @online_judge hackerrank
* @problem_id 30-more-exceptions
* @problem_address https://www.hackerrank.com/challenges/30-more-exceptions
**/
#include <algorithm>
#include <... | ALGO | 0.999135 | 5.332122 | {
"github_metadata": {
"branch": "master",
"commit_count": 295,
"repo_created_at": "2016-12-01T23:52: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": "e8598590... |
8fccc0ac-8908-4458-a727-7097416d4b86 | Shiva-gsk/Coding-Problems | 4.cpp | #include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main(){
int len;
cin>>len;
int k;
cin >>k;
int arr[len];
for(int j=0; j<len; j++){
cin >>arr[j];
}
int start =0;
int end = k-1;
while(end<len){
int sum =0;
int cost1=0;
int sub[k]... | ALGO | 0.999964 | 3.518129 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2025-05-01T12:49: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": "ad9361347... |
b44adfc9-a534-4f0e-8e29-dff60ecf3c15 | minhdb/ProgrammingProblems | the-daily-byte/stack_problems/validate_characters.cc | /**
* The Daily Byte 09/06/2021
* Given a string only containing the following characters
* (, ), {, }, [, and ] return whether or not the opening
* and closing characters are in a valid order.
*/
#include <stack>
#include <string>
#include <cassert>
#include <cstdio>
using std::stack;
using std::string;
bool v... | ALGO | 0.994624 | 6.14433 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2016-04-20T22:22: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": "9cc3a001... |
5f22b6ba-274b-42c3-882d-5e92e395c995 | shmundhra/Algorithmic-Programming | InterviewBit Codes/Linked Lists/Sort_List.cpp | // https://www.interviewbit.com/problems/sort-list/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
ListNode* Merge ( ListNode *A , ListNode *B )
{
ListNode *C , *tmp , *currA , *prevA , *currB , *prevB ... | ALGO | 0.999992 | 6.010528 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2018-12-30T12:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7908004e... |
fd5601df-7f14-4c1f-b3bf-5e303935648a | phannguyenlong/c_programming | algorithsm_data/linked_list/single_linked_list/class_linked_list.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
class Tnode;
class Tlist;
typedef Tnode* Ref;
class Tnode {
private:
int key;
Ref next;
public:
Tnode(Ref next, int key): next(next), key(key) {}
int getKey() { return key; }
friend class Tlist... | ALGO | 0.999752 | 4.567922 | {
"github_metadata": {
"branch": "master",
"commit_count": 141,
"repo_created_at": "2019-12-15T08:07:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15b5913a... |
416b317e-5ab6-4bed-844c-7b3c5777c6fd | mrklein/mousse | 0.1.0/src/mesh_tools/searchable_surface/searchable_disk.hpp | #ifndef MESH_TOOLS_SEARCHABLE_SURFACE_SEARCHABLE_DISK_HPP_
#define MESH_TOOLS_SEARCHABLE_SURFACE_SEARCHABLE_DISK_HPP_
// mousse: CFD toolbox
// Copyright (C) 2014-2015 OpenFOAM Foundation
// Copyright (C) 2016 mousse project
// Class
// mousse::searchableDisk
// Description
// Searching on circular disk given as o... | TOOL | 0.93098 | 6.032574 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2015-12-31T10:07:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "442952ab... |
80b0207b-8f00-4be8-a93a-12f331189a4e | minmaxmean/ACMP | 688/b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef map <int, int> mii;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
int const maxn = int(1e5 + 12);
int const maxb = int(2e6 + 12);
int const inf = int(1e9 + 7);
ll const linf = ll(1e18 + 12);
double ... | ALGO | 0.999987 | 3.046034 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2015-10-13T18:49:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12aa4c4ab... |
79db2949-306d-42fc-a400-8d344256a855 | ManuelDGriseri/Matrix-classes | Main.cpp | #include "mat.h"
#include "mats.h"
#include "mattd.h"
#include "vect.h"
#include <iostream>
#include <chrono>
#include <random>
int main() {
try {
// Mat
m1::Mat mt1(2, 3);
m1::Mat mt2(2, 3);
for (int i = 0; i < mt1.get_nl(); i++) {
for (int j = 0; j < mt1.get_nc(); j++) {
mt1(i, j) = j;
mt2(i, j)... | TOOL | 0.988025 | 5.36876 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-15T14:33: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": "e8974ef48669... |
4c5496bc-42aa-40bd-971e-a9604d604471 | hinohie/primitive_based_deformation | src/Polyrect.cpp | #include "Polyrect.h"
void Polyrect::sortAO()
{
int i, j;
int n = v.size();
max_x = -1;
max_y = -1;
min_x = width;
min_y = height;
long t1, t2, t3;
int x, y;
for(i=0; i<n; i++)
{
v[i].x;
v[i].y;
if(x < 0)
{
x = 0;
}
else if(x > width)
{
x = width;
}
if(y < 0)
{
y = 0;
}
els... | ALGO | 0.998357 | 4.309234 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-06-15T01:35:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85e85c0103... |
626b8a64-5bc9-47ba-b557-1db7fa90e493 | warrior-graph/anomaly_detection | main.cpp | #include <bits/stdc++.h>
#define bug(x) cout << #x << " = " << (x) << '\n'
#include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
#include <new_eigen.hpp>
using namespace cv;
using namespace std;
using namespace new_eigen;
using tensor = vector<Mat>;
using kernel = tensor;
Rect2i cut_image(const Mat &frame)
... | ALGO | 0.992687 | 5.494699 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-06-02T16:03: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": "fdc1a90a4... |
59cacd36-e002-42b3-88b3-6fce7df63e53 | SohnQuixote/Algorithm | C++/문제 유형/깊이.너비 우선 탐색/음료수 얼려먹기/main.cpp | #include <iostream>
#include <stack>
#include <vector>
#include <queue>
/*
dfs 필요 자료구조 스택, (연결 정보 - 인접 행렬, 인접 리스트), 방문 정보
스택 빌때까지 탐색하는데 재귀함수로 호출하면 알아서 호출이 스택구조
vector<int> 사용
bfs 필요 자료구조 큐 , 연결정보, 방문정보
큐 빌때까지 탐색
음료수 얼려먹기
N,M -> N*M 얼음판
구멍 뚫려 있는 부분 0
그렇지 않은 부분 1
얼음판으로 만들 수 있는 아이스크림의 수
*/
using namespace std;
int dx[4]... | ALGO | 0.999936 | 4.005761 | {
"github_metadata": {
"branch": "main",
"commit_count": 282,
"repo_created_at": "2021-07-18T00:57: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": "af2aef5e7c... |
50385244-fd3a-41a2-b0ab-41198f5cfbc8 | WillBux/Extended-Kalman-Filter | src/tools.cpp | #include <iostream>
#include "tools.h"
using Eigen::VectorXd;
using Eigen::MatrixXd;
using std::vector;
Tools::Tools() {}
Tools::~Tools() {}
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
//Calculate the error using the Ro... | ALGO | 0.98237 | 5.859711 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2017-06-04T20:46: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": "81a418492... |
c7d9ccc1-6603-42cc-91b5-13bfd8de4303 | abhijith96/ResizableArrayImplementations | src/BrodniksOptimalArray/BrodniksOptimalArray.h | //
// Created by <NAME> on 24/03/23.
//
#ifndef RESIZABLEARRAYIMPLEMENTATIONS_BRODNIKSOPTIMALARRAY_H
#define RESIZABLEARRAYIMPLEMENTATIONS_BRODNIKSOPTIMALARRAY_H
#include <vector>
#include <cmath>
#include <iostream>
//#include "BrodniksOptimalArray.h"
namespace BrodniksOptimalArray{
using brodniks_array_size_... | ALGO | 0.945299 | 4.800124 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-04-04T22:30: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": "7140530d1093... |
abf1d7bd-4a20-4def-9192-322428bc9218 | kironbot/AtCoder | ABC/ABC128/D/main.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
#define rep(i, a, n) for (ll i = (a); i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,t... | ALGO | 0.999995 | 4.254704 | {
"github_metadata": {
"branch": "master",
"commit_count": 743,
"repo_created_at": "2018-06-24T09:41: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": "525eee57... |
90bbda30-576b-4caa-8f29-d3ab59c0a06a | huguangAOA/Bilibili-Clang | 4.第4章:函数与程序结构/第四章代码/21.HZOJ-236.cpp | /*************************************************************************
> File Name: 4.HZOJ-236.cpp
> Author: huguang
> Mail: <EMAIL>
> Created Time:
************************************************************************/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <st... | ALGO | 0.999945 | 3.088932 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-07-02T15:30:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c87caac7e1... |
3ad14075-9836-4e8e-84ad-7f336bf10075 | ericl816/Competitive-Programming-Solutions | DMOJ/Seasonal/Old Christmas Lights.cpp | #pragma GCC optimize "Ofast"
#pragma GCC optimize "unroll-loops"
#pragma GCC target "sse,sse2,sse3,sse4,abm,avx,mmx,popcnt,tune=native"
#include <bits/stdc++.h>
#define scan(x) do{while((x=getchar_unlocked())<'0'); for(x-='0'; '0'<=(_=getchar_unlocked()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;
#define ll long long
#d... | ALGO | 0.99992 | 4.728676 | {
"github_metadata": {
"branch": "master",
"commit_count": 388,
"repo_created_at": "2021-05-10T21:58:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf75dc69... |
8342283e-9ac7-4079-af3f-1188f57cf60b | hanriiver/algorithm | 백준/Silver/2485. 가로수/가로수.cc | #include<bits/stdc++.h>
using namespace std;
int n;
long long arr[100001];
vector<long long> v;
long long gcd(long long a, long long b) {
for (; b; a %= b, swap(a, b));
return a;
}
int main() {
ios_base::sync_with_stdio(false), cin.tie(NULL);
cin >> n;
for (int i = 0; i < n; i++) cin >> arr[i];
... | ALGO | 0.999936 | 3.751089 | {
"github_metadata": {
"branch": "master",
"commit_count": 371,
"repo_created_at": "2021-06-11T17:53: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": "f65e985f... |
21dc221f-9e07-40a3-aaf9-4865ad386e6e | KrithigaRamesh/Arduinomusicbuzzer | _buzzercovervaraharoopamarduino.ino | /*
Melody "<NAME>
Plays a melody
circuit:
*8-ohm speaker on digital pin 8
created 21 Jan 2010
modified 27 Nov 2023
by <NAME>
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Tone
*/
#define sa 2093
#define ri 2217
#define ga 2637
#define ma 2793
#define pa 3135
// notes... | ALGO | 0.997877 | 5.824047 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-12-05T03:56:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c977cb060cbc... |
f1aeb69f-f4d9-40c9-9beb-3fbe2dde6ec8 | Ellard24/CS162 | week3/lab/main1.cpp | /***************************************************
*Program FileName: main1.cpp
*Author: <NAME>
*Date: 10/15/2015
*Input: All input comes during runtime
*Output: Score is shown and winner is determined and
displayed to screen.
***************************************************/
#include <iostream>
#include <ti... | TOOL | 0.996974 | 3.085869 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-03-17T15:47: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": "317ee5c817... |
d9e58a5f-9341-4716-93f0-4ad5b1535f64 | bineanfrank/algorithms_hd_851 | 2016/stack_for_queue.cpp | //
// Created by Harlan on 2017/1/7.
//
// http://blog.csdn.net/zdp072/article/details/19755675
#include <stack>
#include <iostream>
#include <cstdio>
using namespace std;
class Queue {
private:
stack<int> stack1;
stack<int> stack2;
public:
bool isEmpty() {
return stack1.empty() && stack2.empty()... | ALGO | 0.99965 | 4.135295 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-11-03T02:22: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": "a470d7671... |
4c1dd613-377f-4af0-871d-bcd32921a5f3 | rtake/atcoder | abc152/d.cpp | # include <bits/stdc++.h>
typedef long long lint;
using namespace std;
#define rep(i,n) for (lint i=0; i<(lint)(n);i++)
lint gcd(lint x, lint y) { return (x==0)? y : gcd(y%x,x); }
lint lcm(lint x, lint y) { return x/gcd(x,y)*y; }
lint P(lint n, lint k) { return (k==1) ? n : n*(P(n-1,k-1)); }
lint mod=1000000007;
lin... | ALGO | 0.999781 | 4.205565 | {
"github_metadata": {
"branch": "master",
"commit_count": 671,
"repo_created_at": "2020-05-09T03:18:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8fe1fa11... |
6a559cd0-5c7f-4cc0-9e3c-541b8b60fb89 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Phi/top0-100/minimum-height-trees-Solution.findMinHeightTrees/177843_+Info.cpp | _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
const char *s, charset_t src_charset, charset_t dst_charset)
{
size_t count = 0;
#ifdef DEVELOPER
switch (dst_charset) {
case CH_DOS:
case CH_UNIX:
smb_panic("cannot call strlen_m_ext() with a variable dest charset (must be UTF16* or UTF8)"... | ALGO | 0.998623 | 5.294909 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-22T14:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e47e9e0d3f42... |
37c3e49f-b672-47cc-ac37-4f526b99ad43 | printfchan/Leetcode | Leetcode/134. Letter Combinations of a Phone Number/Letter Combinations of a Phone Number.cpp | /************************************************************************/
/*
https://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/
Given a digit string, return all possible letter combinations that the number could represent.
A mapping of digit to letters (just like on the telephone buttons) is giv... | ALGO | 0.999694 | 5.923358 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2014-04-06T14:30: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": "350cceefa... |
6e95e126-2f31-490e-b296-c3ad0c34a472 | ishandutta2007/codeforces-l | lyc_music/normal/1616/F.cpp | // Lynkcat.
// Problem: CF1616F Tricolor Triangles
// URL: https://www.luogu.com.cn/problem/CF1616F
// Memory Limit: 250 MB
// Time Limit: 1000 ms
// -----------------------------------------------
#include<bits/stdc++.h>
#define poly vector<int>
#define IOS ios::sync_with_stdio(false)
#define ll long long
#define mp ... | ALGO | 0.999835 | 4.532015 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17: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": "b16ddc88912d... |
8d8601a0-7d8f-4360-a29f-03a209b3b626 | yash3004/practice | DSA/dsa/Queue.cpp | #include<bits/stdc++.h>
using namespace std;
class Queue{
private:
int f;
int rear;
int *arr;
int size;
int cap;
//constructor
public:
Queue(int n){
this-> f = -1;
this-> rear = f;
this ->cap = n;
arr = new int[cap];
this-> size = 0;
}
... | ALGO | 0.998257 | 3.821434 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-09-18T15:17: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": "5a051a8bdcf... |
948b6602-33d6-46de-a121-ef185fd8637f | sergey-pashaev/aoc-cpp | src/2015/d6p2.cpp | // Day 6, Part Two
// You just finish implementing your winning light pattern when you
// realize you mistranslated Santa's message from <NAME>
// Elvish.
// The light grid you bought actually has individual brightness
// controls; each light can have a brightness of zero or more. The
// lights all start at zero.
//... | ALGO | 0.993868 | 6.316809 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-12-07T05:12: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": "f35336936... |
2cf055ba-9877-4c56-8744-2781b7b51771 | penguin72487/programing | 別人的範例程式/稀疏矩陣.cpp | #include <iostream>
class BcNode{
public: BcNode* op_Up;
public: BcNode* op_Down;
public: BcNode* op_Left;
public: BcNode* op_Right;
public: BcNode(){
op_Up = this;
op_Down = this;
op_Left = this;
op_Right = this;
}
};
class MNode: public BcNode{
public: int... | ALGO | 0.994724 | 3.971326 | {
"github_metadata": {
"branch": "master",
"commit_count": 744,
"repo_created_at": "2020-09-05T04:22: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": "f00fab41... |
4a97e970-4002-4b65-ada6-0b93e0a9a31f | hiroshi-maybe/topcoder | solutions/ElectronicPetEasy/ElectronicPetEasy.cpp | #include <fstream> // for greed plugin
#include <iostream>
#include <algorithm> // max,min
#include <vector>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>... | ALGO | 0.997135 | 4.771849 | {
"github_metadata": {
"branch": "master",
"commit_count": 1437,
"repo_created_at": "2015-05-24T07:26:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea17400... |
c57af2ab-a5bf-4868-9eda-0ad90d0ecee1 | rakeshre/Leetcode | 0023-merge-k-sorted-lists/0023-merge-k-sorted-lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* merge(ListN... | ALGO | 0.999871 | 6.378834 | {
"github_metadata": {
"branch": "main",
"commit_count": 472,
"repo_created_at": "2023-02-01T05:41: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": "88884a0180... |
f73c03b8-9aee-44e9-bf29-b94fb495e016 | denis-gubar/Leetcode | Matrix/0861. Score After Flipping Matrix.cpp | static int X[20];
class Solution {
public:
int matrixScore(vector<vector<int>>& A) {
int result = 0;
int N = A.size(), M = A[0].size();
int Z = (1 << M) - 1;
memset(X, 0, sizeof(X));
for (int i = 0; i < N; ++i)
for (int j = 0; j < M; ++j)
X[i] |= A[i][j] << (M - 1 - j);
for (int i = 0; i < N; ... | ALGO | 0.999939 | 5.590963 | {
"github_metadata": {
"branch": "master",
"commit_count": 132,
"repo_created_at": "2019-10-28T13:05:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ebbed22... |
13860087-a37f-447c-ba3a-9227945732bf | albertnez/uva-online-judge | problems/469.cc | #include <iostream>
#include <vector>
#include <sstream>
using namespace std;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
const int di[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int dj[8] = {0, -1, -1, -1, 0, 1, 1, 1};
int dfs(int i, int j, const vs& map, vvb& m) {
int s = 0;
for (int k... | ALGO | 0.999249 | 4.0987 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-09-27T18:12: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": "bd8fec9708... |
bca9eb1d-ca24-4ffd-a6f8-f151ea1cb426 | Long9Ngon/CTDL-GT | 9_duyetDoThi/ketBan.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> ke[100001];
bool check[100001];
int n, m, dem;
void Bfs(int u)
{
queue<int> res;
res.push(u);
check[u] = true;
while(!res.empty())
{
dem++;
u = res.front(); res.pop();
for(int i = 0; i < ke[u].size(); i++)
{
int s = ke[u][i];
if(!chec... | ALGO | 0.999932 | 4.918876 | {
"github_metadata": {
"branch": "all",
"commit_count": 2,
"repo_created_at": "2021-12-15T08:05: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": "0c3678a5faf69... |
aaa8f3dc-56d0-40bf-896e-6a0c2264d9b4 | sergio-sak/Pdp-Solutions | Pdp 35/C(23 out of 23)/Chemicals/Sergios/chemicals.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<long long> vll;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pl;
ll N, K, temp, left = 0, right = 0, complement, res = 0;
vll chemicals;
std::unordered_map<ll, ll> hmap;
int main()
{
#ifdef CONTEST
... | ALGO | 0.999903 | 3.88101 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2023-08-26T18:12:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d8b48b7228... |
03a6e454-2b44-4ab0-afc7-fcfa67f88b26 | tosakikolumia/shenjian-homework | homework/4-b2-2/4-b2-2.cpp | /* 2351753 信08 黄保翔 */
#include <iostream>
#include <iomanip>
#include <limits>
using namespace std;
int zeller(int y, int m, int d) {
int w,c,y1,m1;
c = y / 100;
y1 = y % 100;
if (m >= 3) {
y1 = y1;
m1 = m;
}
else {
if (y1 == 0) {
y1 = 99;
c = c - 1;
}
else {
y1 = y1 - 1;
}
m1 = m + 12;
... | ALGO | 0.999154 | 3.544754 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2024-11-10T03:38:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da4318ece2... |
e9cc3e6f-5e75-4649-b7cb-071dc2ebfbc4 | Lemon-412/OS-simulator | exp1-2/DeadLock.h | #ifndef _Lemon_DeadLock
#define _Lemon_DeadLock
// no deadlock protection
namespace NoProtection{
vector<int> apply_for_allocation(int resource_n,vector<int>& own,vector<int>& apply){
vector<int> release(resource_n,0);
return release;
}
bool check_allocation(int resource_n,vector<int>& req... | ALGO | 0.988635 | 5.651856 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-01-20T08:58:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5d9fedd68... |
8f3a5fa8-93f9-4e95-804b-5bc8e8245350 | Ceffa/Ryno-Engine | Ryno Physics/Headers/Narrow.h | #pragma once
#include "Core.h"
#include "RigidBody.h"
#include "Contact.h"
#include "Broad.h"
namespace Ryno {
//Struct used by the contact generators to store contacts.
struct CollisionData {
void setup(F _max_contacts);
Contact* contacts;
I remaining_contacts;
I max_contacts;
CollisionData& operator++... | ALGO | 0.926952 | 4.882603 | {
"github_metadata": {
"branch": "master",
"commit_count": 420,
"repo_created_at": "2015-11-04T10:10:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 5,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4a6a99... |
e44b47c1-d7ac-4db8-873e-811564eaeaa0 | avinashw50w/ds_algo | Data structures/Advanced/Disjoint Sets/largest tree queries.cpp | /*There is tree of N ( 0< N <=10^5) vertices and E edges (0< E <10^5) . You have been given q
queries and in each query, you have given two vertices and you have to remove the edge between
these two vertices and give the largest size of the tree from the resultant forest.
Use DSU offline queries.
- Union all the edg... | ALGO | 0.999914 | 5.139714 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2019-06-23T03:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55a19d21d... |
c714170f-8af6-42c2-8a48-0aa48e749c08 | XieJiongyan/LuoguSolver | P1462 通往奥格瑞玛的道路/P1462 通往奥格瑞玛的道路/源.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace::std;
#define int long long
struct edge {
int to, next, weight;
edge(int fto, int fnext, int fweight) : to(fto), next(fnext), weight(fweight) {}
edge() = default;
};
vector<edge> vsedge(2);
struct node {
int edge, money... | ALGO | 0.999861 | 4.524687 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-07-24T13:38:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f969955ece... |
ed9f76d5-566a-4468-a423-76e8296b4245 | Essux/Competitive-Programming | Algorithms/Geometry/Isolated Segments.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
const double EPS = 1e-9;
struct point {
double x, y;
point() { x = y = 0; }
point(double _x, double _y) : x(_x), y(_y) {}
};
struct line {
double a, b, c;
};
struct square {
point p1, p2;
square(point a, point b) {
... | ALGO | 0.999226 | 4.09469 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2016-10-22T17:09:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69a1097ac... |
0c6f21f0-802c-48bb-b52b-491128a04c65 | AizenFrog/381706-2_Antipin_lab | math_function_lib/Polish_record.cpp | #include "Polish_record.h"
#include <cmath>
Calculator::Calculator(const char* string)
{
str.WrightString(string);
numbers = new Stack<int>(100);
s_char = new Stack<char>(100);
}
int Calculator::Calculate()
{
int a = 0, b = 0;
bool priority_of_simbols = true;
while (1)
{
Number tmp = str.GetNextChar... | ALGO | 0.989961 | 3.836922 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2018-10-19T06:17:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83e4031cb... |
41243c1f-4dff-46d4-86b2-5767ccd0f91d | changnet/lua_insertion_ranking | linsertion_ranking.cpp | #include "linsertion_ranking.hpp"
#include <cmath>
#include <cerrno>
#include <cassert>
#include <fstream> // std::ofstream
#define LIB_NAME "lua_insertion_ranking"
#define array_resize(type,base,cur,size) \
do{ \
type *tmp = new type[size]; ... | ALGO | 0.990046 | 3.739855 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2017-04-05T10:45:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5d8891ac... |
e69bbda4-bad8-407c-8198-06134be70aee | shas9/codehub | Codeforces/Round/Round 607 - D1/A.cpp | // God put a smile upon your face <3
#include <bits/stdc++.h>`
#define slld(longvalue) scanf("%lld", &longvalue)
#define ll long long
#define ull unsigned long long
#define pll pair < long long, long long >
#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back
#define bug ... | ALGO | 0.999945 | 3.976374 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-25T17:32:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "154dc6ea9e... |
6e84f465-d559-4082-ba43-f22bde133c63 | SalmaNasser77/SWE_Assignments | Session_temp_8_Arrays_with_pointers/Solution/Task_temp_8.1_sol.cpp | #include <iostream>
using namespace std;
// Function to swap the values of two integers using pointers
void swap(int *a, int *b) {
int temp = *a; // Store the value pointed to by a in a temporary variable
*a = *b; // Assign the value pointed to by b to the location pointed to by a
*b = temp; // A... | ALGO | 0.999835 | 6.350404 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2024-09-01T10:40: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": "89ff2ac001d... |
fdb6d0ba-69d1-48be-b5f3-30743bb27223 | anipatil72/My_Competitive_Programming | 852.cpp | // ॥ श्री गणेशाय नमः ॥
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ull unsigned long long
using namespace std;
using namespace __gnu_pbds;
int lcs(string &str1, string &str2)
{
int ans = 0;
int na = str1.length();
in... | ALGO | 0.999753 | 3.594551 | {
"github_metadata": {
"branch": "main",
"commit_count": 171,
"repo_created_at": "2023-04-02T04:50: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": "d410a336ac... |
5354b84b-3858-499c-8d41-a079609fbc46 | Yoonlang/yoongorithm | 23-4/23-4-9/yoon/1058.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <unordered_set>
#include <vector>
using namespace std;
int N;
bool map[51][51];
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> N;
string s;
for (int i = 0; i < N; i++) {
cin >> s;
... | ALGO | 0.999675 | 3.904406 | {
"github_metadata": {
"branch": "main",
"commit_count": 258,
"repo_created_at": "2023-03-11T01:15:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9fb2ac506... |
81fd4bd5-d769-4653-85ea-c94619511516 | Shagun0409/gfg_solutions_dsa | Difficulty: Medium/Make Binary Tree From Linked List/make-binary-tree-from-linked-list.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
/* Link list Node */
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
struct TreeNode {
int data;
TreeNode *left;
TreeNode *right;
TreeNode(int x) {
data ... | ALGO | 0.999858 | 4.914297 | {
"github_metadata": {
"branch": "main",
"commit_count": 500,
"repo_created_at": "2023-07-16T19: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": "d1c6b85c10... |
d9aeae32-4226-4fec-ab85-ea2add70b2c7 | ZavalichiR/Backup | SD/Toate functiile+teste+subiecte examen/Stive si Cozi/Stive si Cozi/functii.cpp | #include"functii.h"
//-----ALGORITM-----
/*
-------Algoritm-------
1.Se va folosi o Stiva de OPERATORI( +,-,*,/,(,) )
si un sir de caractere: char post[100];
2.Se parcurge sirul SIR (forma infixata data de la tastatura)
de la stanga la dreapta pana intalneste '\0'-se termina
3.La intalnirea unui operand( 0 to 9) a... | ALGO | 0.996819 | 3.760634 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-08-13T09:47:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32ea50acd... |
5c9415fd-03b2-4908-8c15-8ffe859dcafe | amado-developer/GraphicsCourse-SimpleRenderer-C | Transformations/Math.h | //
// Created by <NAME> on 9/9/20.
//
#ifndef TRANSFORMATIONS_MATH_H
#define TRANSFORMATIONS_MATH_H
#include <tuple>
using namespace std;
class Math
{
public:
tuple<int, int, int> sum(tuple<int, int, int> v0, tuple<int, int, int> v1);
tuple<double, double, double> sub(tuple<double, double, double... | ALGO | 0.973029 | 5.546568 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2020-08-31T00:13: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": "e76ecddc5... |
594c7384-7fa2-4cec-b0fa-3eebef1a8862 | Zhang-VISLab/Proposal-Generation-for-Object-Detection-using-Cascaded-Ranking-SVMs | VOCcode/mexSparseMatrices.cpp | #include <math.h>
#include "mex.h"
void sparse_matrices(double *x, int *pair, int *ratio, int dim, int pair_len, double *S, int *I, int *J)
{
// sparse matrices
for (int i=0; i<pair_len; i++)
{
if (ratio[2*i] == ratio[2*i+1])
{
for (int j=0; j<dim; j++)
{
S[i*2*dim+j] = x[dim*(pair[2*i]-1)+j] - x[dim... | ALGO | 0.996423 | 4.249697 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-03-16T19:14: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": "4d7e4f33fc... |
31fe40ce-7e77-4b71-89de-dece7700c9b3 | ikamii/udacity-cpp-nd | CppND-System-Monitor-Project/include/linux_parser.h | #ifndef SYSTEM_PARSER_H
#define SYSTEM_PARSER_H
#include <fstream>
#include <regex>
#include <string>
namespace LinuxParser {
// Paths
const std::string kProcDirectory{"/proc/"};
const std::string kCmdlineFilename{"/cmdline"};
const std::string kCpuinfoFilename{"/cpuinfo"};
const std::string kStatusFilename{"/status"... | TOOL | 0.923365 | 7.042094 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-11-22T18:28:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b260b7b8f4e... |
f766fc00-3469-4ad7-b96f-280d2d13cc05 | OsorioLuis/practica_2 | problema13.cpp | #include <iostream>
#include <cstdlib>
//establecemos funciones
int randomGenerator();
void matrizCreator(int rows, int columns);
int main13(){
int rows, columns;
std::cout<<"Ingresa la fila: ";std::cin>>rows;
std::cout<<"Ingresa las columnas: ";std::cin>>columns;
//llamado de la funcion
matriz... | ALGO | 0.965832 | 4.438818 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-19T14:59: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": "a85314ae6383... |
da04416f-adf4-4873-b9ac-b78786b37c2b | AkshatAggarwal14/Competitive-Programming | CodeChef/PERMAND.cpp | #ifdef LOCAL
#include "Akshat.hpp"
#else
#include "bits/stdc++.h"
using namespace std;
#define dbg(...)
#endif
using ll = long long;
auto sz = [](const auto &container) { return int(container.size()); };
#define all(x) begin(x), end(x)
const ll INF = 1e18;
const ll N = 1e5 + 5;
const ll MOD = 1e9 + 7; // 998244353
v... | ALGO | 0.99994 | 4.243657 | {
"github_metadata": {
"branch": "master",
"commit_count": 850,
"repo_created_at": "2021-08-16T13:49:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6f36373... |
a4794247-3771-4cee-8986-79e57dce7a9c | pmarathe25/ATTFoundryBetaChallenge | src/Group/GroupAllocator.cpp | #include "Group/GroupAllocator.hpp"
#include <algorithm>
#include <iostream>
GroupAllocator::GroupAllocator(int numRacks, int numRacksPerGroup, int numGroups, int goalCapacity) {
this -> numRacks = numRacks;
this -> numRacksPerGroup = numRacksPerGroup;
this -> numGroups = numGroups;
this -> goalCapacit... | ALGO | 0.978686 | 6.254167 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2017-01-26T15:58: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": "ede895d04... |
90501ea5-6d58-4608-975f-030dfee6e689 | dhairyapandya05/LeetCode-Problem-Tracker | 2505-number-of-good-paths/number-of-good-paths.cpp | class Solution {
public:
vector<int>parent;
vector<int>rank;
int find(int u){
if(parent[u]==u) return u;
return parent[u]=find(parent[u]);
}
void Union(int u, int v){
int parentu=find(u);
int parentv=find(v);
if(parentu==parentv) return;
if(rank[u]>... | ALGO | 0.999983 | 5.708569 | {
"github_metadata": {
"branch": "main",
"commit_count": 628,
"repo_created_at": "2025-01-08T06:20:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0873be4b2... |
10612f5e-ef77-46fa-a659-a29f90bf7087 | ptiwari0664/CplusplusProgramming | HackerRankC/ForLoop.cpp | #include <iostream>
#include <iomanip>
#include <limits>
using namespace std;
int main() {
// Complete the code.
int a=0,b=0;
// string temp;
// getline(cin>>ws,temp);
// a = stoi(temp);
// temp.clear();
// getline(cin>>ws,temp);
// b = stoi(temp);
// temp.clear();
cin >> a >>... | ALGO | 0.999855 | 3.884796 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-05-05T16:17:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c3868d6a0... |
b79d45ca-2c70-44f4-ba06-78831697de2b | deepdarshan21/leetcode-solutions | 312. Burst Balloons/DP.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Approach: DP(top down)
Edge Cases:
Time Complexity: O(n*n) Space: O(n*n)
Status: Accepted
Runtime: 1078 ms faster than: 5.6%
Memory Usage: 10.5 MB less than: 26.43%
Remarks:
*/
class Solution {
public:
int maxCoins(vector<int>& nums) {
... | ALGO | 0.99992 | 5.230714 | {
"github_metadata": {
"branch": "main",
"commit_count": 889,
"repo_created_at": "2022-01-07T14:50:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be7cb7fbaf... |
67a01b8b-78e5-4062-ab26-18303efa6d4d | kamyu104/LeetCode-Solutions | C++/shortest-path-with-alternating-colors.cpp | // Time: O(n + e), e is the number of red and blue edges
// Space: O(n + e)
class Solution {
public:
vector<int> shortestAlternatingPaths(int n, vector<vector<int>>& red_edges, vector<vector<int>>& blue_edges) {
vector<vector<unordered_set<int>>> neighbors(n, vector<unordered_set<int>>(2));
for (c... | ALGO | 0.999898 | 5.879774 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
88e80d37-fe3f-4eff-a114-f5e188600ca1 | JaiswalRohit13/competitive_programming | basic_programs/barclays2.cpp | // 13. Roman to Integer
// Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
// Symbol Value
// I 1
// V 5
// X 10
// L 50
// C 100
// D 500
// M 1000
// For example, 2 is written as II in Roman ... | ALGO | 0.999466 | 5.894082 | {
"github_metadata": {
"branch": "dev",
"commit_count": 87,
"repo_created_at": "2023-01-24T14:15:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67d56aae74ae... |
6e3cbadc-783d-477c-b3c8-52e34b5ddf1b | Oxid15/CppLabs | ЛР2/Задача 2/Source.cpp | #include<iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
int n;
cout << "Write array size:" << "\n"; cin >> n;
int *m = new int[n];
if (n >= 10)
{
srand(time(NULL));
for (int a = 0; a != n; a++)
{
m[a] = rand();
cout << "m[" << a << "]=" << m[a] << "\n";
}
}
else
... | ALGO | 0.999985 | 3.203812 | {
"github_metadata": {
"branch": "master",
"commit_count": 342,
"repo_created_at": "2017-09-08T14:45: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": "6088a79b... |
11167f4b-670e-433b-aa7a-750cfd8ab051 | PeacocksFly/Algorithmics_Exercises | PrintNodesInTopViewOfBinaryTree.cpp | #include "PrintNodesInTopViewOfBinaryTree.h"
PrintNodesInTopViewOfBinaryTree::PrintNodesInTopViewOfBinaryTree() {
head = new node(1);
head->l = new node(2);
head->r = new node(3);
head->l->r = new node(4);
head->l->r->r = new node(5);
head->l->r->r->r = new node(6);
}
PrintNodesInTopViewOfBinaryTree::~Print... | ALGO | 0.999864 | 4.471036 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-02-09T10:45: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": "107e00f31... |
6a0a6ba7-6342-4be2-85f2-49056206e570 | Davy-07/Leetcode-Submissions | 84-largest-rectangle-in-histogram/84-largest-rectangle-in-histogram.cpp | class Solution {
public:
vector<int> smaller_right(vector<int>& heights)
{
stack<pair<int,int>> right;
int psuedo = heights.size();
right.push({0,psuedo});
vector<int> ans;
for(int i=heights.size()-1;i>=0;i--)
{
while(right.top().second!=psuedo &&... | ALGO | 0.999962 | 6.128287 | {
"github_metadata": {
"branch": "main",
"commit_count": 499,
"repo_created_at": "2022-07-06T18:01:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4782caa07c... |
66ab0132-d317-4e63-8e23-60b33766dcc4 | razaOnGit/DSA-LB | BACKTRACKING/letter-tile-possibilities-backtracking.cpp/main.cpp | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run a... | ALGO | 0.999922 | 5.576438 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-06T13:53: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": "2055c1ea766c... |
139e9b7e-5464-4b07-af66-703862605441 | ghibli613/cp-coding | coding/big_o/lv2/lect13/right_most_non_zero_digit.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
int n; cin >> n;
vector<ll> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
int cnt = 0;
for (int i = 0; i < n; i++)
{
while (a[i] > 0 && a[i] % 5 == 0)
{
a[i] /= 5;
... | ALGO | 0.999604 | 4.660196 | {
"github_metadata": {
"branch": "main",
"commit_count": 248,
"repo_created_at": "2024-06-30T18: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": "d296c776f7... |
b378766f-dc87-42b7-9d38-d5b963efe497 | fezione/sortThread | mainwindow.cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->setWindowTitle ( tr("Сортировка с потоками") );
this->setFont ( QFont("Helvetica") );
sorting = new myThread(this);
connect( s... | TOOL | 0.948363 | 5.027356 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-07-20T21:24: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": "df08b247062c... |
ab4ca0b6-8504-4844-b2ce-68bac3fdbe5c | RahulScripted/DSA | Circular Linked List/Circular Single Linked List/AllOperation.cpp | // All operation performed on linked list
#include<bits/stdc++.h>
using namespace std;
class Node{
public:
int val;
Node* next;
Node(int val){
this->val = val;
this->next = NULL;
}
};
class CircularLinkedList{
public:
Node* head;
int... | ALGO | 0.999448 | 4.893342 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-09-18T00:14: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": "6c06c962b2b4... |
edcaeee5-1420-49e7-a821-ffece1dfee24 | VSH30/CPP-Progs | file handling/matttt.cpp | #include<iostream>
using namespace std;
class matrix{
int **p,r,c;
public :matrix(){
cout<<"Enter the total no. of rows:";
cin>>r;
cout<<"Enter the total no. of columns:";
cin>>c;
p=new int*[r];
for(int j=0;j<r;j++){
p[j]=new int [c];
}
}... | ALGO | 0.965015 | 3.636157 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-03-07T10:39:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e508d78cfc... |
f31786b5-cd61-4553-9bb1-a6a591aab617 | mingjingsi/LPM | src/functions.cpp | #include "functions.hpp"
using namespace arma;
vec pnorm(vec x){
uword M = x.n_elem;
vec Phi = zeros<vec>(M);
for (uword i = 0; i < M; i++)
Phi(i) = gsl_cdf_ugaussian_P(x(i));
return Phi;
}
mat pnorm_mat(mat x){
uword M = x.n_rows;
uword N = x.n_cols;
mat Phi = zeros<mat>(M, N);
for (uword i = 0;... | ALGO | 0.996816 | 4.984757 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2018-07-03T07:02:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a39281769... |
2907902d-c9d6-40fd-8e40-1301c0918fe8 | ChanHyukLeee/Study-and-practice | boj/boj7562.cpp | #include <bits/stdc++.h>
#define X first
#define Y second
using namespace std;
int board[304][304];
int vis[304][304];
int dx[8] = {-2,-1,1,2,-2,-1,1,2};
int dy[8] = {1,2,2,1,-1,-2,-2,-1};
int nx, ny;
int main(void){
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
while(n--){
int I... | ALGO | 0.999461 | 3.750511 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2021-08-10T02:17: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": "f5b2dbde4... |
fec5a5f7-4522-4165-ad2d-2b92145a8c37 | Junaidk11/DataStructuresAndAlgorithm | Linkedlist/doublyLinkedList_main.cpp | #include <iostream>
using namespace std;
#include "doublyLinkedList.cpp"
int main(){
doublyLinkedList* numbers = new doublyLinkedList; // Dynamically allocate memory for the doubly linked list
int x;
// Add Node to the front of list
printf("Enter an integer (Note: Adding to the front of the list):... | ALGO | 0.998979 | 5.542229 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2020-10-08T18:09: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": "3e2bf410... |
d89db56a-d451-4987-8953-d3817ece2382 | khaledsliti/CompetitiveProgramming | Codeforces/Contests/CF1295/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
const int N = 1e5 + 5;
int n, x;
string s;
void solve()
{
int p = x;
bool found = false;
... | ALGO | 0.999709 | 4.249492 | {
"github_metadata": {
"branch": "master",
"commit_count": 454,
"repo_created_at": "2019-02-20T20:20:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eefd1859... |
4e7d2ba9-0147-460d-863b-69c5ab31e21b | haimgil1/ap1 | ex6/src/Bfs.h |
#ifndef TASK2BFS_Bfs_H
#define TASK2BFS_Bfs_H
#include <stack>
#include "Grid.h"
#include "Matrix.h"
#include "AbstractNode.h"
#include "Searchable.h"
/* A bfs class that contain the bfs algorithm.
BFS is an algorithm for traversing or searching tree or graph data structures.
It starts at the tree root (or some ... | ALGO | 0.999672 | 4.415875 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-12-25T17:43: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": "c7d2fe4c1... |
cf9b4356-ed3a-4153-a70f-5ec209092878 | purisaurabh/GeeksForGeeks | Medium/Boundary Traversal of binary tree/boundary-traversal-of-binary-tree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999889 | 5.870337 | {
"github_metadata": {
"branch": "main",
"commit_count": 608,
"repo_created_at": "2022-11-23T12:52:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab66b8e34b... |
f1d4891e-54cd-419f-8299-22400f4205a5 | erickmerlo/programacion2 | prueba4/main.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
char p1,p2,p3,p4,p5,p6,p7,p8,p9;
int pos;
string resultado="Empate";
void presentar(char p1,char p2,char p3, char p4,char p5,char p6,char p7,char p8,char p9)
{
cout << endl << p1 << " | " << p2<< " | " <<p3;
cout << endl <... | ALGO | 0.999617 | 3.703017 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2013-10-10T22:30: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": "7da1984a3... |
111cd319-5add-4edd-8673-e9b73ba7c31b | Jongwon0280/Data_Structure | DFS_List_Stack_ver.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 100
int visit[4];
typedef struct Adj_element {
int vertex;
Adj_element * link;
}element;
typedef struct Adj_list {
int n; // 정점개수
element * plink[MAX];
}Alist;
typedef struct Stack {
int cur;
int ele[MAX];
}S;
void init_S(S * s) {
s->cur = 0... | ALGO | 0.999923 | 4.136586 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-01-10T06:33:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ecea953e6... |
097f6cea-e43c-4371-a124-3349cc1c47ab | JMH201810/Labs | C++/Lab7-5-2/src/Lab7-5-2.cpp | //============================================================================
// Name : Lab7-5-2.cpp
// Author : JMH
// Version :
// Copyright : Your copyright notice
// Description : Exceptions: using in program
//============================================================================
#include... | ALGO | 0.909693 | 5.240137 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-10-03T20:07: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": "a28e4b7078... |
236ccb87-d94c-46ba-a359-fe7696ed50cf | sanyinchen/algorithm | cpp/leetcode/part1/Subarray_sum_equals_k_560.cpp | //
// Created by Administrator on 2020年05月29日, 0029.
//
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
int subarraySum(vector<int> &nums, int k) {
int res = 0;
if (nums.size() == 0) {
return res;
}
if (nums.size() == 1) {
... | ALGO | 0.999718 | 5.480121 | {
"github_metadata": {
"branch": "master",
"commit_count": 245,
"repo_created_at": "2017-04-12T13:10:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05349c77... |
3951195f-1e0e-4d22-acb7-2a14a3770846 | tiankonguse/leetcode-solutions | problemset-new/018/01847-closest-room/1847.cpp | #include <bits/stdc++.h>
#include "base.h"
using namespace std;
typedef __int128_t int128;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<pll> vpll... | ALGO | 0.999973 | 5.473101 | {
"github_metadata": {
"branch": "master",
"commit_count": 1037,
"repo_created_at": "2015-04-11T09:31:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 81,
"forks": 26,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcbc5... |
edfb4c7d-e288-4016-a91c-2750fe53b374 | jhhoward/WolfensteinCGA | tools/huffman.cpp | typedef struct
{
uint16_t bit0,bit1; // 0-255 is a character, > is a pointer to a node
} huffnode;
typedef struct
{
int16_t width,height;
} pictabletype;
huffnode grhuffman[255];
typedef uint8_t byte;
typedef uint16_t word;
unsigned huffbits[256];
unsigned long huffstring[256];
long counts[256];
huffnode nodea... | ALGO | 0.999566 | 4.335003 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2023-01-07T14:31:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 335,
"forks": 11,
"issues": 15,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fbde... |
d92ef782-b6f4-40b7-bd34-74c23d70ba25 | SamuelAndrey/Tugas-1-Struktur-Data | paket.cpp | // TUGAS PERTAMA - STACK (tumpukan) dari modifikasi file paket.cpp
// <NAME>
// A11.2021.1376
// 43UG2
#include <iostream>
#include <conio.h>
#define MAX 5 // maksimal tumpukan
using namespace std;
struct paket {
char jenis_brg[30];
int berat;
char kota[30];
};
struct paket kirim[100];
void push(int x)... | ALGO | 0.949438 | 3.916734 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-09-27T10:08: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": "3523973d6d12... |
9aac02ca-926b-4958-a3f6-5c7524b0a48f | Izeren/mini-java-compilator | src/IRT/register_allocation/ControlFlowGraphBuilder.cpp | #include "ControlFlowGraphBuilder.h"
#include <map>
std::map<std::string, int> buildLabelMap(const AssemblyCommands &commands) {
std::map<std::string, int> map;
for (int i = 0; i < commands.size(); ++i) {
const AssemblyCode::LabelCommand* labelCommand =
dynamic_cast<const AssemblyCode::... | TOOL | 0.931055 | 5.976636 | {
"github_metadata": {
"branch": "develop",
"commit_count": 400,
"repo_created_at": "2016-09-11T13:44:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e288a4... |
65ad9498-e0e0-49c0-8f84-c2d8dd934cfa | wolfvoid/HNU-resourses | 专业核心-算法设计与分析(89)/算法设计-实验/实验4_甘晴void/第1题 0-1背包问题(回溯).cpp | // -*- coding:utf-8 -*-
// File : 01背包问题(回溯).cpp
// Time : 2023/12/14
// Author : wolf
#include <iostream>
using namespace std;
int w[5000];
int v[5000];
bool flag[5000];
bool ans[5000];
int now_w = 0, now_v = 0;
int n, maxw, bestv = 0;
int rest_v;
void backtrace(int depth)
{
if (depth == n) // 到达第... | ALGO | 0.999987 | 4.656422 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-03-01T13:10:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 96,
"forks": 23,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7726c0ff... |
8ba4757e-f6b4-4e73-96a6-b0b9433bf1cd | werner291/Multigoal-Orchard-Drone-Planning-Library | src_old/utilities/MeshOcclusionModel.cpp | //
// Created by werner on 27-2-23.
//
#include <random>
#include "MeshOcclusionModel.h"
MeshOcclusionModel::MeshOcclusionModel(const shape_msgs::msg::Mesh &mesh, double margin) : margin(margin) {
// Use CGAL to create an AABB tree of the mesh's triangles.
for (const auto &triangle: mesh.triangles) {
const auto... | ALGO | 0.976059 | 6.845606 | {
"github_metadata": {
"branch": "main",
"commit_count": 1146,
"repo_created_at": "2021-08-11T14:52:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b9d5c0f3... |
0cccc1d5-e3f0-46d4-ba99-7c03b611ad33 | emoltz/Bridge_Spring2022_OH | exampleArchive/June10.cpp | #include <iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(){
data = 0;
next = nullptr;
}
};
class LinkedList{
private:
Node* head;
Node* tail;
public:
LinkedList(){
head = nullptr;
tail = nullptr;
}
~LinkedList(){
... | ALGO | 0.999682 | 5.502102 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2022-04-22T13:02:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e62e330c6... |
6a6678d6-64ff-41ca-ad2c-9d7631974e22 | zihaomu/opencv_lite | 3rdparty/MNN/source/backend/cpu/compute/ConvolutionHybrid.cpp | //
// ConvolutionHybrid.cpp
// MNN
//
// Created by MNN on 2023/10/26.
// Copyright © 2018, Alibaba Group Holding Limited
//
#include "ConvolutionHybrid.hpp"
#include <string.h>
#include "core/BufferAllocator.hpp"
#include "backend/cpu/CPUBackend.hpp"
#include "core/Concurrency.h"
#include "ConvOpt.h"
#include "co... | ALGO | 0.924545 | 4.629642 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-05-08T08:56:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "955cf3ae3b... |
85b265df-0a16-4c58-a612-de24f626de2b | Xe0n0/LeetCode | Scramble String.cpp | //rev.2 3-dimension DP, O(n^4)
class Solution {
public:
bool isScramble(string s1, string s2) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
int n;
if ((n = s1.size()) != s2.size()) return false;
if (s1 == s2) return true;
... | ALGO | 0.999996 | 5.819556 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2013-08-25T08:07:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fcc3eb33... |
b5e24a21-832d-4da1-ac78-dd52593128f3 | longsll/algorithm-practises | codeforce/oth/C_Place_for_a_Selfie.cpp | #include <bits/stdc++.h>
#define debug_(x) cerr << #x << " = " << x << ' '
#define debug(x) cerr << #x << " = " << x << '\n'
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T;
cin >> T;
while (T--) {
int n, m;
cin >> n >> m;
set<int> S;
... | ALGO | 0.999881 | 3.797112 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2023-03-28T08:46:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bef0de39d1e... |
ac0bfcee-2fe4-4bc7-8481-62a40eb69b12 | lm2-poly/OpenFiberSeg | InsegtLibraries/texture_gui/code/functions/biadjacency_matrix.cpp | /*=================================================================
* syntax: B = biadjacency_matrix(A,M,K) OR B = biadjacency_matrix(A,M)
*
* BIADJACENCY_MATRIX - build biadjacancy matrix from assignment image
*
* Input: - A: X-by-Y assignment image
* - M: patch size (length of edge)
* ... | ALGO | 0.99893 | 5.545459 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2021-10-22T14:00:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f52a93a228b... |
98543648-6ddd-4da8-a90f-b2c92e097c43 | ishandutta2007/codeforces-s | sirrembocodina/normal/484/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
struct info {
int st, fin, mx;
bool all;
};
info operator+(const info& a, const info& b) {
info res;
res.st = a.st + b.st * a.all;
res.fin = b.fin + a.fin * b.all;
res.mx = max(max(a.mx, b.mx), a.fin + b.st);
res.all = a.a... | ALGO | 0.999997 | 4.242771 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "bbca53b3ba21... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.