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 |
|---|---|---|---|---|---|---|---|
72c9a36f-b2fd-4628-926b-e97ad305b4e0 | cyrilggg/ACM | problem/Daily/2022/6/24/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define returnNo return void(puts("No"))
#define returnYes return void(puts("Yes"))
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T... | ALGO | 0.999824 | 4.657214 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2021-11-29T01:52: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": "cf2ee678d1c... |
d84d8078-ccdd-4d30-a940-c97db3b2ba38 | BIT-21-SE-simplysml/C- | 41 10.30 cfround/2/2.cpp | #include <bits/stdc++.h>
using namespace std;
long long gbs[101];
long long a[24];
long long gcdd(long long a, long long b){
long long temp;
while(b != 0){
temp = a % b;
a = b;
b = temp;
}
return (a);
}
int main(){
int t;
cin >> t;
gbs[0] = 1;
gbs[1] = 2;
gbs[2] = 6;
for(long long i = 3; i <= 24; i++){
... | ALGO | 0.999707 | 3.500012 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-10-12T07:36:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06b4974d04... |
257d6b5d-2c8b-4b5d-a6e0-8cfe84d90861 | miyosuda/intro-to-dl-android | HandWriting/jni-build/jni/include/tensorflow/core/kernels/topk_op.cc | /* Copyright 2015 Google 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 by applicable law or agreed to in ... | ALGO | 0.996322 | 7.728267 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2016-02-23T17:38:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3981b105d... |
94c0491d-7dba-452c-a7df-f23fd4f0df33 | abdullahalkheshen/leetcode-diaries | Design-Gurus/Two Pointers/C++/18-k_sum.cpp | /*
Introduction:
• This problem is a follow-up of 3Sum, so take a look at that problem first if you haven't.
• 4Sum and 3Sum are very similar; the difference is that we are looking for unique quadruplets instead of triplets.
• As you see, 3Sum just wraps Two Sum in an outer loop. As it ite... | ALGO | 0.999988 | 6.691318 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2023-10-09T10:32: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": "30aaa337f62... |
8c3e4249-9823-4297-aada-ece8be4d14fb | uniqueFire12/Leetcode | 0124-binary-tree-maximum-path-sum/0124-binary-tree-maximum-path-sum.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.999973 | 5.976206 | {
"github_metadata": {
"branch": "main",
"commit_count": 946,
"repo_created_at": "2022-12-30T14:40:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "454ce0b278... |
23170ea6-34af-41af-9be7-de1f72d452db | smoe1/ThesisCode | dogpack-mapped/lib/1d/DogSolveTDRK.cpp | // Two-Derivative Runge-Kutta Solver.
//
// This solver is a hybrid between the full Lax-Wendroff method and a
// Runge-Kutta solver.
//
// See the fourth order scheme from
// http://www.springerlink.com/content/412506004227h393/
//
// "On Two Derivative Runge-Kutta Methods."
//
// This method is fourth order accurate,... | ALGO | 0.999979 | 4.651307 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-06-04T20:02:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bc86fd1b2... |
8e6ad3c9-036b-406e-9f3e-77eb8e0d6624 | mdarafat1819/Code-Library | Graph Theory/articulation point using stack.cpp | #include <bits/stdc++.h>
using namespace std;
#define SIZE 3001
struct Graph
{
int vertex, edge, parent[SIZE], child[SIZE], dt[SIZE], low[SIZE];
vector<int>adj[SIZE], ap;
bool visited[SIZE], taken[SIZE];
Graph(int v, int e)
{
vertex = v;
edge = e;
}
void getAdjList()
... | ALGO | 0.999966 | 4.558729 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2020-04-10T17:44:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a75ec07... |
aac1de72-c0e5-4e99-96fe-1d97c02f2b0c | egross91/Coding | SPOJ/CHICAGO.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <sstream>
#include <iomanip>
using namespace std;
/** DATA STRUCTURE **/
struct Node {
int num;
double weight;
Node() : num(1), weight(1.0) { };
Node(int _n, int _w) : num(_n), weight(_w) { };
}; /// END Node STRUCTURE
struct Comp {
bool operator... | ALGO | 0.999617 | 4.092676 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2013-12-30T17:41: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": "7583b08f3... |
0d3e9aca-d6a1-4025-8919-a67439246bd7 | ITHelpDec/Leetcode | 0417 - Pacific Atlantic Water Flow/main.cpp | // dfs solution
class Solution {
public:
vector<vector<int>> pacificAtlantic(vector<vector<int>>& heights) {
int n = heights.size();
int m = heights[0].size();
std::vector<std::vector<bool>> pacific(n, std::vector<bool>(m, false));
std::vector<std::vector<bool>> atlantic(n, std::ve... | ALGO | 0.999986 | 6.661469 | {
"github_metadata": {
"branch": "main",
"commit_count": 129,
"repo_created_at": "2022-12-14T23:39:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9a86eb32e... |
32dedb97-6eac-446c-a03c-2961f4c4106f | Kostya22B/CVUT_FEL | 3_semester/PCC/sem_work/trapezoidalIntegralSolver.cpp | #include "trapezoidalIntegralSolver.hpp"
// Function for calculating the definite integral by the trapezoidal method
double trapezoidalIntegralSolver::trapezoidalIntegration(const std::function<double(double)>& f, double a, double b, int n) {
double h = (b - a) / n;
double integral = 0.0;
for (int i = 0; i ... | ALGO | 0.999906 | 5.90443 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2024-04-05T18:42: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": "08cb6a583b9... |
849c99f0-1756-4050-af58-d26544e0be4f | TonyJZ/IntegratedPhotogrammetry | src/ImageMatch/KeyMatch.cpp | // KeyMatch.cpp: implementation of the CKeyMatch class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "KeyMatch.h"
#include <string.h>
#include <assert.h>
#include "TinClass.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_N... | TOOL | 0.911594 | 3.538708 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-10-26T16:56:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6c3aca9ac... |
bde0ef71-ff54-4cd3-ba11-122659a8234f | satyamgupta0202/Interview-Preparation | Boolean Parenthesization - GFG/boolean-parenthesization.cpp | // { Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
int dp[1002][1002][2];
int solve(string s , int i ,int j , bool istrue){
if(i>j)return 0;
if(i==... | ALGO | 0.99995 | 5.233478 | {
"github_metadata": {
"branch": "main",
"commit_count": 1921,
"repo_created_at": "2022-01-16T04:48: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": "7ed4b1ab1... |
22d523ed-720e-440a-8b30-9e4fe521f7f9 | arpitsharma1306/LeetCodeSolutions | 85-maximal-rectangle/maximal-rectangle.cpp | class Solution {
public:
vector<int> getNSL(vector<int>&height){
int n=height.size();
stack<int>st;
vector<int>result(n,-1);
for(int i=0;i<n;i++){
while(!st.empty() && height[st.top()]>=height[i]){
st.pop();
}
if(!st.empty()) resul... | ALGO | 0.99996 | 6.15512 | {
"github_metadata": {
"branch": "main",
"commit_count": 1367,
"repo_created_at": "2024-10-21T16:00: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": "35cf8f05a... |
c62ae5bf-76b6-4d0a-979d-0ccaa658d43f | kyun1016/algorithm | BOJ/12. 큐 사용하기/1966 printer Queue.cpp | ////#include <iostream>
////#include <queue>
//
////std::queue<int> q;
////int priorities[10] = { 0 };
////int my_priority;
////
////void find_my_order(int m) {
//// int count(0), max, temp;
//// for (int i = 0; i < q.size(); i++) {
//// max = 0;
//// for (int j = 1; j < 10; j++) {
//// if (priorities[j] != 0) {
//... | ALGO | 0.999875 | 4.411856 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2019-05-01T02:34:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39162566... |
8ec03a54-247e-4e47-bde2-95b8f8e7a4e0 | wilsonwei123/Bio-Pedigrees | tree.cpp | //to-do: add/remove sibling method, use bfs to print generations
//urgent fix: for add commands, make sure newNode links are severed. eg if newNode is already a child of this then it cannot be a partner of this until connection removed.
//make addParent() and removeParent() make partnering parents optional
#include <i... | TOOL | 0.928108 | 4.386527 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2025-06-20T21:17:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "71c5a399cc6... |
94c61760-5095-4d9a-9508-2c2c9c981c7c | saksham-kapoor/data-structures-algo-cpp | Linked List Full/linear_linked_list/basic_linked_list.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
};
class LinkedList
{
private:
Node *first;
public:
LinkedList() { first = NULL; }
LinkedList(int A[], int n);
~LinkedList();
void Display();
void Insert(int val);
void Delete(int index);
int ... | ALGO | 0.999549 | 4.697978 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-02-07T17:25: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": "48d095d62... |
e687c1b4-f992-4b0e-90e4-34805cc9b9a8 | animishtripathy24/Computer_Networks_Practicals | Caesar_Cipher_Method.cpp | #include<iostream>
using namespace std;
string encrypt(string& text, int key)
{
string result;
for (int i = 0; i < text.length(); i++) {
if (isupper(text[i]))
result += char(int(text[i] + key - 65) % 26 + 65);
// Encrypt Lowercase letters
else
result += char(i... | ALGO | 0.999913 | 3.77257 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-06-12T07:35: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": "2d17dd1e08... |
833642b7-88a8-4627-8c21-b5d8a9847c62 | eyakub175/Contest | Day-4/problem solve/problem6.cpp | /*
Time Duration: 20 minutes.
Problem 6 : In this Problem there will be a given array size and element of the array
you have to take an element from the array and put it into a different array in the basis of their evenness
*/
#include <stdio.h>
int main()
{
int size, earr[100], i, e=0, o=0, osum=0, esum=0... | ALGO | 0.999804 | 4.135737 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-03-17T16:52: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": "0b65a5a4a35d... |
be7d8e24-0be6-4821-be90-743c7c7518d3 | RisshabSingla/Competitive-Programming | Code Forces/Contests/Educational Round #165 (Div. 2)/C.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
const int mod = 1000000007;
// ll findAns(vector<ll> &arr, int k, int n)
// {
// ... | ALGO | 0.999866 | 4.471877 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2022-10-29T12:01: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": "3b7b79e025... |
adb3f73e-0f7a-468f-b3de-220fbcdfb18e | mszubova/SPbCT_ZubovaMS-EducationalPractice | EducationalPractice/EducationalPractice/MyForm.h | #pragma once
#include "MathLibrary.h"
#include <iostream>
#include <mutex>
#include <fstream>
#include <vector>
#include <iterator>
#include <string>
#include <algorithm>
#include <chrono>
#include <Windows.h>
namespace EducationalPractice {
using namespace System;
using namespace System::ComponentModel;
using na... | ALGO | 0.994715 | 3.562241 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-12-26T06:30: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": "a2b2f9a513... |
4f1c6a93-3b03-4888-b0f6-84ac505bcf67 | shushovitJR/C-programs | bankin_prac_program.cpp | #include<iostream>
#include<iomanip>
using namespace std;
void showbalance(double balance){
cout<<"balance:$"<<setprecision(3) <<fixed <<balance<<endl;
}
double deposit(){
double amt= 0; //local variable
cout<<"enter the amount you want to deposit:"<<endl;
cin>>amt;
if (amt>0)
return (amt);
... | TOOL | 0.95428 | 4.083497 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-15T01:21: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": "169fa8355cdb... |
551f0736-c580-4bb6-97ac-04c0e27195d4 | voidmind26/cpp | pre3/c.cpp | #include<iostream>
#include<queue>
#include<algorithm>
#include<cstring>
using namespace std;
const int M = 5e4 + 1;
const int N = 1e4 + 1;
const int Level = 19;
const int oo = 0x7fffffff;
struct Edge {
int to, next, w;
}edge[M << 1];
struct node {
int u, v, w;
node() {}
node(int a, int b, int c... | ALGO | 0.999998 | 4.344038 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-08-02T11:20: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": "46cf9ffcc1e... |
d1c8a0ca-ab8c-4682-acae-8b73349dde43 | Didnelpsun/CS408 | Code/CPP-Code/head/sequence_stack.h | #include "head.h"
using namespace std;
// 顺序栈
class SequenceStack {
private:
// 栈内元素
element_type *_data{};
// 栈顶指针
int _top{};
// 最大容量
int _max_size{};
// 设置数据
bool SetData(element_type *data);
// 栈顶指针自加
bool SetTop();
// 设置栈顶指针
bool SetTop(int top);
// 获取栈顶指针
... | ALGO | 0.913698 | 4.53214 | {
"github_metadata": {
"branch": "main",
"commit_count": 258,
"repo_created_at": "2021-03-30T02:36:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 240,
"forks": 38,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ea560a... |
81eba781-47ff-4dd9-b5ed-f054f3f601d1 | Edwardkoroteev/asciilines | src/asciilines.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <fstream>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
bool checkFile(string filename);
void initSpace(char** &canvas, int height, int width);
vector<string> split(string line);
void populateSpace(char** &canvas, vector<string> sep, ... | ALGO | 0.993915 | 3.955164 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-06-30T17:22: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": "3279d1cb41... |
6d9a026a-1593-4fbe-844e-c85ca6922634 | arimnrg16/CP | My Problems/Belanja Robot/solution-3.cpp | #include <bits/stdc++.h>
#define pb push_back
#define f first
#define s second
#define mp make_pair
using namespace std;
int n, q;
int p[100005], s[100005];
int globalK;
vector <pair <int,int> > vc[100005];
long long ans[100005];
int maxi[20], valMap[100005], val[20];
bool cmp(pair <int,int> a, pair <int,int> b){
ret... | ALGO | 0.999842 | 3.356879 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2019-03-13T13:45:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18ccccd0... |
8bc1b0fd-c7c1-41af-a6a9-cff1d9c1c8e9 | portugueseTorch/Algorithms-and-Data-Structures | Tree/BinarySearchTree.cpp | #include "BinaryTree.hpp"
Node *BinaryTree::binarySearchR(Node *node, int x) {
if (!node) return NULL;
if (x < node->data)
return binarySearchR(node->left, x);
else if (x > node->data)
return binarySearchR(node->right, x);
else
return node;
}
Node *BinaryTree::binarySearchI(int x) {
Node *p = getHead();
w... | ALGO | 0.999981 | 3.667657 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-10-26T15:23:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbe6da023817... |
a814116c-1360-41b9-8044-aae051085924 | kenkinming2002/libkann | libtensor/src/memops/Stack.cpp | #include <libtensor/memops/Stack.hpp>
namespace tensor
{
template<typename T>
static inline void stack_verify_same_shape(const std::vector<Tensor<T>>& values)
{
if(values.empty())
throw std::runtime_error("Cannot stack empty vector of tensors");
for(const auto& value : values)
if(values.fron... | TOOL | 0.923704 | 7.077837 | {
"github_metadata": {
"branch": "master",
"commit_count": 793,
"repo_created_at": "2020-09-03T09:35: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": "ac4d843e... |
b1fe8698-bd4c-4cae-9961-b91b33a9b04f | mukel/ProgrammingContests | OldStuff/SPOJ/new3/empty.cpp | /*
<NAME>
SPOJ #199 "Empty Cuboids"
16 - 9 - 2008
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
#define REP( i, n ) \
for ( int i = 0; i < (n); i++ )
#define REPD( i, n ) \
for ( int i = (n) - 1; i >= 0; i-- )
typedef long long int64;
const int
MAXN = 5001,
MAXC = 1000000;
i... | ALGO | 0.999983 | 4.14112 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2013-10-16T00:48:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "518eb63... |
dd1342bd-92cd-4405-93d3-38b7d146a793 | Ankit80165/Data-Structures-and-Algorithms | arrays/quick-sort.cpp | #include<bits/stdc++.h>
#include<cstring>
#include<climits>
using namespace std;
#define add(x) accumulate(x)
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define rep(i, a, b) fo... | ALGO | 0.999989 | 4.924102 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-05-24T14:21: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": "ac85f34fd... |
3b18b2d8-6f5c-4834-8b03-54fe82210109 | vwraposo/Noic | Grafos/paises.cpp | #include <iostream>
#include <algorithm>
#define MAXN 505
#define INFINITO 999999
using namespace std;
int N, M, K;
int mapa[MAXN][MAXN];
int distancia[MAXN];
int processado[MAXN];
void Dijikstra (int S) {
for (int i = 0; i < N; i++) {
processado[i] = false;
distancia[i] = INFINITO;
}
dis... | ALGO | 0.999973 | 3.616606 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-08-31T13:29: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": "ed07734e77... |
a8ab7175-894a-4343-842f-2ff2b4dfd261 | IgnAMS/ICPC | Ejercicios/NWERC 2021/H2.cpp | #pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define repx(i,a,b) for(int i=a; i<b; i++)
#define rep(i,n) repx(i,0,n)
typedef long long ll;
typedef pair<ll, ll> pll;
typedef double db;
typedef vector<ll> vl;
#define ff first
#define ss second
#define pb push_back
// g++ -std=c++11 A.cpp -o ... | ALGO | 0.999973 | 4.222978 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2021-05-19T20:12:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19bae7590... |
fba77617-89da-47c0-be65-9aabae14aa17 | SuperFoolGirl/algorithm_learning | BFS/迷宫/1746.cpp | // 存二维坐标可以用pair 超过两个信息点再考虑结构体
#include <iostream>
#include <queue>
#include <cstring>
using namespace std;
#define maxn 1005
queue<pair<int, int>> q;
string map[maxn];
int n;
int dist[maxn][maxn]; // 与起点的距离
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int x1, y1, x2, y2;
int bfs(int x, int y)
{
memset(dist... | ALGO | 0.999916 | 4.839526 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2025-01-10T11:02:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5850a1541... |
8f28ebb5-e705-4c5f-97d0-53a4e1b6d866 | blasbarbagelata/modelo-y-simulacion | TP2/atomics/modelica/modelica_qss_cross_detect.cpp | #include "modelica_qss_cross_detect.h"
void modelica_qss_cross_detect::init(double t,...) {
va_list parameters;
va_start(parameters,t);
//index=static_cast<int>(va_arg(parameters,double));
index=(int)va_arg(parameters,double);
level= 0;
outval= 1;
from_discont=false;
for(int i=0;i<10;i++){u[i]=0;};
for(int i=0;i<10... | ALGO | 0.914416 | 3.695119 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-04-03T18:54: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": "beb479301c6... |
f0c96419-18c2-4c5d-8420-9fa9b9840025 | ecto0310/procon_submission | atcoder/abc149/abc149_d/9217127.cpp | // Date: Sun, 29 Dec 2019 11:29:32 +0000
// Language: C++14 (GCC 5.4.1)
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main()
{
i64 n, k, r, p, s;
string t;
cin >> n >> k >> r >> s >> p >> t;
i64 ans = 0;
for (i64 i = 0; i < k; i++)
{
vector<vector<i64>> dp(2, vector<i64>(3, 0... | ALGO | 0.997157 | 4.827889 | {
"github_metadata": {
"branch": "main",
"commit_count": 2101,
"repo_created_at": "2022-12-07T13:10: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": "888e90e08... |
2902cc7e-e808-4e18-8c2f-b352f5c27b61 | lythesia/leet | cc/word-break-ii/word-break-ii.cc | #include <bits/stdc++.h>
using namespace std;
typedef vector<string> vs;
typedef unordered_set<string> us;
typedef vector<int> vi;
typedef vector<vi> vvi;
class Solution {
public:
void gao(vs &ans, string sol, int p, string &s, vvi &dp) {
if(p < 0) ans.push_back(sol);
else {
for(int ss : dp[p]) {
... | ALGO | 0.999623 | 5.226637 | {
"github_metadata": {
"branch": "master",
"commit_count": 205,
"repo_created_at": "2015-04-02T13:19:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d18aec73... |
c02b3298-7b75-4887-b739-9ab22b2f233f | emonson/em_cpp_mapa | src/include/SpectralAnalysis.h | #ifndef SPECTRALANALYSIS_H
#define SPECTRALANALYSIS_H
/* SpectralAnalysis.h
Based on the Matlab code of
<NAME> & <NAME>
<NAME> – 2014
Duke University
*/
#include <Eigen/Core>
#include <Eigen/SVD>
#include "ComputingBases.h"
#include <iostream>
#include <vector>
#include <cmath>
using namespace Eigen;
namespac... | ALGO | 0.984298 | 6.412104 | {
"github_metadata": {
"branch": "master",
"commit_count": 148,
"repo_created_at": "2014-04-05T19:06:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9c8ed43... |
60bdc6ec-39b5-417a-aae6-2e787796e7ab | ReadyTalk/avian | src/main.cpp | /* Copyright (c) 2008-2015, Avian Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice appear
in all copies.
There is NO WARRANTY for this software. See l... | TOOL | 0.957992 | 5.226574 | {
"github_metadata": {
"branch": "master",
"commit_count": 4775,
"repo_created_at": "2012-05-04T18:18:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1232,
"forks": 173,
"issues": 35,
"pull_requests": 3
},
"file_meta": {
"content_id": "a1... |
37a3e954-aa54-4ed0-8d59-5c53ca0709bf | seoyoon130/boj_codingTest | 프로그래머스/lv2/49994. 방문 길이/방문 길이.cpp | #include <string>
#include <map>
#include <iostream>
using namespace std;
int solution(string dirs) {
map<pair<pair<int, int>, pair<int, int>>, bool> visitedEdge;
int answer = 0;
int curY = 5;
int curX = 5;
for(int i = 0;i<dirs.size();++i){
int startX = curX;
int startY = curY;
... | ALGO | 0.99981 | 4.378782 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2022-12-02T00:52:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70f5433b09... |
4292e200-e146-4b4c-aefb-50172e7e8e90 | gentryx/libgeodecomp | src/libgeodecomp/misc/simplexoptimizer.h | // vim: noai:ts=4:sw=4:expandtab
#ifndef LIBGEODECOMP_MISC_SIMPLEXOPTIMIZER_H
#define LIBGEODECOMP_MISC_SIMPLEXOPTIMIZER_H
#include <libgeodecomp/misc/optimizer.h>
#include <libgeodecomp/misc/simulationparameters.h>
#include <utility>
namespace LibGeoDecomp {
/**
* This is a Implementation of the siplex algorithm,... | ALGO | 0.999936 | 6.77148 | {
"github_metadata": {
"branch": "master",
"commit_count": 4396,
"repo_created_at": "2014-09-25T14:03:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 27,
"forks": 19,
"issues": 47,
"pull_requests": 1
},
"file_meta": {
"content_id": "13fd... |
ec137df7-8f11-4d5f-956b-7aeb1d20f4ae | hsc1993/MetropolisMonteCarlo_kinkpair | SegmentStressCal/SegmentStressCal.h | #ifndef _SEG_STRESS_CAL_H
#define _SEG_STRESS_CAL_H
#include "../StandardIncludes.h"
#include "../Settings.h"
#include "../simulation/Simulation.h"
#include <tuple>
/************************************************************
* non-singular anisotropic stress functions
* ***************************************... | ALGO | 0.936752 | 4.727105 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-03-27T20:46: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": "e0c2282c28c... |
cd391018-66bb-4c96-a5e9-d3068bb94314 | dh434/leetcode | jx_top100/189. 旋转数组.cpp | /*
给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。
示例 1:
输入: [1,2,3,4,5,6,7] 和 k = 3
输出: [5,6,7,1,2,3,4]
解释:
向右旋转 1 步: [7,1,2,3,4,5,6]
向右旋转 2 步: [6,7,1,2,3,4,5]
向右旋转 3 步: [5,6,7,1,2,3,4]
示例 2:
输入: [-1,-100,3,99] 和 k = 2
输出: [3,99,-1,-100]
解释:
向右旋转 1 步: [99,-1,-100,3]
向右旋转 2 步: [3,99,-1,-100]
说明:
尽可能想出更多的解决方案,至少有三种不同的方法可以解决这个问... | ALGO | 0.999977 | 5.937287 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-06-18T07:21:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d34ee03e80... |
9dcd3185-802f-4ec0-8e02-f7f34f69083e | Capmare/Digger | Digger/AIMovementComponent.cpp | #include "AIMovementComponent.h"
#include "AnimControllerComponent.h"
#include "AIGridComponent.h"
#include "GameObject.h"
#include "Renderer.h"
#include "MapComponent.h"
void dae::AIMovementComponent::FixedUpdate(const float fixedDeltaTime)
{
if (bStopPathFinding) return;
m_StateChangeTimer += fixedDeltaTime;
m_P... | ALGO | 0.965649 | 4.511699 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2025-02-10T09:06: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": "f4767e47fcc... |
8f5f9beb-80c9-43b1-9501-25c348eb09c1 | utkarshmaken/cp | inter iit 2020/90.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define f(i,a,b) for(int i = a;i<b;i++)
#define rep(i,a,b) for(int i = a;i<=b;i++)
#define fd(i,a,b) for(int i = a;i>b;i--)
#define repd(i,a,b) for(int i = a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi first
#define ... | ALGO | 0.999605 | 4.397797 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-06-28T05:46:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "839cd1c89775... |
5b735e46-6ec9-40a6-b330-a11ffbabacdc | baebea227/practice_algorithm | 백준/Gold/9019. DSLR/DSLR.cc | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int D(int n) {
n = n * 2;
if(n > 9999) n %= 10000;
return n;
}
int S(int n) {
if(n == 0) n = 9999;
else n--;
return n;
}
int L(int n) {
int temp = n / 1000;
n *= 10;
n %= 10000;
n += temp;
return n... | ALGO | 0.999902 | 5.191386 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2025-05-07T10:36: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": "317ee8d15c2... |
e4309b43-6d4c-4305-a009-15fa1b52fb38 | anandadfoxx/codeforces_solutions | 208A.cpp | #include <bits/stdc++.h>
#define FOR(i, start, end) for(int i = start; i < end; i++)
#define ROF(i, start, end) for(int i = end; i > start; i--)
#define FORO(i, end) for(int i = 0; i < end; i++)
#define ROFO(i, start) for(int i = start; i >= 0; i--)
#define pub push_back
#define fir first
#define sec second
#define pob... | ALGO | 0.999754 | 3.11456 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2022-06-05T09:11:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "419fde75b... |
4980f6e9-5722-47b2-b4e0-e8bef31d36f5 | Flyingrhino007/DataStructure | 707.cpp | //C++ file
/*=============================================
*
* Filename: Leetcode/707.cpp
*
* Author: Joe_CAO - <EMAIL>
* Description: LeetCode 707
* Create: 2018-08-28 14:34:11
# Last Modified: 2018-08-28 14:34:25
=============================================*/
using namespace std;
struct node
{
... | ALGO | 0.999835 | 4.741898 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-08-28T06:47: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": "2cbf03b04... |
1ab4d4a3-ec43-4a77-9ec9-4aa23ed22bbe | TheHumankind/c-full-course | chapter 2 operations on data/04. c++ compound operators/main.cpp | #include <iostream>
int main(){
int val {45};
std::cout << "(no operator) The val is " << val << std::endl;
std::cout << std::endl;
val += 5;
std::cout << "(+= operator) The val is " << val << std::endl; // 50
std::cout << std::endl;
val -= 5;
std::cout << "(-= operator) The val is " ... | TOOL | 0.938692 | 4.446657 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-05-11T11:58: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": "6ba942daa68... |
e8d69db5-4fec-41e4-b89a-b3c5630bab99 | sirmbcode/harmonicanalyzer | Source/MovingAverageFilter.h | /*
==============================================================================
MovingAverageFilter.h
Created: 20 Jun 2024 1:55:24pm
Author: <NAME>
==============================================================================
*/
#pragma once
class MovingAverageFilter
{
public:
// check what ... | TOOL | 0.914459 | 6.311082 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-06-20T00:47:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67dc73588753... |
7146ea7c-2143-4432-92b2-5366f3fe24aa | GuanyiLi-Craig/interview | Array/q79.cpp | /****************************************************************************************************
79. Word Search
-----------------------------------------------------------------------------------------------------
Given a 2D board and a word, find if the word exists in... | ALGO | 0.999525 | 5.577482 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2017-01-01T21:30: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": "d2cefb40... |
e7c81626-972b-4b3f-ae97-ae6b4595c810 | admin2811/ANBM | Code/De2.cpp | #include <iostream>
#include <string>
using namespace std;
//C = 7*P -b mod 26
//a = 7, b nh?p t? bàn phím
// P = 15(C-b) mod 26
// Hàm tính ??c chung l?n nh?t (GCD) c?a 2 s? a và b?
int gcd(int a, int b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
// Hàm t́m ph?n ngh?ch ??o a trong Z26
int ng... | ALGO | 0.999977 | 4.594066 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-25T04:53: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": "04a5f9cfda6c... |
182e87f1-6aee-404a-a45e-627d355a22d7 | Kyan820815/leetcode | lc02xx/lc0229.cpp | //--- Q: 0229. Majority Element II
//--- method 1: O(n) one pass
class Solution {
public:
vector<int> majorityElement(vector<int>& nums) {
int cnt1 = 0, cnt2 = 0, v1 = INT_MIN, v2 = INT_MIN;
for (auto &num: nums) {
if (v1 == num) {
++cnt1;
} else if (v2 == nu... | ALGO | 0.999969 | 5.501626 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2020-11-27T03:28: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": "8b57da0759... |
14e15f52-b46b-434e-b3f9-79707b4644fb | zhiderek/Route-Planning-Project | src/route_planner.cpp | #include "route_planner.h"
#include <algorithm>
RoutePlanner::RoutePlanner(RouteModel &model, float start_x, float start_y, float end_x, float end_y): m_Model(model) {
// Convert inputs to percentage:
start_x *= 0.01;
start_y *= 0.01;
end_x *= 0.01;
end_y *= 0.01;
// Use the m_Model.FindCloses... | ALGO | 0.977364 | 5.249278 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-04-16T18:35: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": "158d86d11a... |
55654cf1-c386-4452-99d9-5def9b987233 | zxvm5962/my-BOJ-codes | 백준/Bronze/17588. Missing Numbers/Missing Numbers.cc | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <sstream>
#include <map>
#include <deque>
#include <queue>
using namespace std;
vector<long long> v(100001);
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
lon... | ALGO | 0.999814 | 3.240106 | {
"github_metadata": {
"branch": "main",
"commit_count": 729,
"repo_created_at": "2023-04-12T14:01: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": "606e39f015... |
85f1aa3c-4e88-4774-aaa0-8cf50d8ec7cf | H-Whisky/Tech_CODE_study | MoocClassDemo/SlidWindowFindString/SlidWindowFindString.cpp | /*
题目描述
给定一个字符串 s 和一个非空字符串 p,找到 s 中所有是 p 的字母异位词的子串,返回这些子串的起始索引。
字符串只包含小写英文字母,并且字符串 s 和 p 的长度都不超过 20100。
说明:
字母异位词指字母相同,但排列不同的字符串。不考虑答案输出的顺序。
示例 1:
输入:
s: “cbaebabacd” p: “abc”
输出:
[0, 6]
解释:
起始索引等于 0 的子串是 “cba”, 它是 “abc” 的字母异位词。
起始索引等于 6 的子串是 “bac”, 它是 “abc” 的字母异位词。
解题思路
(1)使用线性循环识别s的前p.length()个字符和p的所有字符并分别记录于sSave、p... | ALGO | 0.999893 | 5.848369 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2021-02-01T07:54: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": "b4cf5b4b... |
07ee0277-0d82-4cfc-930d-153dcc20c4b0 | arielker/Competitive-Programming-234901 | class7-practice/uva_12506.cpp | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef... | ALGO | 0.999953 | 4.242748 | {
"github_metadata": {
"branch": "main",
"commit_count": 136,
"repo_created_at": "2022-03-28T12:06: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": "706db74e06... |
33cf88c6-58d9-4c2b-9920-59c2cd1ffb7c | Hansimov/cpp-primer | ch03/3-43 cout arr withou auto.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int arr[3][4] = {
{0,1,2,3},
{4,5,6,7},
{8,9,10,11}
};
// // v1: use range for
// for (const int (&p)[4] : arr) {
// for (int q : p)
// cout << q ... | ALGO | 0.941016 | 4.390657 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-11-18T09:34:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4be56873d5... |
e7ce50a8-9a7a-4737-954d-bbd726988f70 | pavel-ryzhov/global_vars | runs/000031.cpp | #include <stdio.h>
#include <malloc.h>
#include <string.h>
/*
1 2 3
.,? abc def
4 5 6
ghi jkl mno
7 8 9
pqrs tuv wxyz
*/
#define WLEN 20
#define PLEN 1000000
// слово
struct TWORD
{
int f; // частота
char w[WLEN+1]; // слово
struct TWORD *next;
} TWORD;
// буква... | ALGO | 0.99997 | 3.390785 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-07-04T20:43: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": "16a946d10b31... |
5c1a930b-acad-414e-b2b7-35e941cc8ace | okaryo/CompetitiveProgramming | AtCoder/ABC/001~100/061~070/063/D.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() {
int n; cin >> n;
LL a, b; cin >> a >> b;
vector<LL> h(n);
rep(i, n) cin >> h[i];
LL ans = 1e9;
LL left = 1, right = 1e9;
LL mid, sum;... | ALGO | 0.999697 | 3.206403 | {
"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": "774ee6d77e... |
3a53c2e4-2d3a-4321-ad36-aa517324ced5 | AymenQ/c2pconvert | src/util.cpp | #include "util.hpp"
#include <array>
#include <fstream>
#include <zlib.h>
constexpr uint16_t CHUNK{16384};
// PNG custom write/flush functions for streams
void write_data(png_structp png_ptr, png_bytep data, png_size_t length) {
static_cast<std::ostream *>(png_get_io_ptr(png_ptr))
->write(reinterpret_cas... | TOOL | 0.942745 | 7.033706 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-06-12T22:49: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": "8a3efd33f... |
ade8ac7c-6cea-4327-937b-669c76265630 | sntwr/UVa-Solved-Problems | solved/UVa467/467.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#define D(x) x
#else
#define D(x)
#endif
#define MK_TRI(x, y, z) make_pair (make_pair (x, y), z)
#define TIME(x) ((x).first.first)
#define STATE(x) ((x).first.second)
#define PERIOD(x) ((x).second)
#define ON 1
#define OFF 0
typedef pair<int, int> pii;
ty... | ALGO | 0.997959 | 3.509311 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-03-10T01:29: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": "15b7e86e34... |
14738079-e843-41d0-96b6-775212039aa8 | versenyi98/programming-contests | UVa Online Judge/00924 - Spreading The News/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define s second
#define f first
int main() {
int employees;
cin >> employees;
map<int, vector<int>> friends;
for (int i = 0; i < employees; i++) {
int number_of_friends;
cin >> number_of_friends;
while (number_of_friends--) {
... | ALGO | 0.999846 | 3.848597 | {
"github_metadata": {
"branch": "master",
"commit_count": 972,
"repo_created_at": "2019-04-25T16:11:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b02cacd... |
02a97996-fd53-40fd-a9e6-37e5f0f01b6e | JoelGunawan/competitive-programming | codeforces/1600-1699/1607/f.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#define endl "\n"
#define ll long long
#define mp make_pair
#define ins insert
#define lb lower_bound
#define pb push_back
#define ub upper_bound
#def... | ALGO | 0.999922 | 3.873929 | {
"github_metadata": {
"branch": "main",
"commit_count": 665,
"repo_created_at": "2021-06-06T04:24:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f88b1614f4... |
1f47a6bc-38c7-495d-86ab-221b5af45c12 | JackKohli/ConsoleChess | ConsoleChess/ConsoleChess/Source.cpp | #include<iostream>
using namespace std; //bad practice...
struct coord {
int x;
int y;
coord(int file, int rank) {
x = file;
y = rank;
}
coord() {
x = 0, y = 0;
};
};
class Piece {//this probably needs a rewrite but i decided to stick with it
public://this could probably just be a struct at this point..... | ALGO | 0.944749 | 4.438839 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-12-05T03:44: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": "0c6230ae059... |
98252574-2d47-41a9-9fcb-9213efb28af8 | farm-ng/farm-ng-core | cpp/sophus/manifold/product_manifold.h | // Copyright (c) 2011, <NAME>
// Copyright (c) 2012, <NAME>
// Copyright (c) 2021, farm-ng, inc.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
#pragma once
#include "sophus/concepts/manifold.h"
namespace sophus... | ALGO | 0.944735 | 7.016948 | {
"github_metadata": {
"branch": "main",
"commit_count": 213,
"repo_created_at": "2022-07-01T04:32:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 39,
"forks": 8,
"issues": 10,
"pull_requests": 11
},
"file_meta": {
"content_id": "f284418a... |
2e698bbb-9197-4cf7-8b98-e1cef571e6ea | VyProductions/AdventofCode2022 | Puzzle05/puzz5b.cpp | #include <iostream>
#include <stack>
int main() {
std::stack<char>* boxStacks;
int numStacks;
std::cin >> numStacks;
boxStacks = new std::stack<char>[numStacks] {};
for (int stack = 0; stack < numStacks; ++stack) {
int numBoxes;
std::cin >> numBoxes;
for (int box = 0; bo... | ALGO | 0.999199 | 5.207167 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2022-12-03T09:07: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": "ae602fe2835... |
b32e9458-b29c-4bcd-bc85-4203d1cf5aa6 | Cthutu/f3 | src/data/config.h | //----------------------------------------------------------------------------------------------------------------------
// Ini file loader and saver.
//----------------------------------------------------------------------------------------------------------------------
#pragma once
#include <filesystem>
#include <m... | TOOL | 0.97844 | 7.215125 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2019-02-28T14:16:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca2bce655... |
1893cc1c-e0df-4e65-b1c1-535cd0b09ba7 | TixiaoShan/LVI-SAM | src/visual_odometry/visual_estimator/estimator.cpp | #include "estimator.h"
Estimator::Estimator(): f_manager{Rs}
{
failureCount = -1;
clearState();
}
void Estimator::setParameter()
{
for (int i = 0; i < NUM_OF_CAM; i++)
{
tic[i] = TIC[i];
ric[i] = RIC[i];
}
f_manager.setRic(ric);
ProjectionFactor::sqrt_info = FOCAL_LENGTH / ... | ALGO | 0.980844 | 5.50556 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-03-04T02:26:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1668,
"forks": 489,
"issues": 11,
"pull_requests": 1
},
"file_meta": {
"content_id": "d6b... |
5e60defc-9b89-4cc6-9ebe-6f25a59f2f25 | Kitware/VTK-m | vtkm/filter/flow/worklet/ParticleAdvectionWorklets.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
// PURP... | ALGO | 0.905698 | 6.937105 | {
"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": "e7e8c... |
51f28ff1-46c4-487b-85fd-4d2cf72831d2 | BinSaif99/CodeForces-Problem-Solving | Contest_Codes/Lab2_Contest/2.cpp | //#include <bits/stdc++.h>
//using namespace std;
//int main() {
// int n;
// cin >> n;
// int gold = ceil(n / 12.0);
// int silver = ceil(n / 4.0);
// int bronze = ceil(n / 2.0);
// while (gold + silver + bronze > n) {
// if (gold > 1) gold--;
// else if (silver > 1) silver--;
// ... | ALGO | 0.995996 | 4.472659 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-04-17T17:47:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6b61a7dd56... |
b9e664c9-80fa-490f-9b41-50e80ec6bbbc | wiwitrifai/competitive-programming | topcoder/archive/ObtuseTrianglesDiv1.cpp | #include <bits/stdc++.h>
using namespace std;
class ObtuseTrianglesDiv1 {
public:
vector<long long> findObtuseTriangles(int a, int n) {
}
};
// BEGIN CUT HERE
#include <ctime>
#include <cmath>
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
using namespace std;
i... | ALGO | 0.984998 | 3.570237 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2016-05-21T12:11:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc4f76d... |
e2ef4ec1-f399-44af-b03c-fb197a7ba6a2 | leggedrobotics/ocs2 | ocs2_core/src/dynamics/LinearSystemDynamics.cpp | /******************************************************************************
Copyright (c) 2020, <NAME>. 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 code must retain t... | ALGO | 0.993824 | 6.977604 | {
"github_metadata": {
"branch": "main",
"commit_count": 7465,
"repo_created_at": "2021-07-08T07:09:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1106,
"forks": 258,
"issues": 50,
"pull_requests": 3
},
"file_meta": {
"content_id": "374f... |
46ef3b9a-db49-494b-b3c5-8ec81a8e5ba1 | KushalLamba/leetcode-GraphQuestion | 0839-similar-string-groups/0839-similar-string-groups.cpp | class Solution {
public:
int find(int x, vector<int>& parent) {
if (x == parent[x])
return x;
return parent[x] = find(parent[x], parent);
}
void unionf(int x, int y, vector<int>& parent, vector<int>& rank) {
int x_parent = find(x, parent);
int y_parent = find(y, p... | ALGO | 0.999992 | 5.764763 | {
"github_metadata": {
"branch": "main",
"commit_count": 161,
"repo_created_at": "2024-10-15T17:26: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": "a73a8d06bb... |
13f98dc3-5066-49b5-aac1-48258f1f5402 | someblue/ACM | 2014single/single8/E/main.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1e9;
const double eps = 1e-6;
const int N = 100010;
int cas = 1;
struct _node{
int pos,val,ans;
friend bool operator < (const _node &a, const _node... | ALGO | 0.999984 | 4.123813 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2014-10-29T13:59:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d10ac5c61... |
05dabc9e-aa08-4eb1-aa64-e8644045c4f8 | GabrielleAnte/AnteGabrielle_CIS17A_46721 | Homework/Assignment_1/2-D Augment - Dynamic Memory Allocation/Ante_Gabrielle_2-D_Augment-Dynamic_Memory_Allocation.cpp | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Ante_Gabrielle_2-D_Augment-Dynamic_Memory_Allocation.cpp
* Author: Gabrielle
*
* Created on July 3, 2020, 3:10 PM
*... | ALGO | 0.997109 | 3.626398 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-06-23T04:26:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc90ab154... |
3e2a4348-3f05-4fde-9084-d246a6540ac4 | swimmingturtle165/Coding | CodeForces/Codeforces Round #633 (Div. 2)/ques4.cpp | #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 unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
#define FOR(i,a,b) ... | ALGO | 0.999886 | 3.726894 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2020-10-06T12:22:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5e7d5adf2... |
7255d156-b09b-46f4-b694-6da062fdbd26 | ZoranPandovski/al-go-rithms | data_structures/Graphs/graphsearch/cycle_undirected_graph/cpp/cycleGraph.cpp | #include<iostream>
#include <list>
#include <limits.h>
using namespace std;
class Graph
{
int V; // No. of vertices
list<int> *adj; // Pointer to an array containing adjacency lists
bool isCyclicUtil(int v, bool visited[], int parent);
public:
Graph(int V);
void addEdge(int v, int w);
boo... | ALGO | 0.999514 | 5.29048 | {
"github_metadata": {
"branch": "master",
"commit_count": 7457,
"repo_created_at": "2017-06-05T19:20:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1359,
"forks": 1929,
"issues": 20,
"pull_requests": 44
},
"file_meta": {
"content_id": ... |
0c6e8101-cd9c-4390-ac1d-b286d16228d8 | deekshith39/CPP | Graphs/maxSizesubtreeWeightsusingDisjointSet.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 100010
// Structure for Edge
struct Edge
{
int u, v;
};
/*
'id': stores parent of a node.
'sz': stores size of a DSU tree.
*/
int parent[N], size[N];
// Function to assign root
int find(int idx)
{
int i = idx;
... | ALGO | 0.999926 | 4.677027 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2020-08-17T10:32:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1bc3131c... |
9aab6da2-74a1-4633-a3b9-a973c37f6c33 | Yusuhyeong/shcool | Image-processing/3/HW3.cpp | /*******************************************************/
/* HW#3 : compareHistogram */
/* 작성자 : 유수형 날짜 : 2022년 4월 14일 */
/* */
/* 문제 정의 : 2개의 히스토 그램 H1과 H2을 method */
/* 방법으로 비교하여 d(H1, H2)를 반환한다 */
/* ... | ALGO | 0.945756 | 5.078694 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-12-21T15:57: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": "d8117f595f... |
df05f6d0-02c7-4b2e-9d3d-1ce5090fc365 | KeatonMacLeod/LeetCodeSolutions | 4Sum.cpp | class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
set<vector<int> > answer;
if (nums.size() < 4)
return{};
std::sort(nums.begin(),nums.end());
for (int a = 0; a < nums.size()-3; a++) {
for (int b ... | ALGO | 0.999909 | 5.98496 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2017-04-12T06:20: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": "833375ff3... |
24aede21-f250-469e-8eb4-fbe11678d788 | sahil2609/financial-engineering | Lab09/200123081_1.cpp | #include <bits/stdc++.h>
using namespace std;
double f(double x, double y){
return (y*(1 - exp(x)))/(1 + exp(x));
}
double fourth_order_rk(double h = 0.001, double x0 = 0, double y0 =3.0, double xt = 1.0){
int n = xt/h + 1;
vector<double>x(n), y(n);
x[0] = x0, y[0] =y0;
int i=1;
while(i<n){
x[i] = x[i-1] + h... | ALGO | 0.999977 | 4.483917 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-09-10T10:27: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": "ea4f1a9d1ab4... |
b5800d5f-50f5-4220-bb9d-d0eb678607cc | biocro/biocro | src/module_library/stomata_water_stress_sigmoid.h | #ifndef STOMATA_WATER_STRESS_SIGMOID_H
#define STOMATA_WATER_STRESS_SIGMOID_H
#include "../framework/module.h"
#include "../framework/state_map.h"
#include <cmath> // for exp
namespace standardBML
{
class stomata_water_stress_sigmoid : public direct_module
{
public:
stomata_water_stress_sigmoid(state_map cons... | ALGO | 0.994755 | 6.239247 | {
"github_metadata": {
"branch": "main",
"commit_count": 3739,
"repo_created_at": "2015-03-04T02:15:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 46,
"forks": 23,
"issues": 26,
"pull_requests": 5
},
"file_meta": {
"content_id": "37dc2e5... |
4f7d86a1-5015-4413-8bb3-16d23d31950d | sdpkjc/training | S_tra/19-08-31/d.cpp | #include <iostream>
using namespace std;
int gcd(int a, int b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
int M[1005][1005];
int SUM[1005];
int main() {
int n, m;
cin >> n >> m;
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
SUM[a]++;
SUM[b]++;
M[a][b]++;
M[b][a]... | ALGO | 0.999994 | 4.030773 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-05-03T18:52: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": "ac2d3fec3b... |
7167419a-bcdc-43e5-bc2a-0bac33b047e6 | gprender/nearest-neighbour | src/rtree.cpp | // rtree.cpp
#include <memory>
#include "rtree.hpp"
using coord_t = spatial::coord_t;
using area_t = spatial::area_t;
using index_t = spatial::index_t;
int const M = 8;
template<typename T>
spatial::Rtree<T>::Rtree():
root_entry(std::make_unique<Entry>(
(Rectangle){0,0,0,0},
std::make_shared<N... | ALGO | 0.997888 | 7.146745 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2020-09-21T06:09:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0898667f4... |
f16f81bd-6ceb-4892-8ac0-25ceb3f3a56f | anikaator/CodingPractice | CrackingCodingInterview/sol1.1/main.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
string str = "abcdeafgg%39%^9";
cout << "First solution O(n^2):"\
"\nTake one character and traverse all the way to check dup";
bool found = false;
for(auto it = str.begin(); it != str.end() - 1; i... | ALGO | 0.999483 | 3.541912 | {
"github_metadata": {
"branch": "master",
"commit_count": 257,
"repo_created_at": "2018-03-28T05:46: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": "4f81519e... |
db0c4ce2-d812-4e9e-be21-5ce9fb8bc8ff | llvm/llvm-project | lld/MachO/Driver.h | //===- Driver.h -------------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | TOOL | 0.927683 | 7.512703 | {
"github_metadata": {
"branch": "main",
"commit_count": 545188,
"repo_created_at": "2016-12-07T09:39:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33545,
"forks": 14484,
"issues": 5000,
"pull_requests": 5000
},
"file_meta": {
"content_... |
63a294b3-99bb-41c9-992c-73294405f2f6 | tokusakurai/Library | Data-Structure/Offline_Dynamic_Connectivity.hpp | #pragma once
// オフライン dynamic connectivity (クエリがオフラインで与えられるとき、辺の削除にも対応できる union find)
// 計算量 O(n + q log(q)log(n))
// 概要
// クエリの順に辺を並べると、ある辺が挿入されてから削除されるまでの間は区間になる。
// 時刻の区間をセグ木の様に管理すると、ある辺が存在する区間をセグ木上の O(log(q)) 個の区間に分解できる。
// セグ木上を dfs しながら undo union find を使うことによってクエリに答えることができる。
// verified with
// https://judge.... | ALGO | 0.99861 | 5.772508 | {
"github_metadata": {
"branch": "main",
"commit_count": 441,
"repo_created_at": "2021-02-25T04:06:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4e16c3c45... |
bea55538-9e47-4534-bdfc-4d3d6e04827b | evmaus/ClusterSAT | src/clustersat/leader/leader_server.cc | // Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | WEB | 0.935091 | 6.492785 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2019-04-16T18:22:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c34027bc... |
1b1726d2-d5b1-436a-bd17-8862c79da78a | Saint-Potato/Maximum-Weight-Interval-Scheduling | maximumWeightIntervalScheduling.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Interval {
int start;
int end;
int weight;
};
// finds the rightmost compatible interval with the interval at current index
int rightmostCompatible(const vector<Interval>& intervals, int index) {
int low = 0, high =... | ALGO | 0.999957 | 6.289742 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-11-14T02:57: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": "90c49cd38633... |
99102f4d-ffef-46b9-b6e0-d3e75708b8be | chill-cy/Data-Structure | 5.sort/12.unstable-6.cpp | /*************************************************************************
> File Name: 12.unstable-6.cpp
> Author:jiangxiaoyu
> Mail:<EMAIL>
> Created Time: 2019年10月29日 星期二 11时58分40秒
************************************************************************/
#include<iostream>
using namespace std;
void quick_so... | ALGO | 0.999897 | 4.478255 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2019-07-19T15:51: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": "e8ec51f9... |
d5eb3ce8-884c-48c6-8b4e-0d47c4ac4c58 | Coach-Academy/Spring-2-2024 | Level 3/CPU - Regular - L3 - C102/Practice G/Week 01/PrintCycle.cpp | #include <bits/stdc++.h>
using namespace std;
vector <int> par; // par[cur] = the node that made into node cur.
vector <bool> vis, cyc;
vector <vector <int>> adj;
void dfs(int cur) {
vis[cur] = cyc[cur] = true;
for (auto &i : adj[cur]) {
if (par[cur] == i) continue;
if (!vis[i]) {
... | ALGO | 0.999988 | 4.390998 | {
"github_metadata": {
"branch": "main",
"commit_count": 126,
"repo_created_at": "2024-04-20T19:30:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "794730b8fb7... |
9b103090-3ddf-4bdc-9d01-cd2122a09941 | mdfaizanahmed786/Data-Structures-Algorithms | Queues/Implementation/ImplemenetUsingArray.cpp | #include <bits/stdc++.h>
using namespace std;
class Queue{
public:
int size;
int front;
int rear;
int *arr;
// rear is always pointing to empty cell in array
Queue(int size){
this->size=size;
this->rear=0;
this->front=0;
arr=new int[size];
}
bool isEmpty(){
if(rear==front){
return true;
}
return f... | ALGO | 0.994477 | 3.947457 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2023-05-26T02:20:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5861174... |
2d56d79e-5d18-4c18-8718-ff6584cb44b4 | wisdompeak/LeetCode | Recursion/1274.Number-of-Ships-in-a-Rectangle/1274.Number-of-Ships-in-a-Rectangle.cpp | /**
* // This is Sea's API interface.
* // You should not implement it, or speculate about its implementation
* class Sea {
* public:
* bool hasShips(vector<int> topRight, vector<int> bottomLeft);
* };
*/
class Solution {
public:
int countShips(Sea sea, vector<int> topRight, vector<int> bottomLeft)
... | ALGO | 0.999208 | 5.669607 | {
"github_metadata": {
"branch": "master",
"commit_count": 8912,
"repo_created_at": "2017-03-01T10:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6018,
"forks": 1314,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "5... |
35385758-08e9-41ab-b917-e464c3df2d31 | azimonti/ma-libs | cpp/libalg_lapack/src/la_lapack_qr.h | #ifndef _LA_LAPACK_QR_H_AC9F890E52F542D4A5F236398520F6EC_
#define _LA_LAPACK_QR_H_AC9F890E52F542D4A5F236398520F6EC_
/************************/
/* la_lapack_qr.h */
/* Version 1.0 */
/* 2023/06/01 */
/************************/
#ifndef USE_LAPACK
#error "USE_LAPACK is not defined"
#endif
#incl... | ALGO | 0.971293 | 5.948288 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2024-09-11T10:25: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": "33ae10cef... |
597f7760-6ec7-4e51-a564-da46a215e5b9 | Ayush7614/Daily-Coding-DS-ALGO-Practice | Codeforces/C++/Rank_List.cpp |
/*
This is c++ code for Rank List Ques of codefoerces
Ques tag - 166_A
*/
#include<bits/stdc++.h>
using namespace std;
bool sortbyfirst(const pair<long long int , pair<long long int , long long int > > &a, const pair<long long int , pair<long long int , long long int > > &b)
{
return (a.first > b.first);
}... | ALGO | 0.999977 | 4.002862 | {
"github_metadata": {
"branch": "main",
"commit_count": 2968,
"repo_created_at": "2020-12-28T05:34:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 322,
"forks": 474,
"issues": 335,
"pull_requests": 20
},
"file_meta": {
"content_id": "c4... |
fe7fe2fa-9685-4d4f-a8d7-a51d521a5550 | jocodoma/coding-interview-prep | LeetCode/Problems/0048_Rotate_Image/rotate_image.cpp | class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
return solution1(matrix);
// return solution2(matrix);
}
void solution1(vector<vector<int>>& matrix){
int n = matrix.size();
// (i,j) -> (j,i) -> (j,N-i-1)
for(int i = 0; i < n; i++){
for... | ALGO | 0.999983 | 6.41414 | {
"github_metadata": {
"branch": "master",
"commit_count": 166,
"repo_created_at": "2019-10-18T22:28: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": "4fa596ed... |
7249ea7e-9713-4948-8abf-b10cd0f2d8ee | cui98040/myLeetCode | myLeetCode/myLeetCode/136.cpp | //
// 136.cpp
// myLeetCode
//
// Created by 崔翔 on 16/2/23.
// Copyright © 2016年 torresgeekhome. All rights reserved.
//
#include "136.hpp"
//Given an array of integers, every element appears twice except for one. Find that single one.
//
//Note:
//Your algorithm should have a linear runtime complexity. Could you ... | ALGO | 0.999332 | 5.116939 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-02-23T13:25: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": "38f4b524d2... |
a58d2a06-2652-4f9f-a1bf-f27e85434f47 | tichita7/DSA-Codes | stackLL.cpp | #include<iostream>
#include<stack>
using namespace std;
class node{
//properties: next ptr, size and value
public:
node* next;
int size;
int val;
node(int val){
this->val = val;
next = NULL;
}
};
class Stack{
//properties: top and size
public:
node* h... | ALGO | 0.980036 | 4.278761 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-04-23T09:55: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": "7dc6aaa4bc... |
dc39357d-7d75-415a-a582-f46994ed8d1e | meretciel/leet_code | maximum_product_subarray.cpp | //
// maximum_product_subarray.cpp
// leet_code
//
// Created by <NAME> on 8/1/15.
// Copyright (c) 2015 <NAME>. All rights reserved.
//
#include <stdio.h>
#include <limits>
#include <vector>
#include <iostream>
using namespace std;
/*
Notice that if a subarray contains zeros, then the product of this subarra... | ALGO | 0.999678 | 5.711612 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2015-07-18T18:38: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": "9802f6e0c... |
2e7d6bae-d080-4218-95a3-f8709cd6a6f1 | jaydip1235/DSA | Array/Medium/shipWithinDDays.cpp | // https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/description/
#include<bits/stdc++.h>
class Solution
{
public:
bool isPossible(vector<int> &arr, int days, int boundary)
{
int n = arr.size();
int required = 1;
int curr_sum = 0;
for (int i = 0; i < n; i++)
... | ALGO | 0.999993 | 5.587906 | {
"github_metadata": {
"branch": "master",
"commit_count": 631,
"repo_created_at": "2021-09-03T04:29:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 23,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "c3dbf8e... |
671c1a36-1fe4-42dc-88ee-ec547114783a | shreyanshTechz/CSES | graph/Round_trip2.0.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll start = 0, finish = -1;
void dfs(int node, vector<int> &vis, vector<vector<int>> &adj, vector<int> &par)
{
vis[node] = 1;
for (auto x : adj[node])
{
if (vis[x] == 0)
{
par[x] = node;
dfs(x, vi... | ALGO | 0.999996 | 4.226348 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-09-05T17:53: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": "97801b02d1d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.