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 |
|---|---|---|---|---|---|---|---|
5ff0a295-a424-42c4-b8fb-739f64ed7bbc | kaustavshouvik/cp-concepts | UFDS/Approach1_O_N2.cpp | #include <bits/stdc++.h>
using namespace std;
class UFDS {
vector<int> par;
int n;
public:
UFDS(int N) {
n = N;
par = vector<int>(n);
for (int i=0; i<n; i++) {
par[i] = i;
}
}
// Finds if a and b are
// in the same set
bool find(int a, int b) {
return par[a] == par[b];
}
... | ALGO | 0.999346 | 5.055902 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-10-15T16:52: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": "5d3eab191c... |
95dea9dd-2b8a-4828-885f-ee89c3de9896 | yuweichen1008/LeetCode | Practice/BinarySearch/1044_Longest_Duplicate_Substring.cpp | /*
Input: s = "banana"
Output: "ana"
Hint: To check whether an answer of length K exists, we can use Rabin-Karp 's algorithm.
*/
class Solution {
public:
//std::string_view does not copy the whole string
// std::unordered_set handles the logic of hashing and comparing std::string_view's.
string longestDupS... | ALGO | 0.999713 | 6.350838 | {
"github_metadata": {
"branch": "master",
"commit_count": 202,
"repo_created_at": "2017-02-02T05:40: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": "5ce7de9e... |
7d853d72-eac2-4e87-a7d7-cf1677b9612b | naved232doom/A2OJ-Ladders | A2OJLadders/1700-1800/A_Party.cpp | #include <bits/stdc++.h>
#include <functional>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <stdio.h>
#inclu... | ALGO | 0.999646 | 3.904186 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-04-27T18:03: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": "a689964e73... |
cd2a30c0-24c2-4a62-b556-ede5b813ee58 | jilles-valk/AOC | AOC15/AOC15.cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include "../ScopeBasedTiming/ScopeBasedTimer.h"
struct LastCurPos
{
int last = -1;
int cur = -1;
};
int NumberAtNthTurn(std::vector<int>& startingNumbers, int n)
{
std::map<int, LastCurPos> numAndLastPos;
for (int i = 0; i < s... | ALGO | 0.999909 | 5.436338 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-12-04T14:53:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d984779a4... |
52c70136-9438-43f2-bd91-e5bae62189a7 | congxie1108/multilevel-vertex-cut | GraphPartitioner/partition_strategy.hpp | /**
* Copyright (c) 2009 <NAME> University.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* ... | ALGO | 0.998839 | 5.214676 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2015-03-13T01:57: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": "d1da07592... |
ea46149d-04f5-40b5-822a-f31894e0c53e | saifamrkhail/convex_hull | Giftwrapping.cpp | #include "Giftwrapping.h"
void Giftwrapping::convexHull(std::vector<cv::Point2f> points, std::vector<cv::Point2f>& hull)
{
Timing* measureTime = Timing::getInstance();
int num_points = points.size();
if (num_points < 3) return;
measureTime->startRecord("Giftwrapping");
float x_min = points[0].x;
int i_min = 0;
... | ALGO | 0.999274 | 4.291636 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2022-10-05T13:45: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": "988f68b9c... |
83044b87-b868-4b1d-9aa7-8e428797f86e | Floweryu/DataStructuresAlgorithms | OJ——work/work_nine/堆排序.cpp | #include <iostream>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define MAX_NUM 100002
#define NUM_MODLE 100
typedef int ElemType;
struct SqList
{
ElemType list[MAX_NUM];
int length;
};
//堆调整
void AdjustHeap(SqList &L, int s, int m) //每次判断该节点的左右子树,将值大的与节点交换位置
{
int j;
int rc ... | ALGO | 0.999613 | 3.905349 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-03-04T11:59: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": "bef75ca182... |
44e50a01-5c58-4f60-abc5-7c85fbc64baf | ajk6646/424_HW2 | Question_2.cpp | // This Homework was completed by <NAME> and worked on with <NAME> and <NAME>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <string>
#include <iomanip>
#include <chrono>
#include <thread>
struct Robot
{
int id;
};
struct Tool
{
char id;
};
void executeTask(const Robot& robot1, co... | ALGO | 0.969345 | 4.757742 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-09T20:32: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": "b695b105c8f8... |
6448c957-1098-41fd-879d-0fe97fed690d | ahmedfawzy98/Competitive-Programming | algorithms_practice/data_stuctures/trees/src/node.cpp | #include <iostream>
#include "../headers/node.h"
using namespace std;
Node::Node(int d) : data(d){}
void Node::visit(){
cout << this->data << " ";
}
bool Node::isLeaf(){
return this->left == nullptr and this->right == nullptr;
}
bool Node::hasOneChild(){
return this->left == nullptr or this->right == n... | ALGO | 0.997976 | 3.162174 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-12T20:51: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": "206a6bee42... |
9f8d5be2-297e-47fd-9094-e34eda1807c4 | lunathanael/utac | src/main.cpp | #include <algorithm>
#include <array>
#include <cstring>
#include <iostream>
#include "engines.hpp"
#include "eval.hpp"
#include "moves.hpp"
#include "perft.hpp"
#include "types.hpp"
#include "utils.hpp"
using namespace std;
int game(int (*engX)(GAMESTATE *gs), int (*engO)(GAMESTATE *gs), bool print) {
GAMESTATE g... | ALGO | 0.999654 | 5.179039 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2023-09-06T21:24: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": "07666ffb1... |
f01af60d-3cc1-4431-a6d9-a70bf00272af | Raidero/fractal | main.cpp | #include <iostream>
#include <cstdlib>
#include <SFML/Graphics.hpp>
#include <thread>
#include <mutex>
#define BUFFER 700
using namespace std;
int n = 0;
std::mutex m;
bool isOn = true;
void fractal(long double originR, long double originI, long double cR, long double cI, long double scale, long double buffer, int max... | ALGO | 0.93604 | 4.439242 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-01-28T01:32: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": "950976c2ff... |
8540c481-37bd-4229-a367-7bf4302a3f27 | Yunhao0799/Metodologia-de-la-Programacion-UGR | Práctica 3/ejercicio3/src/utilidades.cpp | #include <iostream>
#include "utilidades.h"
using namespace std;
int mezclarUnico(const double * const array1, const int tam1, const double * const array2, const int tam2, double *salida)
{
int tam_salida;
tam_salida = tam1;
int i, j;
double elemento;
//copia el primer vectopr en nuestro vector auxiliar
... | ALGO | 0.998672 | 4.409408 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-06T10:55: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": "c0c3248a77... |
f9fdcf96-2b42-47d8-ab8a-5dc499fe930c | Multi-Robot-Exploration/frontier_detection | include/freespace_frontier_extractor.h | #ifndef _OCTOMAP_FRONTIERS3D_FREESPACE_FRONTIERS_EXTRACTOR_H_
#define _OCTOMAP_FRONTIERS3D_FREESPACE_FRONTIERS_EXTRACTOR_H_
//#include <octomap_frontiers3d/FreeSpaceFrontierRepresentative.h>
//#include <octomap_frontiers3d/util/octomap_frontiers3d_util.h>
#include <freespace_frontier_representative.h>
#include <octoma... | ALGO | 0.989943 | 6.716456 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-11-17T05:52:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c6045198e4... |
c21f5248-8a52-4f17-931d-c3365c5444fe | ishandutta2007/codeforces-f | fizzydavid/normal/690/F3.cpp | //by yjz
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#define foreach(it,s) for(__typeof((s).begin()) it=(s).begin();it!=(s).end();it++)
#ifndef LOCAL
#define cerr if(0)cout
#endif
typedef long long ll;
typedef unsigned long long ull;
const in... | ALGO | 0.999767 | 3.280784 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a6d6209d8fa9... |
75abd42a-4280-41e0-b140-a12fe8073c6c | TheWheezard/PROGRAMACION | EDNL/EJERCICIOS/ArbolesBin/AbinPseudocompleto.cpp | #include "..\..\Implementaciones\Abin.hpp"
template <typename T>
bool esPseudocompleto(Abin<T>& A) {
if (!A.arbolVacio()) {
size_t alturaMax = calcularAlturaMax(A, A.raiz());
size_t alturaMin = calcularAlturaMin(A, A.raiz());
if (alturaMax - alturaMin > 1) return false; //doubt, check que... | ALGO | 0.981237 | 3.963923 | {
"github_metadata": {
"branch": "main",
"commit_count": 374,
"repo_created_at": "2021-10-25T22:15: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": "813315d646... |
6c363e86-97e6-4758-be5f-87c7004ca732 | mariofv/DocSim | src/mainexperimentoslsh.cpp | #include <iostream>
#include <chrono>
#include <cmath>
#include "kshingleset.h"
#include "lsh.h"
#include "minhashsignatures.h"
#include "reader.h"
#include "kshinglesethashed.h"
using namespace chrono;
void setSimilarity (uint& unionSize, uint& interSize, const set<pair<uint,uint>>& correctPairs, const set<pair<u... | ALGO | 0.995423 | 3.515557 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2016-10-19T08:58:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96bb49e20... |
cf43277a-92fc-47ce-a450-dd30b7dab60d | Phoenix-RK/GeeksForGeeks | arrays/Rotation/Rotate_and_Delete.cpp | //Phoenix_RK
/*
ROTATE AND DELETE
//////////////////////////////////////
Given an array arr[] of N integers. Do the following operation n-1 times. For every Kth operation:
Right rotate the array clockwise by 1.
Delete the (n-k+1)th last element.
Now, find the element which is left at last.
Testcase:
6
1 2 3 4 5 6
////... | ALGO | 0.999927 | 4.078489 | {
"github_metadata": {
"branch": "master",
"commit_count": 380,
"repo_created_at": "2020-03-27T07:09:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "19d1ae2b... |
cc1e9924-c37e-4852-9cfe-55b34e9640db | xamrutya/Competitive-Programming---CB | Game Theory/The Game Of Stones - 1.cpp | /*
The Game Of Stones - 1
Two players (numbered 1 and 2) are playing a game with stones. Player 1 always plays first, and the two players move in alternating turns. The game's rules are as follows:
In a single move, a player can remove either 2,3,or 5 stones from the game board. If a player is unable to make a move, t... | ALGO | 0.999984 | 5.21086 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-07-31T11:18: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": "93d0cf912d... |
b961468a-9aae-4fb1-bb0a-2feff627c588 | Team973/2018-inseason | third_party/ctre/cpp/include/ctre/phoenix/Signals/MovingAverage.h | /*
* Software License Agreement
*
* Copyright (C) Cross The Road Electronics. All rights
* reserved.
*
* Cross The Road Electronics (CTRE) licenses to you the right to
* use, publish, and distribute copies of CRF (Cross The Road) firmware files (*.crf) and Software
* API Libraries ONLY when in use with Cros... | TOOL | 0.991782 | 5.478361 | {
"github_metadata": {
"branch": "dev",
"commit_count": 718,
"repo_created_at": "2018-01-07T23:58:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70c60b64a796... |
7ea0c09c-a198-46e4-8b65-20b3a84d25b5 | ishandutta2007/codeforces-a | anz/normal/1157/B.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <bitset>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
ll gcd(ll a, ll b)
{
for... | ALGO | 0.999931 | 3.660134 | {
"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": "0c9505b2e73d... |
6861b3a2-ac60-46aa-bf17-a260c8efac75 | manavkush/PracticeProblems | CodeChef/Contests/August Challenge 20/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
typedef long long int lli;
typedef vector<int> vi;
#define all(x) x.begin(), x.end()
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define d... | ALGO | 0.999874 | 3.834553 | {
"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": "4ff67d59... |
ab1a9935-e7bc-4fef-b2ac-55fad34ce8ac | zJames/Util | Util/Containers/BitSet.h | //------------------------------------------------------------------------------
// Copyright : (c) 2006
// Authors :
// JRP <NAME>
//------------------------------------------------------------------------------
#ifndef BITSET_H
#define BITSET_H
#include <cstring>
#include <intrin.h>
/////////////////////////////... | TOOL | 0.95542 | 6.345301 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-10-02T14:43: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": "3587e4c0ba02... |
30a1d3f6-cdd3-4c72-82ed-a9b0ae74d994 | enabledornot/adventofcode | 2022/day04/cleanup.cpp | #include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
typedef struct elfpair{
int elfs[4];
} elfpair;
int* toAry(string charStr) {
int* elfpair = (int*)malloc(sizeof(int)*4);
memset(elfpair,0,sizeof(int)*4);
int currentNumb = 0;
int cval = 0;
for(int i = 0;i<charStr.le... | ALGO | 0.995836 | 3.435683 | {
"github_metadata": {
"branch": "main",
"commit_count": 118,
"repo_created_at": "2022-12-01T00:39:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5fd9422f2a... |
c5e13411-d746-42a0-ade9-562c601407aa | chemi123/atcoder | practice/red_scarf.cpp | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define ... | ALGO | 0.999987 | 4.147628 | {
"github_metadata": {
"branch": "master",
"commit_count": 546,
"repo_created_at": "2020-08-06T00:17: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": "14776d3f... |
5a92bc83-f45b-435d-8be9-5a2df7dad4ac | MrDonaldoWorking/School-Codes | lkl_2017_08/День 12 Строки/B.cpp | #define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:108777216")
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <vector>
#include <algorithm>
#include <string>
using ll = long long;
using ull = unsigned long long;
using ld = long double;
//ŠKAN
//template<typename T>
//using pair2<T> = ... | ALGO | 0.999953 | 3.930637 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-07-13T15:23:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bed3e0cb4... |
81263539-1893-4560-adb5-902f28d16e25 | sreejithsankar55/Sorting_algos | Merge_sort.cpp | //Sreejith
//9-6-2018
//Merge Sort
//The following program depicts merge sort using cpp stl
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void mergesort(vector < ll >& v,ll l,ll r);
void merge(vector < ll >& v,ll l,ll m,ll r);
int main()
{
ll n,b;
cin>>n;
vector < ll > v(n);
for ( ll ... | ALGO | 0.999996 | 5.246323 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-06-05T16:59:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a49105d1a... |
bd39fc8a-525e-404d-a9cc-8e8a722f7f0e | shashwata2003/DSA | 2.FamousQues/CompanyBased/Amadeus/RepeatedDNASequence.cpp | #include<iostream>
#include <bits/stdc++.h>
#include <array>
using namespace std;
/*
You are given a string of size ‘N’ consisting of only characters ‘a’,’c’,’g’ and ’t’.
You have to find all the sub-strings of the given string of length 10 that is occurring more than once
in the given string.
Sample Input 1
2
12
aa... | ALGO | 0.997279 | 3.262014 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-07-15T03:10: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": "aebed4c240e... |
0a189cd6-7329-482a-a63f-ea10916d0c19 | chenzhi87v5/LeetcodeOJ | 015-3Sum.cpp | //3Sum 三数之和
/*
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0?
Find all unique triplets in the array which gives the sum of zero.
*//*
这道题让我们求三数之和,比之前那道Two Sum 两数之和要复杂一些,我们还是要首先对原数组进行排序,然后开始遍历排序后的数组,
这里注意不是遍历到最后一个停止,而是到倒数第三个就可以了,然后我们还要加上重复就跳过的处理,对于遍历到的数,
我们用0减去这个数得到一个sum,我们只需要... | ALGO | 0.999807 | 5.409274 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2016-03-17T11:26:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5ebe267... |
29ef0612-cc18-4d89-a902-c76ec30634a2 | ishandutta2007/codeforces-u | umqra/normal/671/D.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <cmath>
#include <ctime>
#include <sstream>
#include <fstream>
#include <functional>
#include <cassert>
#include <complex>
#include <valarray>
using... | ALGO | 0.999752 | 3.695314 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9eb7d2bfc5f... |
5f424cd4-015f-483c-871d-03f8085a456c | ishandutta2007/codeforces-s | sofapuden/normal/318/A.cpp | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i = a; i<b; i++)
#define dep(i,a,b) for(int i = a-1; i>=b; i--)
#define makeUnique(vec) sort(all(vec)); vec.resize(unique(all(vec)) - vec.begin())
#define LOG_vec(vec, sep) for (int fl = 0; fl < vec.size(); fl++) { cout << vec[fl]<< sep; } cout << "\n";
#define LOG_int... | ALGO | 0.999856 | 3.17004 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b611d3d01fd7... |
d12a9b68-008d-47c5-873f-4860996dbbd3 | Adityapandeygit/C-programming | perfect print fuction.cpp | #include <stdio.h>
// Function to check if a number is perfect or not
int isPerfect(int n)
{
int i, sum = 0;
// Check if the number is a multiple of any number between 1 and n-1
for (i = 1; i < n; i++)
{
if (n % i == 0)
{
sum += i;
}
}
// Return 1 if the su... | ALGO | 0.985697 | 4.793245 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-02-24T16:40: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": "aa8754b3ab7d... |
f447277c-a68c-434f-8621-18803fea5003 | ermine27/atcoder | s8pc-6/s8pc-6-b.cpp | #include <bits/stdc++.h>
using namespace std;
#define reps(i,s,n) for(int i = (int)(s); i < (int)(n); ++i)
#define rep(i,n) reps(i,0,n)
using ll = long long;
using vi = vector<int>;
using vl = vector<long long>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bo... | ALGO | 0.999953 | 3.479664 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2022-05-16T12:56:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "d4c3dcd4c6... |
9e372a8f-5a0a-4c0d-99d8-399976aa2385 | AdamKN0/webserv42 | Req/parseBody.cpp | #include "HTTPRequest.hpp"
void HTTPRequest::parseURLEncodedBody(const std::string &CT)
{
std::vector<std::map<std::string, std::string > > data;
std::istringstream iss(this->boooooooooody);
std::string key_value;
while (std::getline(iss, key_value, '&'))
{
size_t pos = key_value.find('=');... | WEB | 0.908748 | 4.148149 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-04-21T23:54:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29d93c5658a8... |
7e0b1759-be27-42cf-b787-e495e7618e92 | pg1049/ApolloniusDiagram | include/Apollonius3D.h | #pragma once
#define _CRT_SECURE_NO_WARNINGS
#include "Edge.h"
#include "cvt.h"
#include "cvtlloyd.h"
#include "CVT_LBFGS.h"
#include<random>
#include<ctime>
#include<cmath>
#include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Constrained_Delaunay_tr... | ALGO | 0.997026 | 3.262861 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-06-05T09:23: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": "78b785aae2c7... |
2673d0ce-0e30-44ee-bfc0-24311b950c34 | snipersim/snipersim | common/misc/config.h | // config.h
//
// The Config class is used to set, store, and retrieve all the configurable
// parameters of the simulator.
//
// Initial creation: Sep 18, 2008 by jasonm
#ifndef CONFIG_H
#define CONFIG_H
// Enable to run core performance model in separate thread
// When # simulated cores > # host cores, this is prob... | CONFIG | 0.927816 | 3.030593 | {
"github_metadata": {
"branch": "main",
"commit_count": 1303,
"repo_created_at": "2022-05-18T13:30:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 137,
"forks": 78,
"issues": 10,
"pull_requests": 9
},
"file_meta": {
"content_id": "242f58... |
ef6694a4-ff1e-463b-b395-877672df2e2c | kiruba-r11/LeetCode-Solutions | 94-binary-tree-inorder-traversal/94-binary-tree-inorder-traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 6.143323 | {
"github_metadata": {
"branch": "main",
"commit_count": 3218,
"repo_created_at": "2022-01-26T12:07:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3949ad2ef... |
beff71f7-0114-473a-b37c-2ef5c3d0abda | yshagit31/DSA | POTD/18-3-2025LongestNiceSubArray.cpp | // 2401. Longest Nice Subarray
// You are given an array nums consisting of positive integers.
// We call a subarray of nums nice if the bitwise AND of every pair of elements that are in different positions in the subarray is equal to 0.
// Return the length of the longest nice subarray.
// A subarray is a contiguo... | ALGO | 0.999898 | 5.775679 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2024-04-23T19:26: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": "354d84b1... |
f90cc10d-a2b5-4846-97a2-ec94b309c588 | amanullah7649/Programming | Game Theory/Game of Sum UVA_10891.cpp | /*
*************** <NAME> ***************
AUTHOR: MD.AMANULLHA
UNIVERSITY OF LIBERAL ARTS BANGLADESH
DATE: / / 2021
*/
#include<bits/stdc++.h>
#define endl '\n'
#define PI acos(-1.0)
#define pf printf
#define sf scanf
#define ff first
#defin... | ALGO | 0.999443 | 3.942846 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-01-05T06:55: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": "a4fb636e3759... |
b7f2a0e6-2fb7-422f-9972-686427aec99b | JmonkG/MBMEDA | EDAMotif/Individuo.cpp | #include "individuo.h"
#include <cmath>
using std::cout;
using std::endl;
void Individuo::Construir (Cromosoma c,Base &x)
{
crom = c;
CalcularFitness(x);
//padre1 = p1;
//padre2 = p2;
}
void Individuo::CalcularFitness(Base &x){
double sumafitness=0;
(*this).dimpos=x.tambase;
/*for(int z=0;z<=x.tambase-1;z++... | ALGO | 0.979896 | 3.675789 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-05-22T03:28:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5769fbeffd... |
bac793fa-bde6-46a5-979b-1b9fcfb92b24 | marovira/csc116_fall2018 | lectures/week_3/code/exception.cpp | #include <vector>
#include <iostream>
#include <stdexcept>
int maxVal(std::vector<int> const& vec)
{
if (vec.empty())
{
throw std::invalid_argument("Cannot compute maximum of an empty vector!");
}
int max{-1000};
for (auto val : vec)
{
if (val > max)
{
max =... | ALGO | 0.911302 | 5.678954 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2018-08-31T19:56:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98e55431f... |
4f9f196c-9bd7-4cd7-9749-51984f69d6e9 | Hyp-ed/hyped-2019 | src/utils/config.cpp | /*
* Authors: <NAME>
* Organisation: HYPED
* Date: 3. April 2019
* Description:
*
* Copyright 2018 HYPED
* 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... | CONFIG | 0.918834 | 6.298354 | {
"github_metadata": {
"branch": "develop",
"commit_count": 1050,
"repo_created_at": "2018-11-17T13:48:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f5c89... |
467b897f-7dfe-4be3-9373-c457c9187a67 | Tem-Am/LeetCode | problem1306.cpp | #include <vector>
#include <queue>
#include <iostream>
using namespace std;
class Solution
{
public:
bool canReach(vector<int> &arr, int start)
{
// Base case
if (arr[start] == 0)
{
return true;
}
// Have a queue to check everything
queue<int> jumpqu... | ALGO | 0.999925 | 5.353926 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-10-14T07:04: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": "c068b1ec4b5... |
abe83069-7f4a-4530-a86d-8db8781f0a49 | wrench126/My-portfolio | problem-solving/Assignments/question 1/main.cpp | #include <iostream>
#include <limits>
using namespace std;
// Prototype
bool check(char V[], char n);
int main() {
char V[5] = {'A', 'O', 'I', 'U', 'E'};
char n;
while (true) {
cout << "Enter the letter (only 1 letter) Enter 0 to exit : " ;
cin >> n ;
n = toupper(n); // converti... | ALGO | 0.997933 | 4.070117 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-11T12:55:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c07eb2de41a7... |
736531d2-0e05-4021-aa2d-61424dc5f651 | georgerapeanu/c-sources | cf1109/C.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
struct query_t{
int t,l,r,v;
};
const int NMAX = 1e5;
const int no_lazy = -1;
int q;
query_t queries[NMAX + 5];
vector<int> events;
vector<int> weight;
map<int,int> norm;
set< pair<int,int> > active;
st... | ALGO | 0.999904 | 4.649539 | {
"github_metadata": {
"branch": "master",
"commit_count": 177,
"repo_created_at": "2018-08-15T14:37:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06870e45... |
cbad9330-1e4a-4986-b78a-ac2b7cbc899e | Nu-NSDI23/Nu | inc/nu/utils/zipf.hpp | #pragma once
#include <cstdint>
#include <limits>
#include <random>
#include <vector>
namespace nu {
//
// Example usage:
//
// std::random_device rd;
// std::mt19937 gen(rd());
// zipf_distribution zipf(300, 1.0);
//
// for (int i = 0; i < 100; i++)
// cout << zipf(gen) << endl;
class zipf_distribution {
p... | ALGO | 0.971337 | 5.330767 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2022-08-22T04:09:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 38,
"forks": 9,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4773f618b5... |
a4c00a88-33c5-4a79-9e94-96511429ab85 | DangQui/BackUp | DevC++/CTDL>_Advanced/Classroom_Concepts/Thuat_Toan_Prim.cpp | #include <bits/stdc++.h>
using namespace std;
struct Graph{
int N; // So dinh cua do thi
int **A; // Ma tran trong so cua do thi
};
// Nhap do thi tu file
void Nhap(Graph &g){
// Tao doi tuong file de doc
FILE *f = freopen("Graph.txt", "r", stdin);
// Nhap so dinh cua do thi (dong dau tien cua file Graph.txt)
... | ALGO | 0.999914 | 3.790695 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-05-08T00:17: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": "483a48aef3... |
4967360c-dbd8-4983-a919-89488ad7c852 | dfreese/miil | include/miil/util.h | #ifndef UTIL_H
#define UTIL_H
#include <vector>
#include <string>
#include <stdint.h>
#include <iostream>
#include <iomanip>
#include <sstream>
namespace Util {
std::vector<bool> int2BoolVec(int input,unsigned int numBits);
int boolVec2Int(const std::vector<bool> &input);
void clearFile(std::string filena... | TOOL | 0.922931 | 5.746312 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2017-12-16T01:32: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": "fe456b28... |
3857c392-9a92-487d-bf30-60917e4911eb | Jorgitou98/Acepta-el-Reto | Soluciones/AceptaElReto561SerieLeibniz.cpp | #include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
string termino(int k, int m) {
int resto = 1;
string term(m + 1, ' ');
for (int i = 0; i <= m; ++i) {
term[i] = resto / k + 48;
resto = (resto % k) * 10;
}
return term;
}
void suma(string & sum1, string const& sum2, int m) {
int... | ALGO | 0.999432 | 3.622091 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2019-02-03T20:16:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d3e9a... |
60f119e0-f032-49eb-9e49-fd1270baa259 | space-sea1231/space_sea | c++/luogu/图论/树论/LCA/P10930 异象石.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 1e5 + 10;
const int K = 33;
int n, m;
int ans, cnt;
int head[N], to[N << 1], nxt[N << 1], val[N << 1];
void Add(int u, int v, int w) {
to[++cnt] = v;
val[cnt] = w;
nxt[cnt] = head[u];
head[u] = cnt;
}
struct Least_Common_A... | ALGO | 0.999994 | 4.321724 | {
"github_metadata": {
"branch": "main",
"commit_count": 136,
"repo_created_at": "2025-01-15T08:15: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": "1aa0404e91... |
5bd77c2a-9da9-4888-815d-11434625247c | molnplus/mingromacs | src/gromacs/gmxpreprocess/insert-molecules.cpp | /*
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* <NAME>, <NAME>, <NAME>, and <NAME>,
* and i... | ALGO | 0.94984 | 6.003893 | {
"github_metadata": {
"branch": "master",
"commit_count": 14695,
"repo_created_at": "2015-12-15T18:42: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": "1285d4... |
a7f12ab2-039f-4e5e-9351-be367fd235dd | rikuTanide/atcoder_endeavor | arc037/arc037_c.cpp | #include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
using namespace std;
const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
... | ALGO | 0.999927 | 3.644213 | {
"github_metadata": {
"branch": "master",
"commit_count": 4423,
"repo_created_at": "2020-12-05T04:36:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0818bb... |
d89718d6-9230-4797-bec5-2d3b80e328d4 | AkshatSharma1/DSA | BinaryTree/Group_1_Codes/buildFromPreandIn.cpp | #include<iostream>
#include<queue>
#include<cmath>
using namespace std;
class node{
public:
node* left;
node* right;
int data;
//constructor
node(int d)
{
data = d;
left = NULL;
right = NULL;
}
};
node* buildTree()
{
... | ALGO | 0.999985 | 4.802176 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-04-28T13:33: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": "4cd501e41b58... |
b7c49812-52b1-43f6-8096-8b44d0fe1064 | savraska/Kata | booster.cpp | // We can now use the BH package
// [[Rcpp::depends(BH)]]
#include <Rcpp.h>
#include <boost/math/common_factor.hpp>
using namespace Rcpp;
// This is a simple example of exporting a C++ function to R. You can
// source this function into an R session using the Rcpp::sourceCpp
// function (or via the Source button o... | TOOL | 0.939188 | 4.810847 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-02-03T10:37:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67c9eff341... |
07e4abbe-a0c3-40b3-bf42-b7e3332007fe | jccarvalhosa/maratona | googlecodejam/2014/round1-b/machine.cpp | #include <bits/stdc++.h>
using namespace std;
long long dp[32][2][2][2];
int main() {
int T;
cin>>T;
for(int t=1;t<=T;t++) {
printf("Case #%d: ", t);
int a, b, k;
cin>>a>>b>>k;
memset(dp, 0, sizeof(dp));
dp[31][0][0][0]=1;
for(int i=30;i>=0;i--) {
for(int mask=0;mask<8;mask++) for(int va=0;va<=1;va+... | ALGO | 0.999683 | 4.371899 | {
"github_metadata": {
"branch": "master",
"commit_count": 482,
"repo_created_at": "2012-12-12T23:19:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cadd937... |
9ec5ffad-9937-402d-9a14-d1980717495d | ZTL-UwU/OI | OJ/gdgzoi/primary/practise/2189/2189_3.cpp | #include <iostream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
const int MAXN = 100100;
struct data
{
int u, v;
};
vector<int> g[MAXN];
stack<int> st;
int color[MAXN];
int dfn[MAXN];
int low[MAXN];
int col;
int tt;
void tarjan(int u)
{
dfn[u] = low[u] = ++tt;
... | ALGO | 0.999986 | 4.262015 | {
"github_metadata": {
"branch": "main",
"commit_count": 562,
"repo_created_at": "2020-07-18T02:10: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": "5134ec8615... |
6eeab70e-0c14-47c6-9a8f-1b3d0a3367b3 | Shantanumali23/DSL | Assi5.cpp | #include<iostream>
using namespace std;
class CLL
{
public:
int route;
CLL *next;
CLL *previous;
public:
CLL()
{
route=0;
next=NULL;
previous = NULL;
}
CLL(int d)
{
route=d;
next=NULL;
previous = NULL;
}
};
class Nav
{
CLL... | ALGO | 0.997435 | 3.927462 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-09-25T03:51:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1db8a8b3653f... |
c203eecb-36e2-45f9-a557-dc06093de97b | maoshuozs/- | 无向图(邻接矩阵).cpp | #include<iostream>
using namespace std;
#define MAXNUM 100
//定义无向图
typedef struct{
char Vex[MAXNUM]; //顶点表
int arcs[MAXNUM][MAXNUM]; //邻接矩阵
int vnum,arcnum; //实际输入的顶点数和边数
}GraphUDG;
int visited[10]; //负责判断是否经过
//定位
int Locate(GraphUDG G,char v){
for(int i = 0;i < G.vnum;i++){
if(G.Vex[i] == v){
... | ALGO | 0.999754 | 4.302541 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-11-27T14:24: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": "d0a9a629209a... |
88b5cedd-9451-45a2-8993-40d1dc72dc56 | ctaicarus/CTDL | contest9/17.cpp | #include<bits/stdc++.h>
using namespace std;
int n , m , a[1001][1001] , d;
bool c[1001] , ok;
void init(){
cin >> n >> m;
ok = false;
for(int i = 1 ; i <= n ; i++) for(int j = 1 ; j <= n ; j++) a[i][j] = 0;
for(int i = 1 ; i <= n ; i++) c[i] = true;
for(int i = 1 ; i <= m ; i++){
int x , y;
cin >> x >> y;
a... | ALGO | 0.999963 | 4.300973 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-08-10T12:43: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": "7e60470cf9... |
dc4844c4-8770-4892-9b68-04db354644ca | EuanWilliams/advent-of-code-2023 | Day-4/day_4_phase_2.cpp | //
// <NAME>: 12/12/2023
//
// Solution for Advent of Code day 4 Phase 2
//
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <array>
#include <map>
using namespace std;
bool check_number_in_array(int number, vector<int> array) {
for (int i = 0; i < array.size(); i++) {
... | ALGO | 0.969276 | 4.862883 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-12-04T14:19: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": "25dffed16e8... |
14907524-5334-4756-a2c1-2f9ff304f341 | webfanrc/data-structure-study-path | week3:树/1020 Tree Traversals (25 分)/main.cpp | #include "stdafx.h"
#pragma warning(disable:4996)
#include <cstdio>
#include <queue>
using namespace std;
#define maxv 31
struct node {
int data;
node* left;
node* right;
};
int post[maxv], in[maxv];
int N;
node* solve(int postL, int postR, int inL, int inR) {
if (postL > postR) return NULL;
node* root = new ... | ALGO | 0.999998 | 4.192106 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2019-06-14T11:42:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c161f6eb... |
fffc6d18-c969-44bd-8889-e6dce466f14a | FHead/fheadhelpercode | Program/ProjectEuler/Problem0150/MinimumSum.cpp | #include <iostream>
using namespace std;
int main()
{
int Array[1000][1000] = {{0}};
long long t = 0;
for(int i = 0; i < 1000; i++)
{
for(int j = 0; j <= i; j++)
{
t = (615949 * t + 797807) % 1048576;
Array[i][j] = t - 524288;
}
}
int RowCumulative[1001][1001] = ... | ALGO | 0.999579 | 3.724894 | {
"github_metadata": {
"branch": "master",
"commit_count": 181,
"repo_created_at": "2015-11-10T02:30: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": "872732b4... |
9209825f-ca7f-4f31-b70e-c8a31e08d687 | nutthanonn/problem-solving | borntodevOfficialTask/cpp/3-star/หมากรุก.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string chess;
map<char, int> score;
score['p'] = 1;
score['n'] = 3;
score['b'] = 3;
score['r'] = 5;
score['q'] = 9;
score['k'] = 0;
int score_me = 0;
int score_you = 0;
for(int i = 0; i < 8; i ++){
cin >> c... | ALGO | 0.999869 | 3.968601 | {
"github_metadata": {
"branch": "main",
"commit_count": 244,
"repo_created_at": "2021-07-03T12:40:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b764c23885... |
206176b5-ca9a-4ee7-914d-78de26a7dcae | ThaiHoangDang/leetcode | C++/Done/121. Best Time to Buy and Sell Stock/3.cc | #include <vector>
using namespace std;
// runtime:
// space:
bool compare(vector<int> &a, vector<int> &b) {
if (a.at(1) == b.at(1)) return a.at(0) < b.at(0);
return a.at(1) < b.at(1);
}
class Solution {
public:
int maxProfit(vector<int>& prices) {
vector<vector<int>> pricesWithOrder;
int... | ALGO | 0.999913 | 5.976209 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2023-09-07T05:16: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": "87c63fbe1f9... |
4e6a3374-a6d6-478d-8b03-ef80c1993f54 | Xilinx/Vitis_Libraries | data_compression/L2/src/adler32_mm.cpp | /*
* (c) Copyright 2019-2022 Xilinx, Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... | ALGO | 0.987115 | 6.370944 | {
"github_metadata": {
"branch": "main",
"commit_count": 471,
"repo_created_at": "2019-09-23T19:13:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 988,
"forks": 381,
"issues": 0,
"pull_requests": 12
},
"file_meta": {
"content_id": "ea4dab... |
d461c7d3-dd96-4a43-bd46-ca8b8238e5ba | Sskarm/Algorithms-and-Complexity | lab_01/bicriteriamst.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;
// Edge class to represent a graph edge
class Edge {
public:
int u, v; // Vertices
int profit, weight; // Profit and weight of the edge
Edge(int u, int v, int profit, int weight)
: ... | ALGO | 0.999965 | 5.789958 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-14T01:58: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": "a059469316f0... |
7f2007c2-661f-4a0d-817e-4400d0e3f66d | averywang21/CS106L-spr20 | lectures/L5-containers/DequeSpeed/main.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <string>
#include <chrono>
#include "graphwindow.h"
using std::cout; using std::endl;
using std::vector; using std::deque;
void printVector(const vector<double>& vec) {
cout << "{";
for(auto i : vec) {
cout << i << " ";
}
cout << ... | TOOL | 0.921055 | 6.033451 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2020-03-18T14:18:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 56,
"forks": 28,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "815b8a5... |
2b4e8efa-e12d-4b80-b3ef-b78cb88fdc69 | lokesh-acharya/simulator-mips | mips.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
#include <cmath>
using namespace std;
int cycles(string s){
if(s=="add"||"sub"||"sll"||"srl") return 1;
else if(s=="sw"||"lw"||"j"||"jr"||"jal"||"beq"||"bne"||"bgtz"||"blez") return 2;
else return 0;
}
int regIndex(... | ALGO | 0.981932 | 3.212742 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-02-15T18:02:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d65fa50737c... |
385ed182-d6ea-405b-8e77-5b1abbf067b6 | kmykoh97/My-Leetcode | solutions/ransom_note.cpp | #include <iostream>
#include <vector>
#include <map>
#include <string>
#include <stack>
#include <set>
using namespace std;
// Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magaz... | ALGO | 0.999467 | 5.860364 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2020-05-11T12:10: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": "36c66bb13... |
4e64c458-c3ac-4bb3-82fc-a51a8d82239f | pupuzuimei/exam_7.3-2 | exam_7.3-2/main.cpp | #include <iostream>
#include<fstream>
#include <algorithm>
#include<string>
#define statistics 6//改变学生人数
using namespace std;
struct student{
string number;//学号
string name;//姓名
string sex;//性别
string phone;
int age;//年龄
double score[7];//成绩
double ave;//平均分
}a[statistics];
struct people{
... | ALGO | 0.945148 | 3.270781 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-07-03T13:22:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82d8d7fb72... |
21639890-6bdc-4531-999a-ad262fc8dd9d | sageslayers/CP | TOKI/Chapter4/jawbreaker1.cpp | #include<bits/stdc++.h>
using namespace std ;
bool visited[26][26] ;
int arr[26][26] ;
int sum ;
void floodfill(int x , int y , int c , int m , int n ) {
//cout << "TES"<< endl ;
visited[x][y] = true ;
sum++ ;
if ( arr[x+1][y] == c && !visited[x+1][y] && x+1 < m ){
floodfill(x+1,y,c,m,n) ;
}
if ( arr[... | ALGO | 0.999826 | 3.142254 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-12-06T13:38: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": "f67879949... |
1585f7f0-1a50-40e1-ad98-58f09cccc374 | Sabro98/alps_study | tuna1210/Floyd/2458_키순서.cpp | #include <iostream>
#include <vector>
using namespace std;
#define INF 1e9
int n, m;
vector<pair<int, int>> G[501];
int floyd[501][501];
void initFloyd()
{
for (int i = 1; i <= n; i++)
{
for(const auto& next : G[i])
{
floyd[i][next.first] = min(floyd[i][next.first], next.second);
... | ALGO | 0.999855 | 4.001575 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2021-08-18T10:06:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8bb5e0a736... |
cb83a8e8-cf9b-46df-b30a-f2fa5f767491 | raihankhan/DSA-drill | DATA STRUCTURES/Largest area of rectangle filled with 1.cpp | #include<bits/stdc++.h>
///...................................*****.................................................///
/// Author : <NAME> ( <EMAIL> ) ///
/// Department of Computer Science ///
/// & Engineering ... | ALGO | 0.999922 | 3.177665 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2019-08-27T14:46:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "781104e5... |
c50412bb-a04e-4d61-8621-67851a7f0842 | alexandraback/datacollection | solutions_5670465267826688_0/C++/ashmelev/main.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <queue>
#include <stack>
#include <sstream>
#include <cstring>
#include <numeric>
#include <ctime>
#define re return
#define fi first
#define se second
#define mp make_... | ALGO | 0.999974 | 3.528847 | {
"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": "6052ead2d... |
ddaa973d-c2fb-4f5f-9459-9b83c366b418 | gnzlbg/hm3 | include/hm3/tree/algorithm/node_neighbor.hpp | #pragma once
/// \file
///
/// Compute node neighbor algorithm
#include <hm3/tree/algorithm/shift_location.hpp>
#include <hm3/tree/algorithm/node_at.hpp>
#include <hm3/tree/concepts.hpp>
#include <hm3/tree/types.hpp>
#include <hm3/tree/relations/neighbor.hpp>
#include <hm3/tree/location/default.hpp>
#include <hm3/utili... | ALGO | 0.998889 | 7.129552 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-10-15T16:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae2620ca25... |
95903784-3a7f-45fe-b70a-c389f7ab9806 | shoraaa/CompetitiveProgramming | 2. Codes/Anh Vuong/School/School/Codes/pycost.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 5;
const int MOD = 1e9 + 7;
int st[N], l[N], r[N], tp;
ll s[N], a[N];
void solve() {
int n; cin >> n;
ll res = 0; st[tp = 0] = 0;
for (int i = 1; i <= n; i++) {
cin >> a[i];
s[i] = s[i - 1] + a[i];
... | ALGO | 0.99995 | 4.456466 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-07-31T18:18:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f230ebaa9d48... |
803d996d-b220-46a4-8691-f79b004c711b | BackofenLab/IntaRNA | src/IntaRNA/InteractionEnergyBasePair.h |
#ifndef INTARNA_INTERACTIONENERGYBASEPAIR_H_
#define INTARNA_INTERACTIONENERGYBASEPAIR_H_
#include "IntaRNA/general.h"
#include "IntaRNA/RnaSequence.h"
#include "IntaRNA/Accessibility.h"
#include "IntaRNA/NussinovHandler.h"
#include "IntaRNA/InteractionEnergy.h"
namespace IntaRNA {
/**
* Implements a simple ener... | ALGO | 0.984044 | 5.880641 | {
"github_metadata": {
"branch": "master",
"commit_count": 1105,
"repo_created_at": "2016-03-31T11:11:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 48,
"forks": 28,
"issues": 27,
"pull_requests": 2
},
"file_meta": {
"content_id": "ad151... |
279b91a9-5229-4860-9a81-fd6d706b53a3 | nandhakumar23/YeetCode | Medium/Max Number of K-Sum Pairs.cpp | ### [1679\. Max Number of K-Sum Pairs](https://leetcode.com/problems/max-number-of-k-sum-pairs/)
Difficulty: **Medium**
Related Topics: [Hash Table](https://leetcode.com/tag/hash-table/)
You are given an integer array `nums` and an integer `k`.
In one operation, you can pick two numbers from the array whose sum ... | ALGO | 0.999899 | 6.561647 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2021-05-21T03:05: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": "f864ed31647... |
dd36f473-7707-4152-b0a4-c7f277100a2f | noobie7/CodeBank | Codeforces/1433/G.cpp | /*
"An anomaly, I'm <NAME>
Cause I know one day I'm gonna be the"
- Greatest, Eminem
*/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef l... | ALGO | 0.999982 | 4.594206 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2021-09-12T05:11:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d252b9bb3... |
bc4719d1-cdb7-4cf4-b02c-402a028bd6a1 | dwax1324/baekjoon | code/10473 인간 대포.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define debug freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#de... | ALGO | 0.999901 | 4.142505 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2020-11-07T09:27: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": "7d2ed68e62... |
f592f058-2097-4fdf-8ac9-8217d1054be0 | PriyanshuSingh/CompProg | codechef/ROWCOLP.cpp | #include <cmath>
#include <climits>
#include <queue>
#include <vector>
#include <map>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cstring>
#include <cassert>
using namespace std;
// Input macros
#define s(n) ... | ALGO | 0.99917 | 3.64516 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2014-11-23T04:51: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": "4852fcd13... |
ee44f6ec-b980-4f4d-b773-0dfe73b3deba | gchinellato/XD | src/motion/pid/PID.cpp | /*
* Project: Toy Robot
* Platfrom: ESP32
* Description: PID
* Owner: gchinellato
*/
#include "PID.h"
PID::PID()
{
this->Ci=0;
this->lastTime=0;
this->lastError=0;
}
float PID::compute(float input)
{
/* Performs a PID computation and returns a control value based on
the elapsed time (dt) an... | ALGO | 0.903045 | 5.422964 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-07-07T18:19:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f782e0206... |
dd4c1b73-e54e-4446-a8f4-8c301b5b8382 | compscihas/labs | hw_paris_olympics/parallel_tracks.cpp | #include <iostream>
#include <iomanip>
#include <cstring>
#include "parallel_tracks.h"
using std::cin, std::cout, std::endl;
//-------------------------------------------------------
// Name: prep_double_array
// PreCondition: an array of doubles is passed in
// PostCondition: data in the array is 'zeroed' out
//----... | ALGO | 0.997499 | 4.255679 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-11-04T16:19: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": "1fc48664fa... |
9817577e-ceff-4218-be25-354baf1b63a1 | LuisDuarte1/DA-RailwayManagement | src/LineFailures.cpp | #include "LineFailures.h"
#include <iostream>
#include <tuple>
#include <algorithm>
#include <cmath>
int maximumTrainsReducedConnectivity(Graph *graph, std::vector<Edge *> segmentsToRemove, Vertex *src, Vertex *dst) {
graph->resetVisited();
graph->resetFlow();
std::vector<std::tuple<std::string, std::stri... | ALGO | 0.953929 | 5.65827 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2023-03-18T15:20:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b83e7c1104... |
dcd2b919-4975-46d2-b71e-64d34c4523a2 | aflores-c/ROS_Mobile_Robot_Implementation | Arduino/pid_tunning/pid_tunning.ino | #define USE_USBCON
#include <ros.h> //Include ROS Library
#include <PID_v1.h> // PID Library
#include <Encoder.h> // Encoder Library
#include <std_msgs/Int16MultiArray.h> //to receive the set point values
#include <std_msgs/Int64MultiArray.h> //to publish vel_wheels
#include <std_msgs/Float32MultiArray.h> //to receiv... | TOOL | 0.973126 | 4.935196 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-09-13T00:40:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5205e9718f4... |
09520492-df0e-485e-b802-03c68fbdf02b | luliCloud/CPP_Beyond_Skillset | primer_practice 1-7/exercise3_04.cpp | #include <iostream>
#include <string>
using namespace std;
/* 编写一段程序读取两个字符串(not sentence),比较其是否相等并输出结果。
如果不相等,输出比较大的那个字符串。 */
void readTwoStr() {
string s1, s2;
while (cin >> s1 >> s2) { // use ctrl + D to trigger EOF
if (s1 == s2) {
cout << "The two strings are equal" << endl;
} e... | TOOL | 0.980736 | 3.834742 | {
"github_metadata": {
"branch": "main",
"commit_count": 349,
"repo_created_at": "2024-04-16T21:45: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": "41805ef0d2... |
8534531f-4e77-45d0-ad9f-6a06fb2f5af4 | walker1239/estructura | IntervalTREE/src/interval.inl | node::node(const int & l, const int & h){
low=l;
high=h;
p_child[0] = NULL;
p_child[1] = NULL;
BalanceFactor = 0;
max=h;
}
intervalTree::intervalTree(){
root=NULL;
}
bool intervalTree::insert(node **n,const int & l,const int & h)
{
if((*n)==NULL){
(*n)=new node(l,h);
return true;
}
if((*n)->low==l){
... | ALGO | 0.995765 | 4.119883 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2018-12-12T17:47: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": "7bba9e723... |
5f68b41f-ca49-4691-9583-412410910725 | prashant-01/DSA-Practice- | Single-Double-LL/single-linked-list.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node* next;
Node(int val){
this->data=val;
this->next=NULL;
}
};
//Iterate over LL
void traverse(struct Node* head){
struct Node* curr = head;
while(curr != NULL){
cout << curr->data << " ... | ALGO | 0.999952 | 4.48207 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-07-21T16:25: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": "942b95e5606... |
550d1b67-4734-4204-b801-8b8f5a506bd0 | Sumitjha480/Discrete_Questions | Question 3.cpp | #include<iostream>
using namespace std;
class stack
{
int *arr;
int front;
int size_stack;
public:
stack()
{
size_stack=50;
arr = new int[size_stack];
front = -1;
}
~stack()
{
delete arr;
}
void push(int x)
{
arr[++front] = x;
}
void pop()
{
front--;
}
int top()
{
return arr[front];
}... | ALGO | 0.999971 | 3.942448 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-05-22T17:55: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": "8e3c8ec853... |
e67cab73-324f-4a31-b4d9-91e64cdbcc93 | festvox/festvox | src/vc/src/vqlbl/main.cc | /*********************************************************************/
/* */
/* Nagoya Institute of Technology, Aichi, Japan, */
/* Nara Institute of Science and Technology, Nara, Japan */
/* ... | ALGO | 0.997176 | 3.649161 | {
"github_metadata": {
"branch": "master",
"commit_count": 352,
"repo_created_at": "2017-11-01T16:21:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 99,
"forks": 31,
"issues": 11,
"pull_requests": 3
},
"file_meta": {
"content_id": "bad92... |
8cca1775-90aa-4f86-b1f8-eabc32755681 | Tanay-Dubey/BinaryTrees | traversal_using_recursion.cpp | #include <iostream>
#include <queue>
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
};
Node *root = NULL;
int size;
void levelorder(Node *head)
{
queue<Node *> a;
a.push(head);
for (int i = 0; i < size; i++)
{
if (head->left != NULL)
a.push(head-... | ALGO | 0.999888 | 4.657629 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-12-07T16:40: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": "413dc0fcd4... |
2bab8348-d75b-458f-a83a-362859c61ece | lilexuan/pat_a | 1061.cpp | #include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char s1[61], s2[61], s3[61], s4[61];
char weeks[7][5] {
"MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN",
};
scanf("%s%s%s%s", s1, s2, s3, s4);
char week, hour;
int minute;
int flag = 0;
for (int i = 0; i... | ALGO | 0.99738 | 3.170061 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2017-11-14T08:57: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": "d25649aea... |
d5f87e02-7103-41db-9dce-2a59282d3322 | alexandraback/datacollection | solutions_2645486_1/C++/Atol/bfast.cpp | #include<algorithm>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
using namespace std;
#define FOR(A, B) for(int A = 0; A < (B); A++)
#define MAX 20000
long long E, R, N;
long long v[MAX];
long long need[MAX], have[MAX];
vector< pair<long long, long long> > fila;
void solve() {
cin >> E >>... | ALGO | 0.999809 | 3.512398 | {
"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": "264fd7466... |
10fc83db-79cd-4d71-90ae-c725df1424b1 | 1tygoime/a | spoj/KDIFF.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 3e5;
int n, k, a[MAX + 5], L[MAX + 5], R[MAX + 5];
deque<int> dmin, dmax;
void pop(deque<int> &d){
while(!d.empty()) d.pop_back();
}
void calc(int *l){
pop(dmax); pop(dmin);
for(int i = 1, j = 1; i <= n; i++){
while(!dmax.empty() && a[dmax.bac... | ALGO | 0.999956 | 4.233709 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-10-12T16:31:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96857784ff2... |
4b4139c9-0e47-426a-ae25-c26c01409108 | simbody/simbody | SimTKmath/Geometry/src/ContactGeometry_SmoothHeightMap.cpp | /* -------------------------------------------------------------------------- *
* Simbody(tm): SimTKmath *
* -------------------------------------------------------------------------- *
* This is part of the SimTK biosimulation toolkit originating from *
... | ALGO | 0.998128 | 6.984058 | {
"github_metadata": {
"branch": "master",
"commit_count": 5026,
"repo_created_at": "2013-08-16T00:21:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2427,
"forks": 483,
"issues": 136,
"pull_requests": 21
},
"file_meta": {
"content_id": "... |
dcdcd27c-afb7-4489-abae-1277b9b093d1 | 101magikarp101/USACO | usaco-guide/silver/sorting-and-searching/Binary-Search/prep-for-merge-sort.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <cstring>
#include <bitset>
#include <string>
#define ll long long
#define pll pair<ll, ll>
#define pii pair<int, int>
#define LLONG_MAX 9223372036854775807
#define MOD... | ALGO | 0.999995 | 4.083353 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-09-25T15:08:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba3ed5ab196... |
d7647908-ff2d-458c-bd76-68971f5fce4b | 9heart/DT3Kaiser | src_game/Kaiser/KaiserAI.cpp | //==============================================================================
///
/// File: KaiserAI.cpp
///
/// Copyright (C) 2000-2014 by Smells Like Donkey Software Inc. All rights reserved.
///
/// This file is subject to the terms and conditions defined in
/// file 'LICENSE.txt', which is part of this source ... | ALGO | 0.996164 | 6.19114 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-09-03T16:23: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": "9526ee2e71... |
17183fd1-dfbc-4dbc-843d-d6b2e070fb30 | LucasStevenson/Advent-of-Code | 2022/day01/cpp/first.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <climits>
int solution(std::ifstream& file) {
std::string line;
int ans = INT_MIN;
int sum = 0;
while (std::getline(file, line)) {
if (line == "") {
// we've reached an empty line
ans = std::max(ans, su... | ALGO | 0.998052 | 5.554892 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2021-12-11T01:41: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": "8e0321a2bd1... |
f9d0a4d0-e75a-457a-9135-27c94794e9a7 | rvikunwar/leetcode | 951/Flip Equivalent Binary Trees.cpp | // Flip Equivalent Binary Trees.cpp
// https://leetcode.com/problems/flip-equivalent-binary-trees/?envType=daily-question&envId=2024-10-24
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullp... | ALGO | 0.999995 | 6.692096 | {
"github_metadata": {
"branch": "master",
"commit_count": 171,
"repo_created_at": "2021-12-22T11:13: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": "446e5e48... |
3f359c98-dc39-48f5-b96a-4e05f3b4ce08 | hayatoito/leetcode | src/bin/0622-design-circular-queue.cpp | // @leetup=info id=622 lang=cpp slug=design-circular-queue
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
#include <vector>
// @leetup=code
class MyCircularQueue {
public:
MyCircularQueue(int k) : q_(k) {
assert(q_.size() == static_cast<size_t>(k));
... | ALGO | 0.996895 | 6.029675 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-08-22T13:55: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": "c107a791b53f... |
cc2e0c34-912a-4561-8055-7d695658af02 | YeJinii/mySoongsil | senior_4th/Coding_Test_Practice/C++로_코테_뿌시기/Backjoon/10971.cpp | //외판원 순회 2
#include <iostream>
#include <vector>
#include <algorithm>
#define MN 11
#define INF 987654321
using namespace std;
int W[MN][MN];
vector<int> v;
int calc(vector<int> &v)
{
int ret = 0;
for (int i = 1; i < v.size(); i++)
{
if (W[v[i - 1]][v[i]] == 0)
return INF;
r... | ALGO | 0.999932 | 3.63202 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2023-10-22T05:52: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": "c2482389ad2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.