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 |
|---|---|---|---|---|---|---|---|
3f6d65ff-9071-4140-a8c8-480a61ca5120 | munjungmin/Algorithm | baekjoon/10972.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int N;
int arr[10005];
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> N;
for(int i = 0; i < N; i++) {
cin >> arr[i];
}
int tmp = -1;
for(int i = N - 1; i > 0; i--) {
if(arr[i] > arr[i-1]) {
... | ALGO | 0.999981 | 4.426964 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2024-02-27T14:31: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": "80eeb6eb291... |
9e4542f7-fe52-4786-8a22-ff4dbe1219c8 | sadp2021/algorithmProblem | Wang/C++/hard/二指输入的的最小距离.cpp | #include <string>
#include <vector>
using namespace std;
class Solution {
public:
int getDistance(int p, int q) {
int x1 = p / 6, y1 = p % 6;
int x2 = q / 6, y2 = q % 6;
return abs(x1 - x2) + abs(y1 - y2);
}
int minimumDistance(string word) {
int n = word.size();
int dp[n][26][26];
fil... | ALGO | 0.99998 | 5.2845 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2019-05-05T13:15:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4853500e7c... |
ef2aa8a2-f0c1-4db9-bff0-604fdb9c881d | Kushagra-Varshney/DSA | Binary Search/find-k-closest-elements.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> twoPtrApproach(vector<int> arr, int k, int x)
{
//approach 1: two pointer approach
int h = arr.size()-1;
int l = 0;
while(h - l >= k)
{
if(x - arr[l] > arr[h] - x)
l++;
else
... | ALGO | 0.999996 | 4.968603 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-09-19T12:55:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e705ad54ff... |
ee87d932-549c-4236-b968-50731b2f5d5e | haskellcg/CPlusPlus_Algorithm_DemoFiles | optimal_binary_search_tree_problem.cpp | /**************************************************************************
* author: haskellcg
* date: 2021-03-02
* description: optimal binary search tree problem solution
*************************************************************************/
#include "optimal_binary_search_tree_problem.h"
void optimal_bina... | ALGO | 0.999965 | 4.659854 | {
"github_metadata": {
"branch": "master",
"commit_count": 185,
"repo_created_at": "2020-04-21T10:23: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": "e9975ea2... |
a94aea4b-cfc1-4b2d-a2b8-ed74dc1f6be8 | BCAPATHSHALA/DSA-SUPREME-2-0-NOTES | DSA SUPREME 2.0 CODES/45. CLASS CODE/PROBLEM6.CPP | // 6. Check Whether a Binary Tree is a Complete Binary Tree or Not? (Leetcode-958)
/*
Time Complexity: O(N)
Space Complexity: O(N)
Where N is number of nodes in binary tree
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(... | ALGO | 0.99876 | 6.559529 | {
"github_metadata": {
"branch": "master",
"commit_count": 322,
"repo_created_at": "2023-08-28T06:24:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 235,
"forks": 86,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "26b2d... |
17d55b38-14e3-4ce8-888a-3d2f0c0da90a | fkfk21/ros-cartpole-path-optimizer | docs/embeddable_codegen/embedding_part3.cpp | /*
* This file is part of CasADi.
*
* CasADi -- A symbolic framework for dynamic optimization.
* Copyright (C) 2010-2014 <NAME>, <NAME>, <NAME>,
* <NAME>. All rights reserved.
* Copyright (C) 2011-2014 <NAME>
*
* CasADi is free software; you can redistribute it and/or
... | ALGO | 0.98401 | 6.167979 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-10-28T05:18: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": "b8c101e9b71c... |
22e27bee-06d5-4c63-b9e2-6bb1fe954c51 | ecnerwala/contest-programming | POI/13/zos/zos.cpp | #include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
#define A first
#define B second
const int MAXN = 1.1e6, MAXM = 4e6;
int N, M;
pair<int, int> E[MAXM];
int deg[MAXN];
bool used[MAXN];
int K;
bool dfs(int e, int v) {
if(e == M) return true;
if(used[E[e].A] || used[E[e].B]) {
return dfs(e... | ALGO | 0.999981 | 3.976361 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2015-03-29T06:02:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c109987... |
e47ad261-251b-4965-b2a7-206c00bc9da2 | shreyash2503/cpp | Trees/avl.cpp | # include <bit/stdc++.h>
using namespace std;
class Node{
public:
Node* left;
Node* right;
int height;
int key;
Node(int key){
this->key = key;
this->left = NULL;
this->right = NULL;
this->height = 0;
}
}
class AVLTree{
public:
Node* root;
int... | ALGO | 0.999912 | 4.61325 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-07-20T16:48:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd1ec634a9... |
9c29b8cc-3ff8-4d72-9fe6-3b8641e50015 | EshaThakur88/Strivers-SDE-Sheet-Challenge | rotate_matrix.cpp | #include <bits/stdc++.h>
using namespace std;
void rotateMatrix(vector<vector<int>>& mat, int n, int m)
{
int left = 0, right = m - 1, top = 0, bottom = n - 1;
while (left < right && top < bottom) {
int temp = mat[top][left];
// Move elements from left to right
for (int col = ... | ALGO | 0.99999 | 6.026124 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2023-06-10T11:35: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": "e0dc9c9b82... |
00461f7c-78d8-4b84-83bc-9fe08759fceb | hookflash/obsolete.op | hookflash-core/webRTC/webRTC_ios/src/modules/video_coding/main/source/timestamp_extrapolator.cc | /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | ALGO | 0.943713 | 5.018551 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2012-11-07T20:22:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 55,
"forks": 17,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "e22c51f... |
1ee0eebc-8e2f-47ca-9487-0d36f2e783a4 | sinhadiptiprakash/dsa | Searching & Sorting/painter_partition_problem.cpp | #include <bits/stdc++.h>
using namespace std;
//This problem is similar to the book allocation problem but in this file it will be solved using recursion and dp
/*
A brute force solution is to consider all possible set of contiguous partitions and calculate the maximum sum partition in each case
and return the minimum... | ALGO | 0.999876 | 4.599195 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-01-08T07:31:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9155dd196dae... |
9f6e3b9c-52ed-4c6c-96d6-c04ae48fc95e | tuaanpv/MBEDAI | src/FacesRecog.h | /**********************************************************************************
* Created 2018 by <NAME>
* <EMAIL>
* Youtube/Tiktok/Instagram: tuaanpv
***********************************************************************************/
#ifndef __FACE_RECOG_H__
#define __FACE_RECOG_H__
#include <opencv2/dnn.... | TOOL | 0.903897 | 5.409274 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-09-30T16:58: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": "b3f48fc35d67... |
a1a1d810-d0f5-4e2f-ab99-8381a737f6e0 | tanvirahmodrafi/Methods | CountSort.cpp | #include <bits/stdc++.h>
using namespace std;
// Function to perform counting sort on an array
void countingSort(int a[], int n) {
int max = INT_MIN;
for (int i = 0; i < n; i++) {
if (max < a[i]) {
max = a[i];
}
}
int arr[max + 1];
for (int i = 0; i < max + 1; i++) {
... | ALGO | 0.999978 | 5.78307 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-10-25T02:00: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": "4d57e565b88... |
5d36641a-d987-433c-8869-6cbdaf24f6e6 | Mhmd-Hisham/Problem-Solving | Codeforces/B. Complete the Word.cpp | #include <bits/stdc++.h>
/*
Problem: B. Complete the Word
Link : https://codeforces.com/problemset/problem/716/B
Solution by: <NAME>
Gmail : <EMAIL>
Github : www.github.com/Mhmd-Hisham
LinkedIn: www.linkedin.com/in/Mhmd-Hisham
*/
using namespace std;
string word, nice = "-1";
int freq[256], p1 = 0, p2 = 0;
in... | ALGO | 0.999998 | 3.731853 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2019-01-25T21:33:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23f84423... |
14aac946-d320-4204-b7fb-cd51ab8e6386 | prkpeevakatya/labi10 | lab 10.cpp | #include <iostream>
#include <locale.h>
using namespace std;
// Тип данных, описывающий каждый отдельно взятый узел списка
struct Node
{
int info; // полезная информация, хранящаяся в этом узле
Node* next; // адрес следующего узла списка
// (nullptr, если данный элемент является последним)
};
bool i... | ALGO | 0.999819 | 4.422058 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-12-18T14:47: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": "3f3dcf31873d... |
6b914cdf-3701-443f-b8e5-19b8175695e5 | ankitagrawal10/DSA_Solution | linked-list/linked list questions/program-10.cpp | #include <iostream>
using namespace std;
// sort 0,1,2 in linked list
class node
{
public:
node *next;
int data;
node()
{
this->next = NULL;
this->data = 0;
}
node(int data)
{
this->next = NULL;
this->data = data;
}
};
node *reverse(node *&head)
{
... | ALGO | 0.999983 | 4.779188 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-02T17:32: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": "15eac0d73f20... |
4a245034-9002-4ea7-9033-a843e3d7d4be | freesurfer/freesurfer | gems/kvlConditionalGaussianEntropyCostAndGradientCalculator.h | #ifndef __kvlConditionalGaussianEntropyCostAndGradientCalculator_h
#define __kvlConditionalGaussianEntropyCostAndGradientCalculator_h
#include "kvlAtlasMeshPositionCostAndGradientCalculator.h"
#include "itkImage.h"
namespace kvl
{
/**
*
* Cost function closely related to Maes's Mutual Information (MI) and Roche'... | ALGO | 0.969917 | 6.227221 | {
"github_metadata": {
"branch": "dev",
"commit_count": 33611,
"repo_created_at": "2017-02-24T19:15:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 699,
"forks": 260,
"issues": 18,
"pull_requests": 11
},
"file_meta": {
"content_id": "eec1... |
fa37cd95-b3a1-4874-910f-bfa6e78cf7da | Ruhan-Saad-Dave/Practical_codes | fds/fds_exp12.cpp | /*
A double-ended queue (deque) is a linear list in which additions and deletions may be made at either end. Obtain a data representation mapping a deque into a one-dimensional array. Write C++ program to simulate deque with functions to add and delete elements from either end of the deque.
*/
#include <iostream>
#def... | ALGO | 0.999421 | 6.474068 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2024-10-16T05:01:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3528b7cd90... |
e508b9a6-9128-4b80-972e-c02be5b545de | mattgarber4/non-independence-electoral-projections | cpp/simFuns.cpp | #include <Rcpp.h>
#include <cmath>
using namespace Rcpp;
double updateProb(bool demWin, int state, double depCoef, NumericVector weights, NumericVector probs) {
double stateWgt = log(weights[state]);
double probWgt = 1.5 - 4 * pow((probs[state] - .5), 2.0);
double base = 0.0;
if (demWin) {
base... | ALGO | 0.999982 | 6.525058 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2020-05-17T04:50:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7462e5f3f... |
b715d45f-47e5-4665-9f75-419984a386e6 | Limgayoung/Algorithm | DFSBFS/ThisIsCote_152.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <queue>
using namespace std;
int N, M;
int map[202][202];
int visit[202][202] = { 0 };
int dx[4] = { 1,-1,0,0 };
int dy[4] = { 0,0,1,-1 };
queue<pair<int, int>> q; //좌표 저장
void bfs(int x,int y) {
pair<int, int> ... | ALGO | 0.999918 | 3.569745 | {
"github_metadata": {
"branch": "main",
"commit_count": 330,
"repo_created_at": "2021-09-25T19:00:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc73471ad5... |
9962311f-eec8-49b6-92a6-c2d9880d03e4 | rajdeep0309/DSA | cp/StandardTemplate1/first_lastPos.cpp | /*
First and last position of element in the sorted array
Send Feedback
You are given a sorted array ARR consisting of N integers and an integer X. You need to find the first and last position of occurrence of X in the array.
Note:
1. The array follows 0-based indexing, so you need to return 0-based indices.
2. If X is... | ALGO | 0.999979 | 5.819177 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-04-29T05:28: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": "016460196421... |
eca2e66c-c79d-4bf2-a360-c41f5cdd3611 | ParasAnxi/DSA-Practice | Lec139 Dynamic Programming/Wild Card Pattern Matching.cpp | #include<bits/stdc++.h>
using namespace std;
// bool solve(string &str,string &pattern,int i ,int j){
// if(i<0 && j<0)return true;
// if(i>=0 && j<0)return false;
// if(i<0 && j>=0){
// for(int k = 0;k<=j;k++){
// if(pattern[k]!='*'){
// return false;
// }
/... | ALGO | 0.999956 | 4.775486 | {
"github_metadata": {
"branch": "main",
"commit_count": 367,
"repo_created_at": "2023-02-25T04:09: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": "f8186044ef... |
3cf1f890-391d-4b32-8457-b50fac082eff | ajmat6/DSA | L_Regions_Cut_By_Slashes.cpp | class DisjointSet {
vector<int> size;
vector<int> parent;
public:
DisjointSet(int n) {
size.resize(n);
parent.resize(n);
for(int i=0; i<n; i++) {
size[i] = 1;
parent[i] = i;
}
}
int ultprt(int node) {
if(parent[node] == node) re... | ALGO | 0.999708 | 4.759804 | {
"github_metadata": {
"branch": "master",
"commit_count": 229,
"repo_created_at": "2023-08-25T16:34:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d6e6052... |
c264e9ea-088f-4434-b44b-b437429c5958 | Nishchal-ll/Data-structure-and-algorithm | Stack/stackasADT.cpp | #include<iostream>
#define max 5
using namespace std;
class stack{
public:
int sdata[max];
int count;
stack(){
this->count=-1;
}
void makeempty(){
count=-1;
}
void checkempty(){
if(count<0){
cout<<"Stack is empty"<<endl;
}
... | ALGO | 0.958852 | 3.561563 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-06T12:48:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b654cf987849... |
bcd2489a-178d-47e3-9123-5c5eac468dc3 | gamaamaral98/FEUP-CAL | TP5_CAL/Graph.h | /*
* Graph.h
*/
#ifndef GRAPH_H_
#define GRAPH_H_
#include <vector>
#include <queue>
#include <list>
#include <limits>
#include <cmath>
#include "MutablePriorityQueue.h"
using namespace std;
template <class T> class Edge;
template <class T> class Graph;
template <class T> class Vertex;
#define INF std::numeric_li... | ALGO | 0.999218 | 3.836418 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2018-03-16T16:48:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b6172d78... |
5a2bdbe9-8ef5-4d30-80a5-abf3dbb808e7 | vmmc2/Competitive-Programming | UVA 10947 - Bear with me, again...cpp | #include <bits/stdc++.h>
#include <cmath>
#define pb push_back
using namespace std;
struct island{
int x, y;
int radius;
};
int graph[105][105];
double dist(island a, island b){
double deltax = abs(a.x - b.x);
double deltay = abs(a.y - b.y);
double x2 = deltax * deltax;
double y2 = deltay * ... | ALGO | 0.999992 | 3.931901 | {
"github_metadata": {
"branch": "master",
"commit_count": 1704,
"repo_created_at": "2018-10-09T00:24:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aab53eb... |
bc9abe2c-43ab-4157-b8a4-1ecb8e013083 | 42p/CppLabs-1 | 4/4_1/4_1.cpp | //Variant 3
//<NAME>. Group-106
//Lab 4. Task 1
#include "stdafx.h"
#include <iostream>
#include <cmath>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;
struct note {
string Name;
string surName;
int number;
int number_short;
int date[3];
};
int main()
{
note mas[8];
note em;
int ... | ALGO | 0.993409 | 3.541015 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-09-22T17:38: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": "31b46913a... |
7af2e7d5-8dcc-48c5-bd82-4d3a5f374806 | purisaurabh/GeeksForGeeks | Medium/Prefix Suffix String/prefix-suffix-string.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 prefixSuffixString(vector<string> &s1,vector<string> s2)
{
// Code here
int n = s1.size();
int m = s2.size... | ALGO | 0.999465 | 5.424959 | {
"github_metadata": {
"branch": "main",
"commit_count": 608,
"repo_created_at": "2022-11-23T12:52:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12de15d4d2... |
75f8513e-4953-4fe8-a322-010c14ede5f1 | ishandutta2007/codeforces-t | thienu/normal/1353/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define u_map unordered_map
#define u_set unordered_set
#define u_multiset unordered_multiset
using ll = long long;
using vvi = vector<vector<int>>;
using vi = vector<int>;
using vvll = vector<vector<long long>>;
using vll = vector<long long>;
using vd = vector<double>;
... | ALGO | 0.999654 | 4.085169 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a4c37afeb70... |
f12286ac-7246-4ee0-a02c-08b75b207b38 | studyninjaa/Programming-Abstractions | Lec13-Pointer2.cpp | #include <iostream>
#include <fstream>
#include <string>
using namespace std;
struct Entry {
string name, phone;
Entry *next;
};
void PrintEntry(Entry *e) {
cout << e->name << " " << e->phone << endl;
}
Entry *GetNewEntry() {
cout << "Enter name (ENTER to quit):";
string name;
getline(cin, n... | TOOL | 0.931994 | 4.264613 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2020-12-11T19:38: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": "5f8397a88e46... |
7eb32ae6-a89b-4704-ba8d-3a791f6d3862 | chengzhag/Implicit3DUnderstanding | external/ldif/gaps/pkgs/R3Surfels/R3SurfelPointGraph.cpp | /* Source file for the R3 surfel graph class */
////////////////////////////////////////////////////////////////////////
// INCLUDE FILES
////////////////////////////////////////////////////////////////////////
#include "R3Surfels.h"
////////////////////////////////////////////////////////////////////////
// Nam... | ALGO | 0.934164 | 4.412731 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2020-11-27T02:39:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 216,
"forks": 38,
"issues": 10,
"pull_requests": 0
},
"file_meta": {
"content_id": "c23cfbe... |
0b4860c1-3cd5-42bd-906f-600d2d46adef | old-man-teach-code/300-bai-code-thieu-nhi | 150-Bai-Code-C++/Bai-022-Tim-phuong-trinh-bac-2/Tim-phuong-trinh-bac-2.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
float a, b, c, d, x1, x2;
cout << "Nhap he so a, b, c cua phuong trinh bac 2 tuong ung : " << endl;
cin >> a >> b >> c;
if (a == 0)
{
if (b == 0)
cout << "Ca a va b khong the bang 0 trong phuong trinh bac 2... | ALGO | 0.999047 | 3.455045 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-07-01T15:18: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": "d03fba9d13... |
c1e640a6-52d8-45df-8bc4-c95d33d8b358 | duchenlong/Cpp | 统计子串中的唯一字符.cpp | //
//我们定义了一个函数 countUniqueChars(s) 来统计字符串 s 中的唯一字符,并返回唯一字符的个数。
//例如:s = "LEETCODE" ,则其中 "L", "T","C","O","D" 都是唯一字符,因为它们只出现一次,所以 countUniqueChars(s) = 5 。
//本题将会给你一个字符串 s ,我们需要返回 countUniqueChars(t) 的总和,其中 t 是 s 的子字符串。注意,某些子字符串可能是重复的,但你统计时也必须算上这些重复的子字符串(也就是说,你必须统计 s 的所有子字符串中的唯一字符)。
//由于答案可能非常大,请将结果 mod 10 ^ 9 + 7 后再... | ALGO | 0.999977 | 5.812056 | {
"github_metadata": {
"branch": "master",
"commit_count": 1006,
"repo_created_at": "2020-03-01T15:16:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 25,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "aabcd... |
80b4f66a-9871-4204-9695-07294f4ebecd | Koweiyi/LC_cpp | 237.删除链表中的节点.cpp | /*
* @lc app=leetcode.cn id=237 lang=cpp
*
* [237] 删除链表中的节点
*
* https://leetcode-cn.com/problems/delete-node-in-a-linked-list/description/
*
* algorithms
* Easy (80.62%)
* Likes: 645
* Dislikes: 0
* Total Accepted: 85.8K
* Total Submissions: 106.5K
* Testcase Example: '[4,5,1,9]\n5'
*
* 请编写一个函数,使其... | ALGO | 0.99978 | 5.968402 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-06-15T06:41:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "791f9ed768... |
8962bc71-778e-4f12-87fb-df7b5dde09a3 | rohitnitj/Leetcode-Submissions | 3309-count-prefix-and-suffix-pairs-i/count-prefix-and-suffix-pairs-i.cpp | class Solution {
private:
bool isPrefixAndSuffix(string &s1, string &s2 ) {
if( s1.size() > s2.size() ) return false ;
int i = 0 , j = 0 ;
bool flag = true ;
while( i < s1.size() && j < s2.size() ) {
if ( s1[i] != s2[j] ) {
flag = false ;
... | ALGO | 0.99977 | 5.952498 | {
"github_metadata": {
"branch": "main",
"commit_count": 1171,
"repo_created_at": "2024-09-14T04:45: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": "80660bb4e... |
337a2b5f-8fd8-42ef-afc2-9c1f61150628 | Erik-Asatryan/Restrictive_Channel_Routing | IntervalGraph.cpp | #include "IntervalGraph.h"
#include "IntervalData.h"
#include "Algorithms.h"
#include <QString>
#include <QDebug>
IntervalGraph::IntervalGraph( const VecOfValues& vecTop, const VecOfValues& vecBottom )
: m_vecTop( vecTop )
, m_vecBottom( vecBottom )
{
// Interval graph is being constructed using top and bottom ve... | ALGO | 0.99745 | 5.348841 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-05-19T20:39:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d1dee14ff... |
970b4bcb-5cfa-4cb4-9be4-683178bd3103 | Kostya1757/lab02 | Polynomial.h | #pragma once
#include <iostream>
#include <vector>
#include <stdexcept>
#include <cmath>
#include <algorithm>
using namespace std;
class Polynomial {
private:
vector<double> coefficients;
vector<int> exponents;
int degree;
public:
Polynomial() : degree(-1) {}
Polynomial... | ALGO | 0.999362 | 5.54475 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-24T11:49: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": "d4f0e0569fd1... |
f741c237-d10e-4f45-a1c7-73e6e85c99a0 | skourta/tiramisu_evaluation_scripts | wrappers/function_gemm_LARGE_wrapper.cpp | #include "Halide.h"
#include "function_gemm_LARGE_wrapper.h"
#include "tiramisu/utils.h"
#include <iostream>
#include <time.h>
#include <fstream>
#include <chrono>
#include <omp.h>
int omp_do_par_for(void *user_context, int (*f)(void *, int, uint8_t *), int min, int extent, uint8_t *state) {
int exit_status = 0;
... | ALGO | 0.912581 | 5.282039 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-05-07T08:19:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dda83aa222c9... |
a69823ca-edf6-4098-be0e-da521d7894d7 | SwathiAvadhani/data-structures_algorithms_cpp | Patterns/numbers.cpp | #include <iostream>
using namespace std;
void pattern1(int n){
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++)
{
cout << j;
}
cout << endl;
}
}
void pattern2(int n){
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++){
cout << j;
}
cout... | ALGO | 0.999841 | 3.863619 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-10-02T05:53: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": "11d7ddc06814... |
92433e8d-00dd-476d-9f50-9dd967a8f4cf | 2694048168/C-and-C-plus-plus | OpenCV_Linux_Ubuntu/13_image_historgram/finder.cpp | /**
* @File : finder.cpp
* @Brief : 均值平移算法查找目标 mean-shift algorithm
* @Author : <NAME>
* @Date : 2021-07-29
*/
#include <iostream>
#include <vector>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/video/tracking.hpp>
#include "colorhistogram.hpp"
#include "contentFinder.hpp"
// ---------------... | ALGO | 0.99845 | 5.071603 | {
"github_metadata": {
"branch": "master",
"commit_count": 344,
"repo_created_at": "2020-08-08T16:47:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 58,
"forks": 18,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "882077... |
957e808f-5d8b-479a-bee9-80a5c4205100 | yooshnn/PS | bojSolution/17_/1774.cc | #include <bits/stdc++.h>
using namespace std;
typedef pair<double, double> pdd;
typedef tuple<double, int, int> tup;
const int MAX = 1000 + 1;
int component[MAX];
priority_queue<tup, vector<tup>, greater<tup>> edges;
int search(int);
void merge(int, int);
int N, M;
vector<pdd> star;
double getDist(pdd a, pdd b) {
r... | ALGO | 0.999652 | 4.432776 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2020-09-11T13:25:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6284420f8... |
151ecb02-9cbb-4d3b-9c84-c2d66fe19fae | Haribala-09/hyprdots | User/History/-73964de8/fq64.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
bool isprime(lli n) {
if (n <= 1) return false;
if (n == 2) return true;
if (n % 2 == 0) return false;
for (lli i = 3; i * i <= n; i += 2) {
if (n % i == 0) return false;
}
return true;
}
int main() {
int t;
... | ALGO | 0.999854 | 5.096316 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-17T14:25: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": "15da1768f56a... |
5e09d4c1-44c3-42fa-9292-ffdee3ffb876 | tony-stark18/LolCode | 2581-divide-players-into-teams-of-equal-skill/divide-players-into-teams-of-equal-skill.cpp | int IO = []{
ios::sync_with_stdio(false); cin.tie(nullptr); return 0;
}();
class Solution {
public:
void sortS(vector<int>& skill) {
int maxEl = *max_element(skill.begin(), skill.end());;
vector<int> freq(maxEl + 1, 0);
for (int i : skill) {
freq[i]++;
}
int k... | ALGO | 0.999923 | 5.433553 | {
"github_metadata": {
"branch": "main",
"commit_count": 2142,
"repo_created_at": "2024-02-02T10:11: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": "fe0614bb3... |
b1250345-715c-4134-9720-dd6622339c85 | Jatin0804/cpp | geek/3_type_inference.c++ | // C++ program to demonstrate use of decltype and auto in functions
#include<iostream>
using namespace std;
#include<bits/stdc++.h>
template<class A,class B>
auto findMin(A a,B b) -> decltype(a < b ? a : b)
{
return (a < b) ? a : b;
}
int fun1() {return 10;}
char fun2() {return 'v';}
int main(void)
{
auto x... | TOOL | 0.905058 | 4.110829 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-07-13T19:46:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d9596253526... |
3c8d7f64-6ff1-4db6-ba6e-d9bf6882779a | AishwaryaPa/Data-Structures-and-Algorithms-Projects-CPP | proj5/Dummy.cpp | /*****************************************
** File: HashTable.h
** Project: CMSC 341 Project 5, Spring 2017
** Author: <NAME>
** Date: 05/1/17
** Section: 03
** E-mail: <EMAIL>
**
** This file contains the class implementations
** for HashTable class
**
***********************************************... | ALGO | 0.986524 | 5.794213 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-05-07T19:32: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": "13093d8946... |
8dc4248e-5cc5-4bb6-be55-4bd2bb7d1927 | anshul-garg27/Placement-prepration | DP/01 Knapsack/0-1 Knapsack recursive memoization.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[1000][1000];
int knapsack(int wt[], int profit[], int w, int n)
{
if (n == 0 || w == 0)
{
return 0;
}
if (dp[w][n] != -1)
return dp[w][n];
int result = 0; //
if (wt[n] > w)
{
result = knapsack(wt, profit, w, n - ... | ALGO | 0.999996 | 4.276744 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2021-05-03T10:15: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": "65a69390956... |
d504e361-974f-4fd2-965c-680cc8263dd1 | colin-skinner/AdventOfCode2024 | Day9_2.cpp | #include <iostream>
#include <fstream>
#include <string>
#include "helpers.h"
using namespace std;
template <typename T>
void print_files(vector<T> vec, std::string delim = "") {
for (const auto& element : vec) {
if (element == -1) {
cout << '.' << delim;
}
else {
c... | ALGO | 0.999653 | 4.361394 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-12-20T04:11: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": "c2464b728ee... |
e0634af5-0371-4d66-a9ac-49e9483bff71 | prototyyype/AssemblyLang | Week3/Carly_Gordon_260_assign3.cpp | // NOTE: The ONLY files that should be #included for this assignment are iostream, vector, and string
// No other files should be #included
#include <iostream>
#include <vector>
#include <string>
// NOTE: The ONLY files that should be #included for this assignment are iostream, vector, and string
// No other files sh... | ALGO | 0.92043 | 5.355425 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-03-10T21:37: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": "620d81f2b... |
c39bd0aa-0222-4d02-a1eb-e3b6e58a0d35 | alkida/clustersimulator | generate_traces/googledata/ready2.cpp | #include <stdio.h>
#include <string.h>
#include <map>
#include <iterator>
#include <unistd.h>
#include <stdlib.h>
using namespace std;
int main(){
FILE *f = fopen("task_events.csv","r");
map<pair<long,long>,bool> inserted;
long t;
map<pair<long,long>,long> ready;
map<pair<long,long>,long> start;
long ... | ALGO | 0.916637 | 3.509875 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-10-19T18:50:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1bc6be3f0... |
011fa3c9-26e6-43ee-acb3-a2a45d58b5ab | tmuttaqueen/MyCodes | Online Judge Code/codeforces/Codeforces Round #553 (Div. 2)/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define intl long long
#define pii pair<int,int>
#define xx first
#define yy second
#define mp make_pair
#define pb push_back
const int MAXN = 300005;
vector<int> val[MAXN];
intl ara[MAXN], tree[3*MAXN], lazy[3*MAXN];
void propagate( int cn, int s, int e )
{
tree[c... | ALGO | 0.999842 | 3.476402 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-01-27T09:25:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1c09098ea... |
eeff9b35-c751-40e3-87e9-2b1cfec264db | Fadhil-22343045/Fadhil-Rahmat-22343045 | Quiz_Fadhil Rahmat_22343045/8 Program Java Queue Deque.cpp | #include <iostream>
#include <queue>
#include <deque>
using namespace std;
int main() {
// Queue
queue<int> myQueue;
// Menambahkan elemen ke queue
myQueue.push(10);
myQueue.push(20);
myQueue.push(30);
// Mengakses elemen di depan queue
cout << "Elemen di depan queue: " << myQueue.fr... | ALGO | 0.97681 | 5.37639 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2022-11-14T03:16: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": "ef158d436d1... |
19943741-a193-4ce6-9df4-8756d5ac5c8c | PlanarG/Code | Contest/6.8/A.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 210;
const int mod = 1e9 + 7;
typedef long long LL;
int f[N], C[N][N], g[N][N], tmp[N][N];
inline int Pow(int x, int y) {
int res = 1;
for (; y; y >>= 1, x = (LL)x * x % mod) if (y & 1) res = (LL)res * x % mod;
return res;
}
int main() {
// ... | ALGO | 0.999975 | 4.122015 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2020-04-07T07:52:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "13aedab43... |
af402652-6995-40cf-97d6-7165a2bfd4cd | sabujcse/Data-Structure | datas2.cpp | /*****************************************************
*#*##################################################* *
*#**************************************************** *
*#* URI: sabujbd, *#... | ALGO | 0.999604 | 3.380067 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-12-09T19:13: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": "69b250e8be... |
a71f0148-b6c9-4da6-8337-77db7da324c9 | moypc10/TC2038-Advanced-Algorithms-Analysis-and-Design | Act 1 Divide y Venceras && Algoritmos Avaros/Actividad1_DivideyAlgoritmosAvaros.cpp | /*
* Actividad: Ejemplos de "Divide y Vencerás" y Algoritmos Avaros
*
* Instituto Tecnológico y de Estudios Superiores de Monterrey
* Campus Guadalajara
*
* <NAME> - A01625510
*
*/
#include <iostream>
#include <vector>
#include <chrono>
#include <cmath> //sqrt
#include <algorithm> //swap
#include <ctime> //ti... | ALGO | 0.99999 | 5.258514 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-11-15T14:09: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": "db4e10c6d3e0... |
cb6bf412-5a2c-4d13-ac1f-69b768efb400 | xianlihua/dsalgo | c++/hw9/a.cpp | /**
* hw9A:List
* http://cxsjsxmooc.openjudge.cn/hw9/A/
*/
#include <iostream>
#include <list>
using namespace std;
int main() {
int n;
cin >> n;
list<int> lists[10000];
char command[7];
for (int i = 0; i < n; i++) {
cin >> command;
int id;
char cc = command[0];
... | ALGO | 0.996389 | 4.323883 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2013-05-18T12:16:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "816db33f5... |
66c31134-4e3a-4f3c-8f4b-25998bbaf117 | lballabio/QuantLib | ql/math/distributions/studenttdistribution.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2008 <NAME>
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modif... | ALGO | 0.994672 | 5.851198 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
ffb806a9-4875-443d-82d6-9650fec388c7 | M1k33y/Genetic_Algorithms | tema2/tema2.cpp | #include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cmath>
#include <time.h>
#include <random>
#include <chrono>
#include <iostream>
#include <vector>
#include <queue>
#include <utility>
#include <thread>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcnt... | ALGO | 0.999989 | 4.649953 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-13T11:07:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1198ef133cc... |
f290e444-f299-45db-8df9-e78b9872fe28 | honey3491/codetree-TILs | 240727/최장 공통 부분 수열/longest-common-sequence.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string A_string, B_string;
cin >> A_string;
cin >> B_string;
int a_len = A_string.length();
int b_len = B_string.length();
int** count_string = new int* [a_len + 1];
for (int i = 0; i <= a_len; i... | ALGO | 0.99998 | 4.35533 | {
"github_metadata": {
"branch": "main",
"commit_count": 182,
"repo_created_at": "2024-07-07T10:33: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": "0099c0996b... |
af78974b-cfb6-4932-8a75-9e75208bf77f | HRF05/DMOJSolutions | ecoo20p2.cpp | #pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#include <iostream>
#include <queue>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <list>
#include <string>
#include <stack>
#include <iomanip>
#include <fstream>
#... | ALGO | 0.999445 | 3.660244 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-08-10T03:36: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": "08ca1aa861f... |
c9820738-2c96-47e9-b341-55c6d7e2fafa | yigitcankzl/AlgoMETU-25-Qualification-Round | Özcan - The Path Memorizer.cpp | //Brace your keyboard
//inzva community built algoleague for every algorithm enthusiast hungry for self-improvement and friendly competition. Have fun and good luck!
#include <bits/stdc++.h>
using namespace std;
const int MOD = 232323233;
const int MAX_N = 1e5 + 5;
const int LANES = 5;
int main() {
int N, M;
... | ALGO | 0.999976 | 4.263944 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-02-25T11:46:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83b68ed20eb0... |
677c545a-4c6d-4071-9aa4-7cb06fa5083a | Irumyuui/ACM-Template | 动态规划/背包问题/多重背包/多重背包.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
constexpr T inf = std::numeric_limits<T>::max() / 2;
// 没有优化
// 要搞滚动数组也行 缺点会丢失信息
void solve1() {
int n, m;
cin >> n >> m;
vector<int> v(n + 1), w(n + 1), cnt(n + 1);
for (int i = 1; i <= n; i ++)
cin >> v[i] >> w[i] >> cnt[i];
vector f(n + ... | ALGO | 0.999991 | 3.781498 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2023-01-23T03:03:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfc38d04fc... |
3b60bc5e-0ff7-47e5-aad3-c0713e5d4c9c | ashutom/CompetitiveProgramming | DECLARE.cpp | // This is standard declarations which needs to be part of the solutions for all the test
//
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define INF (ll)(1e18)
#define inf 0x7fffffff
#define inff 100000
#define ff first
#define ss second
#define ... | ALGO | 0.998604 | 3.092343 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-04-18T15:10: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": "0153dc3f7... |
5703d10f-d05d-47f2-956f-7cd6ce91148a | knakul853/spoj | gss1.cpp | #include<bits/stdc++.h>
#define INT_MIN -999999
using namespace std;
struct node{ // structure for storing the the prefix,suffix,sum and answer.
int pre,suff,ans,sum;
};
node seg[4*50010];
int ar[50010];
//since every leaf node will have the same prefix,suffix sum and answer !
void leaf(int a,int b)
{
... | ALGO | 0.999969 | 5.039623 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2018-08-14T15:40:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 11,
"issues": 2,
"pull_requests": 10
},
"file_meta": {
"content_id": "4376c0e... |
eeb04308-a33d-4cc8-af2b-fd7b543d1f6a | EricArndt/UVA | C++/Root/Contest Volumes/Volume CXII/10035 - Primary Arithmetic/Main.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main() {
while (true) {
int n1;
int n2;
cin >> n1;
cin >> n2;
if (n1 == 0 && n2 == 0) {
break;
}
int num1[10];
int num2[10];
for (in... | ALGO | 0.999808 | 4.848116 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2012-11-05T18:09:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7687b6418... |
1cd90678-5f26-496d-9d4a-611d1aed0fdf | enrevol/cpp | spoj-vn/C11PRIME.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
bool sieve[32000];
int pn;
int pr[5000];
... | ALGO | 0.999856 | 3.603275 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2015-03-28T03:24:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0071235a3... |
f11e663c-3003-4930-8789-42c36fbeb429 | QuantumFellow/Codelab | Chapter-6-Arrays/Exercises/(Bonus) 1.Iterating Through Arrays/Source.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int Ascii = 97; //declaring a in ascii
char alphabet[26];
for (int i = 0; i < 26; i++) { //will generate 26 values
alphabet[i] = Ascii; //stores array values
Ascii++; //moves to next ascii letter
}
for (int j = 0; j < 26; j++) {
cou... | ALGO | 0.99916 | 3.209078 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-27T13:25:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e7a6cdff552... |
68fcfb23-178b-458d-b289-51845cd94485 | Rajeesh5/CtsRepo | HuffmanCoding.cpp | #include<stdio.h>
#include<malloc.h>
#include<iostream>
using namespace std;
struct treeNode
{
int data;
char info;
struct node* left, *right;
};
struct Heap //MIN_HEAP
{
treeNode **arr;
int capacity,heapSize;
}*h;
int getLeftChildIndex(int i) {if((2*i+1)>=h->heapSize)return -1; else return (2*i+1);... | ALGO | 0.999934 | 3.132094 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2016-07-28T11:12: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": "aea72d158... |
a2a1d7ee-f220-45f2-a4c4-9f78289a8ce4 | frankling2020/Leetcode | 24Wn/p295/main.cpp | #include <vector>
#include <queue>
using namespace std;
class MedianFinder {
priority_queue<int,vector<int>, less<int> > big_heap;
priority_queue<int,vector<int>, greater<int> > small_heap;
public:
MedianFinder() {
}
void addNum(int num) {
int small_sz = small_heap.size();
int... | ALGO | 0.999976 | 6.059856 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-03-13T16:44: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": "dd30ad0f4bb... |
62cfa2b6-9040-4528-879c-5182eb269202 | Pranav-Rustagi/Problem-Solving | 0843-binary-trees-with-factors/0843-binary-trees-with-factors.cpp | class Solution {
public:
int numFactoredBinaryTrees(vector<int>& arr) {
unordered_map<int, long long> m;
sort(arr.begin(), arr.end());
int n = arr.size(), mod = 1e9 + 7, count = 0;
for(int i = 0 ; i < n ; i++) {
int s = 0, e = i - 1;
m[arr[i]] = 1;
... | ALGO | 0.999934 | 5.85961 | {
"github_metadata": {
"branch": "main",
"commit_count": 1140,
"repo_created_at": "2022-08-11T13:51:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62afd228f... |
ecc98a40-398c-40f9-871c-751bc88488a5 | mleykhner/ProjectEnigma | main.cpp | #include <iostream>
#include "configuration.cpp"
#include "string"
int rotorStep(int rotor, int input, int direction, int position);//Проецирование символа через ротор
int projectLetter(int input, int rots[], int * poss); //Проецирование символа через все роторы
void newPositions(int * positions); //Расчет новых полож... | ALGO | 0.994184 | 4.066291 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-06-22T13:33: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": "a583ef9a40... |
332930cc-0cd1-4363-889b-69b30798178e | Njavris/adventofcode | 2022/day22/day22.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <unistd.h>
#include <cstring>
#include "utils.h"
class Vec {
public:
int x, y, z;
Vec() : x(0), y(0), z(0) {};
Vec(int x1, int x2, int x3) : x(x1), y(x2), z(x3) {};
std::string toStr(void) {
return "(" + std::to_string(x) + ",... | ALGO | 0.99971 | 3.959735 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2022-12-05T11:01: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": "ccd35f79c09... |
0ad30d4f-4c6b-4e15-b138-583e3d6b96be | rohany1/Cpp-Kaksha | BinaryTree/diameterBinaryTree.cpp | #include<iostream>
#include<algorithm>
using namespace std;
struct Node{
int data;
struct Node* left;
struct Node* right;
Node(int val){
data=val;
left=NULL;
right=NULL;
}
};
int heightOfTree(Node* root){
if(root==NULL){
return 0;
}
int leftTreeHeight=he... | ALGO | 0.999955 | 4.668118 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2021-07-28T06:19: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": "59e46c9b8... |
2530a7bf-385c-4816-8800-d7e4a1ee6e26 | WebKit/WebKit-http | Source/ThirdParty/libwebrtc/Source/webrtc/modules/audio_processing/ns/quantile_noise_estimator.cc | /*
* Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | ALGO | 0.997466 | 7.357258 | {
"github_metadata": {
"branch": "master",
"commit_count": 231005,
"repo_created_at": "2011-01-11T13:50:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4992,
"forks": 1983,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
9d839f1d-e20b-4c69-9c21-c1f12f046f98 | zhangzhangjjww/introduction-to-algorithm- | Euler_tour/euler_tour.cpp | #include<iostream>
#include<cstdlib>
#include<limits>
#include<fstream>
#include<list>
const int MAX=100;
using namespace std;
template<class T> struct Node
{
T key;
Node* pre_t;
Node* next_t;
Node(T k=0):key(k),pre_t(NULL),next_t(NULL) {}
};
template<class T> struct double_list
{
Node<T>* list_h... | ALGO | 0.999988 | 4.113033 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-05-27T08:32:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31eccaaf07... |
324d3670-e426-40c5-ad90-3d7eb484bfe8 | andres-rad/Programming-Challenges | RegLATAM2009/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define forsn(i,s,n) for(tint i = (tint)(s); i < (tint)(n); i++)
#define forn(i, n) forsn(i,0,n)
#define dforsn(i,s,n) for(tint i = (tint)(n); i >= (tint)(s); i--)
#define dforn(i,n) dforsn(i,0,n)
#define pb push_back
#define mp make_pair
#define fst first
#define snd secon... | ALGO | 0.999511 | 3.483827 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2016-05-10T05:38: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": "307b7bd9... |
752d78ec-c8ca-4745-927f-bb21bc035277 | ouyangyewei429/ACM-ICPC | HDOJ/hdoj_1335_simulation.cpp | /*
PROG: Basically Speaking
ID : ouyangyewei
LANG: C++
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
const int maxn = 80;
char num[maxn];
int result[maxn];
int dig, base, tarBase, cnt, r, i;
int main()
{
while ( EOF!=scanf("%s %d %d", num, &base, &tarBase) )
{
... | ALGO | 0.998209 | 3.327706 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2014-07-31T01:34:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2a4ff95f7... |
4341944d-cbb0-4526-a94e-bf84572535b1 | KashviSharma15/Operating-System | bestFit.cpp | #include <iostream>
using namespace std;
void bestFit(int blockSize[], int m, int processSize[], int n) {
int allocation[n];
for (int i = 0; i < n; i++)
allocation[i] = -1;
for (int i = 0; i < n; i++) {
int bestIdx = -1;
for (int j = 0; j < m; j++) {
if (blockSize[j] ... | ALGO | 0.999818 | 4.880088 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-04-05T03:21:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6039a9d8e2fd... |
0dd87fea-4a3a-479c-bd0a-cb61727231bb | dohabo/SANTA | Main_Controller_MEGA/robot3.ino | //비전 검사 시 양품일 경우
void robot3_1(){
int movedelay = 20;//(로봇 작동 속도)
int waitdelay = 100;//(서보 모터간 딜레이)
// Servo1 구동
for(int i = 120; i>=1; i--){
Servo3_1.write(i);
delay(movedelay);
}
delay(waitdelay);
// Servo2 구동
for(int i = 30;i<=80;i++){
Servo3_2.write(i);
delay(movedelay);
}
delay(... | TOOL | 0.939975 | 4.090789 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-01-25T04:59:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff30cc5e7a76... |
961fe3f9-f339-41cf-90e2-6f334afeda69 | Cron191/DSA | ASS5/6.cpp |
#include <iostream>
using namespace std;
struct TNODE
{
int key;
TNODE *pLeft;
TNODE *pRight;
};
typedef TNODE *TREE;
TREE CreateNewTREE(int x)
{
TREE p = new TNODE;
p->key = x;
p->pLeft = NULL;
p->pRight = NULL;
return p;
}
void InsertTREE(TREE &T, int x)
{
TREE p = CreateNewTREE(... | ALGO | 0.999852 | 3.846695 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2024-11-01T07:58:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab5082117... |
66d5366c-2ba3-486c-a9aa-62c8a0c9b889 | Xilinx/Vitis_Libraries | codec/L2/demos/pikEnc/host/pik/lehmer_code.cc | // Copyright 2017 Google Inc. All Rights Reserved.
//
// 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.
// TODO(veluca): Lehmer coding takes up to 5% of the decoding time on very
// small images (32x32 pixels), and up t... | ALGO | 0.999976 | 6.604957 | {
"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": "231323... |
5be8ed85-4c20-4849-aefe-6d07982416c1 | CaSchmidt/csUtil | csUtil/src-Core/include/cs/Core/CRC.h | /****************************************************************************
** Copyright (c) 2022, <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:
**
** 1. Redistributions of source ... | ALGO | 0.982226 | 7.165443 | {
"github_metadata": {
"branch": "master",
"commit_count": 1099,
"repo_created_at": "2018-10-06T15:29:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "afa0d63... |
808424d8-80e0-4c4a-b97d-e51eb0ca2516 | pkbmh/Algorithms-in-c- | Array/Maximum_Subarray_Sum.cpp | #include<bits/stdc++.h>
using namespace std;
#define ARRAY_SIZE(arr) sizeof(arr)/sizeof(arr[0])
int cross_sum(int arr[] , int l , int mid , int h) {
int sum = 0;
int left_sum,right_sum;
left_sum = right_sum = INT_MIN;
for(int i = mid; i >= l; i--) {
sum += arr[i];
if(sum > left_sum)
... | ALGO | 0.99992 | 4.765598 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-01-06T18:11: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": "b3a8b7c7f4... |
5f5370d3-da58-4590-8682-ce515fa30f38 | andrewqt/Competitive-Programming | CodeForces/_0260_D_BlackAndWhiteTree/_0260_D_BlackAndWhiteTree.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
priority_queue<pair<int, int>> t[2];
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> qu[2];
int val[100005];
vector<pair<pair<int, int>, int>> ans;
bool done[100005];
int clr[100005];
int par[100005];
int getrt(int n){
return pa... | ALGO | 0.999603 | 3.594718 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-09-08T12:27:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c30d90322... |
6faa0450-3d58-4063-a7f6-faaa841cd92d | jingweixi233/OnlineJudge_SJTU | 1602.cpp | #include <iostream>
using namespace std;
const int N = 100000;
int num1[N];
int num2[N];
int arr[N];
int main(){
int num1Len, num2Len;
int i, j, k;
cin >> num1Len >> num2Len;
for(i = 1; i <= num1Len; i++){
cin >> num1[i];
}
for(i = 1; i <= num2Len; i++){
cin >> num2[i];
}... | ALGO | 0.999997 | 3.33021 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-01-20T13:43: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": "5b0f54490... |
29b19cdc-8314-43a6-a830-d1e7a53330ad | bradelement/coding_exercise | zoj/misc/3768.cpp | #include "cstdio"
#include "vector"
#include "algorithm"
using namespace std;
//任意自然数是最多三个三角形数的和
//高斯发现了这个规律。他在1796年7月10日在日记中写道:EYPHKA! num = Δ + Δ + Δ
const int lim = 123456789;
vector<int> num;
bool gao(int n, vector<int> &ans)
{
int target;
vector<int>::iterator it = lower_bound(num.begin()+1, num.end(), ... | ALGO | 0.999863 | 4.053232 | {
"github_metadata": {
"branch": "master",
"commit_count": 214,
"repo_created_at": "2014-03-11T14:19:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d99ba927... |
a56c65ea-a3da-4fc7-9961-a922457cd517 | mangoqwq/competitive-programming | Other/lazy.cpp | #include <bits/stdc++.h>
using namespace std;
#define ms(x,a) memset(x,a,sizeof x)
typedef long long ll;
const int mod=1e9+7, seed=131, MAXN=1e5+1;
int n, q;
struct nd{
ll mn, set, inc;
bool flag;
void upd(int t, int val){
if (t==1){
if (flag) set+=val;
else inc+=val;
... | ALGO | 0.999961 | 5.220924 | {
"github_metadata": {
"branch": "master",
"commit_count": 540,
"repo_created_at": "2020-08-28T16:37:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28d0ca30... |
b3ac3050-9d4c-467e-846d-ad3fc5f634b9 | caalive/CLearn | OneHour/lesson5/listing5_7.cpp | /**********************************************************************
> File Name: listing5_7.cpp
> Author:
> Mail:
> Created Time: Wed 22 Nov 2017 08:48:05 PM CST
************************************************************************/
#include <iostream>
#include <bitset>
#include <string>
using namespace s... | TOOL | 0.918698 | 4.382809 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-11-19T01:48: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": "cd3da257c... |
4b2ed66e-3122-4bf0-9160-3b1a84711c1d | swraj28/Competitive-Programming | Dp/1. competitive dp_question/F_=Zero_Remainder_Sum_cf.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626
const int mod = 1000000007;
#define fo1(i,a,b) for(int i=a;i<=b;i++)
#define deb(x) cout<<x<<"\n";
#define deB... | ALGO | 0.999974 | 3.206146 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-10-29T21:43:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e55aa72a9... |
f966a871-8bee-4f04-9968-85aaf85da484 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1248/all/29176998_62981495.cpp | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define allin(x, V) for(auto x : V)
#define endl '\n'
#de... | ALGO | 0.999961 | 4.031141 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40: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": "db9d37a54... |
51edac18-2634-4006-b2d8-a4b8f2575b18 | hernss/cpp_udemy_course | LambdaExpressions/LambdaExpressions/main.cpp | #include <iostream>
#include <string>
#include <fstream>
template<typename T>
struct Unnamed {
T operator()(T x, T y) const {
return x + y;
}
};
/*
struct Unnamed {
int operator()(int x, int y) const {
return x + y;
}
};
*/
template<typename T, int size, typename Comparator>
void Sort(T(&arr)[size], Compara... | TOOL | 0.901706 | 5.173177 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-03-02T12:00: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": "7b294ecaeeda... |
c8146795-5e3a-45e8-82a3-5eaf837e4810 | andrasigneczi/cpp_lang_training | HackerRank/XoringNinja.cpp | #include <bits/stdc++.h>
/*
Given an array with ints. Calculate the sum of every possible subset's xor of the array and return
with Sum() % (pow(10,9) + 7)
*/
using namespace std;
vector<string> split_string(string);
using ull = unsigned long long;
ull traversalSum(const vector<int>& arr, vector<int>& groupMembers... | ALGO | 0.999943 | 5.547472 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2017-02-02T06:52: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": "da9e4fa9b... |
ab4b06c0-8d07-44ea-8948-64c95cb13b2f | abdullahbutt09/Data-Structure-Algorithms | Trees-Problems/Binary-Search-Tree/Insertion-In-BST/Insertion_In_BST.cpp | #include <iostream>
using namespace std;
struct tree
{
int data;
tree *left;
tree *right;
};
void InsertionInBST(tree *, int);
void InOrderTraversal(tree *);
tree *CreateNode(int data)
{
tree *NewNode = new tree();
NewNode->right = nullptr;
NewNode->left = nullptr;
NewNode->data = data;
... | ALGO | 0.999967 | 4.618472 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2024-10-21T06:43: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": "a121265b... |
c1543969-d932-43c4-9327-9114ad9ab60e | cwsamuelson/dataStructures | polynomial/source/high_polynomial.cc | #include<cmath>
#include<utility>
#include<high_polynomial.hh>
using namespace gsw;
high_polynomial::high_polynomial(std::initializer_list<storage_type::value_type> il)
: mCoeff(il) {
}
high_polynomial& high_polynomial::operator+=(const high_polynomial& hp) {
for(const auto&[key, value] : hp.mCoeff) {
... | ALGO | 0.993476 | 5.61038 | {
"github_metadata": {
"branch": "master",
"commit_count": 857,
"repo_created_at": "2013-04-16T17:14:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 17,
"pull_requests": 0
},
"file_meta": {
"content_id": "a987db0... |
be0d3e8b-dcb8-442b-ac13-fbb662d3e099 | phamtu2x5/Codeptit | C++/CPP07/35.cpp | #include <bits/stdc++.h>
#define int long long
#define N 1000005
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
using namespace std;
signed main()
{
fastio;
int t, m, n;
cin >> t;
while (t--)
{
int ans = 1e9;
... | ALGO | 0.999977 | 4.344089 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-03-25T13:41: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": "4e703844d45... |
c1244be5-38c0-46bb-bc24-b04ee5c67274 | teodor-cotet/Algorithms | infoarena/gandaciJava/java.cpp | #include <bits/stdc++.h>
using namespace std;
ifstream fin("java.in");
ofstream fout("java.out");
const int NMAX = 10009;
int nL; int nR; int m;
vector<int> g[NMAX];
bool used[NMAX];
int pairL[NMAX];
int pairR[NMAX];
void read() {
fin >> nL >> nR >> m;
for(int i = 1; i <= m ; ++i) {
int x; int y;
fin >... | ALGO | 0.999932 | 3.769614 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-04-23T21:56: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": "46c017a65c... |
9816a4b0-ab94-4295-828c-8c2912348adf | danielee3/Leetcoding | Cplusplus/0312_138_Copy_List_With_Random_Pointer.cpp | /*
March Leetcoding Challenge Day 11
138. Copy List with Random Pointer
[Solution]
Language: C++
Time Complexity: O(n)
Space Complexity: O(n) <- The output itself is O(n)
*/
// Definition for a Node.
class Node {
public:
int val;
Node* next;
Node* random;
Node(int _val) {
val = _val;
... | ALGO | 0.988419 | 5.825772 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-03-02T22:01: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": "3e8e39e3873... |
eeee8e9c-b4f2-4da7-8e5a-b5f020982984 | uluyol/heyp-agents | heyp/alg/fairness/max-min-fairness.cc | #include "heyp/alg/fairness/max-min-fairness.h"
#include <iostream>
#include "absl/algorithm/container.h"
#include "absl/base/macros.h"
#include "absl/strings/substitute.h"
#include "absl/types/span.h"
#include "heyp/alg/fairness/nth-element.h"
namespace heyp {
namespace {
constexpr bool kDebugAllocator = false;
... | ALGO | 0.999906 | 7.287858 | {
"github_metadata": {
"branch": "main",
"commit_count": 976,
"repo_created_at": "2020-12-25T19:25:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1dc7891fb2... |
ad3b3bc2-cfca-4a05-8dad-cde2e9b3e670 | LutzGross/esys-escript.github.io | paso/src/Smoother.cpp |
/*****************************************************************************
*
* Copyright (c) 2003-2018 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development unt... | ALGO | 0.999104 | 5.997882 | {
"github_metadata": {
"branch": "master",
"commit_count": 5724,
"repo_created_at": "2020-08-10T02:31:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 15,
"issues": 63,
"pull_requests": 0
},
"file_meta": {
"content_id": "373c... |
8c863cd7-7063-4dad-855f-32f1553e7605 | wcheung8/Programming-Team-Archive | practice/fall2017/acm2017/treasuremap.cpp | #include <bits/stdc++.h>
#define ull unsigned long long
#define f(i, n) for(int (i) = 0; (i) < (n); i++)
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef pair<int, int> pi;
typedef priority_queue<pi, vector<pi>, greater<pi> > q;
const int INF = 1e7;
vector<pi> a[1... | ALGO | 0.999953 | 3.633792 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2016-10-14T03:52:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08a5f542b... |
61a600f2-9c42-4bdb-9d19-5bc5dd8a752d | nayuta1019/AtCoder | ABC/ABC151-160/ABC159/B/B.cpp | /*
ABC159
2020/03/23/ 自力AC
*/
#include <bits/stdc++.h>
using namespace std;
// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
// container util
#define all(x) (x).begin(), (x).end()
// typedef
typedef long long llint;
typedef unsigned long long u... | ALGO | 0.999984 | 4.054967 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-02-16T07:17:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a77052ea45... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.