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 |
|---|---|---|---|---|---|---|---|
bdfcb1fe-8bf8-4bc0-b395-51de7e83eb56 | mindspore-ai/mindspore | mindspore/ccsrc/plugin/device/cpu/kernel/erfinv_cpu_kernel.h | /**
* Copyright 2022 Huawei Technologies 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.971675 | 3.510322 | {
"github_metadata": {
"branch": "master",
"commit_count": 83896,
"repo_created_at": "2020-02-11T08:43:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4559,
"forks": 740,
"issues": 181,
"pull_requests": 20
},
"file_meta": {
"content_id": ... |
62c0938c-b7c6-4af2-ad16-ab9452605901 | xyiyy/icpc | src/shuoj/problem set/1783.cpp | //gaoshenbaoyou ------ pass system test
#include <iostream>
#include <sstream>
#include <ios>
#include <iomanip>
#include <functional>
#include <algorithm>
#include <vector>
#include <string>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <cs... | ALGO | 0.999748 | 3.047315 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2015-08-04T13:49:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47716cc2... |
f8d07c82-a891-4ac8-8629-85fed5792a26 | konhyong/threeSphere | src/generator.hpp | #ifndef INCLUDE_GENERATOR_HPP
#define INCLUDE_GENERATOR_HPP
#include <iostream>
#include "allocore/al_Allocore.hpp"
#include "transformations.hpp"
using namespace al;
using namespace std;
enum GroupType {
EUCLEADIAN = 0,
SPHERICAL,
HYPERBOLIC
};
struct Transform {
Mat4d mat;
int depth;
Mat4d old;
};
s... | ALGO | 0.980782 | 6.078807 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2017-06-27T20:53:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "052564f1... |
18cef6f3-ab3d-4e4d-81b1-02de45f2d65f | fbksd/fbksd-package | denoisers/SBF/ReconstructionFilter.h |
/*
Copyright(c) 2012-2013 <NAME>
All rights reserved.
The code is based on PBRT: http://www.pbrt.org
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain... | ALGO | 0.986074 | 6.139969 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-01-05T21:39:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c020788f87... |
ce504100-3494-474c-b840-095ca0110158 | daspers/CP | CodeForces/Normal/1228D.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define INF 2000000000000000000LL
#define EPS 1e-9
#define debug(a) cerr<<#a<<"="<<(a)<<"\n"
#define FastSlowInput ios_base::sync_with_stdio(false); cin.tie(NULL);
typedef long long ll;
typedef ... | ALGO | 0.999913 | 3.87302 | {
"github_metadata": {
"branch": "master",
"commit_count": 447,
"repo_created_at": "2017-08-01T14:39: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": "02c7bb83... |
5535b7de-e14d-478f-b911-b4fc8594271b | husainasfak/ds-and-algo | CPP/01. basics-of-cpp/02. Array.cpp | #include<bits/stdc++.h>
using namespace std;
void printArray(int arr[],int size){
cout<<"size of array in this function "<<sizeof(arr) << endl;
// ! Array passed by reference so this would print size of address not actual array size (only address passed not actual array and both array share the common memor... | ALGO | 0.99019 | 4.780583 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-02-17T03: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": "18ab14486f5... |
2f90536d-7f17-4aab-a6e2-bfcb85d64ec5 | abhishek18124/LVCPPJan2025 | LVCPPJan2025/Lecture 53/001DP_Permutations.cpp | /*
https://leetcode.com/problems/permutations/
*/
class Solution {
public:
vector<vector<int>> ans; // to track all the permuations of v[]
vector<int> perm; // to track a single permuation
int n; // to track the size of v[]
void f(const vector<int>& v, int i, int bitmask) {
// base case
if (bitmask == (... | ALGO | 0.999986 | 6.725704 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2025-01-21T19:22:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c202678e096... |
8996d165-d0d8-41f5-ab0a-dd5fff3f4cca | amitpoitrix/Windows | DSA_Practice/1Beginner/6_Trees/17_MaxWidthBT.cpp | #include<iostream>
#include<queue>
using namespace std;
// striver Tree Series : Leetcode 662. Maximum Width of Binary Tree
// Max width of a BT is the max distance btw two nodes at the same level
struct Node{
int data;
Node * left;
Node * right;
Node(int data){
this->data = data;
this... | ALGO | 0.9999 | 5.326579 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-28T10:55: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": "bbc60c776ee5... |
9f1b0340-b2b8-4ec5-8e1a-63593b6f73c9 | IvanKasyanov2004/VK_course_2024 | seminar 1/4.cpp | #include <iostream>
using namespace std;
#ifndef N
#define N 3
#endif
#ifndef M
#define M 7
#endif
void showArrayM(int (&a)[M]){
for (int i = 0; i < M; i++){
std::cout << a[i] << " ";
}
}
void showArrayN(int (&a)[N]){
for (int i = 0; i < N; i++){
std::cout << a[i] << " ";
}
}
//слияни... | ALGO | 0.999871 | 4.442617 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-03-24T18:19: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": "1baccdecaa72... |
cbc3827b-8003-46d8-85ac-bef270ad1cd5 | amalendu02/Data-Structure | TREE/depthfirstsearch.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int val) {
this->data = val;
this->left = NULL;
this->right = NULL;
}
};
// its return root node of created tree
Node* createTree() {
cout << "Enter the val... | ALGO | 0.999905 | 4.693678 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-05-24T16:35: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": "fd9dd954d66... |
717ae2fd-b08a-4266-b2b5-5c6a76041dcd | jasper166/CP | CSES/Graph/Labyrinth/sol.cpp | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair < int, int >;
using pll = pair < ll, ll >;
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
#define FOR(i, a, b) for(int ... | ALGO | 0.999989 | 3.454456 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2023-09-17T08:57:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e101f7b2... |
5a2ee3f3-ca02-47aa-b83a-f8e51043aa73 | fuqinho/POJ | 3280/main.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999972 | 3.468251 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2012-01-31T09:00:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c326a4b0... |
275eef2e-58bc-4a58-b83f-a5fb58de067a | devinpowers/Cplusplus | Weeks/Week8/algorithms/search_value.cpp |
#include<iostream>
using std::cout; using std::endl;
#include <map>
using std::map;
#include<string>
using std::string;
void printKey(map<int, string>& Map, string K) // pass in map and value to find
{
// If a is true, then we have
// not key-value mapped to K
bool a = true;
// Traverse th... | ALGO | 0.984043 | 4.038059 | {
"github_metadata": {
"branch": "main",
"commit_count": 383,
"repo_created_at": "2020-12-01T20:28: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": "99c84068e1... |
c9544189-0ea9-43c0-ad97-cb05254eb41a | TahRulpi/OnlineSolves | Toph/OppositeCase.cpp | #include <stdio.h>
#include <string.h>
#define MAX_SIZE 100
using namespace std;
string convertString(string & str){
int length = strlen();
for (int i=0; i<length; i++){
//convert it to upper
if (str[i]>= 'a' && str[i]<= 'z'){
str[i] = str[i]-32;
}
else if(str[i]>= '... | ALGO | 0.999117 | 3.954813 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-09-24T07:52: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": "10eaef65b071... |
349cafc3-cc92-46fc-ba79-6475af585817 | t-mochizuki/cpp-study | AtCoder/Educational DP Contest/A - Frog 1/main.cpp | // g++ -std=c++14 -DDEV=1 main.cpp
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::abs;
using std::min;
#define rep(i, n) for (int i = 0; i < (n); ++i)
class Program {
private:
int N;
vector<int> h;
... | ALGO | 0.999864 | 4.375408 | {
"github_metadata": {
"branch": "main",
"commit_count": 731,
"repo_created_at": "2017-05-27T08:16:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d32e0f6ed... |
ab9a41c0-6d2c-4fe3-b991-35d77ca19528 | kaleemfaryad/PF | week7/task7.cpp | #include <iostream>
using namespace std;
void patient(int days);
main()
{
cout << "Enter the number of days you visited Hospital: ";
int Days;
cin >> Days;
patient(Days);
}
void patient(int days){
int D1 = 0;
int treated = 0;
int untreated = 0;
int doctors = 7;
for (int i = 1; i <= days; i++)
{
... | ALGO | 0.999411 | 3.703282 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-09-16T15:18: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": "99390475ab26... |
127a3a0a-6d98-41c8-ad35-6a4e079dbb7c | bjadamson/BoomHS | include/boomhs/rectangle_algorithms.hpp | #pragma once
#include <boomhs/polygon.hpp>
#include <boomhs/transform.hpp>
// Implementation of various algorithms dealing with 2-dimensional rectangles.
//
// NOTE:
// Implementation of these algorithms is left as non-member functions on a central rectangle "Type"
// is intentional to keep algorithms de-coupled from ... | TOOL | 0.998397 | 6.853186 | {
"github_metadata": {
"branch": "release",
"commit_count": 1388,
"repo_created_at": "2016-06-02T02:21:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1c58b... |
5522630c-b7db-4e6c-9f40-e3c61b4799a7 | daocrossover/Leetcode-Cpp | 56. Merge Intervals/Solution1.cpp | // Description:
// Given a collection of intervals, merge all overlapping intervals.
// Example 1:
// Input: [[1,3],[2,6],[8,10],[15,18]]
// Output: [[1,6],[8,10],[15,18]]
// Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6].
// Example 2:
// Input: [[1,4],[4,5]]
// Output: [[1,5]]
// Expla... | ALGO | 0.999992 | 6.699782 | {
"github_metadata": {
"branch": "master",
"commit_count": 249,
"repo_created_at": "2018-09-10T19:58:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d57e120... |
6fe4596e-6791-48ed-adae-60d90453d14c | sultanul-kawser/first-ripo | C++/search.cpp | #include <iostream>
#include <string>
using namespace std;
int search(int array[], int size, int mynum);
int main()
{
int array[] = {3, 5, 4, 1, 8, 9, 2, 6, 7, 10};
int size = sizeof(array) / sizeof(array[0]);
int index;
int mynum;
cout << "Enter a element from 1 to 10 to search: " << endl;
c... | ALGO | 0.990393 | 3.345416 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2025-03-11T20:23: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": "e9479761d4e... |
0e0e21c6-9aed-43a9-9d31-ef2b4bd1cb95 | GerhardRaven/P2VV | src/RooTrivialTagDecay.cxx | /*****************************************************************************
* Project: RooFit *
* Package: RooFitModels *
* @(#)root/roofit:$Id$
* Authors: ... | TOOL | 0.911408 | 5.394714 | {
"github_metadata": {
"branch": "master",
"commit_count": 3313,
"repo_created_at": "2014-06-20T21:37:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a8312d... |
99d1db65-2388-412f-a382-b56e76f6825c | asmelko/gpgpu24-artifact | esom-cuda/esom-cuda/headers/projection-cuda.hpp | #ifndef ESOM_CUDA_PROJECTION_CUDA_HPP
#define ESOM_CUDA_PROJECTION_CUDA_HPP
#include <algorithm>
#include <type_traits>
#include "interface.hpp"
#include "projection.cuh"
#include "structs.cuh"
#include <cuda/cuda.hpp>
/**
* Basic CUDA implementation of top-k algorithm with templated kernel wrapper.
*/
template ... | ALGO | 0.996072 | 7.035373 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-11-24T15:38:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "076ecdb111e3... |
0e29ab45-13fd-4d19-bf01-7794eacf54ed | manavkush/PracticeProblems | Leetcode/super-egg-drop/Accepted/8-8-2022, 12:45:18 PM/Solution.cpp | // https://leetcode.com/problems/super-egg-drop
class Solution {
private:
int util(vector<vector<int>> &dp,int n, int k) {
if(n==0 || n==1) return n;
if(k==1) return n;
if(dp[n][k]!=-1) return dp[n][k];
int ans = 1e7;
int l = 1;
int r = n;
... | ALGO | 0.999991 | 5.67848 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2020-05-01T23:53: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": "7ab113e6... |
5c2b68af-ffa4-4675-945d-40c8fc88c6d0 | deSigntheClutch/competitive-programming-code-repository | Atcoder/AtCoder Beginner Contest 152/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const double pi = acos(-1.0);
const int N = 1e6 + 5;
const int MOD = 1e9 + 7;
int prime[N], prime_id[N], len;
bool isnp[N];
int n, a[N], b[N], cnt[N];
int powMod(int u, int v) {
int res = 1;
while (v) {
if (v & 1) res = res * u % MO... | ALGO | 0.999991 | 4.856815 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-01-01T00:15: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": "664dd7745714... |
ad465057-50d7-479f-8015-22618d350ba7 | mkmark/leetcode | leetcode/2157/solution_4_1.cpp | /*
author: <EMAIL>
time: O()
space: O()
Runtime: 1270 ms, faster than 64.18% of C++ online submissions for Groups of Strings.
Memory Usage: 68.5 MB, less than 69.73% of C++ online submissions for Groups of Strings.
*/
// profiled
#include <bits/stdc++.h>
using namespace std;
class disjoint_set {
public:
vector... | ALGO | 0.999986 | 5.472446 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2022-01-21T14:01:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a36d771905... |
b29d380a-2e5c-4357-af99-5ce92440ec54 | DoHuuDuy2kPtit/Datastructure-Algorithm | Contest9/12.cpp | #include<bits/stdc++.h>
using namespace std;
bool check = true;
void BFS(int s, int t, vector<int> a[], bool chuaxet[], int truoc[]){
queue<int> q;
q.push(s);
chuaxet[s] = false;
while(!q.empty()){
int u = q.front();
q.pop();
for(int i = 0; i < a[u].size(); i++){
i... | ALGO | 0.999962 | 4.001692 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-05-24T18:27: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": "50b34b91c8... |
c663a280-b85f-40c4-a3ea-ee077b0e88bd | kishoremkv/dsa-prep | misc/NumberOfInversions.cpp | // codingninjas url: https://www.naukri.com/code360/problems/number-of-inversions_6840276?utm_source=youtube&utm_medium=affiliate&utm_campaign=striver_Arrayproblems&leftPanelTabValue=PROBLEM
// Using merge sort algo
int res = 0;
void merge(vector<int> & arr, int l1, int r1, int l2, int r2)
{
vector<int> temp;
i... | ALGO | 0.999925 | 5.897974 | {
"github_metadata": {
"branch": "main",
"commit_count": 127,
"repo_created_at": "2023-04-28T17:07: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": "061c2eb107... |
81a35df6-8889-4b6d-8de2-8b250e914c1d | lodhaakash07/Data-Structures-And-Algorithm | cycle sheet 2/pro2.cpp | /*
Write a program that takes the details of a person (name, age, and city) and sort it using
Insertion sort based on names. Then search for a specific name using binary search.
*/
#include<stdio.h>
#include<conio.h>
#include<string.h>
int size;
struct person{
char name[20];
int age;
char city... | ALGO | 0.999836 | 4.55926 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-09-21T08:10:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d59f997160... |
d30f1b04-d9f9-4216-a473-629f227884f2 | BillyLjm/LeetCode-Problems | 1091-Shortest_Path_in_Binary_Matrix.cpp | /*******************************************************************************
* 1091-Shortest_Path_in_Binary_Matrix.cpp
* Billy.Ljm
* 01 June 2023
*
* =======
* Problem
* =======
* https://leetcode.com/problems/shortest-path-in-binary-matrix/
*
* Given an n x n binary matrix grid, return the length of the ... | ALGO | 0.99999 | 6.367254 | {
"github_metadata": {
"branch": "master",
"commit_count": 237,
"repo_created_at": "2023-02-26T14:11: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": "530ed1f6... |
00608319-639e-471b-b061-174ed89eddab | pradeep891/6Companies30Days | Microsoft/q10 Stickler Thief.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
// } Driver Code Ends
class Solution
{
public:
//Function to find the maximum money the thief can get.
int FindMaxSum(int arr[], int n)
{
// Your code here
int ans[n+1] = {0};
ans[1]... | ALGO | 0.999794 | 5.710017 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2022-01-07T20:48: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": "304213319... |
606c64b0-8d3a-4ed0-aae5-6fe3ebd607e7 | phatbs21/Algorithm-High-school | t11/muave.cpp | #include <bits/stdc++.h>
using namespace std;
//██████╗░░█████╗░██████╗░██████╗░░█████╗░████████╗████████╗░█████╗░░██████╗
//██╔══██╗██╔══██╗██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝╚══██╔══╝██╔══██╗██╔════╝
//██████╔╝███████║██████╔╝██████╔╝██║░░██║░░░██║░░░░░░██║░░░██║░░██║╚█████╗░
//██╔═══╝░██╔══██║██╔══██╗██╔══██╗██║░░██║░... | ALGO | 0.999991 | 3.538213 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-09-19T09:28: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": "7306d5ded8e6... |
b7592b35-0905-488b-8875-9f6e3826e350 | enaim/Competitive_Programming | CODEFORCES/Round #626 (Div. 2)/A. Even Subset Sum Problem.cpp | #include <map>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <bitset>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <sstream>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define OO 2e9+10
#defi... | ALGO | 0.999111 | 3.324636 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-09-01T17:09:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4c391301e... |
2043f41c-9538-4222-9180-a9d296c169f1 | oceanbase/oceanbase | src/sql/rewrite/ob_transform_simplify_expr.cpp | /**
* Copyright (c) 2021 OceanBase
* OceanBase CE is licensed under Mulan PubL v2.
* You can use this software according to the terms and conditions of the Mulan PubL v2.
* You may obtain a copy of Mulan PubL v2 at:
* http://license.coscl.org.cn/MulanPubL-2.0
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BAS... | TOOL | 0.958133 | 5.596344 | {
"github_metadata": {
"branch": "develop",
"commit_count": 18841,
"repo_created_at": "2021-05-31T14:36:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9275,
"forks": 1759,
"issues": 441,
"pull_requests": 77
},
"file_meta": {
"content_id"... |
55bba39d-8507-4768-a59a-8b0042cc04ad | shrenisahu/LEET-CODE | 2244-minimum-rounds-to-complete-all-tasks/2244-minimum-rounds-to-complete-all-tasks.cpp | class Solution
{
public:
int minimumRounds(vector<int> &tasks)
{
sort(tasks.begin(), tasks.end());
unordered_map<int, int> mpp;
int count = 0;
for (auto i: tasks)
{
mpp[i]++;
}
for (auto it: mpp)
... | ALGO | 0.999923 | 4.385465 | {
"github_metadata": {
"branch": "main",
"commit_count": 1791,
"repo_created_at": "2022-06-01T05:39:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0334862f4... |
2e56d9df-5c24-4777-907c-40901eec5697 | MADEAPPS/newton-dynamics | newton-3.14/applications/demosSandbox/sdkDemos/demos/ClosestDistance.cpp | /* Copyright (c) <2003-2019> <Newton Game Dynamics>
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* includi... | ALGO | 0.983554 | 5.434585 | {
"github_metadata": {
"branch": "master",
"commit_count": 15119,
"repo_created_at": "2014-07-09T11:21:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 991,
"forks": 192,
"issues": 34,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6... |
1929634a-8400-47fb-83c9-474b2bdfebc1 | stephaneduarte/ASA1P_1516 | proj.cpp | #include <iostream>
#include <stdio.h>
#include <list>
#include <vector>
#define NIL -1
using namespace std;
//Undirected Graph
class Graph{
int NVertices;
list<int> *linked; //Dinamic array of adjacency lists
void SearchFundamentals(int u, bool visited[], int visittime[], int lowtime[], int parent[], bool ... | ALGO | 0.999851 | 4.155471 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-08-16T11:26: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": "5904019775... |
ee7ac4c4-e5c5-4e90-8d89-5b9d636494d4 | turesnake/leetPractice | src/_leetcode/leet_253.cpp | /*
* ====================== leet_253.cpp ==========================
* -- tpr --
* CREATE -- 2020.06.15
* MODIFY --
* ----------------------------------------------------------
* 253. 会议室 II
*/
#include "innLee... | ALGO | 0.999978 | 6.047652 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2020-05-13T04:27: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": "134a0765b... |
9c0e8a7a-23d4-49c7-9d36-6f9bc433723f | qzysw123456/ACM_ICPC_Template | WinterCamp2015/solutions-010290/a.cpp | #include <cstdio>
#include <iostream>
#include <queue>
#include <vector>
#include <functional>
typedef long long Long;
const int N = 200000;
int x[N];
int main()
{
int n, m, d, d0;
scanf("%d%d%d%d", &n, &m, &d, &d0);
for (int i = 0; i < n; ++ i) {
scanf("%d", x + i);
}
if (n == 1) {
std::cout << x[0] + d0 ... | ALGO | 0.999941 | 3.770162 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-03-27T06:30:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "abd46b2d4e... |
2700ea39-120d-4d2f-90cd-f1f6466f2c20 | SudarshanDamodare/DSA | gfg/linkedLists/dll.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define us unordered_set
// Doubly LinkedLists
class node{
public:
int data;
node* next;
node* prev;
node(int val){
data=val;
next=prev=NULL;
}
};
void displayLL(node* head){
while(head!=NULL){
cout<... | ALGO | 0.999178 | 4.313138 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2021-07-22T16:32: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": "0db56c10c... |
a0ba82e2-ba39-4692-857c-c54bfcc0ba87 | gitslick0/CPP_Kerr_Tracing | src/VP_CS/main.cpp | // Calculate the velocity of sources based on crosssectionally related accretion disk element
# include <iostream>
# include <cmath>
# include <VPCS/helper_functions.h>
# include <random>
# include <algorithm>
# include<valarray>
# include <array>
extern "C" {
double Fp(const double* p, const double* f1234, cons... | ALGO | 0.999855 | 4.953423 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2024-03-20T09:16:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "92226b136ad... |
6ef5ebcd-d266-4114-985e-6f29a1d27290 | mahabub19/resource | Contest/CF_practice/B_Sort_the_Subarray.cpp | #include<bits/stdc++.h>
using namespace std;
#define deb(x) cout << #x << " = "; print(x)
#define ll long long
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define N (ll)(2e5 +1)
#define f first
#define s second
#define pb push_back
#define mod (ll)(1e9+7)
void print(vector<ll> &vec){
f... | ALGO | 0.99994 | 4.478606 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-09-17T12:59:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "47427cf126c8... |
196f402a-533e-4e8e-9e2b-114d9da0e533 | truongduy134/uva-online-judge-solutions | Volume_119/UVA11995.cpp | #include <cstdio>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
void clearStack(stack<int> & mStack)
{
stack<int> mEmpty;
swap(mEmpty, mStack);
}
void clearQueue(queue<int> & mQueue)
{
queue<int> mEmpty;
swap(mEmpty, mQueue);
}
void clearPQueue(priority_queue<int> & mPQ... | ALGO | 0.999591 | 3.948474 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2013-05-09T16:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "edfb8cc... |
8b031af6-c559-4106-8583-f67dcf76567d | WHS241/Algorithms | structures/src/structures/binary_tree_base.tpp | #ifndef BINARY_TREE_CPP
#define BINARY_TREE_CPP
#include <stdexcept>
#include <structures/binary_tree_iterator.h>
namespace tree {
template<typename T> binary_tree<T>::node::~node() noexcept {
delete left;
delete right;
}
template<typename T>
const typename binary_tree<T>::node& binary_tree<T>::node::opera... | ALGO | 0.990775 | 6.913085 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2019-07-07T13:38: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": "a6fb97f7d... |
533b05b0-3219-4690-a6bd-d052e8056257 | Haroun-Jinzo/ML-DL-project | Algorithms/Knn.cpp | #include "Knn.h"
#include<cmath>
#include<limits>
#include<map>
#include"stdint.h"
#include"../DataHandler.h"
#define EUCLID
KNN::KNN(int val)
{
k = val;
}
KNN::KNN()
{
}
KNN::~KNN()
{
}
void KNN::find_knearest(data* query_point)
{
neightbors = new std::vector<data*>;
double current_min = std::numeric_limits<do... | ALGO | 0.95239 | 5.109283 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-23T17:37: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": "b69445bc0978... |
9481f6b9-048c-4635-989f-1050fa43f49a | narayanapavansai/CSA0618-Design-and-Analysis-of-Algorithm | binary search tree cost.cpp | #include <stdio.h>
#include <stdlib.h>
struct Node {
int key;
int freq;
struct Node* left;
struct Node* right;
};
struct Node* createNode(int key, int freq) {
struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
newNode->key = key;
newNode->freq = freq;
newNode->left = new... | ALGO | 0.999999 | 5.370165 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-11-21T03:42: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": "468eca6576e6... |
bb93a063-248f-4b66-a054-e9b5f60508ab | VivekSubr/algo-cpp | fsm/simple_regex_fsm.h | #pragma once
#include <string>
#include <unordered_map>
#include <iostream>
#include <cctype>
//https://leetcode.com/problems/regular-expression-matching/description/
/*
Given an input string s and a pattern p, implement regular expression matching with support for '.' and '*' where:
'.' Matches any single character... | ALGO | 0.916995 | 5.79672 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-10-21T05:11: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": "6daedfdbe63... |
d73708ea-4ac0-4a31-962f-1d9fb7b099f7 | Chalkydoge/FDU_DS | w12/w13/aaa.cpp | #include<stdio.h>
#include<string.h>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#define INF 0x3f3f3f3f
#define Max 1010
using namespace std;
int n,m,tt,ans;//顶点个数 边的个数 输出计数 MST的权值
struct edge
{
int u,v,w;
} Q[Max];
int mp[Max][Max],dis[Max],book[Max];
int used[Max][Max],pre[Max];
int out... | ALGO | 0.999974 | 3.581552 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-09-16T05:10: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": "78ad0e582... |
50b3c77a-95c4-4d07-94a0-a162aa2eb0fb | MutsuGhost1/AlgorithmAndDataStructure | Leetcode/53.cpp | class Solution {
public:
int maxSubArray(vector<int>& nums) {
/// kandane's algorithm
int current = nums[0], best = current;
for (int i = 1; i < nums.size(); i++) {
current = nums[i] + max(current, 0);
best = max(best, current);
}
return best;
}
... | ALGO | 0.999983 | 5.618634 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2021-09-17T11:24: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": "a30a66b6... |
5b90bf99-8d98-4c77-b885-c125d4d1fb61 | santiagosantos08/tp-ayda2-grafos | main.cpp | #include <iostream>
#include <list>
#include <set>
#include <map>
#include "Grafo.h"
const int rojo = 1;
const int blanco = 0;
void printLista(std::list<int> & camino);
void pruebaInteractiva();
void pruebaPreCargada();
bool existeCaminoDfs(Grafo<int> & g,int origen,int destino,std::list<int> & camino,std::set<int> &... | ALGO | 0.986122 | 4.600233 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-04-14T00:52: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": "0cce532f1d9... |
21a153c2-439b-4598-b6b3-b31a7060a07e | kamilszymczak1/my_solutions | cf/contests/1681/d.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#include <bitset>
#include <map>
#include <set>
#include <cstring>
using namespace std;
int inf = 1 << 30;
int Get(long long x, vector<bool>&ok) {
int result = 0;
while(x) {
ok[x % 10] = true;
result++;
x /= 10;
}
return... | ALGO | 0.999561 | 3.495419 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-04-23T06:54: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": "06ee8070349... |
35a7bf5a-372a-4f37-8a28-41df8525ad58 | zamax110813/kyopuro | kyopuro/algorithm_and_data_structure/chapter12/12_5.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)b;i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)b;i--)
#define FORA(i,I) for(const auto& i:I)
#define ALL(x) x.begin(),x.end()
#define SI... | ALGO | 0.999946 | 4.731782 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2021-11-18T01:59: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": "6567f3e2... |
cf0e69ca-b2a5-479c-8dd5-d12e69cc637f | ishandutta2007/codeforces-a | axs7384/normal/1575/H.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=505;
const int inf=1e9+7;
int f[N][N][N],g[N];
char s[N],t[N],_t[N];
int n,m;
int bor;
inline void mn(int &x,int y)
{
x>y?x=y:0;
}
int main()
{
scanf("%d%d",&n,&m);
scanf("%s",s+1);
scanf("%s",t+1);
for (int i=1;i<=m;++i)
{
for (in... | ALGO | 0.999977 | 3.594419 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51: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": "c9f61d4a03df... |
49297f0f-af77-465e-a4d6-bcd03b548de5 | gnishida/LeetCode | 1489/1489/1489.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <unordered_set>
#include <unordered_map>
using namespace std;
class Solution {
public:
vector<vector<int>> findCriticalAndPseudoCriticalEdges(int n, vector<vector<int>>& edges) {
for (int i = 0; i < edges.size(); i++) {
edges[i].push... | ALGO | 0.999754 | 5.698977 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-01-02T18:46: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": "5e52ff2d2... |
65092439-72d5-49c1-abc8-0a5fdc59b6e1 | kinantanbagaspati/competitive-programming | CSES/1669.cpp | #include <bits/stdc++.h>
using namespace std;
vector<long long> al[100069], ans;
long long par[100069];
void init(long long n, long long m){
long long u, v;
while(m--){
cin >> u >> v;
al[u].push_back(v);
al[v].push_back(u);
}
for(int i=1; i<=n; i++){
par[i] = -1;
}
... | ALGO | 0.999971 | 3.871257 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-03-07T09:45:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f89118629... |
cb8d9bf0-16c4-41df-a51f-b994cfcc34d8 | Ahhzsthl/RetestCode | unit6/6.7.cpp | #include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
const int MAXN = 4e4;
bool isPrime[MAXN];
vector<int> prime;
void Initial(){
//质数筛法
for(int i = 0; i < MAXN; i++){
isPrime[i] = true;
}
isPrime[0] = false;
isPrime[1] = false;
for(int i = 2; i < MAXN; ++i){
... | ALGO | 0.999577 | 4.298022 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2022-02-27T03:31: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": "910ba3727... |
032b9388-5d09-446f-8543-2ea91537d00c | HJackH/OnlineJudges | UVa/V005/539 - The Settlers of Catan.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 25 + 5;
int n, m, ans;
bool vis[MAXN][MAXN];
vector<int> G[MAXN];
void dfs(int x, int depth) {
ans = max(ans, depth);
for (int v : G[x]) {
if (!vis[x][v]) {
vis[x][v] = vis[v][x] = 1;
dfs(v, depth + 1);
... | ALGO | 0.999875 | 4.613519 | {
"github_metadata": {
"branch": "master",
"commit_count": 413,
"repo_created_at": "2020-03-06T14:01:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42fbbe88... |
4934786c-bc71-420f-9ab2-8be65691358e | Aryagithubk/CrackYourPlacement | 44-wildcard-matching/wildcard-matching.cpp | class Solution {
public:
bool isOnlyStar(string &p,int j){
for(int i=0; i<=j; i++){
if(p[i] != '*'){
return false;
}
}
return true;
}
bool helper(string &s,string &p, int i,int j,vector<vector<int>>&dp){
if(i < 0 and j < 0){
... | ALGO | 0.999993 | 5.234755 | {
"github_metadata": {
"branch": "main",
"commit_count": 727,
"repo_created_at": "2024-09-28T21:25: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": "007d96614e... |
46a634e8-b5d7-428d-beb9-551c1bd1f66c | mark1879/LeetcodePractice | greedy_algorithm/max_area.hpp | #ifndef MAX_AREA_HPP
#define MAX_AREA_HPP
/**
11. 盛最多水的容器
给定一个长度为 n 的整数数组 height 。有 n 条垂线,第 i 条线的两个端点是 (i, 0) 和 (i, height[i]) 。
找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。返回容器可以储存的最大水量。
提示:
n == height.length
2 <= n <= 105
0 <= height[i] <= 104
*/
#include <iostream>
#include <vector>
#include <... | ALGO | 0.998119 | 6.797692 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-07-13T03:12:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d258ee9b23b... |
8595a6fc-af8b-49bd-a7f5-d7754854dc08 | vamosbada/Algorithm | Baekjoon/cpp/boj_7562.cpp | //boj_7562
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
int t,a;
int dx[8] = {-1,-2,-2,-1,1,2,2,1};
int dy[8] = {2,1,-1,-2,2,1,-1,-2};
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> t;
while(t--){
pair<int,int> start;
pair<int,int> end;
... | ALGO | 0.999945 | 3.880488 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2025-03-31T12:03: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": "c680e87a9ac... |
397a7e39-b020-4fb3-a2ff-692b4b7c9e03 | x1o/funcopt | src/DirectionFunction.cc | #include "DirectionFunction.h"
Point FixDirection(const Point& p, Point& q, const ScalarField* f) {
auto dom = f->GetDomain();
if (! dom.Contains(p)) {
throw std::domain_error("Domain doesn't contain starting point.");
}
double contract_factor = 0.9;
while (! dom.Contains(p + q)) {
q = contract_facto... | ALGO | 0.99732 | 6.061991 | {
"github_metadata": {
"branch": "qt5-gui",
"commit_count": 18,
"repo_created_at": "2017-04-13T18:53: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": "905df6dd... |
2ec953ca-374a-4895-88fd-81ebdc9880bd | Javier-Larroca/ProgI-2024-2C-TN-Virtual | Clase 09/g06_ej05/main.cpp | #include <iostream>
using namespace std;
/*
5 Hacer una función llamada Redondear que reciba como parámetro un número
float y devuelva un número entero con el redondeo del mismo.
Por ejemplo:
Si recibe 7.78, debe devolver 8.
Si recibe 7.48, debe devolver 7.
Si recibe 7.5, debe devolver 8.
Hacer un programa para... | TOOL | 0.972557 | 3.609079 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-08-13T14:30: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": "c8d8407e317... |
b8fba108-aaed-4904-ba4f-872d62559aa0 | Aryan-Satija/DSA | GRAPHS/BFS AND DFS/enclaves.cpp | // LEETCODE -> Number of Enclaves
#include <bits/stdc++.h>
using namespace std;
void dfs(int i, int j, vector<vector<int>>& board)
{
board[i][j] = 0;
// left
if((j-1) >= 0 and board[i][j-1] == 1)
dfs(i, j-1, board);
// right
if((j+1) < board[0].size() and board[i][j+1] == 1)
dfs(i,... | ALGO | 0.999929 | 6.023909 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T13:38:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "395ad0c67687... |
575196c0-a6dc-4de4-b1d6-69a72ebbd539 | Yourrrrlove/leetcode-2 | 图论/最大人工岛.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
using namespace std;
class Solution {
private:
int area = 0;
int dire[2][4] = { {-1,1,0,0},{0,0,-1,1} }; //1—4表示上下左右四个方向
void dfs(vector<vector<int>>& grid, vector<vector<bool>>& visited, int x, int y, int flag) {
if (visited... | ALGO | 0.999968 | 5.520582 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2024-03-13T07:16: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": "8725b2db11... |
541c1ba6-f4c5-4703-a18b-1c17d0c606f0 | xuxian73/RISCV_Simulator | MemoryAccess.cpp | //
// MemoryAccess.cpp
// RISC-V pipeline
//
// Created by 许贤 on 2020/7/12.
// Copyright © 2020 许贤. All rights reserved.
//
#include "MemoryAccess.h"
void MemoryAccess::update() {
if (stall) return;
switch (opcode) {
case 0b0100011:
store();
return;
case 0b0000011:
... | ALGO | 0.99402 | 5.332177 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-07-14T07:20: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": "a468dd064... |
bb9959e4-b36b-4c5e-b02b-4607cfc4f1e4 | apple/turicreate | src/external/boost/boost_1_68_0/libs/hana/test/_include/auto/sort.hpp | // Copyright <NAME> 2013-2017
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
#ifndef BOOST_HANA_TEST_AUTO_SORT_HPP
#define BOOST_HANA_TEST_AUTO_SORT_HPP
#include <boost/hana/all_of.hpp>
#include <boost/hana/assert.hpp>
#i... | TEST | 0.920049 | 7.102002 | {
"github_metadata": {
"branch": "main",
"commit_count": 1571,
"repo_created_at": "2017-12-01T00:42:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11198,
"forks": 1137,
"issues": 502,
"pull_requests": 21
},
"file_meta": {
"content_id": "... |
2953d55d-36cd-4b81-8e8d-67636d436b16 | Mxdhushri/PICT_COURSEWORK_4thYEAR | sem 2/LP 5/High Performance Computing/MiniProject.cpp | #include <mpi.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <ctime>
// Function to perform quicksort on a vector
void quicksort(std::vector<int>& arr, int left, int right) {
if (left >= right) return;
int pivot = arr[(left + right) / 2];
int i = left, j = right;
... | ALGO | 0.999988 | 5.682938 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-07-06T18:15: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": "5e736aa2de1... |
eed71f00-5593-4fc2-96c2-868fa0281fee | nshkrdotcom/cli_experiments | agi-cli-platform/cpp_cli_tools/cli11_demo/src/config_manager.cpp | #include "config_manager.hpp"
#include <sstream>
#include <algorithm>
ConfigManager::ConfigManager() : verbose_(false) {
config_file_ = get_default_config_path();
if (!load_config()) {
create_default_config();
}
}
bool ConfigManager::load_config(const std::string& config_path) {
std::string pa... | CONFIG | 0.947081 | 6.202599 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-06-21T01:16: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": "72dd2c35d1e... |
426a1492-0cca-4aec-9450-84ab8119a5f5 | Kuldeep-Padshala/DSA | Concept022_BinaryTreeAdvanced/22-LongestPathSum.cpp | /*
class Node {
public:
int data;
Node *left;
Node *right;
Node(int x) {
data = x;
left = NULL;
right = NULL;
}
}; */
class Solution {
public:
// 7 +
pair<int,int> longestPathSum(Node* node,int height,int sum) {
// code here
if (n... | ALGO | 0.999973 | 5.303574 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2025-02-07T11:17: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": "7b6643a6a0... |
520a9557-4c9e-4902-959a-c88bd46a7b02 | YKSudhir/DSA | Stack/Stack_using_linked_list.cpp | #include<iostream>
using namespace std;
class Node
{ public:
int data;
Node *next;
public:
Node(int value)
{
data = value;
next =NULL;
}
};
class Stack
{
Node *top;
int size;
public:
Stack()
{
top = NULL;
size =0;
}
//push
void ... | ALGO | 0.99263 | 3.853339 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-22T12:50: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": "25474a1f17f7... |
7aa17e12-7ac1-4351-8bb8-be1e94a5dc1c | DollarAkshay/Competitive-Coding | CodeChef/CodeChef_Rupsa_and_the_Game.cpp | /*~~~~~~~~~~~~~~~~~~*
* *
* $<NAME>$ *
* *
*~~~~~~~~~~~~~~~~~~*/
//https://www.codechef.com/JAN16/problems/RGAME
#include <math.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <set>
#i... | ALGO | 0.999852 | 3.763522 | {
"github_metadata": {
"branch": "master",
"commit_count": 570,
"repo_created_at": "2018-01-31T16:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b1bef28... |
c8f88ca4-18de-4856-b67b-459a2e39012d | puzzlef/leiden-communities-openmp | inc/dfs.hxx | #pragma once
#include <vector>
using std::vector;
#pragma region METHODS
/**
* Find vertices visited with DFS.
* @param vis vertex visited flags (updated)
* @param x original graph
* @param u start vertex
* @param ft should vertex be visited? (vertex)
* @param fp action to perform on every visited vertex (ve... | ALGO | 0.995831 | 5.874165 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2023-06-12T06:59:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 16,
"forks": 5,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "375483f8e6f... |
cfdf8a55-c3f8-42f1-9775-060d26ab29db | lnishan/Competitive-Programming_Solutions | TIOJ/1056_2.cpp | // 0 - , 1 O , 2 X
#include <iostream>
using namespace std;
int a[9], three[9];
char v[20000]; // 3^9
int getN(){
int i, n=0;
for( i=0; i<9; i++ )
n+=a[i]*three[i];
return n;
}
int check(){
if( (a[0]==a[1]&&a[1]==a[2]&&a[0]==1) || (a[3]==a[4]&&a[4]==a[5]&&a[3]==1) || (a[6]==a[7]&&a[7]==a[8]... | ALGO | 0.999607 | 4.069431 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2015-03-20T05:48:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47a65b06... |
0f4dbdfa-37b5-41cc-9c59-ed1a305aa4f9 | rnallandigal/advent-of-code | c++/include/utils.h | #ifndef AOC_UTILS_H
#define AOC_UTILS_H
#include <functional>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <fmt/format.h>
template <typename T>
concept Hashable = requires(T a) {
{ std::hash<T>{}(a) } -> std::convertible_to<std::size_t>;
};
namespace std {
temp... | TOOL | 0.91806 | 7.02587 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2021-11-10T01:51: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": "25b5a1c74... |
77d8bccd-0cb2-4f93-a406-daa69c51d559 | KenWR/algorithm | Solved.ac/Gold/3190. 뱀/뱀.cc | #include <algorithm>
#include <cstddef>
#include <deque>
#include <iostream>
#include <iterator>
#include <list>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
typedef struct s_snake {
int y;
int x;
} t_snake;
int N, K, L;
const int dy[4] = {-1, 0, 1, 0};
const int dx[4] = {0, 1, 0... | ALGO | 0.999929 | 4.104182 | {
"github_metadata": {
"branch": "main",
"commit_count": 390,
"repo_created_at": "2023-10-21T07:43: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": "b4d5425eea... |
ffcdd4c6-7463-47ef-8e6f-57dd36cae226 | grainmad/cpcode | cf/contest/1814/C.cpp | #include <bits/stdc++.h>
// #define SINGLE_INPUT
#define ll long long
#define N 500005
#define MOD 998244353
using namespace std;
void sol() {
int n, s1, s2;
cin >> n >> s1 >> s2;
vector<int> r(n);
for (int& i : r)
cin >> i;
vector<int> idx(n);
iota(idx.begin(), idx.end(), 0);
sort(... | ALGO | 0.99988 | 3.606427 | {
"github_metadata": {
"branch": "main",
"commit_count": 489,
"repo_created_at": "2022-12-14T16:45: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": "e9c3392e80... |
97ed412c-5f01-49d9-bcf3-4c6153f3492a | raincross7/code-similarity | codes/train_code/problem094/problem094_358.cpp | #include <bits/stdc++.h>
#define owo(i,a, b) for(int i=(a);i<(b); ++i)
#define uwu(i,a, b) for(int i=(a)-1; i>=(b); --i)
#define senpai push_back
#define ttgl pair<int, int>
#define ayaya cout<<"ayaya~"<<endl
using namespace std;
/*#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
gp_hash_table<int... | ALGO | 0.999879 | 3.407852 | {
"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": "914538726b20... |
33c23ba9-6762-4f6f-b387-5c818abb7ba1 | Faeueu/reajuste_salarial.cpp | main.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
double salario;
cout << "Digite o salario: ";
cin >> salario;
double percentual, aumento, novoSalario;
if (salario <= 280) {
percentual = 0.20;
} else if (salario <= 700) {
percentual = 0.15;
} else ... | TOOL | 0.985489 | 4.226865 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-08-21T06:49: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": "3a28799430f7... |
082572c3-d8e2-4333-89e5-e225788ed7c5 | WajahatSiddiqui/Datastructures-and-Algorithms | DataStructures/Arrays/leader-in-array.cpp | /**
* Print Leaders in the array
* A number is a leader if it is greater that all the elements
* on its right side
* Right most element is always a leader
*/
#include <iostream>
using namespace std;
/**
* 1) Take a number and test if it
* greater than all the numbers on right side
* 2) if the test counter reac... | ALGO | 0.999991 | 4.656844 | {
"github_metadata": {
"branch": "master",
"commit_count": 194,
"repo_created_at": "2015-03-15T17:32: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": "41a2732a... |
3e5a7e54-6b98-4188-96ed-cd37bf795537 | chromium/chromium | third_party/blink/renderer/platform/audio/vector_math_scalar.h | // Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif
#ifndef THIRD_PARTY_BLINK_RENDE... | ALGO | 0.958267 | 7.025774 | {
"github_metadata": {
"branch": "main",
"commit_count": 1609541,
"repo_created_at": "2018-02-05T20:55:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 21189,
"forks": 7786,
"issues": 0,
"pull_requests": 120
},
"file_meta": {
"content_id":... |
8bf82321-650e-46be-b9f6-7bf7fdc8d2de | Ting2003/pggrid_parallel | triplet.cpp | // ----------------------------------------------------------------//
// Filename : triplet.cpp
// Author : <NAME> <<EMAIL>>
//
// class definition of triplet
// ----------------------------------------------------------------//
// - <NAME> - Fri Oct 29 16:43:17 CDT 2010
// * created file
#include <iostream>
#include... | TOOL | 0.944045 | 4.46015 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2011-04-25T20:04:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa634c196... |
40484f18-bac2-48e6-9282-f9c407eb4c94 | 0inn/Algorithm | 백준/Gold/11000. 강의실 배정/강의실 배정.cc | //
// main.cpp
// Algorithm-c++
//
// Created by 김영인 on 2023/10/16.
//
#include <iostream>
#include <queue>
#include <algorithm>
#define MAX 200001
using namespace std;
struct Info {
int s, t;
};
int N, ans=1;
Info arr[MAX];
priority_queue<int, vector<int>, greater<int>> pq;
bool cmp(Info &a, Info &b) {
... | ALGO | 0.999857 | 4.268009 | {
"github_metadata": {
"branch": "main",
"commit_count": 387,
"repo_created_at": "2022-09-27T09:24: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": "c456865d7b... |
c519ac28-3051-4b3c-8053-1b75b1f19ba6 | mfranzil-unitn/unitn-prog1 | lab-2018/es11/1102-giardino_main.cc | #include <cstdlib>
#include <iostream>
#include "1102-giardino.h"
using namespace std;
int main(int argc, char* argv[]) {
Albero*** giardino;
// Indica quanti esemplari per ogni specie (3 faggi, ...)
int quanti[NUMERO_SPECIE] = {3, 1, 2, 1, 3};
// La scelta del numero "9" e' assolutamente arbitraria,
... | ALGO | 0.931413 | 4.2084 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2018-09-04T16:51:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "608d22e4f5... |
86f685a5-f2fd-4b2c-a6e4-533131d0ad72 | mochow13/competitive-programming-library | Data Structures/Persistent Segment Tree 1.cpp | // Calculate how many distinct values are there in a given range
// Persistent Segment Tree implementation
// Actually used in Codeforces - The Bakery
int n, k, a[MAX], last[MAX], nxt[MAX];
int idx=1;
int Tree[64*MAX], L[64*MAX], R[64*MAX], root[2*MAX], rt[MAX];
int pos[MAX];
void build(int node, int l, int r)
{
if(... | ALGO | 0.999929 | 3.342147 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-06-24T07:55:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 451,
"forks": 109,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a7b5... |
e17604a2-c3dd-421c-a19f-7638a09bbc66 | arsh5620/bigint | ExprEval/main.cpp | #include <iostream>
#include <windows.h>
#include <malloc.h>
#include <sstream>
#include "LibBigInt.h"
#pragma comment(linker,"\"/manifestdependency:type='win32' \
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='<KEY>' language='*'\"")
HWND textBox1, textBox2, lab... | TOOL | 0.921905 | 4.204168 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-09-23T02:50: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": "edb1792c00... |
7d740069-24a9-4344-a5e2-a6b6d9b01a07 | reikonakajima/Lensing | src/GGLensData.cpp | //
// GGLensData.cpp
//
#include "GGLensData.h"
void
GGLensData::rescaleMeanR(float scale) {
for (int j=0; j<meanR.size(); ++j) {
meanR[j] *= scale;
}
return;
}
void
GGLensData::getValuesAt(vector<float> radial_vals,
vector<float>& signalT, vector<float>& signalX, vector<float>& var) {
int n = radia... | ALGO | 0.968461 | 5.039009 | {
"github_metadata": {
"branch": "master",
"commit_count": 239,
"repo_created_at": "2014-06-09T15:21:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "5db9d19e... |
8388d61f-c87d-4c96-a37a-12ba89439907 | Daibingh/armor-detector | My_ArmorDetector/ArmorDetector.cpp | #include "stdafx.h"
#include "ArmorDetector.h"
#define PI 3.14159265
ArmorDetector::ArmorDetector(int color)
{
init(color);
}
ArmorDetector::ArmorDetector()
{
}
ArmorDetector::~ArmorDetector()
{
m_frame.release();
m_bin.release();
m_enemy.release();
m_subed.release();
m_blur.release();
targets.clear();
... | TOOL | 0.953416 | 4.670951 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-12-17T13:18: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": "02f7508f37... |
9a462eaf-55f6-4eac-9f7a-8c7381a54fed | rainboyOJ/problems | other_oj/noiopenjudge/ch0111/09/solutions/rainboy.cpp | #include <cstdio>
int l,n,m;
int _min = 0x7f7f7f7f;
int a[50005];
void init(){
scanf("%d%d%d",&l,&n,&m);
int i;
for (i=1;i<=n;i++){
scanf("%d",&a[i]);
if( _min > a[i]-a[i-1])
_min = a[i]-a[i-1];
}
if( l - a[n] < _min)
_min = l - a[n];
a[n+1] = l;
}
int cnt... | ALGO | 0.999975 | 3.075195 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2020-09-10T07:14:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 32,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a55da029... |
d30a7899-d292-4a4d-858f-f408aeae5043 | fabr1z10/monkey2 | src/shapes/polyapprox.cpp | #include "polyapprox.h"
#include "../assetmanager.h"
#include "stb_image.h"
std::vector<glm::vec2> PolyApproximation::approximatePoly(const std::string& filename,
glm::ivec4 coords, float epsilon) {
auto path = Game::instance().getWorkingDirectory() + "/assets/" + filename;
int width, height, channe... | ALGO | 0.973216 | 5.871092 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2025-01-22T11:13: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": "e5d0b6befd0... |
06ee9961-3346-454e-91e6-d7eaabc3bb69 | alexandraback/datacollection | solutions_1484496_0/C++/dano/c.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <map>
#include <utility>
#include <set>
#include <algorithm>
#include <iostream>
#include <sstream>
using namespace std;
#define CLEAR(X) memset(X,0,sizeof(X))
#define REP(i,n) for(int i=0;i<(n);i++)
template <cla... | ALGO | 0.999596 | 3.254951 | {
"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": "a7b2cb42b... |
4aa92b84-3de0-47f0-8f31-31ec96494f94 | Vacbo/SupaaaaComp | atv-16/mpi_standard_deviation.cpp | #include <mpi.h>
#include <iostream>
#include <vector>
#include <cmath>
#include <numeric>
#include <cstdlib> // for rand() and srand()
#include <ctime> // for time()
int main(int argc, char** argv) {
// Initialize the MPI environment
MPI_Init(&argc, &argv);
// Get the rank of the current process
... | ALGO | 0.99994 | 5.145205 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-08-14T17:45: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": "5a189d1d5c9... |
de070bf8-6903-42a0-aac4-6db99a012169 | Deep145757/GeeksForGeeks | Difficulty: Medium/Minimize the Heights I/minimize-the-heights-i.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int getMinDiff(int k, vector<int> &arr) {
// code here
int n = arr.size();
sort(arr.begin(), arr.end());
... | ALGO | 0.997762 | 5.868398 | {
"github_metadata": {
"branch": "main",
"commit_count": 774,
"repo_created_at": "2024-02-08T17:31: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": "46aab45240... |
837a651d-dc8f-4dc4-a45b-ebe525429f3b | sabujmaity/Programming-Practice | DSA Sheet/Arrays/Freq_in_SortedArray.cpp | #include<bits/stdc++.h>
using namespace std;
#define fo(i,n) for(int i=0;i<n;i++)
#define fo1(i,n) for(int i=1;i<n;i++)
#define pb push_back
#define F first
#define S second
typedef long long ll;
typedef long double ld;
void freq_sorted_array( vector<int> &input){
int size = input.size();
int freq = 1, i = 1;... | ALGO | 0.999839 | 4.30435 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2023-02-07T12:44: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": "90850d2f3b0... |
f5e0bf3e-59f3-4dee-84b8-1d275f9f2d2b | weihuayi/fealpy | src/whysc/hello.cpp | #include <iostream>
#include <cmath>
int main()
{
double a[4] = {0, 1, 2, 3};
std::cout << "vector a:(";
for(int i=0; i < 4; i++)
{
std::cout << a[i] << " ";
}
std::cout << ")" << std::endl;
double sum = 0.0;
for(int i=0; i < 4; i++)
{
sum += std::abs(a[i]);
... | ALGO | 0.987344 | 3.116571 | {
"github_metadata": {
"branch": "master",
"commit_count": 9724,
"repo_created_at": "2017-07-04T07:25:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 372,
"forks": 165,
"issues": 25,
"pull_requests": 1
},
"file_meta": {
"content_id": "22... |
d6a37adf-a3c9-472f-ab45-4ee5b20459b7 | Mark-S2004/Crossword-Game-Trie | Crossword_GUI_Project/Crossword_GUI/Trie.hpp | #pragma once
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
#define alphabet_size 26
class Trie
{
private:
class Node
{
public:
bool isEndofWord;
Node *children[alphabet_size];
int index;
Node() : isEndofWord(false), index(0)
{
... | ALGO | 0.959982 | 3.503756 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2023-11-23T20:53:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6993a2c682d... |
252ae2f8-4985-449e-a23c-87227f6c18c3 | anasschoukri2/UVA- | 11475.cpp | #include <bits/stdc++.h>
using namespace std;
int pre[1000045];
void pr(string s)
{
for (int i = 0, j = 1; j < s.size(); j++) {
while (s[i] != s[j] && i)
i = pre[i - 1];
if (s[i] == s[j])
i++;
pre[j] = i;
}
}
int main()
{
string s, a;
while (cin >> s) {
... | ALGO | 1 | 4.2201 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2019-01-01T17:10: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": "0456f6a7e... |
16dbb5ce-eed1-4355-831b-abe24a5c310d | Adithyan8/CGVR_Lab | P1 - Line.cpp | #include<stdlib.h>
#include<gl/glut.h>
#include<iostream>
using namespace std;
int flag = 0, x1, x2, yc1, y2;
void display(){}
void drawPoint(int x, int y)
{
glColor3f(0, 0, 0);
glPointSize(5);
glBegin(GL_POINTS);
glVertex2f(x, y);
glEnd();
}
void drawLine()
{
int dx = x2 - x1, dy = y2 - yc1;
int incx = 1, ... | ALGO | 0.984901 | 4.082133 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-12-15T18:12:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a75545e719b... |
c978fcf7-25a5-4abb-976a-a2ea67b123d7 | Ghost-LZW/TemplateForXCPC | src/DataStructure/00_BitTree.cpp | template<typename T>
struct BitTree {
T sum[Ma];
void add(int pos, T val) {for (; pos < Ma; pos += lowbit(pos)) sum[pos] += val;}
T pre(int pos) {T ans = 0; for (; pos; pos -= lowbit(pos)) ans += sum[pos]; return ans;}
T range(int l, int r) {return pre(r) - pre(l - 1);}
void clear(int n) {memset(sum, 0, sizeof(T) ... | ALGO | 0.999764 | 4.324472 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-09-23T14:02: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": "e30d845b065c... |
bea7e74b-ac99-4b2c-891a-8c4f3b01a4c4 | Aryog/30_days_of_DSA | DP/longest_palindromic_subsequence.cpp | // Given a string s, find the longest palindromic subsequence's length in s.
// A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
// Example 1:
// Input: s = "bbbab"
// Output: 4
// Explanation: One possible lon... | ALGO | 0.999991 | 6.488829 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-08-25T07:38: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": "e8c16c9c401... |
08846488-462f-4fe9-b87e-a31e58ad7cb5 | jwakely/CppPerformanceBenchmarks | mathlib.cpp | /*
Copyright 2007-2010 Adobe Systems Incorporated
Copyright 2018 <NAME>
Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
or a copy at http://stlab.adobe.com/licenses.html )
Goal: Examine performance of the standard math library routines.
Assumptions:
1) mathlib functio... | TEST | 0.944991 | 5.874925 | {
"github_metadata": {
"branch": "master",
"commit_count": 153,
"repo_created_at": "2022-03-27T21:35:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05af773... |
9e8abe31-58cc-46a6-8fdb-0680a5eca16a | enigma-aaa/COP290A1_subtask3 | src/RSI.cpp | #include "RSI.h"
#include "CommonCons.h"
RSI::RSI(int n,int x,double oversold_threshold,double overbought_threshold,chrono::year_month_day startDate,chrono::year_month_day endDate,string symbolName)
:n(n),x(x),oversold_threshold(oversold_threshold),overbought_threshold(overbought_threshold),startDate(startDate),endDat... | ALGO | 0.984404 | 5.110982 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2024-02-07T15:19:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb9a99fa5d... |
b1eafef6-d679-423f-aede-49751c7cbf76 | SuperFoolGirl/algorithm_learning | DFS/连通块问题/1596.cpp | // 8联通
// 1 自己写的 30分 原因在于递归里面 ans和cnt用的太危险 重复计数了
// 重点学习一下2解里面 是如何规避ans和cnt带来的问题的
// 经过1683的熏陶,可以初步判定这道题也不需要回溯
#include <iostream>
using namespace std;
#define maxn 110
int m, n;
int ans = 0;
char map[maxn][maxn] = {'\0'};
int dx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy[] = {-1, 0, 1, -1, 1, -1, 0, 1};
bool vis[maxn][... | ALGO | 0.999933 | 4.907893 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2025-01-10T11:02: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": "091a8817e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.