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 |
|---|---|---|---|---|---|---|---|
a8bbc37c-bf14-49df-a857-8d3ac2f388ad | August12/Seed | Algorithm/bk16234.cpp | #include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
int N, L, R;
int Map[51][51];
int Vit[51][51];
int dr[4] = {1, 0, -1, 0};
int dc[4] = {0, 1, 0, -1};
int Cnt;
int Answer;
vector < pair<int,int> > v;
void dfs(int r, int c) {
Vit[r][c] = 1;
v.push_back(make_pair(r,c));
for(int i=0; i... | ALGO | 0.999603 | 3.898553 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2018-04-16T01:59:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45ff94ab5... |
b339aadf-4578-4dba-854f-a88167384d79 | roydevashish/cpp | F06Patterns-2/DiamondOfStars.cpp | /*
Title: Diamond of Stars
Problem statement
Print the following pattern for the given number of rows.
Note: N is always odd.
Pattern for N = 5
..*
.***
*****
.***
..*
The dots represent spaces.
Detailed explanation ( Input/output format, Notes, Images )
Input format :
N (Total no. of rows and can only be odd)
Outp... | ALGO | 0.999951 | 5.566193 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-12-19T15:26: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": "461f33c758b... |
c4360131-f455-4cce-83e0-6344655fcb21 | ttyang/sandbox | sandbox/SOC/2008/spacial_indexing/geometry/example/doxygen_examples.cpp | #include <geometry/area.hpp>
#include <geometry/aswkt.hpp>
#include <geometry/centroid.hpp>
#include <geometry/correct.hpp>
#include <geometry/distance.hpp>
#include <geometry/envelope.hpp>
#include <geometry/fromwkt.hpp>
#include <geometry/intersection_segment.hpp>
#include <geometry/intersection_linestring.hpp>
#incl... | TOOL | 0.923753 | 7.444679 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 20907,
"repo_created_at": "2013-10-11T03:08:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2723179... |
727ddb85-f4b4-4bb3-9430-9f66b34acb1b | Srivallikuppala/Gfg | Medium/Minimum Multiplications to reach End/minimum-multiplications-to-reach-end.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 minimumMultiplications(vector<int>& arr, int start, int end) {
// code here
queue<pair<long long,int>>que;
... | ALGO | 0.999862 | 5.503381 | {
"github_metadata": {
"branch": "main",
"commit_count": 209,
"repo_created_at": "2024-01-06T04:29: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": "58056c4075... |
59752593-f896-40c4-9b9d-8cf6cda51e31 | ishandutta2007/codeforces-b | belonogov/normal/576/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
const int N = 5e5 + 10;
const int INF = 1e9 + 19;
const int K = 51;
struct Rev {
int * ptr;
int val;
Rev(int *ptr, int val): ptr(ptr), val(val) { }
};
struct CEdge {
int v, u, ... | ALGO | 0.999914 | 4.406159 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a02be8a6f2f... |
9aa6d88e-a3c8-4774-a749-d673c1ffc98d | redsn0w422/replica | PointerJump/src-timing/PointerJumping.cpp | #include <sys/mman.h>
#include <pthread.h>
#include <cxxabi.h>
#include <stdio.h>
#include <string>
#include <iostream>
#include <cstdlib>
#include <memory>
#include <map>
#include <list>
#include <vector>
#include <fstream>
#include <pthread.h>
#include "wireless.h"
#ifndef SIZE
#define SIZE 100
#endif
#ifndef NUM_T... | ALGO | 0.9826 | 3.458261 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-04-11T16:15: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": "69058a0ae2... |
2f4eade2-fd14-4f48-838c-02cc8498b959 | trilinos/Trilinos | packages/intrepid2/src/Discretization/Basis/Intrepid2_HGRAD_LINE_Cn_FEM_JACOBIDef.hpp | // @HEADER
// *****************************************************************************
// Intrepid2 Package
//
// Copyright 2007 NTESS and the Intrepid2 contributors.
// SPDX-License-Identifier: BSD-3-Clause
// *****************************************************************************
... | ALGO | 0.911826 | 6.795533 | {
"github_metadata": {
"branch": "master",
"commit_count": 104031,
"repo_created_at": "2015-11-16T19:39:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 593,
"issues": 263,
"pull_requests": 61
},
"file_meta": {
"content_id":... |
48069d98-f716-4413-b896-07a24b107bae | Simonhancrew/Joy | LeetCode/DP/CPP/Leetcode1000-minimum-cost-to-merge-stones.h | // 区间dp + 前缀和
#if 1
class Solution {
public:
enum {
N = 35,
};
int f[N][N][N]{};
int s[N]{};
int k{};
int dfs(int l, int r, int p) {
auto& res = f[l][r][p];
if (res != -1) return res;
if (p == 1) {
return res = l == r ? 0 : dfs(l, r, k) + s[r + 1] - s[l];
}
res = numeric_limi... | ALGO | 0.99988 | 5.209354 | {
"github_metadata": {
"branch": "master",
"commit_count": 1044,
"repo_created_at": "2022-01-26T02:18: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": "0dca2f2... |
8040c86e-42d7-4dd5-b35a-7a44c3c9314b | ArghyaB118/Guide2ICPC | Multithreading/parallel_search.cpp | // https://www.geeksforgeeks.org/linear-search-using-multi-threading/
#include <iostream>
#include "time.h"
#include "pthread.h"
using namespace std;
#define max_length 16
#define max_thread 4
#define item_range 100
int current_thread = 0;
struct thread_data {
vector<int> arr;
int key;
};
void* threadSearch (void*... | ALGO | 0.998025 | 4.598189 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2019-07-24T05:16:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c74db056... |
46a8cee4-c00e-4204-8a6f-6a4b6922becb | Ishikajain02/Codeforces-Contests | Rated 900/gravity_flip.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
char x;
cin>>x;
string v;
cin>>v;
string t1,t2,t3;
t1="qwertyuiop";
t2="asdfghjkl;";
t3="zxcvbnm,./";
string ans="";
if(x=='R'){
for(int i=0;i<v.size();i++){
if (t1.find(v[i]) != std::string::npos) {
for(int j=0;j<t... | ALGO | 0.999459 | 3.232021 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2023-12-29T09:12: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": "c5a991e4d04... |
d0bdd9cd-2e92-42cb-8258-e0ea853d8ef3 | niozhao/vlc-3.0.11-VS2019 | contrib/libchromaprint/chromaprint-1.4.2/src/fingerprint_decompressor.cpp | // Copyright (C) 2016 <NAME>
// Distributed under the MIT license, see the LICENSE file for details.
#include "fingerprint_decompressor.h"
#include "debug.h"
#include "utils/pack_int3_array.h"
#include "utils/pack_int5_array.h"
#include "utils/unpack_int3_array.h"
#include "utils/unpack_int5_array.h"
#include "utils.... | ALGO | 0.974621 | 5.952945 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-01-15T10:46:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 31,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "4abbb58... |
30b60356-ece3-4e81-b630-97379ac1989a | Arkaim/ADS | Algorithms/rabin_karp.cpp | #include<iostream>
#include<cstring>
#include<cstdio>
#define d 256
using namespace std;
void search(char * txt, char * pat, int q) {
int m = strlen(pat);
int n = strlen(txt);
int i, j;
int p = 0;
int t = 0;
int h = 1;
for (i = 0; i < m - 1; i++) {
h = (d * h) % q;
}
for (i =... | ALGO | 0.999974 | 4.242468 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-11-17T09:20:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffc4d5b703... |
3f18dc02-0098-4445-933b-048927f81ba6 | gtxygyzb/OI_and_ICPC | 2022train/221026/18nanjingm.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N = 1e6 + 50;
const ull base = 131;
ull gap[N], hs[N], ht[N];
int n, m, suf[N];
void init()
{
gap[0] = 1;
for (int i = 1; i <= N - 50; i++)
gap[i] = gap[i - 1] * base;
}
void gethash(char *s, u... | ALGO | 0.999982 | 3.793871 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-16T11:13:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67750a86fbaf... |
50b07176-72cc-43a2-bb19-c3a6013b95ef | Boheng92/Group7Final | crawler_Arduino/crawlerDemo_RC/crawlerDemo_RC.ino | #include <Wire.h>
#include <Servo.h>
#include <PID_v1.h>
#include <SoftwareSerial.h>
#define STOP 0
#define AUTO 1
#define MANU 2
boolean isAuto;
boolean isSpecial;
double Setpoint, Input, Output;
double Kp=3.0, Ki=0.00001, Kd=1.2;
PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
Servo wheels; // servo f... | ALGO | 0.955564 | 5.403739 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2015-12-01T20:06: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": "8f7af1f7f... |
4d33dbd3-33f2-4f24-b080-0798713bbf72 | wjdansrl7/Coding-Test | 백준/greedy/tempCodeRunnerFile.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int main(int argc, char const *argv[])
{
long x, y;
int w, s;
long result[3];
memset(result, 0, sizeof(result));
cin >> x >> y >> w >> s;
if (x > y)
{
if (x & 1)
{
result[0] = y ... | ALGO | 0.999608 | 3.577682 | {
"github_metadata": {
"branch": "master",
"commit_count": 489,
"repo_created_at": "2023-03-07T14:20: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": "87f25962... |
5288bfcf-b2e8-4782-ba61-729a4bb81a6f | citxx/pedestrian-recognition | src/Sample.cpp | #include <cmath>
#include <iostream>
#include "Chi2Kernel.hpp"
#include "debug.hpp"
#include "Sample.hpp"
const int SQUARE_SIZE = 8;
Sample::Sample(cv::Mat image) {
if (image.cols < PATCH_WIDTH || image.rows < PATCH_HEIGHT) {
std::cerr << "Invalid sample image" << std::endl;
throw "Invalid sample... | ALGO | 0.929475 | 6.409894 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2011-09-30T10:00:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db2154d99... |
d48e1e1a-3558-4bce-806c-4ea8747d7cd8 | rjenez/W266-final-project | data/programming-homework-dataset-plagiarism-detection/src/B2016/Z3/Z1/student8599.cpp | /B2016/2017: Zadaća 3, Zadatak 1
//Autotestovi by <NAME> (<EMAIL>)
#include <iostream>
#include <utility>
#include <vector>
#include <cmath>
#include <functional>
#include <stdexcept>
double Proizvod(std::vector<std::pair<double, double>> x, int k, int d, int i){
double proizvod(1);
for(int j=k; j<=k+d; j++){
... | ALGO | 0.995753 | 5.013005 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2022-02-09T00:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcda356947... |
e221dc5b-a81e-4bb2-a3d1-a898d5ba5bcd | rel-isma/CPP_MODULES | CPP09/ex01/RPN.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* RPN.cpp :+: :+: :+: ... | TOOL | 0.958127 | 5.574335 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-01-02T17:14: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": "b77b91185af... |
ed5c3cb5-4fba-4c0d-bd15-5b8efdec9ef8 | alberto-pino/CameraOpenGL | Transformations/camera.cpp | #include "camera.h"
#include <cmath>
#include <iostream>
// TODO
// devuelve los valores de distancia de los planos a partir del fov horizontal
FRUSTUM makeFrustum(double fovX, double aspectRatio, double nearValue, double farValue)
{
const double DEG2RAD = 3.14159265 / 180;
double tangent = tan((fovX / 2) * DEG2R... | TOOL | 0.947061 | 4.720886 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-02-26T08:55: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": "9cadbe3f37... |
1230a0e4-a8e0-462f-b97a-d6f13c3d6982 | TINABJan254/CPP-PTIT | CPP0629_DanhSachDoanhNghiepNhanSinhVienThucTap2.cpp | #include <bits/stdc++.h>
using namespace std;
class company
{
private:
string code, name;
int numStudent;
public:
int getNumStudent(){
return numStudent;
}
string getCode(){
return code;
}
friend istream &operator >> (istream &in, company &x){
in >> x.code;
in.ignore();
getline(in, x.na... | ALGO | 0.999537 | 4.168832 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-09-10T00:56: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": "16a46b2f3... |
873b4fa1-6cde-4610-bf25-0ac4795854a2 | ishandutta2007/codeforces-j | jeroenodb/normal/1468/G.cpp | #include "bits/stdc++.h"
// #include "geodeb.h"
using namespace std;
#define all(x) begin(x),end(x)
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 = typename enable_if<!is_same<T... | ALGO | 0.998737 | 3.821528 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42: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": "77b0c979f27a... |
e86ef522-63e4-4102-a780-b9385d4cd702 | robotbuf/Algorithm | 백준/Gold/2668. 숫자고르기/숫자고르기.cc | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n;
int arr[101];
bool visited[101];
bool finished[101];
vector<int> result;
void dfs(int x, vector<int>& temp) {
visited[x] = true;
temp.push_back(x);
int next = arr[x];
if (!visited[next]) {
dfs(next, temp);... | ALGO | 0.999994 | 4.505844 | {
"github_metadata": {
"branch": "main",
"commit_count": 237,
"repo_created_at": "2025-03-02T04:07: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": "6855f57979... |
0129fec9-eb1a-4782-b75c-a19f4d1e20df | bizkut/warz-client | External/NaturalMotion/morpheme/SDK/euphoriaCore/src/erGravityCompensation.cpp | // Copyright (c) 2011 NaturalMotion. All Rights Reserved.
// Not to be copied, adapted, modified, used, distributed, sold,
// licensed or commercially exploited in any manner without the
// written consent of NaturalMotion.
//
// All non public elements of this software are the confidential
// information of NaturalMo... | ALGO | 0.936428 | 4.932786 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-12-20T14:48:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 17,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "38f790f8... |
10427fdc-fe9d-4eda-aa33-b4a3c3b139fd | michalMilewski-8/gk2-lab2-homeworks | gk2-lab2/butterflyDemo.cpp | #include "butterflyDemo.h"
using namespace mini;
using namespace gk2;
using namespace DirectX;
using namespace std;
#pragma region Constants
const float ButterflyDemo::DODECAHEDRON_R = sqrtf(0.375f + 0.125f * sqrtf(5.0f));
const float ButterflyDemo::DODECAHEDRON_H = 1.0f + 2.0f * DODECAHEDRON_R;
const float Butterfly... | ALGO | 0.926317 | 4.336409 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-03-26T19:30:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df9c002afc... |
91854196-a65f-4cc0-8dbe-958443fe16ef | hardnp/vehicle_routing_problem | lib/include/constraints.h | #pragma once
#include "problem.h"
#include "solution.h"
#include <cassert>
#include <cmath>
#include <ostream>
namespace vrp {
namespace constraints {
int total_violated_time(const Problem& prob, const Solution& sln);
template<typename ListIt>
inline int total_violated_time(const Problem& prob, const SplitInfo& inf... | ALGO | 0.934989 | 7.027957 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2018-11-16T17:35:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 5,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "3653224d42... |
73c996fa-970b-4688-b239-ea04feb168d3 | MikeFranco/CodigosFPOO | Algoritmos/Narrativa_7.cpp | #include <stdlib.h>
#include <stdio.h>
#include <string.h> /*aņadimos la biblioteca "string.h" */
#include <iostream>
#include <fstream>
#include <ctime>
using namespace std;
string nombrearchivo;
int arreglo [1000];
int comparador [1000];
int contador=0;
int conta=0;
int n=0;
int ayuda[1000];
int auxi=0;
FILE *fp;
... | ALGO | 0.99426 | 3.431705 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2019-01-29T21:24: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": "7424e367... |
a82ff739-1228-470a-87c7-017a91db0b7a | yashk9293/Aditya-Verma-Dynamic-Programming | 10_unbounded_knapsack.cpp | // Question Link :- https://www.geeksforgeeks.org/problems/knapsack-with-duplicate-items4201/1
// Knapsack with Duplicate Items (Unbounded Knapsack)
// T.C = O(n*W)
// S.C = O(W)
class Solution {
public:
int knapSack(int n, int W, int val[], int wt[]) {
int t[n + 1][W + 1];
for (int i = 0; i <= n; i++... | ALGO | 0.999998 | 5.553761 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2024-06-28T08:43:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a7ca05efc... |
cfe4cd5b-187c-41aa-b713-c0a15ff1117d | hmazhar/physbam_public | PhysBAM_Tools/Grids_Uniform_Advection/ADVECTION_SEMI_LAGRANGIAN_UNIFORM_DEFINITION_BETA.h | //#####################################################################
// Copyright 2002-2010, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//######################################... | ALGO | 0.999206 | 5.291536 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2014-04-02T21:48:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 13,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "db5e49d... |
9a992813-7c7d-4719-a898-e830fcc1792c | huihut/interview | Algorithm/CountSort.cpp | /*****************
计数排序:统计小于等于该元素值的元素的个数i,于是该元素就放在目标数组的索引i位(i≥0)。
计数排序基于一个假设,待排序数列的所有数均为整数,且出现在(0,k)的区间之内。
如果 k(待排数组的最大值) 过大则会引起较大的空间复杂度,一般是用来排序 0 到 100 之间的数字的最好的算法,但是它不适合按字母顺序排序人名。
计数排序不是比较排序,排序的速度快于任何比较排序算法。
时间复杂度为 O(n+k),空间复杂度为 O(n+k)
算法的步骤如下:
1. 找出待排序的数组中最大和最小的元素
2. 统计数组中每个值为 i 的元素出现的次数,存入数组 C 的第 i 项
3. 对所有的计数累... | ALGO | 0.999965 | 5.637276 | {
"github_metadata": {
"branch": "master",
"commit_count": 372,
"repo_created_at": "2018-02-09T09:49:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36377,
"forks": 8072,
"issues": 24,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
cb8aff83-78b7-4cc3-bdd2-429579c7000f | ShahjalalShohag/code-library | Graph Theory/ST Numbering.cpp | #include<bits/stdc++.h>
using namespace std;
const int N = 3e5 + 9;
/*An st-numbering of G with two designated vertices s and t is an assignment of
the integers from 1 to n to the vertices of G, such that
1. each vertex is assigned a distinct number,
2. s is assigned the number 1,
3. t is assigned the num... | ALGO | 0.999986 | 3.91096 | {
"github_metadata": {
"branch": "main",
"commit_count": 952,
"repo_created_at": "2018-11-18T08:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3240,
"forks": 840,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "9afbc... |
a0187aff-5c54-4de4-aec9-63a3ac8e9c32 | tempure/algorithm-advance | OJ/codeforces/722_div2/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
typedef vector<int> vi;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
mt19937 mrand(random_device{}());
const ll mod = 1000000007;
int rnd(int x) {... | ALGO | 0.999936 | 4.643275 | {
"github_metadata": {
"branch": "master",
"commit_count": 1297,
"repo_created_at": "2020-11-16T08:58:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d29808... |
aad201d6-0a37-4ff9-8c19-63e3ea9754d4 | TechMusab/Data-Structures-Algorthims | Day1/patterns.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
// int i=1;
// while (i<=n){
// int j=1;
// while (j<=n){
// cout <<"* ";
// j++;
// }
// cout<<endl;
// i++;
// }
// int i=1;
// while (i<=n){
// int j=1;
// while (j<=n){
// cout << n-j+1 <<" " ;
... | ALGO | 0.999977 | 3.577659 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2025-04-13T07:27: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": "96e4296b793... |
52dc15f3-05c7-40c6-8cbc-d01054b86c83 | rlaehgnss/USACO | 2022 US Open/Silver 2.cpp | #include <bits/stdc++.h>
using namespace std;
char s[101010], t[101010], ans[101010];
int Q, lens, lent, ssum[101010][18] = {{0}}, tsum[101010][18] = {{0}}, imp_1[18] = {0}, imp_2[18][18] = {{0}};
int main() {
scanf("%s %s %d", s, t, &Q);
lens = strlen(s);
lent = strlen(t);
for (int i = 0; i < lens; i++) {... | ALGO | 0.99992 | 3.467886 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2022-02-26T07:40:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3cd9157bc86... |
37a40c5a-9de3-41c1-9632-2b776ab33379 | kumyiheng/kumyiheng.github.io | itsa/C_MM37(done)/C_MM37.cpp | #include <iostream>
using namespace std;
int main() {
int x = 0, y = 0;
while (cin >> x >> y) {
if (x == 0 && y == 0) {
cout << "Origin" << endl;
} else if (x > 0 && y > 0) {
cout << "1st Quadrant" << endl;
} else if (x < 0 && y > 0) {
cout << "2nd Q... | ALGO | 0.999915 | 4.259531 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2021-09-26T03:42:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c89a96a77... |
8187bb58-60bf-4520-8855-205de9a3a133 | bkamplai/CSCI-111 | Class_Examples/CSCS_111_files-up_to_10_1_2021[31]/arr_starred_contour.cpp | #include <iostream>
using namespace std;
/*
******************************************************************
* Generate and odd-size side-length square (2-D) array
* with its contour (4 sides ) starred.
******************************************************************
*/
#define AND &&
#define OR ||
#define NOT_EQU... | ALGO | 0.997302 | 3.845079 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-01T17:42: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": "f89b5dfe818c... |
a6063b43-5378-49d1-b7e0-81d652a81f15 | Himanshi1207/DSA_2022 | 2022/Gfg/Nov/14Find_Patterns.cpp | // Given two strings S and W. Find the number of times W appears as a subsequence of string S where every character of string S can be included in forming at most one subsequence.
// Example 1:
// Input:
// S = "abcdrtbwerrcokokokd"
// W = "bcd"
// Output:
// 2
// Explanation:
// The two subsequences of str... | ALGO | 0.999977 | 5.12071 | {
"github_metadata": {
"branch": "main",
"commit_count": 98,
"repo_created_at": "2022-01-10T07:29: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": "42378d9472e... |
b91f0e29-0adc-4d91-aca1-b5433814905c | nebulaM/Algorithm | leetcode/96_uniqueBST.cc | /**
* Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
* Solution obtained from
* https://discuss.leetcode.com/topic/8398/dp-solution-in-6-lines-with-explanation-f-i-n-g-i-1-g-n-i
*/
int numTrees(int n) {
//http://stackoverflow.com/questions/3082914/c-compile-error-... | ALGO | 0.999859 | 6.248908 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2017-01-21T03:12: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": "317072e11... |
9f4c273d-b926-4e73-961c-929bd34f957b | Sa3dClay/hackerrank | Halloween party/main.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
/*
* Complete the 'halloweenParty' function below.
*
* The function is expected to return a LONG_INTEGER.
* The function accepts INTEGER k as parameter.
*/
long halloweenParty(int k) {
long pieces = k/... | ALGO | 0.999905 | 5.82349 | {
"github_metadata": {
"branch": "master",
"commit_count": 93,
"repo_created_at": "2022-02-14T15:50:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69a59db8e... |
30c72947-a5f3-48f2-abff-e97e86bb3b6e | tarunlahrod/Algorithms | Lenght of a loop.cpp | //using slow and fast pointer approach to find the length of a loop in a linked list.
#include<iostream>
using namespace std;
//basic node element structure with 1. Data and,
//2. Pointer to store the address of the next node.
struct node
{
int data;
node *next;
} *head; // head pointer, stores the address of t... | ALGO | 0.999934 | 5.242813 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2018-11-18T15:41:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c062e584d... |
b28b5d35-532c-4432-be9e-2b56953e13ce | Vspack1/Con-tro-BTVN | bai1.cpp | #include <iostream>
using namespace std;
int main() {
// a. Khai báo 2 biến x và y kiểu số nguyên.
int x, y;
// b. Khai báo con trỏ p để trỏ đến biến kiểu số nguyên.
int *p;
// c. Cho con trỏ p trỏ đến x.
p = &x;
// d. Con trỏ p nhận giá trị lưu trữ là 80.
*p = 80;
... | TOOL | 0.967978 | 3.878891 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-08T00:50:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "944457696043... |
17c93d6f-7d75-4d09-a9b6-726d0d89b47e | metaflow/contests | uva/chapter_8/10717.cc | #include<bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using ii = pair<int,int>;
using vii = vector<ii>;
using vvi = vector<vi>;
using ll = long long;
using llu = unsigned long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vd = vector<double>;
using vvd = vector<vd>;
using vll = vector<ll>... | ALGO | 0.999879 | 3.298424 | {
"github_metadata": {
"branch": "master",
"commit_count": 415,
"repo_created_at": "2014-05-12T04:59:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "544d2677... |
6696da9d-1f64-487f-b7c8-a32529c06fed | Sirisap22/com_fun_weekly_assignment | week_7/assignment_1/assignment_1/Source.cpp | #include <iostream>
#define ll long long
using namespace std;
// leetcode 11.Container With Most Water
ll findArea(ll a, ll b, ll* arr) {
if (a == b) return 0;
ll maxHeight = *(arr + a) > * (arr + b) ? *(arr + b) : *(arr + a);
return (b - a) * maxHeight;
}
ll maxArea(ll* arr, ll size) {
ll ans = 0;
for (ll i = ... | ALGO | 0.999709 | 4.500879 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-08-16T11:42: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": "46161d788... |
1c4242ae-1844-48cc-98a0-009122acde9b | arsmx/ITMO | algorithms and data structures 2nd sem/10/B-spantree_1.cpp | #include <fstream>
#include <cmath>
#include <iomanip> // для setprecision
using namespace std;
class CApex {
public:
int x = 0;
int y = 0;
float distToMate(const CApex & second) { // расст до точки, которую подаем
return sqrt((second.x - x) * (second.x - x) +
(second.y - y) *(second.y - y)... | ALGO | 0.999743 | 3.907469 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-07-26T02:25: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": "201cd878e6f4... |
c9c02eec-a037-4ac8-977b-a1154f0ea1c6 | ideometre/BigMax | informatique/code source/bigmax_final/bigmax_final.ino | #include <Wire.h>
#include <VL53L0X.h>
#define xshut_right 12
#define xshut_left 13
VL53L0X tof_right;
VL53L0X tof_left;
// pin numbers input
const int btn_pin = A0;
const int micro_start = 4;
const int line_right = A6;
const int line_left = A7;
const int coder_right_a = 2;
const int coder_right_b = 7;
const int cod... | TOOL | 0.935006 | 4.927805 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2018-04-10T07:20:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "71fad2ea0d... |
e9798a00-0379-41dd-b5c6-a55ce8b311c7 | hallstattmia/usaco_code | 20DEC/P/2.cpp | #include <bits/stdc++.h>
using namespace std;
template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
while(*sdbg!=',')cerr<<*sdbg++;
cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}
template<class T> ostream &operator<... | ALGO | 0.999498 | 4.504096 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-12-23T12:45:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "27176316f5... |
dd987022-6641-4d37-842c-3baed8a5b965 | bank2014/Automata | Automata/소스.cpp | #include <iostream>
#include <stack> // stack<>
#include <string>
#include <vector>
using namespace std;
class node {
public:
char state;
int input;
node* next;
};
int OperatorPriority(char c)
{
if (c == '*') {
return 3;
}
else if (c == '.') {
return 2;
}
else if (c == '|') {
return 1;
}
else {
r... | ALGO | 0.999893 | 4.697878 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-11-11T14:31:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fcae6a44aeba... |
e6f2315d-e6ac-4931-85a5-16feccfcd435 | 26F/data_structures_cpp | linkedlist/linkedlist.cpp |
#include "linkedlist.h"
// Constructor
Node::Node(int value) : value(value), next(NULL) {}
// get value from Node
int Node::getValue(void)
{
return value;
}
// set Nodes value
void Node::setValue(int val)
{
value = val;
}
// get next node
Node* Node::getNext()
{
return next;
}
// set Node's next nod... | ALGO | 0.986613 | 4.383784 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-06-29T04:02:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d93adcd71c1... |
c952e353-ba43-4797-9938-9bebf4df233d | parthh1112/basic-programming | cbRecursion02.cpp |
// fibonaci numbers
// #include <bits/stdc++.h>
// using namespace std;
// int fibo(int n){
// if(n == 0 || n == 1)return n;
// return (fibo(n-1) + fibo(n-2));
// }
// int main(){
// int n;cin>>n;
// cout<<fibo(n)<<endl;
// return 0;
// }
// find all subsequence
// #include <bits/stdc++.h>
// using n... | ALGO | 0.999958 | 4.279001 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-09-10T19: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": "f3c254187e... |
cae10e15-512b-468f-8a60-8992765931c0 | Algorithms-and-Data-Structures-2021/semester-work-merge-and-insertion-sort | benchmark/merge_sort_benchmark.cpp | #include <fstream> // ifstream
#include <iostream> // cout
#include <string> // string, stoi
#include <string_view> // string_view
#include <chrono> // high_resolution_clock, duration_cast, nanoseconds
#include <vector>
#include <algorithm>
#include "merge_sort.hpp"
using namespace std;
using na... | ALGO | 0.963369 | 5.282602 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-05-15T10:43:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e7df7e142c3... |
414c40b9-42f1-44d0-bf34-40a6e29a7664 | Bryan1203/LiDAR-Based-Lane-Navigation | src/kiss-icp/cpp/kiss_icp/core/Registration.cpp | // MIT License
//
// Copyright (c) 2022 <NAME>, <NAME>, <NAME>, <NAME>.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// t... | ALGO | 0.99741 | 7.203834 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2024-10-31T16:21:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd022bea1... |
b30438d9-5ff0-4ba4-9edf-11a6947618ea | MFurkanATES/Antenna-Tracker | tb6600/servo_kodu_calisan.cpp | #define pwm_signal_in 1
#define pwm_signal_in_pin 3
#define neutral_pwm 1500
#define dirPin 6
#define stepPin 7
volatile int n_pwm_in = neutral_pwm;
volatile unsigned long ul_start_period = 0;
volatile boolean b_new_pwm_signal = false;
int delay_time = 10;
int set_speed = 0;
int duration = 0;
void setup()
{
... | ALGO | 0.998505 | 5.343264 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-04-27T19:35: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": "0684e06448... |
3d5ff9fb-5e1e-42ea-8d3c-160f470d2604 | SachaEpskamp/psychonetrics | src/02_algebrahelpers_modelMatrix_cpp.cpp | // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
// we only include RcppArmadillo.h which pulls Rcpp.h in for us
#include <RcppArmadillo.h>
#include <math.h>
#include <vector>
#include <pbv.h>
#include <cmath>
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
using namespace ... | ALGO | 0.999548 | 6.029289 | {
"github_metadata": {
"branch": "master",
"commit_count": 510,
"repo_created_at": "2019-02-12T19:43:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 5,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "9199f8... |
a249ae4f-65fa-4cc8-bd43-2d8547a1a3d7 | RahmanKhorramfar91/Subtree-Decomposition-for-Multistage-SP | MCAP-GDP-DE/Functions.cpp |
#include "Functions.h";
vector<int> GetRho(int m, int n) {
std::vector<int> Pred = ProblemData::Pred;
std::vector<int> rho;
if (n == 0) { rho.push_back(m); return rho; }
if (n == m) { rho.push_back(m); return rho; }
rho.push_back(m); rho.push_back(n);
int prec = Pred[n];
while (prec != m)
{
rho.push_back(... | ALGO | 0.999028 | 3.734035 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-11-06T16:03: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": "ca47ad7a90... |
1c339d64-a195-4a5f-ae98-38ad6f5f13ef | ishandutta2007/codeforces-s | subscriber/normal/464/A.cpp | #include<stdio.h>
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<memory.h>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<sstream>
#include<cstring>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define SS stringstream
#define sqr... | ALGO | 0.999972 | 3.248383 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca5460977c73... |
bbba926f-d1b3-4fcc-a37a-6f7c4ee837f2 | ChaoticCross12/CodeForces | 490A_TeamOlympiad.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int numOfStu;
vector<int> holder1;
vector<int> holder2;
vector<int> holder3;
cin >> numOfStu;
int stuArr[numOfStu], counter1 = 0, counter2 = 0, counter3 = 0;
for (int i = 0; i < numOfStu; i++)
{
ci... | ALGO | 0.99993 | 3.551653 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2020-09-01T22:54: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": "6769eb637... |
16c66506-529c-42f2-ba48-0ea23b1ec438 | sam82arth/codeStocker | HIRINGWO.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
vector<int> store;
vector<int> factors;
int num_to_bits[16] = { 0, 1, 1, 2, 1, 2, 2, 3,
1, 2, 2, 3, 2, 3, 3, 4 };
unsigned int countSetBitsRec(unsigned int num)
{
int nibble = 0;
if (0 == num)
return num_to_... | ALGO | 0.99971 | 4.40848 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-04-12T05:20: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": "d3e536ab66f8... |
a935a43a-e0fc-4570-a8da-ddbabaa95132 | ailanaki/parallelProgramming | lab1/lab1.cpp | #include <iostream>
//#include "tbb/parallel_invoke.h"
//#include "tbb/task_scheduler_observer.h"
//#include "tbb/flow_graph.h"
#include <random>
#include <chrono>
#include <cassert>
//#pragma once
class quicksort {
int BLOCK = 1000;
std::random_device rd;
std::mt19937 gen{rd()};
int n = 1000 * 1000 *... | ALGO | 0.999261 | 4.84102 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-03-02T14:35: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": "c574b7dc2a... |
73e5f4f0-dd96-4b1b-b2c2-bb8f72eea1fd | moalhayek/programming_methodology2 | Project 2/PM2 Project 2/PM2 Project 2/Graph.h | // Graph.h
// PM2 Project 2 Graph Class
#ifndef Graph_h
#define Graph_h
#include <vector>
#include <iostream>
using namespace std;
// struct for each weighted directed edge which points from src to dest
struct Edge{
int src;
int dest;
int weight;
};
class Graph{
private:
vector< vector<int> > adj... | ALGO | 0.996547 | 3.2507 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-07-23T20:15: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": "048995bfe2... |
070b2e3e-cec1-491b-8ad0-51320baf48fb | blazerzar/advent-of-code | 2021/day_25.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cassert>
/* Move all cucumbers in the selected herd */
void move_cucumbers(const std::vector<std::string> &cucumbers,
std::vector<std::string> &moved, char herd) {
for (int y = 0; y < cucumbers.size(); ++y) {
for (int x ... | ALGO | 0.999983 | 5.720309 | {
"github_metadata": {
"branch": "main",
"commit_count": 126,
"repo_created_at": "2020-12-04T16:54:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "923a34fd3c... |
8d170679-72e4-4a60-8d05-0244decc52ec | Anguei/OI-Codes | LuoguCodes/CF978D.cpp | //【CF978D】Almost Arithmetic Progression - 洛谷 - Ac
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
const int kMaxN = 100000;
int b[kMaxN + 5], a[kMaxN + 5];
//int x[] = {0, 0, 1, -1};
/*
int work()
{
int res = 0;
int dis = a[2] - a[1];
for (int i = 3; i <= n; ++i)
{
a[i] = a[i - 1... | ALGO | 0.999962 | 3.570924 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-14T14:22: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": "bfb8154864... |
71b7cfc6-f209-4873-b7d1-9ae7c0266ad0 | luckiness/List | list.h | #pragma once
#include<iostream>
using namespace std;
typedef int DataType;
struct Node
{
DataType _data;
struct Node * _next;
Node(const DataType &d)
:_data(d)
,_next(NULL)
{
}
};
class Slist
{
friend ostream & operator<<(ostream &os,Slist &s);
public:
//构造链表
Slist()
:_head(NULL)
,_tail(NUL... | ALGO | 0.998275 | 4.206285 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-05-20T00:33:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c3c65f9fb... |
d9cd5124-651f-415c-b55a-6efeac1cf167 | deep-astaad/codeforces | Mar 2023/C_Sum_on_Subarrays.cpp | /* Code by : <NAME> (deep_aman) */
#include <bits/stdc++.h>
using namespace std;
#define deep_aman ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define int long long int
void solve()
{
int n, k; cin >> n >> k;
int cnt = -1;
for (int i = n; i > 0; --i)
{
if (k == 0) {
cout << cnt-- << ' ';
... | ALGO | 0.999849 | 4.032701 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2022-07-21T20:23: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": "fa8d51148df... |
59bd7b03-c60c-447a-ab59-a9ddae06dc85 | FanTuani/ACM-Training-Plan | Practice_Records/RiceQuakes/Templates/线段树+树剖维护路径子树和.cpp | // 线段树+树剖维护路径子树和
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 2e5 + 10, INF = 0x3f3f3f3f3f3f3f;
int n, q, root, mod, t[4 * N], mk[4 * N], top[N], hson[N], dep[N], dn[N], a[N],
fa[N], sz[N], b[N], mxdn[N], cnt;
void build(int l, int r, int pos = 1);
void push_down(int pos, int c... | ALGO | 0.999962 | 4.512135 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2024-01-05T04:42:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4019fa5c68... |
929af230-0d7d-4387-ae3c-cc876652bb60 | HamdyAbdELFatah/Problem-Solving | Codeforces/216-B/216-B-116511529.cpp | //============================================================================
// Author : <NAME> <NAME>
// Code is like humor. When you have to explain it, itís bad.
//============================================================================
#include <bits/stdc++.h>
#define FIO cin.tie(0), cin.sync_with_stdio(... | ALGO | 0.999762 | 4.010359 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2020-12-09T13:18: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": "133147fd150... |
0d4ed440-a137-4201-a1b3-58710ea3b824 | FlorianPommerening/deletefree-incremental-lmcut | src/steinertreeImprove.h | #ifndef STEINERTREEIMPROVE_H_
#define STEINERTREEIMPROVE_H_
#include "Variable.h"
#include "RelaxedOperator.h"
#include "RelaxedTask.h"
#include <vector>
typedef std::pair<const RelaxedOperator *, Variable *> PlanSetEntry;
typedef std::vector<PlanSetEntry> PlanSet;
/*
* Finds a plan with cost h^FF/add
* and retur... | ALGO | 0.998693 | 3.287304 | {
"github_metadata": {
"branch": "master",
"commit_count": 161,
"repo_created_at": "2020-06-24T11:04: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": "acede5ec... |
cee5b180-3c54-4e43-9138-6cdcc271d86c | florinpavelescu15/Solved-Problems-on-Algorithm-Design-Techniques | prinel.cpp | #include <fstream>
#include <vector>
#include <climits>
#include <cmath>
using namespace std;
// problema rucsacului discontinuu
int rucsac(int N, int W, vector<int> &w, vector<int> &p) {
// inainte de a incepe, verific daca nu cumva
// toate obiectele pot fi introduse in rucsac
// in acest caz, returnez ... | ALGO | 0.999929 | 3.821928 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-03-02T15:49: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": "0a5a842b897b... |
ca6897f1-96f8-4c55-9da4-2501cebe4911 | kuhaku-space/atcoder-submissions | code/abc/abc261/abc261_f.cpp | #line 1 "a.cpp"
#define PROBLEM ""
#line 1 "/home/kuhaku/home/github/algo/lib/algorithm/inversion_number.hpp"
#include <algorithm>
#include <iterator>
#line 4 "/home/kuhaku/home/github/algo/lib/algorithm/compress.hpp"
#include <vector>
/**
* @brief 座標圧縮
*
* @tparam T 要素の型
*/
template <class T>
struct coordinate_co... | ALGO | 0.999967 | 5.392688 | {
"github_metadata": {
"branch": "main",
"commit_count": 446,
"repo_created_at": "2022-05-21T07:48: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": "0578a890c2... |
624ad40e-6dda-43ed-9471-03fcfcb5874b | jolars/hesso-r | inst/include/hesso/hesso/lasso.hpp | #pragma once
#include "math.hpp"
#include "objective.hpp"
#include "results.hpp"
#include "solver.hpp"
#include "update_hessian.hpp"
#include "utils.hpp"
#include <Eigen/Core>
#include <Eigen/Eigenvalues>
#include <boost/dynamic_bitset.hpp>
#include <iostream>
#include <vector>
namespace hesso {
template<typename T,... | ALGO | 0.996909 | 6.147295 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2022-04-23T20:11: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": "fe686f63463... |
dada2254-a802-48b0-a130-a02e50aa781c | fhiroki/atcoder | VirtualContest/20200517/abc075/c/main.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int n, m;
bool visited[50];
bool graph[50][50];
void dfs(int v) {
visited[v] = true;
rep(v2, n) {
if (!graph[v][v2] || visited[v2]) continue;
dfs(v2);
}
}
int main() {
cin... | ALGO | 0.999966 | 3.792294 | {
"github_metadata": {
"branch": "master",
"commit_count": 416,
"repo_created_at": "2020-03-07T08:44: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": "9782d99e... |
d9633388-8064-4d4a-aa96-daf95915ce0a | HackerTrackerBlood/CPP_PTIT | CPP0311.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define foru(i, a, b) for (int i = a; i <= b; ++i)
#define ford(i, b, a) for (int i = b; i >= a; --i)
#define fill(a, b) memset(a, b, sizeof(a))
#define all(v) v.begin(), v.end()
#define ii pair<int, int>
const int mod = 1e9 + 7;
int main()
{
ios_... | ALGO | 0.999985 | 4.078633 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-09-15T13:42: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": "aec493479bcc... |
fe99ba24-b28e-4eb0-bbfa-b2ffbd9a0ecd | Seairth/AoC2021 | src/day13.cpp | #include <stdio.h>
#include <string.h>
#include <string>
#include <fstream>
#include <algorithm>
#include <map>
#include <vector>
#include <list>
using namespace std;
#define DAY "13"
#define INPUT_FILENAME "../input/day" DAY ".txt"
#define INSTRUCTION_PREFIX "fold"
#define EMPTY_SYMBOL ' '
#define DOT_SYMBOL '#'
s... | ALGO | 0.999513 | 4.542623 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-11-26T16:33: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": "2e465738e92... |
6156e45e-92a5-406f-9f34-e31407f64055 | RummeniggePires/Projeto-C | Lista_Encadeiada/main.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
typedef struct lista{
int info;
struct lista* prox;
}Lista;
Lista* lst_criar(void){ //o void significa que nao sera passado nenhum parametro.
return NULL; // retorna nulo para criar a variavel com valor nulo(zerado).
}
Lista* lst_inserir(Lista *l, i... | ALGO | 0.995768 | 4.183418 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2016-04-09T22:59: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": "e9d34d45c... |
81e9dccf-6480-4076-a23e-2165c22df098 | coder-writes/tree-notes | 32findNumberOfNodes.cpp | #include <bits/stdc++.h>
using namespace std;
struct TreeNode
{
int data;
struct TreeNode* left;
struct TreeNode* right;
TreeNode(int val)
{
data = val;
left = NULL;
right = NULL;
}
};
int counter(TreeNode* root,int &cnt){
if(root==nullptr) return 0;
cnt+... | ALGO | 0.999867 | 5.05602 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-06-23T05:47:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdf46b06ee59... |
ebfe1189-7017-4ab1-9d47-6338e88ab47a | AnkitJha-03/CS-Playground | Mutual-Exclusion/Producer-Consumer/problem.cpp | #include <windows.h>
#include <condition_variable>
#include <iostream>
#include <mutex>
#include <thread>
// THIS IS WRONG IMPLEMENTATION OF PRODUCER-CONSUMER PROBLEM
const int N = 5; // Buffer size
int count = 0; // Shared variable (unsafe)
// Condition variable and mutex for conditional wake-up
std::condition... | ALGO | 0.995041 | 5.817045 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-06-24T15:06:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3af665f58cb1... |
be5a191a-fdae-4805-bb99-6a8fe69fb773 | SkyLoaderr/xray-engine-repo | Dima/bge.root/bge/bge/othello_classic_board_try_move.cpp | ////////////////////////////////////////////////////////////////////////////
// Module : othello_classic_board_try_move.cpp
// Created : 08.12.2004
// Modified : 08.12.2004
// Author : <NAME>
// Description : Othello classic board try move implementation
///////////////////////////////////////////////////////////... | ALGO | 0.990859 | 5.821271 | {
"github_metadata": {
"branch": "master",
"commit_count": 83977,
"repo_created_at": "2021-04-21T18:03:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9796... |
c09eb698-c630-4684-9ee3-9faafdf6689e | lovebaonvwu/leetcode-cpp | 2021/decode_the_slanted_ciphertext.cc | class Solution {
public:
string decodeCiphertext(string encodedText, int rows) {
int cols = encodedText.size() / rows;
string ans;
for (int j = 0; j < cols; ++j) {
for (int i = 0, k = j; i < rows && k < cols; ++i, ++k) {
ans += encodedText[i * cols + k];
}
}
while (ans.back... | ALGO | 0.999241 | 6.619829 | {
"github_metadata": {
"branch": "master",
"commit_count": 2622,
"repo_created_at": "2019-04-21T11:29:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90b6e40... |
77e07064-e079-479b-ab3a-6d7a277e5b4d | GauravJha-Git/CPP | gfg/2.cpp | // You are given an array arr[] of non-negative integers. Your task is to move all the zeros in the array to the right end while maintaining the relative order of the non-zero elements. The operation must be performed in place, meaning you should not use extra space for another array.
// Examples:
// Input: arr[] = [... | ALGO | 0.999905 | 6.336177 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2025-03-18T20:19:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2794ee6944... |
be390171-839f-4f40-a569-0b109a77c5ff | ATeletubby/PAT-Advanced | pat_advanced/1004.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
using namespace std;
struct node{
int k = 0; // 子结点数量
vector<string> CID; // 子节点ID
};
int main(){
int N, M;
cin >> N >> M;
map<string, node> trees; // RID -> node(k... | ALGO | 0.999929 | 3.406273 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-02-23T16:36:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c997b1ad6... |
569dd6a0-8f3b-455c-b838-eb209f74c859 | saksham-kapoor/DSA-Prep | DP-patterns/Decision-Making/03-house-robber-3.cpp | // Bottom Up manner
class Solution
{
int *solve(TreeNode *root)
{
int *res = new int[2];
if (!root)
{
res[0] = 0, res[1] = 0;
return res;
}
int *left = solve(root->left);
int *right = solve(root->right);
res[0] = max(left[0], lef... | ALGO | 0.999994 | 5.923145 | {
"github_metadata": {
"branch": "main",
"commit_count": 528,
"repo_created_at": "2020-12-23T03:18:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d119d398... |
68c02d00-7b5a-4336-8adf-b5ba0d52cc9a | devjangdae/BOJ | 백준/Bronze/9297. Reducing Improper Fractions/Reducing Improper Fractions.cc | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t; cin >> t;
for (int i = 1; i <= t; i++) {
int num, den; cin >> num >> den;
int quotient = num / den;
num %= den;
cout << "Case " << i << ": ";
if (quotient == 0) {
if ... | ALGO | 0.998459 | 5.799596 | {
"github_metadata": {
"branch": "main",
"commit_count": 682,
"repo_created_at": "2023-05-09T14:12: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": "6e1300fc23... |
bea3c8fa-df47-4abd-80ab-50b30dc5ae95 | hehe520/Data-structure-and-algorithm | 递归_分治_回溯_搜索/连连看 - 广搜.cpp |
/* 连连看 广搜 杭电 1175 题
输入数据有多组。每组数据的第一行有两个正整数n,m(0<n<=1000,0<m<1000),
分别表示棋盘的行数与列数。在接下来的n行中,每行有m个非负整数描述棋盘的方格分布。
0表示这个位置没有棋子,正整数表示棋子的类型。接下来的一行是一个正整数q(0<q<50),
表示下面有q次询问。在接下来的q行里,每行有四个正整数x1,y1,x2,y2,
表示询问第x1行y1列的棋子与第x2行y2列的棋子能不能消去。n=0,m=0时,输入结束。
注意:询问之间无先后关系,都是针对当前状态的!
Sample Input
3 4
1 2 3 4
0 0 0 0
4 3 2 1
4
1 1 3 4
... | ALGO | 0.999511 | 3.686633 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-08-12T00:51:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 160,
"forks": 76,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd958d6... |
76b33615-5497-4b98-9a11-38325b2047be | Consensys/zsl-q | zsl-golang/zsl/snark/libsnark/src/algebra/evaluation_domain/domains/extended_radix2_domain.tcc | /** @file
*****************************************************************************
Implementation of interfaces for the "extended radix-2" evaluation domain.
See extended_radix2_domain.hpp .
*****************************************************************************
* @author This file is part of lib... | ALGO | 0.995577 | 7.263589 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-10-17T04:27:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 73,
"forks": 33,
"issues": 2,
"pull_requests": 2
},
"file_meta": {
"content_id": "cab719f46... |
e5d99311-594f-4e80-99ad-cf5341bbfb74 | jerrysun2004/LeetCode | minimumpathsum.cpp | //November 30th, 2022
class Solution {
public:
int minPathSum(vector<vector<int>>& grid) {
//another classic dp like problem
//start from top iterate from right and bottum
//if not corner dp[m][n]=dp[m-1][n]+dp[m][n-1]
//if corner dp[m][n]=dp[m-1][n] if left side
//dp[m][n... | ALGO | 0.999954 | 5.593858 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-12-07T01:14: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": "2b12260b054a... |
74a9ec98-db43-46d5-a1e5-9b54ee342029 | martinrey/algoritmos-3 | TP1/ej2b/src/tester.cpp | /**
@file tester.cpp
@brief Tester de puentes
@author <NAME>
@date 2014.08.16
*/
// std
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <stdint.h>
#include "solucion.h"
using namespace std;
void test(const string& input, const string& output) {
cout << "#### TEST" << endl << "in... | TEST | 0.987043 | 3.959868 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-12-19T04:16: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": "a096928209... |
5e97bb2e-9b59-447e-b6fa-1ed23f827f6c | Pulkith/Competitive | School/UTD2022Spring/b.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int N; cin >>N;
int cnt = 0;
vector<string> reps = {
"Wow! Either you got incredibly lucky or you are cheating!"
"Impressive! That didn't take you very long."
"Nice! Not ba... | ALGO | 0.999845 | 3.268297 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2021-04-25T17:34: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": "5de68b175... |
2cb1f0fc-9fbb-4285-abca-62c0503e5cd2 | vaibagga/Competitive-Questions | two_strings/main.cpp | /*
Given two strings of equal length, you have to tell whether they both strings are identical.
Two strings S1 and S2 are said to be identical, if any of the permutation of string S1 is equal to the string S2. See Sample explanation for more details.
Input :
First line, contains an intger 'T' denoting no. of tes... | ALGO | 0.999992 | 5.85327 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-01-27T16:04:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "185398cd34... |
f7ebe4f8-b030-42bf-8d57-6a9ee853047e | mjt123/leecode | source/permutations_ii_main.cpp | #include "common/headers.h"
class Solution {
private:
vector<vector<int>> res_;
vector<bool> vis_;
void dfs(vector<int>& nums, vector<int>& temp, int cur) {
if (cur == nums.size() ) {
res_.emplace_back(temp);
return ;
}
for (int i = 0; i < nums.size(); ++i) {
if (vis_[i] || (i > 0 ... | ALGO | 0.999982 | 5.919522 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-08-06T07:29: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": "68e27f61a25... |
7e02609b-d4c0-40c3-abd8-f2035c64a603 | ravi-prakash1907/OS-Practicals | Practical10.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#ifdef __linux__
#define CLRSCR "clear"
#else
#define CLRSCR "cls"
#endif
using namespace std;
class PreemptivePriorityScheduler;
class process
{
int processId;
int arrivalTime;
int burstTime;
int turnAroundTime;
int wai... | ALGO | 0.999907 | 5.811593 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-11-23T16:44:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d99ceeb7... |
cf39026d-8e19-4549-a294-7868402d7909 | CarlosManuelRodr/ProgramacionCientifica-UV | Unidad 4- Visualización de relatividad general/SchwarzschildRayTracer/Source/Sphere.h | #pragma once
#include "Hitable.h"
/**
* @brief Función auxiliar para calcular las coordenadas UV de la esfera en el punto de colisión.
* @param p Posición de la colisión
* @param u Variable donde se almacena la coordenada U
* @param v Variable donde se almacena la coordenada V
*/
void get_sphere_uv(const Vector3& p, f... | ALGO | 0.975322 | 6.324965 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-09-18T19:49:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc9b9f695... |
95388fba-e809-42b4-84a5-55984f6a94f2 | feixh/VISMA-tracker | tracker/oned_search.h | //
// Created by feixh on 10/24/17.
//
#pragma once
// stl
#include <vector>
#include <iostream>
// 3rd party
#include "opencv2/core/core.hpp"
#include "tbb/blocked_range.h"
// own
#include "utils.h"
namespace feh {
struct EdgePixel {
float x, y, dir, depth;
static const int DIM = 4;
};
static EdgePixel I... | ALGO | 0.999179 | 5.204365 | {
"github_metadata": {
"branch": "devel",
"commit_count": 167,
"repo_created_at": "2018-03-02T17:30:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd720258... |
51d0b1dd-99b8-48a1-959b-ce18152a8afd | teleport1995/shad_algorithms_2015 | 2_12/A.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <algorithm>
using std::cin;
using std::istream;
using std::ostream;
using std::cout;
using std::vector;
using std::max;
using std::map;
class Node
{
public:
int left, right;
vector < int > sorted;
Node()
{
}
Node(int left, int r... | ALGO | 0.999963 | 4.786567 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-02-20T11:08: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": "34216e11a4... |
61f35e16-4855-455e-acef-1856721a6bbd | manuelF/tesis | tesis/ferreriaDarago/trmm-in-xeon-experiment/partir.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
#include <sstream>
#include <cstdlib>
#include "timer.h"
#ifdef MAGMA
#include <magma.h>
#include <magma_lapack.h>
#include <magma_types.h>
#else
#include <mkl.h>
#endif
using namespace std;
#ifdef MAGMA
magma_queue_t queue;
magma_device_t device;
#endif
floa... | ALGO | 0.993276 | 4.115397 | {
"github_metadata": {
"branch": "master",
"commit_count": 1008,
"repo_created_at": "2013-11-18T14:28:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ae3127... |
1eece66b-6c7e-45ed-a613-1886531cd481 | Ujala-2110/DSA_Cpp | Graph/Practice_Graph/Wealth_Disparity.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
void dfs(ll v, vector<vector<ll>> &graph, vector<ll> &w, ll &ans, ll wealth)
{
for (ll child : graph[v])
{
ans = max(ans, wealth - w[child]);
dfs(child, graph, w, ans, max(w[child], wealth));
}
}
int ... | ALGO | 0.999964 | 3.954945 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-14T13:16: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": "b17a1fc23691... |
67355b8c-e798-4538-97a4-98387a49668c | MAPF-Competition/Start-Kit | default_planner/heuristics.cpp |
#include "heuristics.h"
#include <queue>
namespace DefaultPlanner{
std::vector<HeuristicTable> global_heuristictable;
Neighbors global_neighbors;
void init_neighbor(SharedEnvironment* env){
global_neighbors.resize(env->rows * env->cols);
for (int row=0; row<env->rows; row++){
for (int col=0; col<env->cols; co... | ALGO | 0.996582 | 4.291547 | {
"github_metadata": {
"branch": "main",
"commit_count": 429,
"repo_created_at": "2022-12-13T23:28:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 28,
"forks": 20,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "723205858... |
d0754da0-6e84-4ba2-914f-35dc9fbe5c34 | miteshkumar77/LC | course-schedule-ii/Accepted/7-18-2020, 4:19:11 PM/Solution.cpp | // https://leetcode.com/problems/course-schedule-ii
class Solution {
public:
vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) {
vector<int> indegree(numCourses, 0);
vector<vector<int> > graph(numCourses, vector<int>());
stack<int> toporder;
vector<bool> vis... | ALGO | 0.999992 | 6.330871 | {
"github_metadata": {
"branch": "main",
"commit_count": 208,
"repo_created_at": "2022-04-18T23:13:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26b9939541... |
91dff81c-68ee-4005-a521-89f8ed94d41e | ReiAccept/Algorithm | cf_gym/102823桂林站CCPC2018/G.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
int read() {
int x; scanf("%lld",&x); return x;
}
const int MAXN=1e5+3;
bool isprime(int x) {
if(x==1) return false;
if(x==2 || x==3) return true;
for(int i=2;i<=sqrt(x);i++) {
if(x%i==0) return false;
}
return true;
... | ALGO | 0.999849 | 3.336859 | {
"github_metadata": {
"branch": "master",
"commit_count": 292,
"repo_created_at": "2018-05-14T08:32:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9946a2fd... |
867c0b33-027a-417e-9f56-e3f362b85dd6 | stamplevskiyd/Simulation_Models | Task2/Task2.cpp | //#include <stdio.h>
#include <math.h>
//#include <stdlib.h>
#include <list>
#include <iostream>
using namespace std;
// Очень простой пример построения имитационной модели с календарём событий
// Модель "самодостаточная" - не используются библиотеки для организации имитационного моделирования
// Возможности С++ испо... | ALGO | 0.953557 | 4.526846 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2021-09-15T18:11: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": "8408f0c6882... |
7185b166-94d8-40bc-8d0d-a77e2ec78fd6 | acnokego/LeetCode | 826_Most_Profit_Assigning_Work/map.cpp | class Solution {
public:
/*
* Complexity: O(WlogD)
* Space: O(D)
*/
int maxProfitAssignment(vector<int>& difficulty, vector<int>& profit, vector<int>& worker) {
map<int, int>diff_max_profit;
// O(DlogD)
for(int i = 0; i < difficulty.size(); ++i){
if(diff_max_pr... | ALGO | 0.999836 | 5.732866 | {
"github_metadata": {
"branch": "master",
"commit_count": 359,
"repo_created_at": "2018-05-16T09:38: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": "164fe064... |
3239c4d9-726b-41ce-a5ab-14ace5324cd9 | rootkonda/LeetCode | 459. Repeated Substring Pattern.cpp | /**
Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase English letters only and its length will not exceed 10000.
https://www.youtube.com/watch?v=BXCEFAzhxGY
Idea is to use ... | ALGO | 0.999876 | 5.511365 | {
"github_metadata": {
"branch": "master",
"commit_count": 430,
"repo_created_at": "2020-04-11T11:28:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb21705f... |
5e3daf73-d3c6-4f9e-9936-ca785c6e3eac | GerardoBelic/UMAP-in-Cpp | dependencies/include/ezarpack/solver_asymmetric.hpp | /*******************************************************************************
*
* This file is part of ezARPACK, an easy-to-use C++ wrapper for
* the ARPACK-NG FORTRAN library.
*
* Copyright (C) 2016-2022 <NAME> <<EMAIL>>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2... | ALGO | 0.997878 | 7.603674 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-12-11T20:06: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": "04aef2602c30... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.