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 |
|---|---|---|---|---|---|---|---|
d7a33af6-0bbf-442f-9dd4-2edfe87f7e6d | kingssafy/til | ps/boj/17144.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int const MAXR = 51, MAXC = 51;
int tempy;
int cleany[5];
int cleanx[5];
int grid[MAXR][MAXC] = {};
int R, C, T;
int dy[4] = {-1, 1, 0, 0};
int dx[4] = {0, 0, -1, 1};
void step1() {
int next[MAXR][MAXC] = {};
... | ALGO | 0.999953 | 4.895654 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2019-01-13T09:38: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": "ca09f208... |
18f5529e-4a37-462c-9d2c-bd509b1c8313 | Sudhanshu3314/Cpp-with-DSA | My Project/Rectang.cpp | /* ----------------------- <NAME> -----------------------
Programmer = <NAME>
Topic = Recursion
Purpose =
Date = /09/2023 */
#include<bits/stdc++.h>
using namespace std;
int main(){
int a , b , c ,d;
cout << "\nEnter value of a side : ";
cin >> a ;
cout << "\nEnter value of b side : ";
ci... | ALGO | 0.999388 | 3.745273 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-10-16T19:17: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": "5d1662a0260... |
6076b8d7-7587-4f0a-ae8d-6f050bebd2ee | dielenka/Melanoma_MRI | src/Melanoma.cpp | #include <iostream>
#include <filesystem>
#include <numeric>
#include <functional>
#include <opencv2/opencv.hpp>
void CalculateHistogram(cv::Mat& src, cv::Mat& histogram)
{
cv::Mat image;
cv::cvtColor(src, image, cv::COLOR_BGR2HSV);
int channels[] = { 0, 1, 2 };
int histSize[] = { 256, 256, 256 };
... | DATA | 0.941549 | 5.580801 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-03-25T12:28:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50e40abca4... |
ce66b437-0f65-43b8-ae6b-a4df5db9f2f5 | superglutenman0312/leetcode | 2583.cpp | #include<bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(... | ALGO | 0.999965 | 4.96536 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-11-07T15:25: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": "9875f107dcb6... |
ee2a8a71-62e8-45f7-92db-48ee0836ba59 | godotengine/godot | core/math/triangulate.cpp | /**************************************************************************/
/* triangulate.cpp */
/**************************************************************************/
/* This file is part of: */
/* ... | ALGO | 0.998212 | 6.905625 | {
"github_metadata": {
"branch": "master",
"commit_count": 76043,
"repo_created_at": "2014-01-04T16:05:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 98972,
"forks": 22820,
"issues": 5000,
"pull_requests": 3866
},
"file_meta": {
"content... |
7f73d51c-a83b-492f-b5ef-040d78a76476 | LiamTyler/Progression | code/core/bounding_box.cpp | #include "core/bounding_box.hpp"
namespace PG
{
AABB::AABB() : min( FLT_MAX ), max( -FLT_MAX ) {}
AABB::AABB( const vec3& _min, const vec3& _max ) : min( _min ), max( _max ) {}
vec3 AABB::Center() const { return 0.5f * ( max + min ); }
vec3 AABB::Extent() const { return max - min; }
void AABB::Points( vec3* data ... | ALGO | 0.953148 | 6.892232 | {
"github_metadata": {
"branch": "main",
"commit_count": 369,
"repo_created_at": "2020-08-16T21:20: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": "44995e9262... |
53e115ff-1012-48b9-b32c-f537ad4deabb | Luxar3-cmd/Lab-redes | main.cpp | #include <iostream>
#include <string>
#include <cryptopp/oaep.h>
#include "rsa_utils.h"
#include "aes_utils.h"
using namespace std;
using namespace CryptoPP;
/*
Esta función convierte un array de bytes a su representación hexadecimal.
Utiliza HexEncoder para codificar el array de bytes.
*/
string BytesToHex... | ALGO | 0.984936 | 5.745773 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2025-06-25T16:50: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": "37cd46b83ed... |
7e6ee249-4c4a-40df-a728-83eb5a006f29 | ishandutta2007/codeforces-d | degwer/normal/663/E.cpp | #include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
int dat[100000];
int dp[2][21][1048576];
int main()
{
int len, num;
scanf("%d%d", &len, &num);
for (int i = 0; i < len; i++)
{
for (int j = 0; j < num; j++)
{
char z;
scanf(" %c", &z);
dat[j] += (1 << i)*(z - '0');
}
}
for ... | ALGO | 0.999952 | 3.342234 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "67daf2f55062... |
e3a044ae-9e4e-47d4-b51b-e0296d5f8400 | MeghaNamdeo/Stack- | Reverse_Of_Stack_Using_Recursion.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
class Solution {
public:
void solve(stack<int> &stack, int target) {
if (stack.empty()) {
stack.push(target);
return;
}
int topElement = stack.top();
stack.pop();
solve(stac... | ALGO | 0.99993 | 5.584168 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-01-15T09:38:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "56f1f838e077... |
209d89b1-19cd-4c0f-87aa-5cca04f53fe3 | raincross7/code-similarity | codes/train_code/problem231/problem231_35.cpp | //om <NAME>
//faith over fear
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define... | ALGO | 0.999976 | 3.635639 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52c6a8fba0d7... |
64a38fa1-3f74-4bee-b07a-d30235ce715b | shudhanshu435/LeetCode | 4-median-of-two-sorted-arrays/4-median-of-two-sorted-arrays.cpp | class Solution
{
public:
double findMedianSortedArrays(vector<int> &nums1, vector<int> &nums2)
{
vector<int> vec;
int len = nums1.size() + nums2.size();
if (nums1.size() == 0 && nums2.size() != 0)
{
for (int i = 0; i < nums2.size(); i++)
{
... | ALGO | 0.999986 | 5.911976 | {
"github_metadata": {
"branch": "main",
"commit_count": 3008,
"repo_created_at": "2022-01-13T07:19: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": "8a5328023... |
9ecd278a-81bb-41e1-aacc-6242fb3d4975 | vansh-potpose/coding-problems | 132-palindrome-partitioning-ii/palindrome-partitioning-ii.cpp | class Solution {
public:
int minCut(string s) {
int n = s.length();
vector<int> dp(n, 0);
vector<vector<bool>> pal(n, vector<bool>(n, false));
for (int i = 0; i < n; ++i) {
dp[i] = i; // max cuts at worst: cut each character
for (int j = 0; j <= i; ++j) {
... | ALGO | 0.999972 | 6.079258 | {
"github_metadata": {
"branch": "main",
"commit_count": 542,
"repo_created_at": "2025-05-14T08:45:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9417ee4bca... |
0b8d9acd-d89d-413b-987d-1b013f57a977 | Chandramani04/CP | Atcoder Contests/ABC335/D_Loong_and_Takahashi.cpp | #include "bits/stdc++.h";
using namespace std;
#define int long long
const int mod = 1e9 + 7;
/*-----------------------------------------------------------------*/
void solve() {
int n;
cin >> n;
int m = n;
int on = n, om = m;
vector<vector<int>> arr(n, vector<int>(m));
vector<vector<int>> ans(... | ALGO | 0.999921 | 3.110695 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2024-01-19T16:04:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "921187a844d... |
97fb5690-e284-497f-ac42-86b499d57a6b | zhishuohuang9111/Data-Structure | chapter02/2_P41_24.cpp | #include<stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
typedef struct lnode{
int data;
struct lnode *next;
}lnode, *linklist;
int a[6] = {1, -4, 2, 3, 4, -2};
int n = 6;
void buildlist(linklist &L){
// 建立 头节点
L = (linklist) malloc(sizeof(lnode));
lnode *s,*r = L;
for(int i = 0; i... | ALGO | 0.999956 | 3.389966 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-08-19T03:55:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5ef96dc797e... |
1ebfe702-9f4b-4e34-8eb3-a35202de755a | pranavsindura/CompetitiveProgramming | codeforces/A/556a.cpp | #include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl ... | ALGO | 0.999958 | 3.691696 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2021-01-26T05:15:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8654dc574... |
fea08e8d-aee2-45b5-98c9-49e207afa606 | isym444/Competitive-Programming-Solved-Problems | rental service commented explanation.cpp | int iShop = 0;
38 int iRent = 0;
39 int i = 0;
40 ll sol = 0;
41 while (i < n) { //n starts going down once better to rent cows rather than milk them. i goes up when sold cow's milk rather than rented them
42 int litres = production[i]; // 7 gal
43 int moneyT = 0, curI = iShop; /... | ALGO | 0.9996 | 3.576617 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-09-30T11:20: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": "1f068d6fd... |
39c70a0c-4e48-422e-b8ab-032086b1246f | darkey91/c- | lca/h.cpp | #include <iostream>
#include <vector>
using namespace std;
const int N = int(1e6) + 3;
int tIn[N], tOut[N];
int log = 1, timer = 0;
vector<vector<int>> t, dp;
struct ver {
int col;
int amount = 1;
int p;
};
void dfs( int v, int parent) {
dp[v][0] = parent;
tIn[v] = ++timer;
for (int i = ... | ALGO | 0.999882 | 4.232553 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-03-25T23:13:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2cd0eaf6... |
ea3688e3-d736-4569-922a-8aeadcd11a92 | Yameroom/Pemrograman-Dasar-2 | Praktikum 4 - Singly Linked List/Mencari Sebuah Elemen di Dalam Singly Linked List (Recursive).cpp | #include <iostream>
#include <ctime>
using namespace std;
struct Node
{
int key;
Node* next;
};
void push(Node** head_ref, int new_key)
{
Node* new_node = new Node();
new_node->key = new_key;
new_node->next = (*head_ref);
(*head_ref) = new_node;
}
bool searchRecursive(Node* head, int x)
{
if (he... | ALGO | 0.999543 | 4.677075 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-06-29T15:24: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": "0c441fac6477... |
0cdbe521-06f9-440d-8e55-c4ccaad4f3fa | ekil1100/arkcompiler_ets_runtime | ecmascript/compiler/codegen/maple/maple_be/src/cg/aarch64/aarch64_alignment.cpp | /*
* Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... | ALGO | 0.992322 | 3.484683 | {
"github_metadata": {
"branch": "master",
"commit_count": 8209,
"repo_created_at": "2024-07-15T11:00: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": "4aabafb... |
e9707313-7bc3-4345-b048-7f41a0ab883d | cea-hpc/NabLab | plugins/fr.cea.nabla.ui/examples/NabLabExamples/src-gen-arcane/accelerator/explicitheatequation/ExplicitHeatEquationModule.cc | /* DO NOT EDIT THIS FILE - it is machine generated */
#include "ExplicitHeatEquationModule.h"
#include <arcane/Concurrency.h>
#include <arcane/ITimeLoopMng.h>
using namespace Arcane;
/*** Free functions **********************************************************/
namespace explicitheatequationfreefuncs
{
Real norm(... | ALGO | 0.998856 | 3.736094 | {
"github_metadata": {
"branch": "master",
"commit_count": 1741,
"repo_created_at": "2018-07-20T14:43:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18,
"forks": 13,
"issues": 20,
"pull_requests": 1
},
"file_meta": {
"content_id": "877b8... |
c3b67703-6965-4839-a43f-8d88d7cf1c06 | ssss4481/myLeetcode | 1371_Find_the_Longest_Substring_Containing_Vowels_in_Even_Counts.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
static const int fast_io = []()
{
std::ios::sync_with_stdio(false);
std::cin.tie(NULL);
std::cout.tie(NULL);
return 0;
}();
class Solution {
public:
int findTheLongestSubstring(std::string s) {
auto charToBitMask ... | ALGO | 0.998824 | 5.151332 | {
"github_metadata": {
"branch": "master",
"commit_count": 205,
"repo_created_at": "2022-09-09T19:17: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": "68209e7c... |
542444d8-5e04-4405-8c10-01ad917edc49 | luqmanarifin/cp | 2015 ACM Syrian Collegiate Programming Contest/d.cpp | #include <bits/stdc++.h>
using namespace std;
char mir[] = { 'A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y' };
int pos[256];
int main()
{
long long C = sizeof(mir)/sizeof(mir[0]);
for (int i = 0; i < C; ++i) {
pos[mir[i]] = i+1;
}
int ntc;
scanf("%d", &ntc);
while (ntc--) {
... | ALGO | 0.999973 | 3.508157 | {
"github_metadata": {
"branch": "master",
"commit_count": 772,
"repo_created_at": "2016-02-09T04:26:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "79c300c5... |
ed16b3e1-4192-4db9-b3d4-d01abeb65ea4 | ellynhan/challenge100-codingtest-study | ise-yen/PGS/실패율.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
bool compare(const pair<double, int> &a, const pair<double, int> &b){
if(a.first == b.first){
return a.second < b.second;
}
return a.first > b.first;
}
vector<int> solution(int N, vector<int> stages) {
... | ALGO | 0.999941 | 3.979993 | {
"github_metadata": {
"branch": "master",
"commit_count": 6737,
"repo_created_at": "2021-08-31T03:30:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 212,
"forks": 107,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "5cf... |
81ddca6b-81fa-4329-983b-5e31f8280522 | kansalraj/DSA | searching.cpp | #include <iostream>
#include <queue>
#include <bits/stdc++.h>
using namespace std;
int binarySearch(int *input, int n, int val)
{
int s = 0, e = n - 1;
int mid = (s + e) / 2;
while (s <= e)
{
if (input[mid] == val)
return mid;
if (input[mid] > val)
e = mid - 1;
... | ALGO | 0.999991 | 3.735644 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-10-19T09:10:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69f629a06cc... |
9f3086ea-1f9b-4983-947e-4f4f952e888a | WhiZTiM/coliru | Archive2/f8/7ae7385da7aa85/main.cpp | #include <array>
#include <iostream>
#include <type_traits>
template<int Base, int Exp>
struct Pow
{
static const int value = Base * Pow<Base, Exp - 1>::value;
};
template<int Base>
struct Pow<Base, 0>
{
static const int value = 1;
};
template<int A, int B>
struct NumCompare
{
static const bool value = (A < B);
}... | ALGO | 0.963884 | 5.98594 | {
"github_metadata": {
"branch": "master",
"commit_count": 42630,
"repo_created_at": "2016-04-21T16:34: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": "5f38a9... |
26bc4598-001a-44a7-bb54-2f02a9003b3b | HOTSONHONET/Coding_practice | Final 450/wordBreak.cpp | // { Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
int wordBreak(string A, vector<string> &B);
// User code will be pasted here
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
vector<string> dict;
for(int i=0;i<n;i++){
... | ALGO | 0.995078 | 4.894881 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2020-12-24T08:56:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6480a779... |
69a021ea-5455-439e-a72f-b3b509085ef5 | Pasha20042000/Wi-fi-analiz | PothosSDR/include/gnuradio/digital/adaptive_algorithm.h | /* -*- c++ -*- */
/*
* Copyright 2020 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef INCLUDED_DIGITAL_ADAPTIVE_ALGORITHM_H
#define INCLUDED_DIGITAL_ADAPTIVE_ALGORITHM_H
#include <gnuradio/digital/api.h>
#include <gnuradio/digital/con... | ALGO | 0.990109 | 7.31761 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-02-21T11:00:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b990a7fe3953... |
84c8597d-59ad-483c-9484-c8e2a293d007 | iamrahatkabir/Module-9-Doubly-Linked-List | delete_at_tail_6_.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <t... | ALGO | 0.997522 | 3.788614 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-07-06T16:34: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": "1500bab881c... |
0b6a0186-e88f-43d6-9fc5-c25f864c18aa | EnnSou/ooss-paddle2.3 | paddle/fluid/operators/detection/distribute_fpn_proposals_op.h | /* Copyright (c) 2019 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 by applicable law or... | DATA | 0.965312 | 6.488757 | {
"github_metadata": {
"branch": "air",
"commit_count": 35433,
"repo_created_at": "2022-07-29T08:29:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba1697b91... |
0211515a-e64a-46fb-b7d0-cc2e5e07c825 | zhuxiangyualter/DataStructureInC | String&Arrays/_4_3.cpp | #include <iostream>
#include <vector>
#include <ctime>
#include <cstdlib>
#include <cmath>
using namespace std;
// 生成随机对称矩阵
vector<vector<int>> generate_symmetric_matrix(int n) {
vector<vector<int>> matrix(n, vector<int>(n));
srand(time(0));
for (int i = 0; i < n; ++i) {
for (int j = i + 1; j < n;... | ALGO | 0.999851 | 5.096274 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2023-12-19T02:49:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f6f32dab2... |
a58ccdb7-6e13-403d-bd73-e4d7f8b225ed | kc4271/STCostAggregation | Src/SegmentTree.h | /*
This project implements the methods in the following paper. Please cite this paper, depending on the use.
<NAME>, <NAME>, <NAME>, <NAME> and <NAME>. Segment-Tree based Cost Aggregation for Stereo Matching, in CVPR 2013.
The code is written by <NAME>, <<EMAIL>>, 2013.
LICENSE
Copyright (C) 2012-2013 by <NAME>
Perm... | ALGO | 0.998543 | 4.507415 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-08-28T12:18:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 17,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "28396621... |
db73d3a6-340e-412a-8de2-a53242df3758 | opengm/opengm | src/tutorials/c++/applications/imageSegWithEMLearning.cxx | /***********************************************************************
* Tutorial: Image Segmentation by learning dataterms by EM
* Author: <NAME>
* Date: 11.07.2014
* Dependencies: None
*
* Description:
* ------------
* Simple example for learning the local dataterms by EM.
* As input an p... | DATA | 0.999026 | 5.294816 | {
"github_metadata": {
"branch": "master",
"commit_count": 2107,
"repo_created_at": "2012-06-01T11:37:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 421,
"forks": 153,
"issues": 58,
"pull_requests": 9
},
"file_meta": {
"content_id": "e6... |
8f34599d-2c55-4dd3-8cbe-bc3a181b35d3 | rajsahu213/DSA-and-CP-codes | DSA-codes/shortest_path.cpp | #include<bits/stdc++.h>
using namespace std;
struct weight
{
int data;
int wei;
};
typedef vector<weight> graph;
void print_adjlist_wei(vector<weight> adj_list[],int v)
{
cout<<"the adjacency list is\n";
for(int i=0;i<v;i++)
{
cout<<i;
for(int j=0;j<adj_list[i].size();j++)
... | ALGO | 0.999977 | 4.084696 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-02-08T05:58: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": "e3ae730f5f... |
45c49865-29aa-42a6-bbf6-3c3a44bf8a1a | PaulLandaeta/UVA-Judge | 12921/12921.cpp | /* go go Accepted*/
#include <bits/stdc++.h>
#define input freopen("in.txt","r",stdin)
#define output freopen("out.txt","w",stdout)
using namespace std;
#define EPS 1e-8
#define PI acos(-1)
#define Vector Point
struct Point
{
double x, y;
Point(){}
Point(double a, double b) { x = a; y = b; }
double mo... | ALGO | 0.998873 | 4.261045 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2013-09-24T21:28: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": "521f0eb46... |
61da4876-85eb-4a49-909f-cfd023a56a62 | BilalKalyar-200/University-Data-Structure | AVL/AVL/AVL_Array.cpp | //IT IS MORE PREFERABLE AND IDEAL TO CREATE AVL TREE USING LINKED LIST NOT ARRAY
//BUT THIS PROGRAM IS JUST TO DEMONSTRATE THAT IT CAN BE DONE
//#include <iostream>
//using namespace std;
//
//const int CAP = 100;
//
//class node {
//public:
// int id;
//
// node() {
// id = 0;
// }
//};
//
//class AV... | ALGO | 0.998729 | 4.033953 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-09-28T06:48: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": "2a9ebe83564... |
3053b588-89a0-433a-87b5-85913c9c6cf7 | tiankonguse/ACM | contest/TheWaySoFar-Training/2013-Jakarta/D.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <set>
#include <vector>
#include <cmath>
using namespace std;
typedef long long LL;
#define N 205
int n , m , K , ca;
struct edge
{
int x , y , w;
bool operator < (const edge& R) const{
return w < R.... | ALGO | 0.999936 | 3.966199 | {
"github_metadata": {
"branch": "master",
"commit_count": 185,
"repo_created_at": "2013-03-25T04:04:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 69,
"forks": 40,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8af066... |
a35398f0-3920-4c5d-a66b-ca57e3d7edc1 | KLab/tenka1-2023 | cpp/main.cpp | #include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <thread>
#include <chrono>
#include <random>
#include <curl/curl.h>
#include <rapidjson/document.h>
using namespace std;
mt19937 mt;
const char* GameServer;
const char* TOKEN;
const int N = 5;
const... | TOOL | 0.925566 | 3.618171 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2023-09-22T09:41: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": "daa585dc96d... |
2a614b33-2adc-427e-bf77-13a0a7154750 | nicelhc13/Algorithm | BellmanFord/TimeTrip/timetrip.cpp | #include <iostream>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
using namespace std;
#define V_MAX 101
#define W_MAX 1001
#define START 0
#define ANDROMEDA 1
#define INF 987654321
#define M 98765432
#define UNREACHABLE 3
vector<pair<int, int> > adj[V_MAX];
bool reachable[V_MAX][V_MAX];
... | ALGO | 0.999952 | 4.215718 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2018-04-03T13:58: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": "fa72b34b4... |
ec901557-4403-499d-bdc5-b9b95a804c19 | Anastasiyapash/OOP | srcCourseRect/main.cpp | #include "line.h"
#include "rect.h"
#include "poly.h"
#include "figure.h"
#define radius 50
#define radius0 100
int score = 0;
float xCntr = 350;
float yCntr = 350;
//float absX = xCntr;
//float absY = yCntr + radius0;
float step = 2;
#define quadro 4
#define triang 3
//float xRect[quadro] = {xCntr,xCntr+r... | TOOL | 0.987914 | 3.165875 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-11-26T14:07: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": "8a9bf740c... |
158a582d-22b7-4998-9f86-1c208aa3e17c | kakarot96/Data-Structures-Algorithms | JanLong2.cpp | /*
Problem Statement:
Bob and Alice are playing a game with the following rules:
Initially, they have an integer sequence A1,A2,…,AN; in addition, Bob has a lucky number a and Alice has a lucky number b.
The players alternate turns. In each turn, the current player must remove a non-zero number of eleme... | ALGO | 0.999968 | 3.744578 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2018-12-13T16:31: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": "32226a7e5... |
07f9e4ad-4684-4cea-afd2-452b0c5a0caf | raven22314/Tareas_Topicos_Programacion | Topicos avanzados de programacion/Lqueue_/Lqueue_/Lqueue_.cpp | //<NAME>
#pragma once
#include <iostream>
using namespace std;
//Recursos utilizados
//Codigo sentinellinked list del profe
//https://www.w3schools.com/cpp/cpp_queues.asp
// Definimos una clase plantilla SentinelLinkedList
template <typename T>
class SentinelLinkedList {
private:
// Clase interna para los no... | TOOL | 0.98978 | 4.477416 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2025-06-09T17:34: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": "386940e19be... |
4f6b2044-cc52-47a7-8543-7865f810430b | tang415a/algorithms | numbers/maxChunksToSorted1.cpp | /*
You are given an integer array arr.
We split arr into some number of chunks (i.e., partitions), and individually
sort each chunk. After concatenating them, the result should equal the sorted
array.
Return the largest number of chunks we can make to sort the array.
Example 1:
Input: arr = [5,4,3,2,1]
Output: 1
Ex... | ALGO | 0.999975 | 6.216151 | {
"github_metadata": {
"branch": "master",
"commit_count": 180,
"repo_created_at": "2018-11-15T07:42: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": "3056e220... |
d0cf21f8-1471-4450-8a5e-13203187db3f | swiftlang/swift | lib/SILOptimizer/Analysis/ClosureScope.cpp | //===--- ClosureScope.cpp - Closure Scope Analysis ------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | TOOL | 0.958614 | 7.81907 | {
"github_metadata": {
"branch": "main",
"commit_count": 185715,
"repo_created_at": "2015-10-23T21:15:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 68847,
"forks": 10498,
"issues": 5000,
"pull_requests": 1122
},
"file_meta": {
"content_... |
5dffdcba-45ba-4481-94fa-8b3f78ffe4d5 | sharmistha2021/light-oj | Area of a parallelogram/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t, i = 1;
scanf("%d", &t);
while(t--){
int ax, ay, bx, by, cx, cy, dx, dy;
cin >> ax >> ay >> bx >> by >> cx >> cy;
dx = cx - bx + ax;
dy = ay - by + cy;
int area = .5*(ax*by + bx*cy + cx*dy + dx*ay - ay... | ALGO | 0.996027 | 4.159184 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-09-26T16:42:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1ac5ba75b2b... |
951a5971-b020-4e04-a231-1e277317f7ba | ishandutta2007/codeforces-y | yousef_salama/normal/713/D.cpp | //In the name of Allah
#include <bits/stdc++.h>
using namespace std;
int n, m, a[1005][1005], b[1005][1005], c[1005][1005], res[1000005];
struct query{
int t, x1, y1, x2, y2;
};
vector < pair <int, pair <int, int> > > X;
void add(int x, int y, int k){
x++, y++;
while(x < 1005){
int yi = y... | ALGO | 0.999276 | 3.507641 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40: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": "d5f11aff99d8... |
3f9c5ddc-2ccf-4e4b-9acd-6fec393fe439 | Dyn0402/QGP_Fluctuations | Event_Plane/Root_Macros/flatten_roli.cpp | /*
* flatten_roli.cpp
*
* Created on: May 15, 2019
* Author: <NAME>
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <tuple>
#include <TH1.h>
#include <TF1.h>
#include <TMath.h>
#include <TRandom.h>
#include <TRandom3.h>
#include <TCanvas.h>
using namespace std;
////////////////////... | TOOL | 0.910007 | 4.746575 | {
"github_metadata": {
"branch": "master",
"commit_count": 907,
"repo_created_at": "2019-05-05T06:39: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": "82cbde04... |
2a41c695-5db6-4e57-954c-b557e85db427 | gaoxiang12/slam_in_autonomous_driving | src/ch6/loop_closing.h | //
// Created by xiang on 2022/4/7.
//
#ifndef SLAM_IN_AUTO_DRIVING_LOOP_CLOSING_H
#define SLAM_IN_AUTO_DRIVING_LOOP_CLOSING_H
#include "common/eigen_types.h"
#include "multi_resolution_likelihood_field.h"
#include "submap.h"
#include <fstream>
#include <map>
#include <memory>
namespace sad {
/**
* 单线程的回环检测模块
* ... | ALGO | 0.996524 | 5.434221 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2023-02-10T05:29:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2252,
"forks": 529,
"issues": 95,
"pull_requests": 5
},
"file_meta": {
"content_id": "6b... |
258dba9d-242c-4762-b02e-669af0d32ea6 | aswaunni/Cpp-Progamming-Questions | Arrays/maxMinArr.cpp | /*
Given a sorted array of positive integers, rearrange the array alternately i.e first element should be the maximum value, second minimum value, third-second max, fourth-second min and so on.
Examples:
Input: arr[] = {1, 2, 3, 4, 5, 6, 7}
Output: arr[] = {7, 1, 6, 2, 5, 3, 4}
Input: arr[] = {1, 2, 3, 4, 5, 6} ... | ALGO | 0.99997 | 4.736374 | {
"github_metadata": {
"branch": "main",
"commit_count": 533,
"repo_created_at": "2021-04-01T08:08: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": "647896bc5f... |
69f74cc3-f260-4a6b-967b-cc0df5e4b8c0 | vimalprogrammer/Python-TQ | CC-perfectPermutation.cpp | /*
An index i in a permutation P of length N is said to be good if:
Pi is divisible by i
You are given 2 integers N and K. You need to construct a permutation P of length N such that exactly K indices in that permutation are good.
If no such permutation exists, output −1.
If multiple such permutations exist, output ... | ALGO | 0.999918 | 4.690981 | {
"github_metadata": {
"branch": "main",
"commit_count": 242,
"repo_created_at": "2021-11-20T07:34: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": "308d185a2a... |
04937ece-42a8-4e6d-b406-ddf26a89f2a9 | qqwangxiaow/leetcode-fast-and-elegant | Top 100 Liked Questions/399-Evaluate Division.cpp | //graph and bfs
//mymap[a]=[b,val] means a/b=val;
//a/d=a/b*b/c*c/d
class Solution {
public:
vector<double> calcEquation(vector<vector<string>>& equations, vector<double>& values, vector<vector<string>>& queries) {
int n=equations.size();
while(n--)
{
mymap[equations[n][0]].push... | ALGO | 0.99999 | 6.069186 | {
"github_metadata": {
"branch": "master",
"commit_count": 950,
"repo_created_at": "2019-07-28T15:10: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": "dfc48c9a... |
9dc886b1-54eb-463c-8303-ef060c618d2f | JayantGoel001/LeetCode | 2096-step-by-step-directions-from-a-binary-tree-node-to-another/2096-step-by-step-directions-from-a-binary-tree-node-to-another.cpp | class Solution {
public:
string getDirections(TreeNode* root, int startValue, int destValue) {
string startPath, destPath;
// Find paths from root to start and destination nodes
findPath(root, startValue, startPath);
findPath(root, destValue, destPath);
string directions;
... | ALGO | 0.999999 | 6.880521 | {
"github_metadata": {
"branch": "master",
"commit_count": 7444,
"repo_created_at": "2021-10-01T11:35:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01963d... |
706c38c4-ba59-4bfe-8227-ea8bae243a65 | paulohenriquesc28/Infix-to-postfix-calculator | pilhaClasse.h | /*
Pilha estatica e sequencial
Desenvolvimento com classe
criado: 15/02/2022.
prof. Dr. <NAME>
*/
/*
<NAME> 32138121
<NAME> 32135513
<NAME> 32135661
<NAME> 32163967
LINK PARA O VIDEO: https://www.youtube.com/watch?v=V7Aq3Rzmhl4&ab_channel=PauloHenrique
*/
#include <iostream>
using namespace std;
// def... | ALGO | 0.951554 | 4.026758 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-04-01T03:06: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": "03e87f0e21bd... |
f9d64509-3373-4a5f-8771-07dda77fd7ca | kubonits/atcoder | abc/200/210/abc218/f/main.cpp | #include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
#define MOD 1000000007
using namespace std;
typedef long long ll;
#include <cstring>
int g[400][400], d[400];
int n, m;
voi... | ALGO | 0.99997 | 3.803868 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2018-12-07T13:30: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": "3895bc5f4... |
d974a431-8910-45f0-a8d6-7422d23e1c95 | davideriemma/AI-Study | Genetic Search/Genetic Search/Genetic Search.cpp | #include <iostream>
#include <string>
#include <queue>
#include "states.h"
const static population_member<float> data[] = {
{"Sleeping bag", 0x1, 1.5},
{"Tent", 0x10, 3.5},
{"Sleeping Pad", 0x100, 4.5},
{"Tarpulin", 0x1000, 2},
{"Cooking stove", 0x10000, 1.7},
{"Pillow", 0x100000, 0.7},
{"Lamp", 0x1000000, 1},... | ALGO | 0.999239 | 3.985837 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-04-03T08:01: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": "bdcac5e5df... |
ffb136e3-747d-477c-ab75-fdf2cffb6c03 | JohnsonKamanga123/bsc-com-09-21-com221-Lab-6 | Exercise_2.cpp | #include <iostream>
using namespace std;
void modifyRow(double ** hold, int row, int col){
for(int i = 0 ; i < row ; i++){
for(int j = 0 ; j < col ; j++){
hold[i][j] = (float)i/(j+1);
}
}
}
void addRows(double ** hold, int row, int col){
for(int i = 0 ; i < row ; i++){
ho... | ALGO | 0.952538 | 3.279887 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-25T16:25: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": "66a3b9650c43... |
0247e07c-f06b-4738-8832-fdd210cd6180 | jaege/Cpp-Primer-5th-Exercises | ch9/9.28.cpp | #include <forward_list>
#include <string>
#include <iostream>
void insertAfterStr(std::forward_list<std::string> &fls,
const std::string &s1,
const std::string &s2) {
auto pre = fls.before_begin();
auto cur = fls.begin();
while (cur != fls.end()) {
if (*cur == s1) {
fls.insert_after... | TOOL | 0.980567 | 6.476944 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2016-01-03T12:17:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 748,
"forks": 247,
"issues": 27,
"pull_requests": 19
},
"file_meta": {
"content_id": "114... |
d760fb6e-43f6-49d1-8c82-bef46045314e | dpspcghst/RavenEngine | src/Renderer/Shapes/Shape2d/Rect.cpp | // Rect.cpp
// #include section
// #####################
// standard library includes
#include <iostream>
// third party includes
#include <glm/gtc/type_ptr.hpp>
// Raven includes
#include "Rect.h"
#include "../../Shaders/ShaderManager.h"
namespace RavenEngine {
Rect::Rect() : Shape2D() {
type = Type::Rect;
}
... | TOOL | 0.970022 | 7.218117 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-02-23T16:17: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": "a4b861da92a... |
a968cbed-fceb-41e8-afe6-5e68c45a2404 | AbdulTawabJuly/3rd-Semester | text editor/Source.cpp | //#include<iostream>
//using namespace std;
//template <class t >
//class linklist
//{
// class node
// {
// public:
// t data;
// node* next;
// node* priv;
// friend class linklist;
// node()
// {
// next = nullptr;
// priv = nullptr;
// }
// node(t as, node* ne = nullptr, node* pri = nullptr)
// {
// ... | ALGO | 0.998802 | 3.650367 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-22T09:23: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": "a0acc760e759... |
09fc5201-c050-4a74-b7dc-852d71c1e883 | qze841/modcpp | ace_coding_interview/arrays/searchInfiniteSortedArray.cpp | // Type your code here, or load an example.
using namespace std;
#include <iostream>
#include <limits>
#include <vector>
class ArrayReader {
public:
vector<int> arr;
ArrayReader(const vector<int> &arr) { this->arr = arr; }
virtual int get(int index) {
if (index >= arr.size()) {
return numeric_limit... | ALGO | 0.999124 | 4.84554 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-03-25T19:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6e926d21db2... |
2e33bf88-7bdb-4b6f-8ae9-c849b68f8417 | Marbax/programming | patterns/Creational/FactoryMethod.cpp |
//++++++++++++++++++++++++++FactoryMethod
#include <iostream>
#include <vector>
using namespace std;
// Иерархия классов игровых персонажей
class Unit
{
public:
virtual void info() = 0;
virtual ~Unit() = default;
};
class Wizard : public Unit
{
public:
void info() override
{
cout << "Wizar... | TOOL | 0.984037 | 5.896609 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2019-03-21T17:56: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": "363804f8... |
799a607a-8190-4808-b5f0-290067f50ae1 | kamyu104/LintCode | C++/unique-paths.cpp | // Time: O(min(m, n))
// Space: O(1)
// Use combination in math.
class Solution {
public:
/**
* @param n, m: positive integer (1 <= n ,m <= 100)
* @return an integer
*/
int uniquePaths(int m, int n) {
return combination(m + n - 2, min(m - 1, n - 1));
}
int combination(int n, i... | ALGO | 0.999993 | 6.998211 | {
"github_metadata": {
"branch": "master",
"commit_count": 1293,
"repo_created_at": "2015-02-16T16:25:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 631,
"forks": 261,
"issues": 1,
"pull_requests": 3
},
"file_meta": {
"content_id": "ead... |
42933257-cb81-49cf-af7e-b7eb9504fd9e | xntrz/tmnt2 | src/Game/Component/Enemy/ConcreteAIModerator/084KaraiAI.cpp | #include "084KaraiAI.hpp"
#include "Game/Component/Enemy/ConcreteEnemyCharacter/084Karai.hpp"
#include "Game/Component/GameMain/GameProperty.hpp"
#include "Game/Component/Player/PlayerCharacter.hpp"
C084KaraiAI::CDecisionUnitMoveEscape::CDecisionUnitMoveEscape(CBaseKaraiChr* pBaseKaraiChr)
: CEnemyAIDecisionUnit(KAR... | ALGO | 0.950271 | 3.95592 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2022-02-01T03:18:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1ce027e2... |
e3c80bb3-6471-4441-9ca8-7cb7fb77b0b6 | ITGuk/HomeWork14 | Task_1/Task__1.cpp | #include <iostream>
using namespace std;
int main()
{
//task1
const int ROW = 2;//Line
const int COL = 4;//column
int arr[ROW][COL]{};
srand(time(NULL));
for (int i = 0; i < ROW; i++)
{
for (int j = 0; j < COL; j++)
{
int ran = rand() % 5 + 1;
arr[i... | ALGO | 0.969501 | 3.381579 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-03-20T09:47: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": "f791cc3a8d5... |
0eebb125-5e94-4487-b457-700fb6628e30 | vishalbelsare/lbann | tools/compute_mean/mpi_states.cpp | ////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2014-2019, Lawrence Livermore National Security, LLC.
// Produced at the Lawrence Livermore National Laboratory.
// Written by the LBANN Research Team (<NAME>, et al.) listed in
// the CONTRIBUTORS file. <<EMAIL>>
//
// LL... | TOOL | 0.955787 | 6.345226 | {
"github_metadata": {
"branch": "develop",
"commit_count": 8279,
"repo_created_at": "2016-12-21T07:47:15.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "LBANN/lbann",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id":... |
58f202d4-ad95-4f18-868c-f53c0672c583 | riverta1992/blockchain_cpp | part2/proofofwork.cc | //#include <limits>
//#include <boost/multiprecision/cpp_int.hpp>
#ifndef Block_H_
#include "block.h"
#endif
#ifndef ProofOfWork_H_
#include "proofofwork.h"
#endif
#ifndef SHA256_H_
#include "../hash-library/sha256.h"
#endif
/*
namespace mp = boost::multiprecision;
constexpr int64_t maxNonce = std::numeric_limits<int... | ALGO | 0.968535 | 3.634106 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-09-14T22:39: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": "51019a9fba3... |
0ee68c84-a420-4442-8251-79ae367f5366 | paro8929/etaON | linear_int.cpp | #include <math.h>
double linear_int(double x0,double x1,double y0, double y1, double x)
{
double temp=0;
double t=x1-x0;
if (isfinite(1/t))
temp=((x-x0)*y1+(x1-x)*y0)/t;
else
temp=y0;
return temp;
}
double quadratic_int(double x0,double x1,double x2, double z0, double z1, double z2, double x)
{
d... | ALGO | 0.977497 | 5.181243 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-04-13T17:10: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": "262a5ea1a1b3... |
26385e0d-04eb-465a-a269-5efd41446c5c | VestniK/wayland-test | libs/cli/struct_args.hpp | #pragma once
#include <optional>
#include <ostream>
#include <span>
#include <string_view>
#include <vector>
#include <libs/cli/get_option.hpp>
namespace args {
namespace detail {
struct option_info {
std::string_view long_name;
std::string_view short_name;
std::string_view description;
};
struct parser_ifa... | TOOL | 0.925804 | 7.493861 | {
"github_metadata": {
"branch": "master",
"commit_count": 466,
"repo_created_at": "2018-05-05T06:27:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66136535... |
78631cb3-2beb-4897-8e70-89d7c8c52504 | frankie02m2023/Project2AED | source_code/FlightNetwork.cpp | //
// Created by franc on 19/12/2023.
//
#include <queue>
#include "FlightNetwork.h"
/** @file FlightNetwork.cpp
* @brief Implementation of FlightNetwork class
*/
/** Finds the airport in the flight network.
* Complexity: O(1) (O(n) in the worst case scenario)
* @param airport airport we want to find
* @return... | ALGO | 0.997943 | 5.461719 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2023-12-19T01:53: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": "b5d399741... |
74f7df33-366a-40ec-ac9a-730ac9ab49f9 | wufan-home/algorithm_problem_set | cpp/0047.cpp | /*
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[
[1,1,2],
[1,2,1],
[2,1,1]
]
*/
class Solution {
public:
void getPermutationUnique(vector<int>& nums, int start, vector<vector<int>>&... | ALGO | 0.999949 | 6.503624 | {
"github_metadata": {
"branch": "master",
"commit_count": 872,
"repo_created_at": "2016-05-14T02:20: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": "7c0830c3... |
da625ee3-e504-4973-b00b-c20446fb9eff | NagiKasuya/dvc-cs165 | labAssignment2MakingExactChange.cpp | // <NAME>//
// <NAME>//
// ID:1871978 //
// Lab Assignment 2, Making Exact Change //
// Date February 25th//
#include <iostream>
using std::cout;
using std::cin;
using std::ios;
using std::endl;
#include <string>
using std::string;
#include <utility>
int main()
{
double hundreddollor = 0;
double fiftydollor... | ALGO | 0.925844 | 3.917173 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-08-02T04:39:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8cd49632b5... |
f974e628-4197-4180-8a5c-0109b4305811 | ritece/UvaSolutions | fillTheContainers.cpp | #include<iostream>
using namespace std;
typedef long long int ll;
bool isPossibleToFill(ll capacityArray[], ll containerSize, ll totalVessels, ll totalContainer )
{
ll start = 0;
while(start< totalVessels and totalContainer > 0)
{
if(capacityArray[start]> containerSize)
... | ALGO | 0.999921 | 3.364494 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2015-12-12T07:14:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "de253b53bf... |
25caacb1-dfbf-464f-82f0-2b0b8d8e7f5a | hyungupark/coding-test | leetcode/algorithms/118_pascals_triangle/main.cpp | #include <vector>
using namespace std;
class PascalsTriangle
{
public:
vector<vector<int>> generate(int numRows)
{
vector<vector<int>> result;
for (int i = 0; i < numRows; i++)
{
vector<int> row;
for (int j = 0; j <= i; j++)
{
if (j =... | ALGO | 0.999991 | 6.703904 | {
"github_metadata": {
"branch": "main",
"commit_count": 494,
"repo_created_at": "2024-09-30T13:51: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": "58ccdfe3e1... |
1ba8d826-fbdb-48f9-ad04-cdca53a22599 | openFirrre/CSU-CS_DS-Assignments | 1-Freshman-Year/Fundamental-of-Computer-Programming/other-leetcode-practice/leetcode_518.c++ | //
// Created by Shawn33712 on 24-8-24.
//
/*
518. 零钱兑换 II
中等
相关标签
相关企业
给你一个整数数组 coins 表示不同面额的硬币,另给一个整数 amount 表示总金额。
请你计算并返回可以凑成总金额的硬币组合数。如果任何硬币组合都无法凑出总金额,返回 0 。
假设每一种面额的硬币有无限个。
题目数据保证结果符合 32 位带符号整数。
示例 1:
输入:amount = 5, coins = [1, 2, 5]
输出:4
解释:有四种方式可以凑成总金额:
5=5
5=2+2+1
5=2+1+1+1
5=1+1+1+1+1
示例 2:
输入:amount... | ALGO | 0.999931 | 5.629224 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2024-04-21T09:19:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "144e468840... |
cd94b7d4-1043-4a11-9ce6-0e4f61e9a186 | royappa/contests | GCJ/b2011r1c.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.999956 | 3.811961 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2024-12-29T21:37: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": "75ff8ace116... |
7e19a60a-dab5-4081-8d06-423c59eddf50 | qtheperfect/cpppp | code/nqueens.cpp | /***************************************************************************
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
0 | | | | | | | | W |
+---+---+---+---+---+---+---+---+
1 | | | W | | | | | |
+---+---+---+---+---+---+---+---+
2 | W | | ... | ALGO | 0.999308 | 5.508389 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-04-01T05:43: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": "fbec463e21d... |
63f14722-fb7d-4463-be14-471c4c5b9c37 | tauhrick/Competitive-Programming | Contests/Google/Code_Jam_2020/Qualification/Vestigium.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int tc;
cin >> tc;
for (int tt = 1; tt <= tc; ++tt) {
cout << "Case #" << tt << ": ";
int n;
cin >> n;
int x;
cin >> x;
vector<vector<int>> grid(n... | ALGO | 0.999187 | 4.382855 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2019-06-24T10:51:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9655e6d0... |
db774ee5-c50a-43ee-ba23-cf001e37d1a2 | NohMinKyung/cp2016440038 | 20181113_SelectionSort/20181113_SelectionSort.cpp | #include <stdio.h>
//함수 : findMin()
//입력 : 배열(배열 이름, 배열 길이)
//출력 : 배열, 최소값
int findMin(int* arr, int len) {
int min = arr[0];
for (int count = 1; count < len; count++) {
if (min > arr[count]) min = arr[count];
}
return min;
}
//함수 : findMinIndex()
//입력 : 배열(배열 이름, 배열 길이)
//출력 : 최소값의 인덱스
int findMinIndex(int* ar... | ALGO | 0.999971 | 4.853215 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-09-18T06:53:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e127265026... |
faedb8c5-f706-40ee-a39c-7814904f562d | yananfan/CodeTest | Offer/41_TwoNumbersWithSum.cpp | //#define _TwoNumbersWithSum_
#ifdef _TwoNumbersWithSum_
#include<iostream>
using namespace std;
bool FindNumbersWithSum(int data[], int length, int sum_expected, int* num1, int* num2);
int main()
{
int data[] = { 1, 2, 4, 7, 11, 15 };
int length = sizeof(data) / sizeof(int);
int sum_expected = 4;
int num1, num2;... | ALGO | 0.999706 | 4.185439 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-02-24T06: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": "4ca211d4ae... |
779c6e03-5ba9-4b8b-a5ae-84b24f22c242 | arobot/LeetCode | old/FizzBuzz/FizzBuzz.cpp | #include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <stdlib.h>
using namespace std;
vector<string> fizzBuzz(int n);
int main(){
vector<string> strings;
int n = 0;
cin >> n;
strings = fizzBuzz(n);
for (int i = 0; i < n; ++i) {
cout << "i=" << i + 1 << ":";
... | ALGO | 0.999864 | 4.536315 | {
"github_metadata": {
"branch": "remote",
"commit_count": 173,
"repo_created_at": "2016-11-18T09:16: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": "68289b0f... |
53214b3c-3f56-41a9-9cfc-ad2e60b3bf5e | korDen/battlesim | engine/tools.cpp | /***************************************************************************
* Copyright (C) 2009 by <NAME> <<EMAIL>> *
* *
* Part of the Free Heroes2 Engine: *
* http://sourceforge.net/projec... | TOOL | 0.964606 | 3.973243 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-10-12T03:21:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45b530e18291... |
96daf53a-f70e-4ece-9743-089d7a3c22fe | z1885874/241-Backup | Assign8/eval.cpp | /*
eval.cpp
CSCI 241 Assign8
Created by <NAME> (z1885874)
Section 2
*/
#include "eval.h"
/**
* checks if thier is bianary operators
* @param op, the string were input into the function
* @returns true or false if binary operator or not
**/
bool isbin(const std::string& op)
{
if (op[0] == '~')
{
return fals... | ALGO | 0.977211 | 4.770917 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-10-03T20:03: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": "b81b1e9aeb07... |
442df40f-cab7-4a10-9312-e3fce14c5190 | xinsongyan/bigman | bigman_control/include/inverse_dynamic_controller/inverse_dynamic_controller.h | #ifndef BIGMAN_CONTROL_INVERSE_DYNAMIC_CONTROLLER_H
#define BIGMAN_CONTROL_INVERSE_DYNAMIC_CONTROLLER_H
#include "ros/ros.h"
#include "ros/time.h"
#include <std_srvs/Empty.h>
#include "bigman_driver/bigman_driver.h"
#include "bigman_kinematic/bigman_kinematic.h"
#include "quadprog/quadprog.hpp"
enum ContactState {
... | ALGO | 0.955037 | 4.506946 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-02-01T10:03:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7aa1738b5... |
cc248f8f-09a5-468d-b289-4cd79e39b8ea | Anurag-Negi28/DSA-Problems | Sorting & Searching_01/cartesian_sort.cpp | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, int>> sortCartesian(vector<pair<int, int>> v)
{
int N = v.size();
// your code goes here
sort(v.begin(), v.end(), [](pair<int, int> a, pair<int, int> b)
{
if (a.first == b.first) // If x values are the same
... | ALGO | 0.999989 | 5.781083 | {
"github_metadata": {
"branch": "main",
"commit_count": 166,
"repo_created_at": "2024-08-10T11:59:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aacc5e298e... |
9d4ca008-a3fe-403b-9f9e-049cb57da32e | trungnam003/tma_exercise_intern_trungnam | exercise_code/priority_queue/p_queue_restaurant.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cstdlib>
#include <map>
#include <iterator>
#include<sstream>
#include <vector>
#include<memory>
using namespace std;
map<int, int> mp;
struct Customer {
int vip;
int id;
int order_num;
string food_name;
string name;... | TOOL | 0.909644 | 3.558095 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-11-22T13:10:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a31a2b7f9d56... |
0f0e212e-b976-4f37-acd6-408f3b6f78d9 | wanjarisaurabh/CODE | ARRAY/2 two sum.cpp |
// TWO SUM
// BRUTE
#include <bits/stdc++.h>
using namespace std;
string twoSum(int n, vector<int> &arr, int target) {
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (arr[i] + arr[j] == target) return "YES";
}
}
return "NO";
}
int main()
{
int n = 5;... | ALGO | 0.999974 | 5.859339 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-03-26T10:02: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": "30084e5a8d9... |
c268b328-9501-4ab3-9bba-c826021b34ee | AMReX-Codes/amrex | Src/LinearSolvers/MLMG/AMReX_MLNodeLinOp.cpp |
#include <AMReX_MLNodeLinOp.H>
#include <AMReX_MLNodeLinOp_K.H>
#include <AMReX_MLMG_K.H>
#include <AMReX_MultiFabUtil.H>
#ifdef AMREX_USE_EB
#include <AMReX_EBMultiFabUtil.H>
#endif
#ifdef AMREX_USE_OMP
#include <omp.h>
#endif
namespace amrex {
MLNodeLinOp::MLNodeLinOp ()
{
m_ixtype = IntVect::TheNodeVector()... | ALGO | 0.944466 | 6.760493 | {
"github_metadata": {
"branch": "development",
"commit_count": 27456,
"repo_created_at": "2017-04-28T19:37:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 637,
"forks": 407,
"issues": 21,
"pull_requests": 19
},
"file_meta": {
"content_id... |
80387340-601c-4809-afde-12255eaf4725 | priyank1618/DSA-practice | dsa sheets/array/sorting_algos.cpp | #include<bits/stdc++.h>
using namespace std;
void selctionsort(int arr[],int n)
{
//in the selection sort select the min element and swap it
for (int i = 0; i < n-1; i++) // this loop go to only n-2 element last element sort j hoy
{
int mini = i; //assume first index is mini now find smaller one... | ALGO | 0.999952 | 5.024031 | {
"github_metadata": {
"branch": "master",
"commit_count": 119,
"repo_created_at": "2023-04-30T05: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": "d6745171... |
027ef3a7-9562-4c6d-a20b-0ef9b4a6c95f | NJUCG/Moer-lite | src/FunctionLayer/Shape/Intersection.h | #pragma once
#include <CoreLayer/Math/Math.h>
#include <FunctionLayer/Ray/Ray.h>
class Shape;
//* Ray与Shape交点处的信息
struct Intersection {
float distance; // 从光线起点到交点的距离
Point3f position; // 交点的位置
Vector3f normal; // 交点处的法线
Vector3f tangent, bitangent; // 交点处的切线和副切线
Vector2f... | ALGO | 0.991885 | 5.345036 | {
"github_metadata": {
"branch": "2025",
"commit_count": 73,
"repo_created_at": "2023-02-04T01:28:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 65,
"forks": 26,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "41dc0879aa... |
668ba507-548e-4e57-8074-9d8f154f1fc2 | liaoyaonline/LeetCodeNote | 算法模板/通用/删除某些元素的均值/main.cpp | /*pow(16,i),queue.front()struct Tree{};vector<string> res(8, "");mp.find(key) ==
* mp.end() int a[5] = {},vector<int> num(a,a+..) set test; test.insert(1),auto
* it = test.begin() bool cmp(const word &num1, const word &num2) {
return num1.value != num2.value ? num1.value > num2.value: num1.name <
num2.name;} v.ins... | ALGO | 0.999577 | 3.877978 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-02-16T14:22:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d2775b9dc... |
10840842-86d5-4c3a-9dc0-3283770d20e6 | xjw/cpp | array/slidingWindow.cpp | /**
* http://blog.chinaunix.net/u3/105033/showart_2209043.html
* http://www.mitbbs.com/article_t1/JobHunting/31728173_0_4.html
*/
#include <iostream>
#include <queue>
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
using namespace std;
int a[] = {1, 3, -1, -3, 5, 3, 6, 7};
int n = ARRAY_SIZE(a);
class comp {
... | ALGO | 0.99995 | 3.815305 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2010-12-23T19:11:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84c9dcf4... |
e028ed77-5b82-4eae-8e1e-1678f03b31f7 | itaiweb/computer_arch | wet03/dflow_calc.cpp | /* 046267 Computer Architecture - Winter 20/21 - HW #3 */
/* Implementation (skeleton) for the dataflow statistics calculator */
#include "dflow_calc.h"
#include <vector>
using namespace std;
// class representing a single node in the dependency tree.
class node
{
public:
node(int, int);
~node... | ALGO | 0.999379 | 6.244428 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2020-10-24T14:32: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": "74d4be70473... |
70803b60-f480-4b8b-b1f8-28f98ed86032 | MicrosoftDocs/visualstudio-docs | docs/snippets/cpp/VS_Snippets_Winforms/ListBox.FindString2/CPP/form1.cpp | #using <System.Data.dll>
#using <System.Windows.Forms.dll>
#using <System.dll>
#using <System.Drawing.dll>
using namespace System;
using namespace System::Drawing;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Data;
/// <su... | TOOL | 0.981851 | 5.157547 | {
"github_metadata": {
"branch": "main",
"commit_count": 62083,
"repo_created_at": "2016-11-14T19:36:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1130,
"forks": 1724,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "145... |
8fb13c6c-535a-4393-8113-54288b3af1e3 | akhikolla/testpackages | fuzzedpackages/lowpassFilter/src/FilterBessel.cpp | #include "FilterBessel.h"
/***************
* class FilterBessel
* implements abstract class Filter for the Bessel filter
* <NAME>, 2016
***************/
FilterBessel::FilterBessel(const List &input) : truncation(input["truncation"]), C(input["C"]),
timescaling(input["timescaling"]), A(input["A"]), a(wrap(input["... | ALGO | 0.998611 | 4.872968 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bdad57d63... |
1459562f-f15d-424c-af99-fd4cc2087823 | CGAL/cgal | Voronoi_diagram_2/doc/Voronoi_diagram_2/CGAL/Apollonius_graph_adaptation_policies_2.h |
namespace CGAL {
/*!
\ingroup PkgVoronoiDiagram2Disks
The class `Apollonius_graph_caching_degeneracy_removal_policy_2` provides a model for the `AdaptationPolicy_2`
concept. The template parameter of the `Apollonius_graph_caching_degeneracy_removal_policy_2` class must be a
model of the `DelaunayGraph_2` concept, an... | TOOL | 0.963296 | 6.794813 | {
"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... |
f0c650fd-a42a-48e7-8ce8-13a1bb76ed6f | tommynton/Data-Structures-and-Algorithms-Cpp | Data Structures/HashTables/SeperateChaining_HashTable.cpp | #include <assert.h>
#include <cstring>
#include <iostream>
#include <string>
#include <math.h>
#include <vector>
using namespace std;
const int DEFAULT_CAPACITY = 3;
const double DEFAULT_LOAD_FACTOR = .75;
template <class T>
struct Node {
Node<T> *next;
Node<T> *prev;
T data;
};
template... | ALGO | 0.999179 | 4.487086 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-11-08T00:58: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": "6dd366fa709... |
7d9e94b9-be26-47fb-8861-663ccb867301 | BoarBlog/BrentDekker | TestRunner/TestRunnerLib/Secant.cpp | //--------------------------------------------------
// Implementation of class Secant
//
// @author: <NAME>
//
// @date: 2025-07-06
//--------------------------------------------------
#include "Secant.h"
using namespace NVL_App;
//--------------------------------------------------
// Constructors and Terminators
//... | ALGO | 0.999986 | 5.931253 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-06-30T10:51:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0382469d152... |
0103ba29-265e-4cf7-b474-0fc89138860f | ashik1104/LEETCODE-F-100 | BINARY_TREE/100_Same_tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999952 | 6.11032 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-05-24T14:18: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": "56d69bd3c122... |
a161f2c6-332f-487e-826b-6f1223e234d8 | firoorg/firo | src/llmq/quorums_commitment.h | // Copyright (c) 2018 The Dash Core developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef DASH_QUORUMS_COMMITMENT_H
#define DASH_QUORUMS_COMMITMENT_H
#include "consensus/params.h"
#include "evo/deterministicmn... | ALGO | 0.917847 | 7.374882 | {
"github_metadata": {
"branch": "master",
"commit_count": 17581,
"repo_created_at": "2016-09-09T22:50:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 751,
"forks": 361,
"issues": 24,
"pull_requests": 16
},
"file_meta": {
"content_id": "e... |
387f0400-8f46-4c0b-9681-ff42b10664be | thisisshub/HacktoberFest | folders/LeetCode C++ Solutions/add-two-numbers(LinkedList).cpp | /**
* Author: <NAME>
* Problem: 2. Add Two Numbers
*/
/**
* 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) {}
... | ALGO | 0.999904 | 5.935524 | {
"github_metadata": {
"branch": "master",
"commit_count": 3643,
"repo_created_at": "2020-09-29T10:51:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 659,
"issues": 8,
"pull_requests": 17
},
"file_meta": {
"content_id": "e2b... |
db8018df-9096-4518-b626-080e37cbed94 | HommeChai/FIR_Algorithms | ACFIR/transform.cpp |
#include "transform.h"
#include <iostream>
#include <iomanip>
#include <cstdlib>
namespace dsplib{
namespace trans{
int bitrev(int k, int len) {
int kr = 0;
for(int i = 0; i < len; i++) {
kr |= ((k >> i) & 1) << (len - 1 - i);
}
return kr;
... | ALGO | 0.999582 | 4.836552 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-06-26T07:56:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ad4e477a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.