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 |
|---|---|---|---|---|---|---|---|
05e22de0-bf4d-48ee-8714-585658d5322a | kirill-korniakov/vlsi-experimental | itlPlace/src/Legalization/LegalityChecks.cpp | #include "Legalization.h"
#include <math.h>
bool CheckGridConsistency(HDPGrid& grid, unsigned maxCellsToReport, double sensitivity, bool drawMismatchses)
{
unsigned errors_count = 0;
HDesign& hd = grid.Design();
if (drawMismatchses)
hd.Plotter->SetAutoRefreshMinFrequency(200);
for (HCells::PlaceableCells... | ALGO | 0.984157 | 6.276918 | {
"github_metadata": {
"branch": "master",
"commit_count": 771,
"repo_created_at": "2014-02-04T05:22:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "9a83df2a... |
5bcdeba2-8a42-45d0-9a77-fadd07461ec1 | LuisJackRamirez/fluffy-octo-meme | Ene-Jun-20/foordOrder02.cpp | #include <iostream>
#include <vector>
#include <set>
#include <utility>
using namespace std;
int
main (void)
{
long long int n = 0;
long long int m = 0;
long long int foodType = 0;
long long int expenses = 0;
long long int dishNums = 0;
vector < long long int >quantities;
vector < long long int >costs;
... | ALGO | 0.999915 | 3.268085 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-05-19T18:18: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": "ad1a685f5... |
80ec108d-76d0-4dc2-8165-0ba11fd2ddf2 | pytorch/pytorch | aten/src/ATen/cpu/vec/vec256/vec256_bfloat16.h | #pragma once
// DO NOT DEFINE STATIC DATA IN THIS HEADER!
// See Note [Do not compile initializers with AVX]
#include <ATen/cpu/vec/vec256/vec256_16bit_float.h>
#include <c10/util/irange.h>
namespace at::vec {
// See Note [CPU_CAPABILITY namespace]
inline namespace CPU_CAPABILITY {
#if defined(CPU_CAPABILITY_AVX2)
... | ALGO | 0.95851 | 7.417695 | {
"github_metadata": {
"branch": "main",
"commit_count": 90499,
"repo_created_at": "2016-08-13T05:26:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 91573,
"forks": 24684,
"issues": 5000,
"pull_requests": 1303
},
"file_meta": {
"content_i... |
5764b833-7c82-4fd2-99f1-418cf82fba74 | pstrinkle/misc-umbc | undergraduate/CMSC421 - Principles of Operating Systems/Projects/proj2/Project2.cpp | #include "Project2.h"
#include "PidQueue.h"
#include "Process.h"
#include "Memory.h"
using namespace std;
int getIndex(vector<Process> them, int pid);
void removeProcess(vector<Process> & them, int pid);
void swapout(Process & process, Memory & memory);
void swapin(Process & process, Memory & memory);
void sortbyPid... | TOOL | 0.970232 | 4.338298 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-06-15T16:33: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": "81de85ad0... |
6b869c8d-d1ed-486a-84cb-efc23fff1489 | ImJimmi/Contrast | contrast_shared_resources/utilities/contrast_functions.h | #pragma once
//======================================================================================================================
namespace contrast
{
//==================================================================================================================
/** Returns the largest whole number be... | TOOL | 0.91071 | 6.893143 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2020-06-12T12:34:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2420e6... |
090952b8-23c3-4fe5-b945-24970da5d0a8 | Exr0nProjects/learn_cpp | algorithms/trees/treap/archive/treap.cpp | /*
24 Sep
*/
#include <bits/stdc++.h>
using namespace std;
const int MAXSZ = 1010;
int val[MAXSZ];
int rnd[MAXSZ];
int p[MAXSZ]; // contains the pos of each child/parent as an index
const int MAXWG = 1000;
int cnt = 1;
void rotate (const int i)
{
if (i == 1) return;
int t = p[i/2];
p[i/2] = p[i];
p[... | ALGO | 0.999918 | 3.962317 | {
"github_metadata": {
"branch": "master",
"commit_count": 2744,
"repo_created_at": "2019-04-07T20:47:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "366334a5... |
df722c6e-4d43-4053-9b15-af397e558ec9 | tred-07/DSA | 3_merge.cpp | #include <bits/stdc++.h>
using namespace std;
void merge(int a[], int l, int mid, int r)
{
// First Spilt The Array In Two Part.Then Join The Two Array
int L[mid - l + 1], R[r - mid-1];
int leftSizeArray = mid - l + 1, rightSizeArray = r - leftSizeArray, current = 0;
for (int i = 0; i < leftSizeArray; i... | ALGO | 0.999971 | 4.609489 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-09-16T10:24:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef7a35cf2d19... |
2738c2aa-d0d3-4778-a9d1-2231dc9599db | malichao/Behavior-Planner | src/main.cpp | #include <BehaviorPlanner/road.h>
#include <BehaviorPlanner/vehicle.h>
#include <iostream>
#include <fstream>
#include <math.h>
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv/cv.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <highgui.h>
void DrawImage(const RoadStringImage& str_img, const Vehi... | ALGO | 0.983349 | 4.380097 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2017-10-12T23:17: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": "5ef079b5d... |
98b458ef-d191-4b5c-8b8c-f3654fae6d1c | Muhammad-Ahmed-Chorahi/Data-Structure | 2. Doubly linked list.cpp | #include<iostream>
using namespace std;
class node
{
public:
int val;
node* next, * prev;
node(int data)
{
val = data;
next = prev = NULL;
}
};
class doublylinkedlist
{
public:
node* head, * tail;
doublylinkedlist()
{
head = tail = NULL;
}
bool isempty()
{
return head == NULL;
}
void insertath... | ALGO | 0.999257 | 4.006446 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-02-03T17:26: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": "307276fe8320... |
8b326608-8a71-413d-b503-cc1dbd8a23a6 | uahic/CodeInterview | graph/graph.h | #ifndef GRAPH_H
#define GRAPH_H
#include <vector>
#include <forward_list>
#include <iostream>
#include <fstream>
#include <string>
#include <memory>
typedef int Node;
typedef std::pair<Node, double> Pair;
typedef std::pair<Node, double> Edge;
typedef std::forward_list<Edge>::iterator EdgeIterator;
typedef std::forwar... | ALGO | 0.98027 | 5.416607 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2016-03-16T10:59: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": "7251fbed0... |
4d7849c5-b24c-4ce6-9b64-6f977f935214 | Divyamsirswal/cp_template | SegmentTree.cpp | void build(vi &v,ll s,ll e,vi &tree,ll idx){
if(s==e){
tree[idx]=v[s];
return;
}
ll m=(s+e)/2;
build(v,s,m,tree,2*idx);
build(v,m+1,e,tree,2*idx+1);
tree[idx]=min(tree[2*idx],tree[2*idx+1]);
}
ll query(vi &tree,ll s,ll e,ll qs,ll qe,ll idx){
if(s>=qs and e<=qe){
retu... | ALGO | 0.999974 | 4.943607 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-31T00:48:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b634d3b25bf4... |
c52e2ba3-bc91-484f-a699-a375633f8521 | chenyongxin/Code_CartesianCraft | include/MyMPI.h | // MyMPI.h
// Customised MPI class.
// Code_CartesianCraft (c) <NAME>
#ifndef MYMPI_H
#define MYMPI_H
#include <mpi.h>
#include <iostream>
#include <typeinfo>
using std::cout;
using std::endl;
using std::cerr;
class MyMPI{
private:
int _rank = 0; // MPI rank
int _siz... | TOOL | 0.905988 | 5.451578 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-03-05T15:48:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99f0f5819... |
47e4b9e4-0457-4ee8-a180-a60b32ce7aaf | ldalessa/ttl26 | include/ttl_old/tree/sum.hpp | #pragma once
#include <ttl/evaluate.hpp>
#include <ttl/index.hpp>
#include <ttl/outer.hpp>
#include <ttl/tensor.hpp>
#include <ttl/tree/node.hpp>
#include <concepts>
#include <cstddef>
#include <type_traits>
#include <utility>
namespace ttl::tree
{
/// A generic sum node, will apply op(A, B).
///
/// The... | TOOL | 0.932482 | 7.320061 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2024-08-11T04:43:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6c8c7788e3... |
958ceeac-65d8-4621-849b-b0e3245531dd | FangGet/BundleFusion_Ubuntu_Pangolin | include/FreeImage/include/CGAL/QP_solver/QP_solver_bounds_impl.h | // Copyright (c) 1997-2007 ETH Zurich (Switzerland).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// You can redistribute it and/or modify it under the terms of the GNU
// General Public License as published by the Free Software Foundation,
// either version 3 of the License, or (at your opt... | ALGO | 0.992274 | 5.378331 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-06-29T03:53:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 34,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "1457367... |
25c3344f-c215-4ec9-a6b3-54932aacfed0 | Seqing-uwu/Competitive-Programming-Other | Kattis /Lyklagangriti.cpp | #include<iostream>
using namespace std;
const int N = 2000000;
const int END = -1;
const int HEAD = 0;
char a[N];
int nxt[N], pre[N];
int pt, cursor;
void init() {
pt = 1;
nxt[HEAD] = END;
pre[HEAD] = END;
cursor = HEAD;
}
void remove() {
if (cursor == HEAD) return;
int cur = cursor;
cursor = pre[cur];
... | ALGO | 0.999993 | 4.072381 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2025-02-03T06:55:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aff062b4f26... |
ae9c253a-0c70-4907-b200-07b607c28b6e | hujiese/C-background-development-interview-experience | 02.C_C++语言/03.STL/01.STL使用/algorithm/src/93.stl_algorithm_bind1st_2nd.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;
class IsGreat
{
public:
IsGreat(int i)
{
m_num = i;
}
bool operator()(int &num)
{
if (num > m_num)
{
return true;
}
return false;
}
protected:
private:
int m_num;
};
void main()
... | ALGO | 0.981112 | 4.27347 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-04-04T14:20:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 181,
"forks": 45,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d3dd7712... |
5e05a845-7855-47e1-a47f-7d1a143edebd | SHARIFsGIT/CSE-fundamental | Basic data structures/Practice problem/Problem_02.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
// for (int i = 0; i < v.size(); i++)
// {
// int sum = 0;
// for (int j = i + 1; j < v.size(); j++)
// {
// ... | ALGO | 0.999943 | 4.704062 | {
"github_metadata": {
"branch": "main",
"commit_count": 218,
"repo_created_at": "2024-04-02T12:42: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": "8a86a095d3... |
4f6ad50f-252b-4d98-81be-c8c455239a4d | ARM-software/ComputeLibrary | src/core/NEON/kernels/arm_conv/pooling/pooling_fp16.cpp | /*
* Copyright (c) 2021-2022 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* ri... | ALGO | 0.9652 | 6.986687 | {
"github_metadata": {
"branch": "main",
"commit_count": 4770,
"repo_created_at": "2017-03-10T14:51:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3008,
"forks": 795,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "f99a9... |
46882b08-de33-42eb-af0d-0b619dfe10ed | LtCoinCidenCe/LeetSolutions | oldVS/Leet/q2903.cpp | #include<vector>
#include<algorithm>
#include<ranges>
using namespace std;
class Solution {
public:
vector<int> findIndices(vector<int>& nums, int indexDifference, int valueDifference) {
int n = nums.size();
int min1=nums[0], max1=nums[0];
int minIndex = 0, maxIndex = 0;
for (int j ... | ALGO | 0.999971 | 5.258303 | {
"github_metadata": {
"branch": "migrate",
"commit_count": 88,
"repo_created_at": "2024-05-14T14:33: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": "e2d81f37... |
c65b6cde-fa22-42df-88f0-d2c65673d6a8 | goofynugtz/CSS452-Object-Oriented-Lab | Assignment 6 - Inheritance/q1_matrix.cpp | #include <iostream>
#include <iomanip>
using namespace std;
class matrix {
protected:
int order = 3;
int ** array;
public:
matrix(const matrix&);
matrix();
void show();
friend istream& operator>> (istream &in, matrix &m){
cout << "Enter the values:\n";
for (int i = 0; i < m.order; i++)
for (i... | ALGO | 0.945065 | 4.350562 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2022-01-19T08:50: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": "f80851213... |
68e44797-3449-4c1a-9ffc-6e4b5661069d | BorkowskiDominik/LeetCode | 0437-path-sum-iii/0437-path-sum-iii.cpp | enum class ALGORITHM {FIRST};
constexpr auto ALGO = ALGORITHM::FIRST;
class Solution {
void findTargetSum(TreeNode* node, const int targetSum, vector<int>& path, int& counter);
int pathSumMain(TreeNode* root, int targetSum);
public:
int pathSum(TreeNode* root, int targetSum) {
if constexpr(ALGO ==... | ALGO | 0.999998 | 6.232844 | {
"github_metadata": {
"branch": "main",
"commit_count": 689,
"repo_created_at": "2025-05-30T14:14: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": "a29674e23e... |
00f2d7dd-2fb6-44d7-8052-0f762c730781 | durgeshmeena/DSA-Learn | 59_Count Special Integers.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
void run() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#else
#endif
}
void print(vector<int> &v){
for(int i=0; i<v.size();... | ALGO | 0.999668 | 4.552676 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2021-10-20T12:18: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": "9dea778ee... |
87158114-5b18-4754-808c-3c37b5afe680 | Xavier-Pisco/TourMateApp | entrega/src/application/graph/algorithms/bfs.h | #ifndef SRC_BFS_H
#define SRC_BFS_H
#include "../Graph.h"
/**
* Performs a breadth-first search (bfs) in a graph (this), starting
* from the vertex with the given source contents (source).
* Returns a vector with the contents of the vertices by dfs order.
* Follows the algorithm described in theoretical classes.
... | ALGO | 0.999613 | 5.628324 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2021-05-17T15:23:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "862586c5... |
9139b9ee-f2d2-4a9b-a042-d7a73bd59952 | Janipai/02393_Programming_in_C- | Week11/exercise1.cpp | #include <iostream>
#include "exercise1.h"
using namespace std;
Node::Node(int n)
{
this->left = this->right = NULL;
if (n <= 1)
{
this->data = 1;
}
else
{
this->left = new Node(n - 1);
this->right = new Node(n - 2);
this->data = this->left->data + this->right->... | ALGO | 0.998181 | 4.221368 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-12-03T17:07: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": "916ed9f0a7... |
d3eadd4b-7bc6-4995-adfe-eb851863ca6d | soroush-tabesh/Competitive-Programming | Codeforces/992/992B.cpp | //In The Name of Allah
//Mon 28/3/97
#pragma GCC optimize "-Ofast"
#include <bits/stdc++.h>
#define Init ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define forar(i,n) for(long long int i = 0; i < n;i++)
#define fori(i,a,b) for(long long int i = a; i < b;i++)
#define WFile freopen("test.in","r",stdin),freopen(... | ALGO | 0.999908 | 3.751135 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2017-10-13T16:34: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": "fad0d6c9e... |
df10bbf8-c033-4ffe-9ed3-f32d55fbf150 | okaryo/CompetitiveProgramming | AtCoder/ARC/051~060/053/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
int main() {
string s; cin >> s;
int n = s.size();
vector<int> num(26, 0);
rep(i, n) {
num[s[i] - 'a'] ++;
}
vector<int> even, odd;
rep(i, 26)... | ALGO | 0.999978 | 3.592556 | {
"github_metadata": {
"branch": "main",
"commit_count": 573,
"repo_created_at": "2019-04-25T11:58:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af9a224d0d... |
e79b6948-9af2-4dda-81f1-60818d2885d6 | sbshah97/Open-GL | Exam-Sums/transformations/trans.cpp | #include <bits/stdc++.h>
#include "GL/freeglut.h"
#include "GL/gl.h"
// Header file for GLUT and OpenGL
// DRAWING CALLBACK FUNCTION
void draw(){
// background colour: yellow
glClearColor( 100, 100, 0, 0 );
glClear ( GL_COLOR_BUFFER_BIT );
// Sets up the DOMAIN (xmin,xmax,ymin,ymax) in R2.
// Let (xmin,xmax,ymin,ymax... | ALGO | 0.913476 | 4.224092 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-01-31T05:13:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "783f6e95a... |
947a9259-6974-4b1e-84b7-be07e32cfb57 | Hexxy-Dev/Old_Code | Class_Projects/P-29_Bases/src/Main.cpp | #include <iostream>
#include <string>
#include <bitset>
int main()
{
int64_t hmm = 0;
std::string input = "017";
std::cin >> input;
if (input[0] == '0') {
if (input[1] == 'b') {
for (size_t i = 2; i < input.size(); i++) {
hmm *= 2;
hmm += input[i] - '0';
}
} else
if (input[1] == 'x') {
... | ALGO | 0.955622 | 4.239782 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2024-02-11T12:48: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": "3a9f5277e28... |
bfc6f853-260a-4369-a305-39ac12377f95 | kartik-py12/neoColab | DSA/unit 2/single_linked_list/10_mid.cpp | // Single File Programming Question
// Problem Statement
// Emma is working with two sets of sensor data recorded in two separate grounded header linked lists. She wants to merge these two lists alternately to analyze the combined data more efficiently.
// Help Emma by writing a program to merge the two grounded... | ALGO | 0.99997 | 4.796653 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-10-20T09:29: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": "5d14bd54726... |
88165061-a090-4f33-b492-596f5e3461be | An-Nguy3n/VIS-Formula-Warehouse-Library | CppSources/Generator/HomoPoly/CPU/HomoPolyCPUFunc.cpp | #pragma once
#include <omp.h>
#include <cmath>
using namespace std;
const double __NEGATIVE_INFINITY__ = -1.7976931348623157e+308;
const double __POSITIVE_INFINITY__ = +1.7976931348623157e+308;
inline void cuda_set_array_value(double* array, int length, double value);
inline void copy_from_operands(double *dest, d... | TOOL | 0.981315 | 5.196693 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2024-07-21T05:12: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": "8e3efbc7650... |
2733921d-1b80-42e5-9033-5d186c8f6f69 | Raghav888/Problem-Solving | .ccls-cache/@home@runner@Problem-Solving/Binary search Questions@11_square_root_using BS.cpp | #include <iostream>
#include <vector>
using namespace std;
double squareRoot(int num) {
int start = 0;
int end = num;
int mid = start + (end - start) / 2;
double ans;
while (start <= end) {
if (mid * mid == num) {
ans = mid;
break;
} else if (mid * mid > num) {
end = mid - 1;
... | ALGO | 0.999924 | 3.9203 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2023-01-29T11:33: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": "50259ac72a5... |
4b8d6963-ea40-4ff0-a316-c6e02f032da5 | mitkonikov/competitive | CodeForces/A_Sakurako_s_Exam.cpp | #include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
void testCase() {
int a, b;
cin >> a >> b;
if (a % 2 == 1) {
cout << "NO" << endl;
return;
}
if (a % 2 == 0 && b % 2 == 0) {
cout << "YES" << endl;
return;
}
for (int i = ... | ALGO | 0.999752 | 4.64979 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2021-09-13T12:20:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5d26b59b... |
750fe958-80fe-422d-b7bc-a792a945eb7a | PantawatB/lab13 | lab13_4.cpp | #include<iostream>
using namespace std;
template <typename xh>
xh mySwap(xh &,xh &);
int main(){
int x, y;
string a, b;
char p, q;
cin >> x >> y >> a >> b >> p >> q;
cout << "Before swapping:\n";
cout << "x = " << x << ", y = " << y << "\n";
mySwap(x,y);
cout << "After swapping:\n";
cout << "x = " << ... | ALGO | 0.998354 | 3.567242 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2023-01-10T07:54: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": "b21907d77... |
0f26925a-9051-4e9d-9f92-29040b036bd8 | panda3d/panda3d | panda/src/egg/eggPrimitive.cxx | /**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file eggPrimitive.cxx
* @au... | TOOL | 0.915199 | 3.474306 | {
"github_metadata": {
"branch": "master",
"commit_count": 26435,
"repo_created_at": "2013-09-30T10:20:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4835,
"forks": 823,
"issues": 308,
"pull_requests": 50
},
"file_meta": {
"content_id": ... |
8d01d6db-b74c-4188-b21f-474aec7bcc59 | kai-chun/UVa_OnlineJudge | projects/UVa10226.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
class species{
public:
string name;
double num;
};
bool comp(species i, species j){
return i.name < j.name;
}
int main(){
int testCase_num;
int treeNum;
int isExist;
vector<specie... | ALGO | 0.999255 | 4.475437 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-03-15T07:27: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": "6bea9c3c5... |
0429d25d-c242-4039-9212-d0e86661ea6f | PacktPublishing/LearningCPPFunctionalProgramming | Chapter07/deadlock/deadlock.cpp | /* deadlock.cpp */
#include <thread>
#include <mutex>
#include <iostream>
using namespace std;
struct Math
{
mutex mtx;
int m_content;
Math() : m_content(0)
{
}
// This method will lock the mutex
void Multiplexer(int i)
{
lock_guard<mutex> lock(mtx);
m_content *= i;
... | ALGO | 0.90788 | 5.85304 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-07-31T06:27:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 50,
"forks": 28,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d8c06f90... |
60c2f728-7fe7-4b57-93a9-ca8a11cc13e1 | xuej41/cpp-projects | DMOJ_CP_Questions/CCC_15_S3_Gates_02.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int G, P;
cin >> G >> P;
int Planes[P];
for(int i = 0; i < P; i++)
{
cin >> Planes[i];
}
const int GATE_COUNT = 100001;
bitset<GATE_COUNT> open;
open.set();
bool Gates[G+1];
for(int i = 0; i < G+1; i++)
{... | ALGO | 0.999762 | 3.765525 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-09-13T01:50: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": "ea8c0bd40b8... |
c9d6c267-ef56-4b41-961a-467f3d3bd787 | UnsEmp/C_Note | text2/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 10;
class Solution {
public:
vector<string> ans;
int son[N][26], idx = 0, n, cnt[N];
string res;
void insert(string s) {
int p = 0;
for(int i = 0;i < s.size();++i) {
int u = s[i] - 'a';
if(!son[p][... | ALGO | 0.999964 | 4.405461 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-04-22T12:11:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38846939429... |
75475b29-8166-49e6-87da-a64fc6489655 | Shrestha005/DSA_cpp | 3.2.Array(Medium)/8.permutation.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
private:
void recurPermute(int index, vector<int> &nums, vector<vector<int>> &ans) {
// Base case: if index reaches the size of the array, store the permutation
if (index == nums.size()) {
a... | ALGO | 0.999976 | 6.687676 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2024-07-15T14:25: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": "4bffaf565bb... |
5e68d35d-4ffa-4976-9dd8-a93f4be479b2 | GRTLCollaboration/Chombo | releasedExamples/EBAMRINS/src/EBAMRNoSubcycle.cpp | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
#include "ParmParse.H"
#include "EBAMRNoSubcycle.H"
#include "EBAMRNoSubcycle... | ALGO | 0.99915 | 4.269216 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2018-01-30T14:07:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 16,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2ed9349f5... |
102d62cd-9a69-4eaf-95eb-881471d1c3d7 | achiang4/CSC255 | Exercises/Exercise2_Chiang/main.cpp | /*
<NAME>
2/05/2023
This program will sort numbers in two different algorithms
complexity
Input: txt file
Output: txt file
Given: inX.txt in which X is 10 and 100
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
void algo(vector<int> ,int, ofstream& );
void bub... | ALGO | 0.998753 | 4.221566 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2023-01-19T01:36:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0339f9e08b2... |
b900c2fa-f754-4939-8288-ad6efbf84455 | travis-ge/Infantry | src/energy/energy.h | //
// Created by quanyi on 2022/3/6.
//
#ifndef MAIN_CPP_ENERGY_H
#define MAIN_CPP_ENERGY_H
#include <iostream>
#include <opencv2/opencv.hpp>
#include "ArmourFinder.h"
#include "base.h"
#include <memory>
#include "common.h"
class Energy{
public:
Energy();
~Energy();
cv::RotatedRect energy_finder(cv::Mat ... | TOOL | 0.957185 | 4.121933 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2022-07-10T03:42:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc40d0fd2... |
d461fca0-360d-4373-9e8e-54de1beeb7ff | par4m/mooc | A2Z/patterns/8.cpp | #include <bits/stdc++.h>
/* Pattern 8
******
*****
****
***
*
*/
using namespace std;
void Pattern(int N) {
// Outer Loop
for (int i = 0; i < N; i++) {
// Inner Loop 1 - Space
for (int j = 0; j <= i; j++) {
cout << " ";
}
// Inner Loop - Star
for (int k = 2 * N - 1 - ... | ALGO | 0.999971 | 4.460452 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2022-05-13T10:57: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": "40f37e10e6... |
c0baad38-46eb-4337-9809-baf1128eb45f | kimurash/tessoku-book | chap09/B66.cpp | // #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = s; i <= (int)(n); i++)
#define MAXNODE 100'009
using namespace std;
typedef int16_t i16;
typedef int32_t i32;
typedef int64_t i64;
typedef pair<int32_t, int32_t> pi32;
class UnionFind{
private:
int32_t parent[MAXNODE]; // 各頂点の... | ALGO | 0.999923 | 4.938771 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2023-06-07T13:35: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": "9f72ec41a60... |
9c3ffd77-e911-4ed0-9b17-fa0424cfcdde | JLLEW/Alghoritms-and-data-structures | heapSort.cpp | #include <string>
#include <iostream>
using namespace std;
bool ifBigger(string s1, string s2) {
if (s1.length() > s2.length())
return true;
else if (s1.length() < s2.length())
return false;
else {
for (int i = 0; i < s1.length(); i++) {
if (s1[i] > s2[i])
return true;
if (s1[i] < s2[i])
return ... | ALGO | 0.999952 | 4.292597 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-21T18:40: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": "9f760f0303... |
b43722a8-9644-4725-ac0f-ba33f1c4b66c | fionser/CODA | core/include/HElib/polyEval.h | /* Copyright (C) 2012,2013 IBM Corp.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distribut... | ALGO | 0.990407 | 6.749401 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2016-11-22T04:51:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73456c8... |
692767ff-db0f-478b-b722-2ea3d28fdb19 | arjuntheprogrammer/iact | iact/iact android practice/mywork/Contact1/res/drawable-hdpi/COA PROJECT - Copy/akansh/oo2.cpp | #include<bits/stdc++.h>
#include<iostream>
#include<string.h>
using namespace std;
class rm{
public:
char code[30];
char str1[30];
char str2[30];
};
class reg{
public:
char code[30];
char str1[30];
char str2[30];
};
rm rm0[8],rm1[8],rm2[8];
reg reg5[8];
void initialise()
{
char a[30],b[30],c[30],d[3... | ALGO | 0.999046 | 3.120429 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-12-04T01:32: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": "1bd24b6130... |
2918e72e-7c92-46bf-93e9-7fe482bf71d6 | Jiwon-Park/Alg-Airline-Reservation | Alg-Airline-Reservation/Reservation.cpp | #include "Reservation.h"
Data::Data(char* name, int res_num, char source, char dest,
Time departure, int departure_date, Time arrival, int arrival_date,
TableElement* transfer_list, int transfer_times, seatlevel level, int price, Time& flight_time)
: res_num(res_num), source(source), dest(dest),
departure(departu... | ALGO | 0.981483 | 3.857177 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-11-12T05:13: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": "040a00294... |
6e0ddec3-61fa-4d22-9fec-574203af041a | blue0206/learning-cpp | best-buy-pizza/best-buy-pizza.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
double pricePerSquareInch(double diameter, double price);
//Calculates the price per square inch of each pizza.
//Converts diameter to radius, then calculates the area.
//Divides price by... | ALGO | 0.996596 | 4.772353 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-09-04T03:19: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": "5983f5ea739... |
042f1847-2911-4b9c-8fd9-0d5fc47a856b | rubengb18/Estructuras-de-datos | ED/Problema81/Problema81/1.NumeroCasos.cpp |
// <NAME> Apellidos
// Comentario general sobre la solución,
// explicando cómo se resuelve el problema
#include <iostream>
#include <fstream>
#include "bintree_eda.h"
using namespace std; // propios o los de las estructuras de datos de clase
// función que resuelve el problema
// comentario sobre el coste, O(f(N)... | ALGO | 0.999957 | 4.747242 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-06-01T13:51: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": "a21d2e8a69bb... |
cb77a1e5-e012-48ab-8850-36207de6058f | dusse/KAP | src/misc/Misc.cpp |
#include "Misc.hpp"
using namespace std;
bool areSame(double a, double b)
{
return fabs(a - b) < EPSILON_COMPARATOR;
}
void crossProd(double A[3], double B[3], double cross[3]){
cross[0] = A[1] * B[2] - A[2] * B[1];
cross[1] = A[2] * B[0] - A[0] * B[2];
cross[2] = A[0] * B[1] - A[1] * B[0];
}
v... | ALGO | 0.995464 | 5.267176 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-06-22T19:27:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19a9ae1492ab... |
da051807-9ab4-4811-896d-549fbf0fddbf | Simo39/University_Projects | Learning From Networks/Code/Old Algorithms/TWC/src/main.cpp | /*
Author : <NAME>, <NAME> and <NAME>
*/
// Libraries :
// C++ Libraries :
#include <filesystem>
// Boost :
#include <boost/program_options.hpp>
// Customized :
#include "results.h"
namespace po = boost::program_options;
int main(int argc, char *argv[])
{
try
{
po::options_description desc("Allo... | ALGO | 0.9405 | 5.76421 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-11-01T11:02: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": "63190e7e7b6... |
44c7e8cb-65a4-4766-9cd4-425bda12defa | Ritwik33/cpp_projects | numberTheory/A_row_gcd_codeforces.cpp | // https://codeforces.com/problemset/problem/1458/A
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define inf 1e18
#define mod 1000000007... | ALGO | 0.999984 | 3.282404 | {
"github_metadata": {
"branch": "main",
"commit_count": 296,
"repo_created_at": "2021-08-22T10:07:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "507807f8c9... |
99a1c359-61d0-4bd5-839f-0a0c879c9b54 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0817/personal_submission/cf1039c_yawn_sean.cpp | #include <bits/stdc++.h>
// #pragma GCC optimize("O3,Ofast,unroll-loops")
// #include <bits/extc++.h>
// using namespace __gnu_cxx;
// using namespace __gnu_pbds;
using namespace std;
struct unionfind {
public:
unionfind() : _n(0) {}
explicit unionfind(int n) : _n(n), parent_or_size(n, -1) {}
bool merge... | ALGO | 0.999984 | 5.005243 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "badb... |
a1372282-8711-4f88-9e74-36d4ead891c5 | igormichalski/Cplusplus | 2024/Prova 2 PP21/q1.cpp |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class VetorOrdenado{
private:
vector<int> meuVetor; //Melhor trocar para data dps
void inserirOrdenado(int x){
meuVetor.push_back(x);
sort(meuVetor.begin(), meuVetor.end());
}
void removerOrdenado(int x)... | ALGO | 0.998302 | 5.077506 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-03-28T15:14:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f20d487e1c6... |
d8e84c8d-4f12-4abc-9d59-741c28194782 | Nishant-Jain-Codes/daily-problem-solving-questions | Coding Ninjas(PENDING)/Data Structures(PENDING)/lect_05_TimeAndSpaceComplexity/RotateArray.cpp | /*
Rotate array
Send Feedback
You have been given a random integer array/list(ARR) of size N. Write a function that rotates the given array/list by D elements(towards the left).
Note:
Change in the input array/list itself. You don't need to return or print the elements.
Input format :
The first line contains an Integ... | ALGO | 0.999587 | 5.450099 | {
"github_metadata": {
"branch": "main",
"commit_count": 1054,
"repo_created_at": "2022-07-18T06:17:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "230b78ece... |
3a236592-790e-4ecb-90b8-63c40ab0fb06 | KratosMultiphysics/Kratos | applications/GeoMechanicsApplication/custom_elements/permeability_calculator.cpp | // KRATOS___
// // ) )
// // ___ ___
// // ____ //___) ) // ) )
// // / / // // / /
// ((____/ / ((____ ((___/ / MECHANICS
//
// License: geo_mechanics_application/license.txt
//
// Main authors: <NAME>
//
#include "permeability_calculator.h"
#include "custom_rete... | ALGO | 0.998143 | 7.217268 | {
"github_metadata": {
"branch": "master",
"commit_count": 106408,
"repo_created_at": "2017-02-13T10:58:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1141,
"forks": 265,
"issues": 381,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
5214494c-58f6-44fd-9c47-a6d3640b2ed2 | cumtmiao/Algrithm | 2017xiaozhao/didi/methdnumber.cpp | /*
题目描述
给定一个有n个正整数的数组A和一个整数sum,求选择数组A中部分数字和为sum的方案数。
当两种选取方案有一个数字的下标不一样,我们就认为是不同的组成方案。
输入描述:
输入为两行:
第一行为两个正整数n(1 ≤ n ≤ 1000),sum(1 ≤ sum ≤ 1000)
第二行为n个正整数A[i](32位整数),以空格隔开。
输出描述:
输出所求的方案数
示例1
输入
5 15 5 5 10 2 3
输出
4
*/
#include<bits/stdc++.h>
using namespace std;
int numberofmethod(vector<int> data,int index,int s... | ALGO | 0.999982 | 4.059012 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2018-04-12T11:51: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": "6584d8785... |
1f390d81-f1f3-4e63-bfde-a82a71ce03e2 | inet-framework/oversim | src/common/SVivaldi.cc | // Copyright (C) 2009 Institut fuer Telematik, Universitaet Karlsruhe (TH)
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later... | ALGO | 0.98989 | 6.022032 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2019-01-25T09:41:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14,
"forks": 6,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "3eb558c1... |
c250748d-9159-44b4-bc5b-fe84617ec0a8 | OloieriAlexandru/Competitive-Programming-Training | codeforces/1203B.cpp | #include <bits/stdc++.h>
#define nmax 405
#define lld long long
using namespace std;
int t, n, a[nmax];
lld arr;
int main()
{
cin>>t;
for (int q=1; q<=t; ++q)
{
cin>>n;
for (int i=1; i<=4*n; ++i)
cin>>a[i];
sort(a+1,a+4*n+1);
bool first = true, ok= true;
i... | ALGO | 0.999756 | 3.508775 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2019-05-29T19:18: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": "5e2395628... |
9bd531e9-ad5d-436a-92d6-07c4fcf45556 | PranavKumar27/SortingProblems | Pgms_9_FindSquareRoot.cpp | #include <iostream>
#include <cmath>
using namespace std;
// Coded on Oct 23, 2021
// For a given number n, find the square root of N upto P decimal places
// Divide on a number line 1 to N such that, i square <= N,
// Find "i" that is closest and <=N. Run binary search here with mid of 1 to N, and so on
// Once fou... | ALGO | 0.999869 | 3.821602 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2021-09-19T12:52: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": "79c78978814... |
16ad1b9e-5f80-4dea-b7d7-4a69bfaaaa7a | keisuke90/AtCoder | practice/abc352-e.cpp | #include <bits/stdc++.h>
#define rep(i, start, end) for(int i = start; i < end; i++)
using namespace std;
struct dsu {
public:
dsu() : _n(0) {}
explicit dsu(int n) : _n(n), parent_or_size(n, -1) {}
int merge(int a, int b) {
assert(0 <= a && a < _n);
assert(0 <= b && b < _n);
int ... | ALGO | 0.99986 | 3.801537 | {
"github_metadata": {
"branch": "main",
"commit_count": 642,
"repo_created_at": "2023-03-11T11:26: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": "c05bc99a89... |
a46d80fd-32e8-4e3e-a96f-2f16c66cb262 | T6Tommy/SEEDLAB-TheGoats | Demo1/arduino/Demo/Forward_Spin_Demo/Forward_Spin_Demo.ino | #include <Wire.h>
#include <Encoder.h>
Encoder myEncR(5, 3);
Encoder myEncL(2, 11);
// pin 7 is H bridge for R
// pin 8 is H bridge for L
int PWM_PinR = 9; // PWM wave outputs to pin 9 & 10
int PWM_PinL = 10;
void setup() {
Serial.begin(57600);
digitalWrite(4, HIGH);
pinMode(PWM_PinR, OUTPUT);
pinMode(PWM_P... | ALGO | 0.940305 | 4.484055 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2022-02-16T20:04:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "080818416c... |
e2dfe210-57eb-4ab8-89b9-af24abcbfee5 | Md-Merazul-Islam/XPSC-Batch-3 | Weekly contest/cf div -2/kh/c.cpp | // /**************بسم الله الرحمن الرحيم*************
// ***********************❀‿❀************************/
// #include <bits/stdc++.h>
// using namespace std;
// #define PI 3.14159265359
// #define dmin 1e-9
// #define dd double
// #define ll long long
// #define yes cout << "YES\n"
// #define no cout << "NO\n"
// #... | ALGO | 0.999984 | 4.554104 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2023-10-12T10:57:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d46b30c5c... |
9ac08079-16a9-4cc1-ab30-1648d7ff6059 | Inuyashaaaaa/IntroductionToAlgorithmicContests | Chapter 7-Brute force/$ 7.7-3.cpp | #include<bits/stdc++.h>
#define LL long long
using namespace std;
double maxWid;
double nowWid;
int num;
struct Node{
double left, right;
double w;
}n[1<<6];
bool vis[1<<6];
void dfs(int cur) {
if(cur == num - 1) {
double width = n[2 * cur].left + n[2 * cur].right;
if(width < maxWid && w... | ALGO | 0.999768 | 3.555656 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2019-07-15T04:53: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": "c6b5efe80... |
8561a07e-a94d-4d15-8f19-bb006ae79b75 | rongals/MuDiSP4 | mudisp-4-examples/gmc-cdma/src/corrlmmse.cpp | //
// MuDiSP2
// Multirate Digital Signal Processor 2
// By <NAME> (C) Apr 1999
//
//
#include "corrlmmse.h"
#define MAXNUMLEN 128
#define VERY_BIG_FLOAT 9.9e9999
#define PI 3.1415926536
//
// Uncomment for X energy dumps
//
#define DUMPXNRG
#define DUMPINTERVAL 1000
#define LMMSE_SWITCH 2000
inline Matrix<compl... | ALGO | 0.997484 | 5.468923 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2012-03-28T15:07:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "114660ab... |
0f35a2a8-7cad-4716-9a05-e8caa76bb303 | viing937/leetcode | algorithms/cpp/381.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
using namespace std;
class RandomizedCollection {
private:
vector<int> nums;
unordered_map<int, unordered_set<int>> valToIdx;
public:
/** Initialize your data structure here. */
RandomizedCollection() {
}
/*... | ALGO | 0.992535 | 6.17567 | {
"github_metadata": {
"branch": "master",
"commit_count": 962,
"repo_created_at": "2015-06-13T14:42: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": "dbd71df9... |
600bdc0a-7494-4a24-9abd-9cdde30b8be7 | malvikpandey/CB_DSA | Recursion/replaceAll0sWith5.cpp | /*
Given an integer N, now you have to convert all zeros of N to 5.
Input Format
The first Line takes input integer N, denoting the number.
Constraints
1<=N<=10000
Output Format
Print the number after replacing all 0's with 5.
Sample Input
103
Sample Output
153
Explanation
Testcase 1: after replacing 0 with 5 ,nu... | ALGO | 0.999169 | 4.517763 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-27T18:21: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": "0e4ca6f4964a... |
582aa580-80c8-44f7-a8e2-774368338ce0 | theVCS/websites_solutions | codechef/cpp/Maximise_Islands.cpp | #include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;
#define ll long long int
//#define bint cpp_int
#define pii pair<int, int>
#define mod 1000000007
#define REP(i, a, b) for (int i = a; i < b; i++)
#define maxN 1000001
//int dx[] = {-2, -... | ALGO | 0.999948 | 3.912555 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2020-10-14T11:50: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": "6a37c0623... |
5e9c88f9-9e21-4e83-8bbe-e28076691943 | ishandutta2007/codeforces-t | tqyaaaaang/normal/599/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
#define LD long double
#define SC(t,x) static_cast < t > ( x )
#define AR(x) vector < x >
#define lp(loop,begin,end) for ( int loop = begin; loop < end; loop++ )
const int INF = 0x3fffffff;
const char *outputs[3] = { "Possible", "Ambiguity", "Impossi... | ALGO | 0.999945 | 3.045326 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27: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": "f58387fc62aa... |
056639ed-b587-4a73-9701-1ebb21aaaf40 | findstr/3DRender | cuda/optics.h | #pragma once
#include "type.h"
#include "auxiliary.h"
namespace render {
namespace optics {
GPU static inline vector3f
reflect(const vector3f &I, const vector3f &N)
{
return I - 2 * I.dot(N) * N;
}
GPU static inline vector3f
refract(const vector3f &I, const vector3f &N, float ior)
{
float cosi = clamp(-1, 1, I.dot... | ALGO | 0.975609 | 4.508093 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2017-11-23T02:51:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7de496a4... |
7a69d9be-54c1-4fdf-b2d3-a05b5f254124 | zaic/mst | gen_simple.cpp | #include <cstdio>
#include <cassert>
#include <random>
#include <string>
#include "gen.h"
using namespace std;
int main(int argc, char *argv[]) {
if (argc < 4) {
fprintf(stderr, "Usage: %s n m filename\n", argv[0]);
return 0;
}
vid_t n = static_cast<vid_t>(stoll(string(argv[1])));
eid_t... | ALGO | 0.972086 | 3.791525 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2014-08-26T19:53:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f938704... |
6c46cd3e-db6a-4510-8ff1-22193ff9b3f7 | Koyingtw/CP | CF practice/1749C.cpp | #include <bits/stdc++.h>
#define Weakoying ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define int long long
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pair<int, int>>
#define pqueue priority_queue
#define pb push_back
#define F first
#define S second
#define max(a, b) (a > b ? a : b)
#d... | ALGO | 0.999897 | 4.68049 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2021-07-10T12:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a5d3792415... |
7cdb0bea-d9fe-4aa4-8fa5-2265bfde0e61 | imeplusplus/ps-competitive-programming | 2022/semana7/hw7/c.cpp | /*
key idea:
read all inputs and save
do the algorithm to compress the coordinates
apply segtree for maximum in range, with lazy update
things to consider:
the size of arrays etc should be equal the number of unique items!!!
in this question, there may be 4 * 10^5 un... | ALGO | 0.999976 | 4.905749 | {
"github_metadata": {
"branch": "main",
"commit_count": 217,
"repo_created_at": "2022-03-14T19:38:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8f6a268e08... |
03ff4397-1153-4e6b-b8f9-9e7bcb50a787 | Pabfigueira/Maratona | Codeforces/Div2_CodeforcesBetaRound18_A.cpp | #include <bits/stdc++.h>
using namespace std;
#define sc(a) scanf("%d", &a)
#define sc2(a, b) scanf("%d%d", &a, &b)
#define sc3(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define scs(a) scanf("%s", a)
#define pri(x) printf("%d\n", x)
#define prie(x) printf("%d ", x)
#define mp make_pair
#define pb push_back
#define BUFF io... | ALGO | 0.999938 | 3.66654 | {
"github_metadata": {
"branch": "master",
"commit_count": 433,
"repo_created_at": "2016-08-13T20:53:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83e01716... |
6413a1ae-1c58-482d-bf57-956778c6b39c | DickyDicky7/SimpleRayTracing | MERL.h | #pragma once
#ifndef MERL_H
#define MERL_H
#include <math.h>
// #include <math.h>
#include <stdio.h>
// #include <stdio.h>
#include <array>
// #include <array>
#include <vector>
// #include <vector>
#include <numbers>
// #include <numbers>
#include <stdlib.h>
// #include <stdlib.h>
... | ALGO | 0.97904 | 4.557994 | {
"github_metadata": {
"branch": "main",
"commit_count": 118,
"repo_created_at": "2025-02-28T20:02: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": "1d8a45a301... |
3a9e249b-ed07-4f2c-81b7-2c8903c6df7e | dvd0904/CPP | struct/bai10_dien_tich_hinh_tron_ngoai_tiep_tam_giac.cpp | #include<bits/stdc++.h>
using namespace std;
#define PI 3.14
struct point{
double x, y;
friend istream& operator >> (istream &in, point &a){
in >> a.x >> a.y;
return in;
}
double operator - (point other){
point dis;
dis.x = other.x - x;
dis.y = other.y - y;
... | ALGO | 0.999497 | 4.831756 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-10-25T13:42:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "173e0f252676... |
4efe0364-2ac4-4ad2-a722-bda8c08bd825 | mirceamaierean/coding-solutions | Infoarena/Arhiva de Probleme/sequencequery.cpp | #include <fstream>
#include <limits.h>
using namespace std;
class InParser
{
private:
FILE *fin;
char *buff;
int sp;
char read_ch()
{
++sp;
if (sp == 4096)
{
sp = 0;
fread(buff, 1, 4096, fin);
}
return buff[sp];
}
public:
InPa... | ALGO | 0.999936 | 4.30512 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-08-11T11:44:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba50743726f5... |
658b1db4-c186-42fe-bf35-1e5848127119 | bijayrauniyar90/GeeksForGeek | Difficulty: Hard/Burning Tree/burning-tree.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
Node *buildTree(string str) {
// Corner Case
if (str.length() == 0 || st... | ALGO | 0.999726 | 5.751644 | {
"github_metadata": {
"branch": "main",
"commit_count": 401,
"repo_created_at": "2024-07-24T16:22: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": "3f2ff8ef89... |
d1cc707f-e683-4341-8509-460db38b097c | NoureldinYosri/competitive-programming | Bubble Cup/2017/qualification/Amusement Park/main.cpp | #include <bits/stdc++.h>
#define loop(i,n) for(int i = 0;i < (n);i++)
#define range(i,a,b) for(int i = (a);i <= (b);i++)
#define all(A) A.begin(),A.end()
#define pb push_back
#define mp make_pair
#define sz(A) ((int)A.size())
#define vi vector<int>
#define vl vector<long long>
#define vd vector<double>
#define vp vecto... | ALGO | 0.99994 | 3.077093 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2015-08-04T09:08: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": "06ed09159... |
de37acad-80ce-4258-8b61-8c46d5825da3 | kasunindikaliyanage/Jyamithika | Jyamithika/Trees/KDTree.cpp | #include "KDTree.h"
using namespace jmk;
void KDTree::traverse(KDNode* _node, std::list<Vector2f>& _list) {
if (!_node)
return;
traverse(_node->left, _list);
if (isALeaf(_node))
_list.push_back(_node->data);
traverse(_node->right, _list);
}
bool KDTree::isALeaf(KDNode* _node) {
if (!_node->left && !_node->r... | ALGO | 0.998626 | 4.836385 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2021-07-05T19:33:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 77,
"forks": 28,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e343be... |
e687e467-f1d5-4835-8452-a30e08df2d24 | ZachariahGlover/projects | personal/challenge/project euler/3_prime_r.cpp | #include <cstdlib>
#include <iostream>
#include <sstream>
using namespace std;
uint64_t largestPrimeFactor(uint64_t n) {
uint64_t k = 2;
while (k < n) {
if (n % k == 0) {
n /= k;
k = 2;
} else {
k++;
}
}
return k;
}
int main(int argc, const char* argv[]) {
cout << "\n";
const char * invalidIn... | ALGO | 0.999449 | 4.278329 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2016-05-24T23:28: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": "fe1cd68db... |
4e467227-1b9e-4044-96c1-fa6527ce054b | ViiniciusK9/tasks | atcoder/abc366/f.cpp | #include<bits/stdc++.h>
using namespace std;
#define DBG(x) cout << "[" << #x << "]: " << x << endl
#define F(x) std::fixed <<std::setprecision(1)<<(x)
#define f first
#define s second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef vector<ll> vi;
typedef pair<int, int> ii;
typedef pair<in... | ALGO | 0.999918 | 3.4414 | {
"github_metadata": {
"branch": "main",
"commit_count": 279,
"repo_created_at": "2021-10-14T23:48:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a6eee23a1... |
6a22f6a6-266f-47cf-b7b3-e63032908317 | Ismail-Mahmoud/Competitive-Programming | Combinatorics.cpp | //Important Series:
//sum of first n integers = n * (n + 1) / 2
// 1 + 2 + 3 = 3 * 4 / 2
//sum of first n odd integers = n^2
// 1 + 3 + 5 = 3^2
//sum of first n powers of two = (2^n) - 1
// 1 + 2 + 4 = (2^3) - 1
//sum of arithmetic series
//sum of geometric series
/**
* Counting principles
- Product R... | ALGO | 0.999935 | 3.897557 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2020-04-16T23:58: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": "3fa2ca6c... |
07c233c0-5f54-46f3-9d72-0af526430b39 | gvilums/mitscriptc | src/regalloc.cpp | #include <algorithm>
#include <cassert>
#include <iterator>
#include <limits>
#include <queue>
#include <unordered_set>
#include <vector>
#include <bitset>
#include "ir.h"
#include "regalloc.h"
namespace std {
template <>
struct hash<::IR::LiveInterval> {
size_t operator()(const ::IR::LiveInterval& interval) con... | ALGO | 0.969629 | 5.906029 | {
"github_metadata": {
"branch": "main",
"commit_count": 421,
"repo_created_at": "2021-12-10T17:23:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b45b98f5a3... |
9dc040ba-913e-496a-be09-10a2e9d05822 | ebby-s/Celegans-simulation | main.cpp | #include "network.hpp"
#include "frame.hpp"
using namespace std;
// loads connections into a network object from a list of connections
//expects format "presynaptic,postsynaptic,weight;"
void load_network(Network* network, istream &source){
char input_char;
string input_line;
vector<string... | TOOL | 0.913789 | 4.174019 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-09-13T08:54: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": "e3658d80cf... |
8b67efbe-ce25-4591-975c-6b6510f72133 | DmitryNazarov212/CPP_courses | sort/mergeSort/mergeSort.cpp | #include "mergeSort.h"
void merge(std::vector<int> &arr, int l, int m, int r)
{
int nl = m - l + 1;
int nr = r - m;
// создаем временные массивы
std:: vector <int> left(nl);
std:: vector <int> right(nr);
// копируем данные во временные массивы
for (int i = 0; i < nl; i++)
left[i] ... | ALGO | 0.999968 | 5.069418 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-11-16T17:54: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": "739a0abc250... |
1a3b232e-c8e8-4553-b121-7dbf3b3edcd7 | Timothyoung97/RenderingEngine | RenderingEngine/maths.h | #pragma once
#include <DirectXMath.h>
using namespace DirectX;
//std
#include <vector>
namespace tre {
struct Plane { // represented using plane equation
XMFLOAT4 eqn;
void normalizePlane();
float getSignedDistanceToPlane(const XMFLOAT3& point);
};
struct Frustum {
Plane topF;
Plane bottomF;
Plane rightF;
... | ALGO | 0.988341 | 6.662676 | {
"github_metadata": {
"branch": "main",
"commit_count": 971,
"repo_created_at": "2023-08-14T03:52:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "3da412f402... |
c781ece3-5589-438d-8787-829708a62b16 | pal-robotics/tiago_tutorials | tiago_pcl_tutorial/include/tiago_pcl_tutorial/pcl_filters.hpp | /*
* Software License Agreement (Modified BSD License)
*
* Copyright (c) 2016, PAL Robotics, S.L.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source... | ALGO | 0.986474 | 6.487306 | {
"github_metadata": {
"branch": "noetic-devel",
"commit_count": 241,
"repo_created_at": "2016-06-13T11:32:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 87,
"forks": 43,
"issues": 9,
"pull_requests": 1
},
"file_meta": {
"content_id": "3... |
0e81d4b2-d568-47ba-b720-299880ee3bf7 | Kitware/VTK-m | vtkm/filter/vector_analysis/worklet/OrientPointAndCellNormals.h | //============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE... | ALGO | 0.967422 | 6.803534 | {
"github_metadata": {
"branch": "master",
"commit_count": 11681,
"repo_created_at": "2019-06-03T18:26:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 35,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37ecb... |
48eabcbc-85b3-48cc-887d-f47ddf162515 | beierjy/InterviewCodes | 7_2_50_GetLastCommonPath.h | //求一棵树的第一个公共父结点。
#include <iostream>
#include <list>
using namespace std;
struct TreeNode{
int m_value;
TreeNode* p_sib;
TreeNode* p_ch;
};
bool GetNodePath(TreeNode* pRoot,TreeNode* pNode,list<TreeNode*> &path){
if(pRoot == pNode)
return true;
TreeNode* pTemp = pRoot;
path.push_back(pRoot);
while(!path.empt... | ALGO | 0.999957 | 3.306136 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2016-05-15T10:35:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3bbf5e57... |
36159f97-4917-4fe3-ae63-252e259f9ab1 | defenestrated/arduino-sequencer | sequencer.ino | /*
code by <NAME>, summer of 2015
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
NOTES:
this code uses timer1, which controls pwm on pins 11 & 12, so don't use those pins
references:
AVR timer datasheet:
http://www.atmel.com/Images/doc2505.pdf
good ... | TOOL | 0.910039 | 4.754956 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-07-22T20:55: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": "28598ed3d... |
5c613aa8-6a12-403f-a60a-a7d83398fda9 | Gemini-cy/MachineLearning | KNearestNeighbors/main.cpp | #include "knn.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <ctime>
std::vector<Data> read_iris_data(const std::string &path){
std::vector<Data> data;
std::ifstream input(path);
std::string line;
//开始读取数据
while(std::getline(input, line)){
//逐行读取数据
std::stri... | ALGO | 0.987593 | 5.364685 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-10-10T07:18: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": "11f9ef10484... |
c7cf9647-f15c-443d-8c7c-13cdb6e62d4e | DWWC-22BCSKPIT-901/day-4-assignment-Abhitha-114 | reverse.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <string>
using namespace std;
int evalRPN(vector<string>& tokens) {
stack<int> st;
for (string& token : tokens) {
if (token == "+" || token == "-" || token == "*" || token == "/") {
int b = st.top(); st.pop();
int a... | ALGO | 0.999851 | 6.605294 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-12-24T09:41:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "dec3fa06eb9a... |
67f4cbb7-a88a-47f5-899d-a4594b492eb5 | ishandutta2007/codeforces-a | ashishgup/normal/863/D.cpp | //Started 5 minutes late
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define trace1(x) ... | ALGO | 0.999951 | 4.097626 | {
"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": "5ec96c3771e4... |
92956d5f-f5df-4e64-9d85-e01ef3d2fbb8 | RiceReallyGood/DQMC | src/debug/matexp.cpp | #include <cstring>
#include "../util.h"
#include "mkl.h"
using namespace std;
int main() {
int n = 4;
double *A = new double[n * n];
double *ExpA = new double[n * n];
memset(A, 0, n * n * sizeof(double));
for (int i = 0; i < n; i++) {
A[i * n + (i - 1 + n) % n] = 1.;
A[i * n + (i ... | ALGO | 0.999772 | 4.40537 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-20T08:02: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": "25efd7b40342... |
3090cbc6-d54f-4139-b800-0ae4f252cfe3 | phongvcao/CP_Contests_Solutions | cpp/Codeforces/451-500/463B_Caisa_and_Pylons.cc | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <stdint.h>
int main(int argc, char **argv) {
int64_t n = 0;
// Read the first line
std::string line = "";
if (std::getline(std::cin, line)) {
std::stringstream ss(line);
ss >> n;
}
int64_t int... | ALGO | 0.999709 | 4.197591 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-12-16T14:20: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": "ec65f4b314... |
fc6a93cd-d28a-477d-a2d7-d883161c4594 | vxl/vxl | contrib/rpl/rgrl/rgrl_est_homo2d_proj_rad.h | #ifndef rgrl_est_homo2d_proj_rad_h_
#define rgrl_est_homo2d_proj_rad_h_
//:
// \file
// \author <NAME>
// \date March 2007
#include <rgrl/rgrl_estimator.h>
#include <vnl/vnl_double_2.h>
//: homography2D transform estimator using the new proj function defined in rgrl_est_proj_func
class rgrl_est_homo2d_proj_rad
: ... | ALGO | 0.99831 | 6.665235 | {
"github_metadata": {
"branch": "master",
"commit_count": 42154,
"repo_created_at": "2013-05-02T18:32:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 250,
"forks": 157,
"issues": 49,
"pull_requests": 0
},
"file_meta": {
"content_id": "06... |
da4d068a-45d2-4e7a-9592-d8ad5413fe92 | EnjiRouz/Tic-Tac-Toe | Проект10/Rules.cpp | #include "Rules.h"
/* запрашивает количество игроков для определения типа
игры (против компьютера или против другого человека) */
void quantity(char* variant)
{
// цикл работает пока не выбран один из предложенных вариантов типа игры
while (*variant != '1'
&& *variant != '2')
{
// вывод просьбы о вводе колич... | TOOL | 0.978841 | 3.622351 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-01-23T08:31: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": "6e07193841... |
6aedd017-c5f0-421b-99aa-b4d180345fa1 | MrRtcl/My-Algorithm | 并查集.cpp | #include <iostream>
using namespace std;
int m,n,f[10050],arr[10050];
int search(int x){
return x == f[x] ? x : f[x] = search(f[x]);
}
void zip(int a,int b){
int fa = search(a);
int fb = search(b);
if(fa != fb){
f[fa] = fb;
}
}
int main(){
cin >> n >> m;
for(int i=1;i<=n;i++){
... | ALGO | 0.999985 | 3.709388 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-11-02T07:13:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0b470118... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.