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 |
|---|---|---|---|---|---|---|---|
4039eec1-277f-44cd-af5c-74a0990f99d3 | MapBer/MapberTestGithub | shape/shape.cpp | #include <iostream>
using namespace std;
class shape
{
public:
virtual float area() = 0;
virtual float perimeter() = 0;
};
class rectangle : public shape
{
private:
float length;
float breadth;
public:
rectangle(float l, float b)
{
length = l;
breadth = b;
}
float area(... | TOOL | 0.964943 | 4.154119 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-08-01T12:01: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": "cb206f107bbf... |
c48c8dd2-6b85-4566-bcc7-2e9ab129023c | JpGeorgis/Projects | repos/tp/Mean_LBP/Voronoi/mean_lbp.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
Mat MeanLBP(Mat image) {
Mat result = Mat::zeros(image.rows - 2, image.cols - 2, CV_8UC1);
for (int i = 1; i < image.rows - 1; i++) {
for (int j = 1; j < image.cols - 1; j++) {
int lbp = 0;
... | ALGO | 0.998424 | 5.944553 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-10-04T17:38: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": "367ad5fe639... |
276ca183-4b38-430b-a9b9-33898c589a06 | Aphrodicez/POSN | POSN17/Camp3/Dynamic_Programming/Longest_Common_Subsequence/53Asia_Decryption.cpp | /*
Author : ~Aphrodicez
School : RYW
Lang : CPP
Algo : Dynamic Programming [ Longest Common Subsequence ] + Greedy Algorithm
Status : Accepted
*/
#include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define pc(x) putchar(x)
#define dec(x... | ALGO | 0.999786 | 4.032587 | {
"github_metadata": {
"branch": "master",
"commit_count": 270,
"repo_created_at": "2020-11-21T02:11:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74146911... |
5e7f5c01-32da-44b6-a606-8351d512cd5d | athanor/athanor | src/operators/opProd.cpp | #include "operators/opProd.h"
#include <algorithm>
#include <cassert>
#include <unordered_map>
#include "operators/flatten.h"
#include "operators/previousValueCache.h"
#include "operators/shiftViolatingIndices.h"
#include "operators/simpleOperator.hpp"
#include "types/intVal.h"
#include "types/sequenceVal.h"
#include... | ALGO | 0.986731 | 7.224793 | {
"github_metadata": {
"branch": "master",
"commit_count": 1289,
"repo_created_at": "2018-08-31T05:18:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 24,
"pull_requests": 1
},
"file_meta": {
"content_id": "f5f2624... |
be36038c-125f-4011-8c71-4efb81dfa683 | subratamondalnsec/Pw-cpp-code | 18BinarySearchTree/class/04ValidateBSTLeetCode98.cpp | #include <bits/stdc++.h>
using namespace std;
class TreeNode {
public:
int val;
TreeNode* left;
TreeNode* right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
/*class Solution {//bekar method
public:
long long maxTree(TreeNode* root){
if(root==NULL) return LLONG_MIN;
retu... | ALGO | 0.999992 | 6.219924 | {
"github_metadata": {
"branch": "main",
"commit_count": 272,
"repo_created_at": "2024-09-22T18:08: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": "97bd6766b4... |
3f711179-325a-4999-b441-826e27c550bd | sk25469/Interview_Prep | Binary Trees/max_sum_leaf_to_root.cpp | #include <bits/stdc++.h>
#include <queue>
#include <vector>
using namespace std;
class Node
{
public:
Node(){};
int data;
Node *left, *right;
};
Node *newNode(int data)
{
Node *node = new Node();
node->data = data;
node->left = node->right = NULL;
return node;
}
bool printPath(Node *root,... | ALGO | 0.999953 | 5.138146 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-07-18T04:50:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "097d54f7b52... |
18a1b287-631e-4133-a2ba-6cf996ddcacf | sawlani/densest-subgraph | alternate_code/rpv3.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include<cassert>
#include <vector>
#include <queue>
#include<list>
#include <set>
#include<cstring>
#include<ctime>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <iomanip>
using namespace std... | ALGO | 0.999816 | 3.701238 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2019-04-15T18:49:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "732f96f2... |
c28e054c-fc54-40f2-a859-6e474003a1af | IcecreamArtist/CLRS_Algorithms | lab3/russiandoll3.cpp | #include<bits/stdc++.h>
// 树状数组优化:二位偏序
using namespace std;
const int maxn = 5e3 + 3;
vector<pair<int, int> > eve; // 信封
#define h second
#define w first
#define all(x) x.begin(),x.end()
int n;
bool cmp(pair<int, int> a, pair<int, int> b) {
if (a.w == b.w) return a.h < b.h;
else return a.w < b.w;
}
void solv... | ALGO | 0.999935 | 3.667372 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2021-03-25T08: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": "61ed057f0... |
4c4a6bbf-f04d-4452-9ec6-905cc7eaab70 | aftab1038/CS-12th | Past Papers/Model Paper 2023/Q8_a.cpp | // Code by <NAME>
// GitHub : aftab1038
/* 2023 Model Paper Questions
Q8 a. Write a program using a user-defined function named ‘RectVol’ that would calculate the volume of a rectangular prism and invoke it in the main function.
The formula to calculate the volume is given below.
* Volume ... | ALGO | 0.917528 | 4.263645 | {
"github_metadata": {
"branch": "main",
"commit_count": 199,
"repo_created_at": "2023-08-06T07:04: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": "caf349d445... |
b46fc64d-4493-444e-ad11-5337cdc5dcbe | OhmsL4w/SchoolProjects | NewFolder/VS projects (C++)/Section19Challenge(readingfromuserandchecking)/main.cpp | // Section 19
// Challenge 3
// Word counter
#include <iostream>
#include <fstream>
bool find_Word(const std::string& target, const std::string &word_to_find) {
size_t found = target.find(word_to_find);
if (found == std::string::npos)
return false;
else
return true;
}
int main() {
std::... | TOOL | 0.997539 | 4.501062 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-05-21T02:50: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": "9c1580736ac1... |
c3bc069c-f791-41c4-9c1c-5574fad3f5ad | pk1890/mownit | lab2/zad4.cpp | #include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <ctime>
#include <cstdlib>
using namespace std;
class Matrix{
public:
vector<vector<float>> data;
size_t dimX, dimY;
void setVal(size_t x, size_t y, float val){
data[x][y] = val;
}
float getVal(size_t x, size_t y){... | ALGO | 0.999149 | 4.402539 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-03-09T15:35: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": "87153df0e... |
2f9cc410-56b1-42f6-938a-ceadba3d11eb | SQL-JQC/DataStructure | DataStructureSourceCode/查找与排序/线型查找/顺序查找.cpp | # include <stdio.h>
# include <malloc.h>
# include <stdlib.h>
# define N 11
typedef int KeyType;
typedef struct ElemType
{
KeyType key;
} ElemType;
typedef struct SSTable
{
ElemType * elem;
int length;
} SSTable;
# define EQ(a,b) ((a)==(b))
# define LT(a,b) ((a)<(b))
# define LQ(a,b) ((a)<=(b))
void Create_Seq... | ALGO | 0.999984 | 4.325753 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-03-12T15:08:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32603e60f05... |
5cfbc387-2f77-49fc-ac45-ea8bb9e6d015 | nstu-feedback/nstu | semester5/parallel/mpi/task4/main.cpp | #include <algorithm>
#include <chrono>
#include <cstring>
#include <random>
#include <vector>
#include <mpi.h>
#include "my_mpi.hpp"
using namespace std;
using hrc = chrono::high_resolution_clock;
using fdur = chrono::duration<float>;
struct range
{
size_t index;
size_t len;
};
struct comm_stats
{
int... | ALGO | 0.999842 | 4.91715 | {
"github_metadata": {
"branch": "master",
"commit_count": 341,
"repo_created_at": "2021-02-17T08:49:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32c019bea... |
deaa8d49-02c1-46f9-ace3-9bfd4d19b0c2 | lemonadesaltbagel/algorithms | leetcode/489.robot-room-cleaner.cpp | #include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
/*
* [865] Robot Room Cleaner
*
* https://leetcode.com/problems/robot-room-cleaner/description/
*
* algorithms
* Hard (23.43%)
* Total Accepted: 683
* Total Submissions: 2.9K
* Testcase Example:
* '[[1,1,1,1,1,0,1,1],[1,1,1,... | ALGO | 0.999869 | 6.416857 | {
"github_metadata": {
"branch": "master",
"commit_count": 149,
"repo_created_at": "2014-05-01T08:54: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": "31a4d3bb... |
52dbfe13-a35e-4b90-9a79-4f25b9cd63b5 | Sadman-Ishtiak/All-AC-in-Problem-Solving | Vjudge/Long Contest (Div3 Div4) - 5/O_Reading.cpp | #include<bits/stdc++.h>
#define int long long
#define endl '\n'
#define YES cout << "YES" << '\n'
#define NO cout << "NO" << '\n'
#define Yes cout << "Yes" << '\n'
#define No cout << "No" << '\n'
#define ld ... | ALGO | 0.999997 | 3.361197 | {
"github_metadata": {
"branch": "main",
"commit_count": 1517,
"repo_created_at": "2023-09-06T07:29: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": "c7b5e8521... |
caadea1f-539a-4028-ac06-ff3afc21fdf7 | GroupProgrammingProject/GPP | src/phonons.cpp | #include "../include/phonons.h"
void normalmodes(int n,int norbs,double rc,double m,Eigen::MatrixXd* rx, Eigen::MatrixXd* ry, Eigen::MatrixXd* rz, Eigen::MatrixXd* modr, Eigen::MatrixXd* eigvects, std::vector<int>* nnear, Eigen::MatrixXi* inear, std::vector<double>* TBparam){
bool v=0;
int i,j,l,J; //J is inde... | ALGO | 0.999319 | 3.692119 | {
"github_metadata": {
"branch": "master",
"commit_count": 177,
"repo_created_at": "2015-01-22T20:09:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "135c9a650... |
70d55077-f37c-492c-9182-c787d06addef | MaheshAravindV/CP | random/mortal.cc | #include <bits/stdc++.h>
using namespace std; using ll = long long;
#define nl "\n"
template <typename A, typename B>ostream& operator<<(ostream& os, const pair<A, B>& p) { return os << '(' << p.first << ' ' << p.second << ')'; }
template <typename X, typename T = typename enable_if<!is_same<X, string>::value, typenam... | ALGO | 0.999792 | 5.017968 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2021-08-09T13:56: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": "1e0ce2a12cb... |
37e11c18-e2a9-47f8-8d16-7b81c247b3a4 | justnik98/infocomm-toolbox | modulators/modulator.hpp | //
// Created by justnik on 21.04.22.
//
#ifndef INFOCOMM_TOOLBOX_MODULATOR_HPP
#define INFOCOMM_TOOLBOX_MODULATOR_HPP
#include <vector>
#include <complex>
#include <numeric>
#include <cmath>
class Modulator {
private:
constexpr static auto pi = M_PI;
constexpr static auto e = M_E;
static double norma... | ALGO | 0.970423 | 5.964271 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2022-04-17T11:03: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": "866912597... |
6cbcad83-4acd-4059-9f6f-5723bc0008e1 | YejingWang/DataStructure | Source/List.cpp | #include <assert.h>
#include "List.hpp"
#include "util/comparator.hpp"
template <typename T>
void List<T>::init()
{
mHeader = new ListNode<T>;
mTrailer = new ListNode<T>;
mHeader->succ = mTrailer;
mHeader->pred = nullptr;
mTrailer->pred = mHeader;
mTrailer->succ = nullptr;
mSize = 0;
}
te... | ALGO | 0.981064 | 6.125446 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-07-11T14:18: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": "35fa55e25d... |
8013363e-c3c3-47f9-ba5b-ad42a163fd4c | kangyul/LeetCode | Section14_Recursion2/3_checkIfElementIsPresent.cpp | #include <bits/stdc++.h>
using namespace std;
bool isPresent(int a[], int n, int x) {
if(n==0) return false;
if(a[0] == x) return true;
return isPresent(a+1, n-1, x);
}
bool isPresent2(int a[], int n, int x) {
if(n==0) return false;
bool remArr = isPresent2(a+1, n-1, x);
if(remArr) return... | ALGO | 0.999538 | 4.825402 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2021-09-13T20:10:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb162a3c8... |
e15e9cba-b834-47fa-9fea-5b18a848bd47 | avcopan/MPACK | mlapack/library/Rggsvd.cpp | /*
* Copyright (c) 2008-2010
* <NAME>
* All rights reserved.
*
* $Id: Rggsvd.cpp,v 1.3 2010/08/07 04:48:32 nakatamaho Exp $
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of... | ALGO | 0.999847 | 5.636923 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-12-18T18:49:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58e8c83d5... |
7e4b4f87-cd40-4e0f-b813-42fa6dfeb0bf | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1244/Standings3/28897785_62488512.cpp | #include<bits/stdc++.h>
//#define DEBUG
#define FOR(i,n) for(int i=1;i<=n;i++)
#define FORZ(i,n) for(int i=0;i<n;i++)
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define piii pair<pair<int,int>,int>
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define SI... | ALGO | 0.999984 | 3.362051 | {
"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": "0f638bc31... |
31125e1a-f18a-4433-aa1f-eb59dd4eadb4 | SreehariSanjeev04/Algorithms | paranthesis.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
struct Node {
int val;
Node* left;
Node* right;
Node(int value) : val(value), left(nullptr), right(nullptr) {}
};
Node* constructBinaryTree(const string& s, int *start) {
if (s.empty() || *start >= s.size()) return nullpt... | ALGO | 0.999873 | 5.486934 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-06T17:03: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": "ec9a131a8b49... |
afa729f1-38ab-4e96-be60-588bdf397aa2 | mahendra1290/algorithms | graphs/UndirectedGraph.cpp | #include<bits/stdc++.h>
using namespace std;
int GRAPH_MAX_SIZE = 100;
enum VertexAttributes {
WHITE = 0,
GRAY = 1,
BLACK = 2,
NIL = -1
};
class Vertex {
public:
int id;
int color;
int distance;
int predecessor;
int discoveryTime;
int fini... | ALGO | 0.999995 | 5.130557 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-11-05T05:26:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c948c170f... |
6b87828d-bc1e-4447-969c-dbdc2cdbfe9a | iloay/Exercise | cirLinkList.cpp | #include<iostream>
#include<assert.h>
using namespace std;
struct Node{
int data;
Node *next;
Node(){next = NULL;}
Node(int data):data(data){next = NULL;}
};
// n代表节点的个数,k是从第k开始数数,m是数到m就退出循环链表
void countNumber(int n,int k, int m)
{
cout<<"N:"<<n<<" K:"<<k<<" M:"<<m<<endl;
assert(n > 0);
... | ALGO | 0.999526 | 3.369959 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2013-08-27T05:43: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": "d00625739... |
1a8f55a4-958a-45ef-8580-798217948f56 | sendoru/ps-cpp-new | source/boj/5444.cpp | // #include "atcoder/all"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const ll MOD9 = 998244353;
const ll MOD1 = (ll)1e9 + 7;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(null... | ALGO | 0.999991 | 4.812846 | {
"github_metadata": {
"branch": "main",
"commit_count": 130,
"repo_created_at": "2024-04-17T08:42: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": "9c6915ffb9... |
7b80f228-cec1-4c28-a9d6-5b568255720a | vindvaki/libzonotope | include/event_point_2.hpp | #ifndef EVENT_POINT_2_HPP_
#define EVENT_POINT_2_HPP_
#include "standardize_vector.hpp"
#include "linalg.hpp"
#include "hyperplane.hpp"
#include "compare_by_angle.hpp"
#include <algorithm>
#include <vector>
namespace zonotope {
/**
* @brief A structure to order vectors in the plane by angle around the origin.
*/
... | ALGO | 0.940262 | 6.761879 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2013-11-02T04:49:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "934319795... |
3e8ccac9-befc-44a9-9cf4-41a12a765784 | anveshi/Competitive-Programming | codeforces/69-A/69-A-12417572.cpp | /*
When things go wrong,
As they sometimes will,
When the road you're trudging seems all uphill,
When the funds are low and the debts are high,
And you want to smile, but you have to sigh,
When care is pressing you down a bit
Rest if you must, but don't you quit.
Life is queer with its twists and turns,
As every one of... | ALGO | 0.999234 | 4.322342 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-02-12T06:24: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": "fbe216db45... |
2b0420ee-3da2-42ad-9f61-86006c5c70a0 | IvanYakimtsov/Sem2 | aois7/main.cpp | #include <iostream>
#include <bitset>
#include <vector>
#include <random>
#include <algorithm>
#include <sstream>
#include <windows.h>
#include <conio.h>
using namespace std;
const int m = 8;
const int n = 8;
bool compare(vector<bool> a, vector<bool> s);
int convertBinaryToDecimal(long long n)
{
int decimalNumber = 0... | ALGO | 0.999559 | 3.921127 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2016-05-26T17:56: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": "ef6ff1d60... |
4e8901cc-3dc2-4595-91c4-e3a97c03add4 | oasis-t/School-Homework- | DS_CH10_2.1/DS_CH10_2.1/源.cpp | #include<stdio.h>
#include<stdlib.h>
#define Maxsize 100000
typedef struct entry
{
int key;
int data;
}Entry;
typedef struct sl
{
int n;
Entry D[Maxsize];
}sl;
void InsertSort(sl* sl)
{
int i, j; //i标识待插入元素下标
for (i = 1; i < sl->n; i++)
{
Entry insertI... | ALGO | 0.999576 | 3.111055 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-07-02T05:47: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": "6f03c8ba62... |
d9ed6a33-f295-4c7b-ad07-3999b76a6cde | pippi0057/Competitive-Programming | JOI/2022-2次予選/B.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll int64_t
#define u32 uint32_t
#define u64 uint64_t
constexpr ll inf = 1e17;
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
#define pii pair<int,int>
#define pll pa... | ALGO | 0.999949 | 4.265614 | {
"github_metadata": {
"branch": "master",
"commit_count": 452,
"repo_created_at": "2020-11-28T14:59:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74735cf6... |
987fe325-c0fd-4a2b-8ee5-1d436417d0a1 | ironque/data-structure | LinkList.h | #ifndef MAIN_CPP_LINKLIST_H
#define MAIN_CPP_LINKLIST_H
#include <iostream>
template <typename Type>
class LinkList {
struct Node{
Type data;
Node* next;
Node():next(nullptr){};
explicit Node(const Type& data,Node* next= nullptr):data(data),next(next){};
~Node()= default;
... | ALGO | 0.985984 | 4.557644 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-10-04T09:22:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d80d1e29d... |
b5c09363-26ed-4283-a10e-391b673f9350 | alexandraback/datacollection | solutions_5769900270288896_1/C++/sh1p23/2.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAX 1111111
#define gi(n) scanf("%d",&n)
#define gl(n) scanf("%lld",&n)
#define pi(n) printf("%d\n",n)
#define pl(n) printf("%lld\n",n)
#define all(c) c.begin(), c.end()
#define MOD 1000000007
#define M_PI 3.14159265358979323846
#define tr(v, it) for(typeof(v.begin(... | ALGO | 0.999511 | 3.958846 | {
"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": "c04a0686d... |
6f902877-9fe4-4f89-b6e2-3ec069a8df5b | JeongbinPark/ProblemSolving_BOJ | 1790_WritingNumbersWithoutWhitespace.cpp | /*
메모리 초과
#include <iostream>
#include <string>
using namespace std;
int main() {
string str;
int N, k;
cin >> N >> k;
for (int i = 1; i <= N; i++)
str += to_string(i);
if (str.size() < k) cout << -1;
else cout << str[k - 1];
return 0;
}
*/
/* 시간 초과
#include <iostream>
#include <string>
using namespace std;... | ALGO | 0.999861 | 4.308056 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2021-01-21T11:34:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c37dd027d... |
ba070e0a-fad8-4bce-bef4-f0f93562825b | Starlight0798/NKU-share | 编译原理/实验/Lab5/src/IRBlockMerge.cpp | #include "IRBlockMerge.h"
#include <unordered_set>
#include <vector>
using namespace std;
void BlockMerge::execute() {
for (auto func = unit->begin(); func != unit->end(); func++){
findBLocks(*func);
}
}
// 查找可以合并的块
void BlockMerge::findBLocks(Function *func) {
for (auto bb : func->getBlockList(... | ALGO | 0.99148 | 5.21269 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-12-23T05:52:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 84,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ab8f9f8c7... |
27bb07ef-f58b-489e-b36f-1300798fea1d | kieme/dainty_dacli | dainty_dacli.cpp | /******************************************************************************
MIT License
Copyright (c) 2018 kieme, <EMAIL>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restric... | TOOL | 0.957001 | 7.11563 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-06-18T14:52: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": "0331b0f78... |
6e6f7584-6022-4271-b98f-8985029115a8 | PeiqiXu/Coursework | C++Project/mp_miniproject/gradient.cpp | #include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <iostream>
#include <random>
#include <unordered_map>
#include <utility>
#include "main.h"
typedef std::vector<std::pair<double, std::string> > vector;
double parse_t(const char ** strp,
std::hash<std::string> & str_h... | ALGO | 0.999688 | 4.268185 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-03-27T18:46: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": "1e6d8ec672... |
75aedd81-3adb-460a-9119-a5154c326887 | GauravUpreti893/LeetCode | 234-palindrome-linked-list/234-palindrome-linked-list.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:
bool isPalindrome(Lis... | ALGO | 0.99953 | 6.068887 | {
"github_metadata": {
"branch": "main",
"commit_count": 4576,
"repo_created_at": "2022-02-01T16:25: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": "d0e52c058... |
0186a6f6-6946-4649-a04f-fea8fe9eabc6 | Chanwoongs/Algorithm_Studies | SelfSoving/Debuging/Debuging/16118_Moon_Fox.cpp | #include <iostream>
#include <vector>
#include <tuple>
#include <queue>
using namespace std;
const int INF = 987654321;
int n, m, a, b, d, res, here, cnt, dist[4001], dist_wolf[4001][2];
vector<pair<int, int>> adj[4001];
void dijkstraFox()
{
fill(dist, dist + 4001, INF);
priority_queue<pair<int, int>, vector<pair... | ALGO | 0.999954 | 3.899591 | {
"github_metadata": {
"branch": "main",
"commit_count": 529,
"repo_created_at": "2023-01-03T13:30: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": "1179252021... |
3575aa05-1b8e-4769-acb3-c6897081da55 | deandalianis/blake-rainbow-tables | rainbow_table_generator/reduce/reduction_function.cpp | #include <cstdlib>
#include <cstdio>
#include "reduction_function.h"
#include "../info.h"
char rcharSet[charSetLen] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n',... | ALGO | 0.998983 | 3.261521 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-01-24T11:45:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5077abb1f... |
14745f6a-d0ac-4dbd-b60c-5c183025c7c7 | josushell/Object-oriented-programming | 객프 LAB/LAB09/ex4/ex4.cpp | #include <iostream>
using namespace std;
class Stack {
private:
int* p_list;
int size;
int MAX_SIZE;
public:
Stack(int _max_size = 1000) :MAX_SIZE(_max_size),size(0) {
p_list = new int[MAX_SIZE];
};
~Stack() {
delete[] p_list;
}
int find_index(int _item) {
for (int i = 0; i < size; i++) {
if (p_list[... | ALGO | 0.91316 | 4.400263 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-05-24T14:49: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": "5a0780abb... |
e22a4754-0848-4937-9205-e69c422c1297 | johnklima/ZShadeSandbox | Framework/Physics/Collision/GJK.cpp | #include "GJK.h"
//==============================================================================================================================
//==============================================================================================================================
GJK::GJK(EngineOptions* eo)
: m_EngineOption... | ALGO | 0.999868 | 3.886716 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2015-08-19T10:13:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6608f7244... |
33784ca4-d003-423f-acf2-00406297fa01 | sanesedu/CompetitiveProgramming | uva/369a/prev.cpp |
#include <bits/stdc++.h>
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fori(i, n) for(int i = 0; i < (int)(n); ++i)
#define forid(i, n) for(int i = (int)(n) - 1; i >= 0; --i)
#define forl(i, n) for(long long i = 0; i < (long long)(n); ++i)
#define forld(i, n) for(long long i = (long long)(n) - 1;... | ALGO | 0.999933 | 5.219259 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2020-06-23T16:29: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": "35d1f5e64... |
7a0747d1-6249-4fcc-846e-c4670b805654 | EmeraldMath/DataStructureAndAlgorithmExercise | AlgorithmAndProgrammingInC++Exercises/longstcommonseq/lcs.cc | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
int* A = new int[n];
int* B = new int[n];
int** M = new int*[n+1];
for (int i = 0; i < n+1; ++ i) {
M[i] = new int[n+1];
for (int j = 0; j < n+1; ++ j)
M[i][j] = 0;
}
for... | ALGO | 0.999928 | 3.653427 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-03-13T02:39: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": "ced0da688... |
c2c20983-dc70-48d7-9cc8-384ba000e839 | FabioHAraujo/ScienceComputerDegree | C++/31-08-22/exec19.cpp | #include <iomanip>
#include <iostream>
using namespace std;
int main ()
{
double idade=0, peso=0, totalIdade=0, count20=0, media=0, countCria=0;
while (idade>=0)
{
cin >> idade;
cin >> peso;
if (idade<20 && idade>0)
{
media+=peso;
countCria++;
... | TOOL | 0.954979 | 3.129924 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2022-08-11T21:17: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": "0fddc5ca8d1... |
100e8801-eabe-4aa9-8aba-4d8c4f83d497 | ishandutta2007/codeforces-l | linkus/normal/653/B.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define all(a) begin(a),end(a)
#define FOR(x,val,to) for(int x=(val);x<int((to));++x)
#define FORE(x,val,to) for(auto x=(val);x<=(to);++x)
#define FORR(x,arr) for(auto &x: arr... | ALGO | 0.999522 | 3.581951 | {
"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": "5cad198796c1... |
6f7e4558-4feb-4d1b-a290-b0dc8af143f9 | ishandutta2007/codeforces-k | krijgertje/normal/1623/C.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
#include <list>
#include <cassert>
#include <climits>
#inclu... | ALGO | 0.999753 | 3.718165 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "508873ee87ed... |
860a59be-933f-4c4e-a5e2-fae1e04e0fc8 | leesimond/GoogleCppClass | GettingStartedEx5.cpp | #include <iostream>
using namespace std;
int reverse(int number) {
int reverse_num, temp_num, result = 0, count = 1;
// get number of digits n in the form 10^(n-1)
temp_num = number;
while (number > 10) {
number /= 10;
count *= 10;
}
number = temp_num;
while (number > 0) {
temp_num = number % 10;
number... | ALGO | 0.999707 | 3.877403 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-10-08T22:36: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": "6de6923399... |
83636ab0-43b1-4b12-9b32-b36f7bfeeb75 | TommyHek/LeetCode | week 13/316.remove-duplicate-letters.cpp | /*
* @lc app=leetcode id=316 lang=cpp
*
* [316] Remove Duplicate Letters
*/
// @lc code=start
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
string removeDuplicateLetters(const string& s) {
const int N = s.size();
// Create a vector to store the last position ... | ALGO | 0.99988 | 7.209275 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-03-03T05:56: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": "4cee71ad278... |
71893d34-3646-4dc8-924b-1eb7fea5eef1 | ayahamadaahmed/C-Programming | Fibonacci .cpp | #include <iostream>
using namespace std;
int fib (int n )
{
if ( n == 0)
{
return 0;
}
if ( n == 1 )
{
return 1;
}
return fib (n-1) + fib (n-2);
}
void fillfibonacciArray (int *arr,int n)
{
for (int i = 0 ; i < n ; i++ )
{
arr[i] = fib(i);
}
}
int main()... | ALGO | 0.999743 | 3.825315 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2024-09-04T21:35:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff4d9d63d0a... |
d25b8671-b69a-4670-a091-93f287950588 | ishandutta2007/codeforces-g | gazelle/normal/1439/B.cpp | #include <bits/stdc++.h>
#define FOR(i, n, m) for(ll i = (n); i < (ll)(m); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define pb push_back
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
constexpr ll inf = 1000000000;
constexpr ll mod = 1000000007;
c... | ALGO | 0.999915 | 4.267078 | {
"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": "9891d59c8e27... |
dbedaed1-7e8f-46ad-acd3-a3f63a2dd734 | krishshanmukh/NITW-Assignments | DS/Tree/inorder.cpp | #include<iostream>
using namespace std;
struct btree
{
btree *lchild;
char data;
btree *rchild;
};
class stack
{
int top;
btree *elts[30];
int size;
int tag[30];
public :
void push(btree *T);
btree* pop();
void display();
int isempty();
stack()
{
top=-1;
}
};
btree* stack :: pop()
{
if(to... | ALGO | 0.999854 | 3.815755 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-09-19T06:14:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41ee1aee45... |
42856384-e90e-4f5e-8d1f-90bec275128b | Bardo91/BOVIL | tests/algorithms/machineLearning/topicModeling/lda/test.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// BOViL: Bardo Open Vision Libraries
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
#include <algorithms/machine_le... | DATA | 0.956921 | 6.576373 | {
"github_metadata": {
"branch": "master",
"commit_count": 476,
"repo_created_at": "2014-02-19T11:02:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "d560954d... |
e43a4437-5188-4fb0-b621-ce4aa5fd61cb | RAFNEE/DS-Project | BpTree-Project/SelectionTree.cpp | #include "SelectionTree.h"
bool SelectionTree::Insert(LoanBookData* newData) {
if (newData == nullptr) return false; // if the data is null, return false
// if root is null, create a new data node and set it as the root
if (root == nullptr) {
root = new SelectionTreeNode();
root->set... | ALGO | 0.9804 | 3.061182 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-12-10T15:09: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": "bde9a8ff99e... |
59793fab-a75c-4de0-8cce-e4357945fd4d | jerry-xon/ThinkDSA | HackerRank Class/Unique_Divide_And_Conquer.cpp | #include <iostream>
#include <vector>
#include <cassert>
using namespace std;
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define trav(a, x) for (auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
ll mod... | ALGO | 0.99999 | 4.394644 | {
"github_metadata": {
"branch": "main",
"commit_count": 133,
"repo_created_at": "2024-07-29T03:10:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ed42d8f9... |
157f0d15-b19d-48d6-9d3f-b441ed89580c | theshameem/OJ-Solve | UVA/uva10281/uva10281.cpp | /*
Solved!
Time: 06:00:01 PM
Date: 11-08-18
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
string time;
ll len, temp = 0, total_times, prev_times = 0, i;
double dis = 0, sp... | ALGO | 0.998789 | 3.820489 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2018-05-14T09:04: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": "c961e3a99... |
769043a1-ab63-4d61-b7ee-65c370d132d8 | chrisboban/cdfrcs_codes | quickSort.cpp | #include <iostream>
using namespace std;
void quicksort(int a[], int l, int h);
int partition(int a[], int l, int h);
int partition(int a[], int l, int h){
int pivot = a[h];
int i = l-1;
for(int j = l; j < h; j++){
if(a[j] <= pivot){
i++;
int temp = a[j];
a[j] =... | ALGO | 0.999991 | 5.517045 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-10-22T12:31: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": "a7ab0abfd7f... |
40937bdc-a1f0-4cad-887a-bd9344f89901 | HoVanThanhMinh/DSA_PTIT | dsa2023.cpp | //#include <iostream>
//#include <vector>
//#include <string>
//#include <algorithm>
//using namespace std;
//
//void backtrack(vector<string>& names, int k, vector<string>& current) {
// if (current.size() == k) {
// for (const string& name : current) {
// cout << name << " ";
// }
// ... | ALGO | 0.999988 | 4.236135 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-08-10T06:08: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": "4c23ba9af16f... |
63d9323d-2e21-40d7-a099-d9277b590d30 | cran/RprobitB | src/gibbs.cpp | // [[Rcpp::depends("RcppArmadillo")]]
#include <RcppArmadillo.h>
#include <stdio.h>
#include <float.h>
#include <Rmath.h>
#include <math.h>
#include "distributions.h"
#include "truncated_normal.h"
#include "class_update.h"
using namespace arma;
using namespace Rcpp;
//' Update class weight vector
//' @description
//' ... | ALGO | 0.999543 | 4.334816 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-05-15T15:47:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc9f9b18812... |
c846cf9b-838c-451e-aa28-699e77f8c0b0 | belwariars/Binary_Search_Tree | BST_from_PreOrder.cpp | // Lowest Common Ancestor...
#include <bits/stdc++.h>
using namespace std;
struct node
{
int data;
struct node* left;
struct node* right;
};
struct node* createnode(int data)
{
struct node* temp = (struct node*)malloc(sizeof(struct node));
temp->data = data;
temp->left = NULL;
temp->right = NULL;
return t... | ALGO | 0.999999 | 5.240873 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-01-11T11:27: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": "f132d4338... |
ebf0af29-95fb-459d-8879-287b48cec91f | tszxtentacion/Algorithm-Cluttered-and-Primary- | NUIST_OJ/P1797.cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int N = 100010;
int n, a[N], b[N], ans;
int main()
{
cin >> n;
for (int i = 0; i < n; i++)
scanf("%d", &a[i]);
for (int i = 0; i < n; i++)
scanf("%d", &b[i]);
sort(a, a + n), sort(b, b + n);
int s1 = 0, t1 = n - 1, ... | ALGO | 0.999929 | 3.261527 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2022-03-17T13:21: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": "4b9cbfa668b... |
d09278e9-e5e0-4628-a73f-6e42e31abe63 | dani-tro/DAA_practicum_23_24 | Exam 2/students-solutions/balulov/flowers_04_30p.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
const int MAX = 20000;
vector<long long int> friends[MAX];
vector<long long int> graph[MAX];
bool visited[MAX];
bool fin;
long long int k, c, f;
void dfs(vector<long long int> gr[], long long int start, long long int curr, int count) {
f... | ALGO | 0.999835 | 4.42875 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2024-02-16T11:05:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73bacaf3614... |
d13a89f1-427a-4ce1-b001-9265d8d804ab | Awee3/Game-Project | PROJECT GAME/main.cpp | #include <conio.h>
#include <graphics.h>
#include <stdlib.h>
#include <iostream>
#include <windows.h>
#include <mmsystem.h>
void jet(int x,int y,float s);
void bullet(int xb,int yb,float s);
void warShip(int xw,int yw,float s);
void intro();
void pembatas();
void play();
void tutor();
void credit();
void mainMenu();
v... | ALGO | 0.992815 | 3.433174 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-01-21T13:42: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": "8de9a676f971... |
9ec2f3b3-7e3a-4819-929f-e5398ccdca72 | akhileshzmishra/Clustering | EMClustering.cpp | #include "StdAfx.h"
#include "EMClustering.h"
#include <cmath>
#include <cstdlib>
#include <random>
#include "KMean.h"
const double IPI = 3.14152;
EMClustering::EMClustering(vector<EMPoint<double> > points, int numofClusters, int numitr):
_numClusters(numofClusters),
_mean(numofClusters),
_coVariance(numofClusters),
... | ALGO | 0.99989 | 3.421499 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-06-11T23:13: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": "6746a7b504... |
73e15a36-3faa-403f-8e70-cbc0c1b34724 | teominsukim/Algorithm | 백준/Platinum/14444. 가장 긴 팰린드롬 부분 문자열/가장 긴 팰린드롬 부분 문자열.cc | #include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<int> p;
string changeString(const string&input){
int len = input.length();
vector<char> line;
string result;
for (int i = 0; i < len; i++)
{
line.push_back('#');
line.push_back(input[i]);
}... | ALGO | 0.999964 | 4.420916 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2024-06-23T09:13: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": "ae83e7c3b8e... |
270d4426-ba51-4955-8776-1a33b27e8dd9 | Beau-Will/cpp_project | compititions/牛客比赛/2025牛客寒假算法基础集训营4/D.cpp | // Problem: Tokitsukaze and Concatenate Palindrome
// Contest: NowCoder
// URL: https://ac.nowcoder.com/acm/contest/95336/D
// Memory Limit: 512 MB
// Time Limit: 4000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
using i64 = long long;
void solve(){
int n,m;std::cin >> n >> m;
... | ALGO | 0.999993 | 4.227837 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2025-03-28T03:24: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": "365d88bebb1... |
bc94037c-625b-4ec8-b493-e41d3926d27f | niteshkumartiwari/daily-competitive-programming | Graph12-Cut Off Trees for Golf Event.cpp | /*
You are asked to cut off trees in a forest for a golf event. The forest is represented as a non-negative 2D map, in this map:
0 represents the obstacle can't be reached.
1 represents the ground can be walked through.
The place with number bigger than 1 represents a tree can be walked through, and this positive numb... | ALGO | 0.999962 | 5.062731 | {
"github_metadata": {
"branch": "master",
"commit_count": 195,
"repo_created_at": "2019-08-28T16:49:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65024add... |
42a41fd4-8f56-4f4e-9b18-0947f76bc435 | PaddlePaddle/Paddle | paddle/phi/kernels/cpu/adamw_kernel.cc | // Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
//
// 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... | TOOL | 0.982082 | 7.442429 | {
"github_metadata": {
"branch": "develop",
"commit_count": 54743,
"repo_created_at": "2016-08-15T06:59:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23037,
"forks": 5770,
"issues": 1009,
"pull_requests": 823
},
"file_meta": {
"content_... |
e4e0ea2e-6056-4051-8a82-42d7132ee6f3 | MarcelPratikto/CS-230-Encapsulation-Design | 230.06.CppTemplate/template.h | /*************************************************************
* 1. Name:
* <NAME>
* 2. Assignment Name:
* Practice 06: Templates
* 3. Assignment Description:
* Find the biggest element in an array, and a stack data structure.
* 4. What was the hardest part? Be as specific as possible.
* fig... | ALGO | 0.988485 | 5.555469 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-21T18:46: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": "c969ff712a80... |
d0026e19-ba56-4932-a680-51a960b679b6 | Stirling75/QFT | PCVC/FFT2M.cpp | #include <tfhe/lwe-functions.h>
#include <tfhe/tfhe.h>
#include <tfhe/tfhe_core.h>
#include <tfhe/tfhe_io.h>
#include <stdio.h>
#include <time.h>
#include <iostream>
#include <fstream>
#define _USE_MATH_DEFINES
#include <math.h>
#define K 9
#define M 100
#define ABSCALE pow(2., 5)
#define M_SLOT 700
#define C_NUM 13... | ALGO | 0.993728 | 3.507929 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-11-03T11:15: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": "b081e051fdc5... |
472ee639-a8f9-4f5f-88cc-e87ebe5e58cb | vancegroup-mirrors/sofa-framework | Sofa/extlibs/CGoGN/include/Algo/Decimation/edgeSelector.hpp | /*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2013, IGG Team, ICube, University of Strasbourg ... | ALGO | 0.998927 | 4.893984 | {
"github_metadata": {
"branch": "master",
"commit_count": 2616,
"repo_created_at": "2013-03-26T20:22:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46608861... |
82c94340-5398-46dc-abf5-abbfeb4a5de6 | yaomthu/leetcode | h_index.cpp | /**
* H index
* Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.
According to the definition of h-index on Wikipedia: "A scientist has index h if h of his/her N papers have at least h citations each, and the other N − h paper... | ALGO | 0.999959 | 5.372684 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-05-07T19:22: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": "fdf29d19e2... |
aa3ae542-9736-4385-a91f-648da0f073c4 | ldcduc/leetcode-training | cpp/remove-duplicates-from-sorted-list-ii.cpp | /* Problem url: https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii
* Code by: ldcduc
* */
/* Begin of Solution */
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nu... | ALGO | 0.999983 | 6.438814 | {
"github_metadata": {
"branch": "master",
"commit_count": 321,
"repo_created_at": "2020-06-12T07:25:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9ace536... |
95e2aac5-be7f-441a-a723-f9d2d1a01c93 | Schrodington/Schrowork | primefactors.cpp | //计算给定范围内质因数之和为质数的数,并列出,说明共有多少个
//一个数可分为几个不同的质因数的乘积,如:10=2×5;90=2×3×3×5
//主要思想:(1)将获得的数先迭代除以最小质因数2,所得的商再迭代除以从2到商的范围内的次小质因数,
// 依此类推,直到从2到所得商的范围内不再有质数;(2)将每个质因数与其相应的迭代次数相乘并求和得质因数之和;
// (3)验证质因数之和是否是质数,是质数则输出原数及其质因数之和,并累积个数。
#include<iostream>
using namespace std;
bool Prime(int f) //布尔函数,判断质因数之和是否为质数
{... | ALGO | 0.99926 | 3.668536 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-10-06T07:41:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58eacab2f... |
c5cc3385-9648-413b-90d5-f2d7c011cb20 | dmireckid/CS225 | mp4/imageTraversal/ImageTraversal.cpp | #include <cmath>
#include <iterator>
#include <iostream>
#include "../cs225/HSLAPixel.h"
#include "../cs225/PNG.h"
#include "../Point.h"
#include "ImageTraversal.h"
/**
* Calculates a metric for the difference between two pixels, used to
* calculate if a pixel is within a tolerance.
*
* @param p1 First pixel
* ... | ALGO | 0.972372 | 4.568047 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2020-06-07T23:08: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": "5ce471f2... |
9f18aa93-dbdd-49aa-b7e6-cda5848196da | Akiko0210/Competitive-programming | codeforces/contest/965/C.cpp | #include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ss second
#define ff first
#define pb push_back
#define pii pair<int, int>
#define INF INT_MAX
using namespace std;
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr <... | ALGO | 0.999973 | 3.897357 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-01-11T06:51: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": "f5048ef52258... |
a46d752b-1692-4a7b-95a6-3612090da61f | dmhiggs/bitmanipulation | squareroot.cpp | //returns floor of square root if not an integer
int mySqrt(int x) {
if (x < 2) return x;
uint64_t mult = 0;
int count = 0;
//have mult start with half the bits of the other, if that's 0 or odd, then +1 bits
while ((x >> (31 - count) & 1u) == 0) count++;
count = (32 - count)/2 - ((count+1) % 2);
//set ... | ALGO | 0.999896 | 4.409897 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2020-11-24T23:54:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "103f1524c8e9... |
0ad8b936-2adb-4f3d-a4c5-63a117291985 | CGAL/cgal | Algebraic_kernel_for_circles/include/CGAL/Algebraic_kernel_for_circles/internal_functions_comparison_root_for_circles_2_2.h | // Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : <NAME>, <NAME>, <NAME>
// Partially supported by the IST Programme of the ... | ALGO | 0.99944 | 6.269813 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
181241f5-ab25-4983-928d-fd4441f9d2b4 | luoshunchong/Cplusplus-Leetcode | Leetcode/4.median-of-two-sorted-arrays.cpp | // @before-stub-for-debug-begin
#include <vector>
#include <string>
#include "commoncppproblem4.h"
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode id=4 lang=cpp
*
* [4] Median of Two Sorted Arrays
*/
// @lc code=start
class Solution {
public:
/*
使用归并的方式,合并两个有序数组,得到一个大的有序数组。
大... | ALGO | 0.999995 | 6.499564 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2021-06-17T02:48: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": "1699230698... |
3b2dd198-805f-4ae3-8e9a-b6b6b929ffbc | AngeloRendiniello/optical_flow_ACA---PARALLELIZZATO | main.cpp | #include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <math.h>
#include <fstream>
#include <string>
#include <stdio.h>
#include <iostream>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
using namespace std;
/* 2-D convolution */
int convolution(Mat filter_mask, Mat points)
{
... | ALGO | 0.997296 | 3.73494 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-06-21T21: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": "220b869138... |
7a5c4fb9-0c82-4e8a-bf36-4c6fa9cef351 | ShriprasadB/Visual-Information-Processing-3 | compression/3.cpp | #include<iostream>
#include<opencv2/opencv.hpp>
#include<math.h>
#define PI 3.141592653
#define N 8
using namespace std;
using namespace cv;
double alpha(int i)
{
if (i == 0)
return (1 / sqrt(2));
return 1;
}
//cosine values
float cosineY(int i, int x)
{
return cos((2 * x + 1) * i * PI) / (2 * 8);
}
float cos... | ALGO | 0.993068 | 4.057026 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-01-02T04:10:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06a082030a... |
3df57b00-a894-4ee7-8ff0-36a8fefbcfa5 | Thalisson-Alves/Competitive-Programming | submissions/CSES/creating-strings.cpp | #include <bits/stdc++.h>
using namespace std;
#define dff(x) " [" #x "]: "
#define df(x) dff(x) << (x)
#define dfn(x) df(x) << '\n'
#define dfv(_x) dff(_x); for (auto _y: _x) cerr << _y << ' '; cerr << '\n';
#define all(x) x.begin(), x.end()
using ll = long long;
using ii = pair<int, int>;
template<typename T=int> i... | ALGO | 0.999885 | 4.34247 | {
"github_metadata": {
"branch": "main",
"commit_count": 1114,
"repo_created_at": "2023-05-15T00:16:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c49c934b7... |
5a2a0989-e373-4e9a-8d2f-7f3bbfb4a7bf | AleXamuel/Proyecto-Nestor | Algoritmos/C++/Grafos/PrimDenseGraph.cpp | //O(n^2)
using namespace std;
#include <bits/stdc++.h>
#define all(A) A.begin(), A.end()
#define For(i, k, n) for (int i = k; i < n; i++)
#define ln "\n"
#define ll long long
#define ull unsigned long long
const int MAXN;
int n;
double d[MAXN];
bool visited[MAXN];
double prim() {
d[0] = 0;
double ans = 0;
... | ALGO | 0.999933 | 3.398002 | {
"github_metadata": {
"branch": "main",
"commit_count": 852,
"repo_created_at": "2024-01-27T19:31:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f72b74a5c... |
b1d0e89b-13c7-4c31-9e85-0448ba302b46 | Jenny-Oh/Algorithm_Study | SWEA_1211_Ladder2.cpp | /*
DFS + 최소 경로 찾기
*/
#include<stdio.h>
#include<string.h>
#define MAX 100
int min, start;
int ladder[MAX][MAX];
int visit[MAX][MAX];
int dir[3][2] = {{1,0},{0,-1},{0,1} }; // 하좌우
int cur; // 경로 횟수
int flag; // 끝까지 도착여부
void DFS(int row, int col) {
//printf("row = %d col = %d \n", row, col);
visit[row][col]... | ALGO | 0.999714 | 3.206802 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2020-12-10T03:50:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf22487904d... |
e7192ba5-320b-458e-baf7-ac431f81d411 | iamzaidsoomro/Robert-Lafore-Exercises | chapter 4-struct/chapter 4 task11.cpp | /*
<NAME>fore chapter 4
Task 9(Build structure time to store hours , minutes and seconds then show sum of time)
by <NAME>(20SW046)
*/
#include <iostream>
using namespace std;
struct time{
int hours;
int minutes;
int seconds;
};// three members one will store hours other will minutes and last will store seconds
... | ALGO | 0.992644 | 3.930932 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2021-03-07T15:53:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a06d12446b... |
faf3d2d3-2bed-4305-980f-4f88333c285a | mascai/exercise | 4_stacks/Generate_all_Parentheses.cpp | /*
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not.
Return 0 / 1 ( 0 for false, 1 for true ) for this problem
*/
int Solution::isValid(string... | ALGO | 0.966735 | 4.170713 | {
"github_metadata": {
"branch": "master",
"commit_count": 485,
"repo_created_at": "2017-06-22T14:58:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "917fe9bb... |
db958f66-797d-4eb9-aa88-d748af10e7f4 | ishandutta2007/codeforces-k | kan/normal/562/D.cpp | #include <bits/stdc++.h>
using namespace std;
#define re return
#define fi first
#define se second
#define sz(x) ((int)x.size())
#define all(x) x.begin(), x.end()
#define fill(x,y) memset(x,y,sizeof(x))
#define mp make_pair
#define pb push_back
#define j0 j237849523
#define j1 j5435324
#define y0 y2543
#define y1 y54... | ALGO | 0.99992 | 4.271509 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3514acb4dab6... |
2fce7d21-ccd8-4637-9988-f71f1e2a8747 | Pavelius/fallout2x | fallout2/terrain.cpp | #include "main.h"
const int chance_alternate_tile = 10;
bool terrain::have(short v) const {
if(isalternate(v))
return true;
for(auto i : blocks) {
if(i == v)
return true;
}
return false;
}
short terrain::random() const {
if(alternate[0] && d100() < chance_alternate_tile) {
adat<short, 4> source;
for(... | ALGO | 0.978758 | 4.844519 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2022-06-13T14:58: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": "bf7c8d7a... |
1bb7ae76-21e5-4605-bbe2-dffb8e9bbd30 | Foolock/routing_QKD | baseline_1TN/node.hpp | #include <vector>
struct Qubit {
// if a qubit is connected with an inter link, available = true
bool available = false;
// the index of qubit this qubit is linked to
int to = -1;
};
struct Node {
// node role: 0 = router, 1 = Alice, 2 = Bob, 3 = TN
// At default, a node is a router
int role = 0;
... | ALGO | 0.998349 | 3.860489 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2023-03-23T20:52: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": "9532dee5484... |
1b25f7a2-e6b7-4af4-952c-d37d2288284c | hill2hill/Algorithm | LeetCode/C++/71.简化路径[M].cpp | /*
* @lc app=leetcode.cn id=71 lang=cpp
*
* [71] 简化路径
*
* https://leetcode-cn.com/problems/simplify-path/description/
*
* algorithms
* Medium (37.79%)
* Likes: 118
* Dislikes: 0
* Total Accepted: 30.8K
* Total Submissions: 79.4K
* Testcase Example: '"/home/"'
*
* 以 Unix 风格给出一个文件的绝对路径,你需要简化它。或者换句话说... | ALGO | 0.999474 | 5.175536 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2019-12-09T12:45: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": "4cdfecf9d... |
513ad441-ca3d-4be3-8b0c-654b8892da0c | CGAL/cgal | Bounding_volumes/include/CGAL/rectangular_p_center_2.h | // Copyright (c) 1998-2003 ETH Zurich (Switzerland).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : <NAME> <<EMAIL>>
#ifndef CGAL_RECTANGULAR_P_CENTER_2_H
#define CGAL_RECTANGULA... | ALGO | 0.999741 | 6.784231 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
a4f6e439-06f0-4d89-a588-41a8a763abaf | Donglidishu/Cpp_Beginner_Tutorial | Part1_C++基础编程/71.结构体案例2.cpp | #include <iostream>
#include <string>
using namespace std;
struct Hero
{
string name;
int age;
string gender;
};
void bobbleSort(Hero heroArray[5], int len)
{
for (int i = 0; i < len - 1; i++)
{
for (int j = 0; j < len - i - 1; j++)
{
if (heroArray[j].age > heroArray[j ... | ALGO | 0.995054 | 4.390958 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2024-10-11T05:01:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e767ea9c47... |
5da2871a-6e58-43ab-bbda-ced9c61ecbf8 | BrandonZu/LeetCode | C++/3rd_072021-102022/229_MajorityElementII.cpp | //
// Created by BrandonZu on 2/16/22.
//
#include "common.h"
// Runtime 20ms(>45%) | Memory Usage 15.9MB(>20%)
class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
vector<int> res;
int num1, num2;
int cnt1 = 0, cnt2 = 0;
for(int num: nums) {
if(num... | ALGO | 0.999979 | 5.890441 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2021-07-09T15:06: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": "4bc6a821... |
1d9eab25-4f10-4581-a878-01f6791439c1 | wmacevoy/grit | drivers/dynamixel/src/RevolutionTest.cpp | #include <iostream>
#include <termio.h>
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <ctime>
#include <memory>
// #include "DynamixelDriver.h"
#include "CreateZMQServoController.h"
using namespace std;
const char *ME = "tcp://*:5502";
const char *SERVER = "tcp://192.168.2.113:5500";
class MyContr... | TOOL | 0.90699 | 3.330865 | {
"github_metadata": {
"branch": "master",
"commit_count": 1642,
"repo_created_at": "2014-08-29T00:34:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ade39ab... |
d8ddf3b7-c3a4-48d5-8664-68f1ae4d7d43 | EunTilofy/ACM-code | 2022-summer/personal/0710/fact.cpp | #include<bits/stdc++.h>
using namespace std;
inline long long read() {
long long x = 0, f = 1;char ch = getchar();
while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
while(ch <='9' && ch >='0') {x = (x << 1) + (x << 3) + ch - '0'; ch = getchar();}
return x * f;
}
bool mk[100000005];
int... | ALGO | 0.999848 | 4.111862 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2022-09-12T07:31: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": "c4b191eaa8... |
04165669-e5b0-4360-90e2-041e7885c7d6 | blmarket/icpc | 2020/R1C/B.cc | #include <iostream>
#include <functional>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <numeric>
#include <iterator>
#include <queue>
#include <set>
#include <map>
#include <vector>
#define mp make_pair
#defin... | ALGO | 0.999942 | 3.007931 | {
"github_metadata": {
"branch": "master",
"commit_count": 8271,
"repo_created_at": "2012-04-15T03:31:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a905f28... |
9b056cab-1469-4cbf-9e2c-1bb8397a06a7 | tumpji/Sliding_puzzle_2014 | solving_engine.cc | #include <cassert>
#include <iostream>
#include <new>
#include <set>
#include "solving_engine.h"
#include "object.h"
#include <pthread.h>
#define THREAD_COUNT 8
//static std::vector<OBJECT>* predej_vysledek ( const OBJECT * data, int position );
static bool zkontroluj_vstup ( const unsigned char * predane , unsig... | ALGO | 0.998427 | 3.591463 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2014-05-31T01:08:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7cc24fc7... |
947041e8-1988-4400-93f3-cf03c24fe42b | arrayfire/arrayfire | src/backend/opencl/cpu/cpu_lu.cpp | /*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
**********************************************... | ALGO | 0.998692 | 6.840029 | {
"github_metadata": {
"branch": "master",
"commit_count": 6246,
"repo_created_at": "2014-10-28T20:58:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4739,
"forks": 546,
"issues": 277,
"pull_requests": 18
},
"file_meta": {
"content_id": "... |
798fc161-3063-43b5-97e5-9fa25d95ce5d | chenghuige/melt | src/vowpalwabbit/rand48.cc | //A quick implementation similar to drand48 for cross-platform compatibility
#include <stdint.h>
#include <iostream>
using namespace std;
//
// NB: the 'ULL' suffix is not part of the constant it is there to
// prevent truncation of constant to (32-bit long) when compiling
// in a 32-bit env: warning: integer constant... | ALGO | 0.959471 | 3.997775 | {
"github_metadata": {
"branch": "master",
"commit_count": 530,
"repo_created_at": "2017-08-24T14:30:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bf4e9e6... |
41f07986-498a-4603-9a91-c83e0e2d9b73 | Blakeym3155/CSC-134 | M7/M7Lab1_blakey.cpp | #include <iostream>
#include <vector>
#include <random>
#include <ctime>
using namespace std;
// TODO: Add better comments
// Direction constants
enum Direction {
NORTH = 1,
SOUTH = 2,
EAST = 4,
WEST = 8
};
// Mapping of direction to cell offset
const std::pair<int, int> DIRECTION_OFFSETS[] = {
{0... | ALGO | 0.999303 | 6.829807 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2025-01-13T15:27:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c85708ee0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.