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 |
|---|---|---|---|---|---|---|---|
c2106414-163b-4ed7-a877-f5af23e4061b | jcazevedo/leetcode | src/3335-total-characters-in-string-after-transformations-i.cpp | // 3335. Total Characters in String After Transformations I
// https://leetcode.com/problems/total-characters-in-string-after-transformations-i/
#include <string>
#include <vector>
using namespace std;
#define MOD 1000000007L
#define MAXA 26
class Solution {
public:
int lengthAfterTransformations(string s, int t... | ALGO | 0.999976 | 5.911254 | {
"github_metadata": {
"branch": "master",
"commit_count": 709,
"repo_created_at": "2022-03-05T00:26: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": "690f25e8... |
d098ebaf-d953-4141-8636-52e22a07ba68 | rupav/cp | competitive_coding/contests/585/585C.cpp | #include<bits/stdc++.h>
using namespace std;
#define fr(i,n) for(int i=0; i<n; i++)
#define rep(i, st, en) for(int i=st; i<=en; i++)
#define repn(i, st, en) for(int i=st; i>=en; i--)
#define sq(a) (a*a)
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll mod = 1e9+7;
ll gcdll(ll a, ll b){
... | ALGO | 0.999969 | 3.527333 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-01-30T05:56: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": "beb814128e84... |
59884b5c-6f92-4d7b-878d-0e8a01856961 | lauraBaakman/Introduction-to-Computational-Science | code/Mud/gridsolver.cpp | #include "gridsolver.h"
GridSolver::GridSolver(Grid *grid, QObject *parent) :
QObject(parent),
grid(grid),
springConstantsMatrix(grid->numSprings(), grid->numSprings(), arma::fill::zeros),
adjacencyMatrix(grid->numSprings(), grid->numFreeParticles(), arma::fill::zeros),
signMatrix(grid->numFreePart... | ALGO | 0.999838 | 5.06313 | {
"github_metadata": {
"branch": "master",
"commit_count": 336,
"repo_created_at": "2018-02-25T14:50: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": "73c18f98... |
30fadbc6-ad20-4e61-9617-c758175c3d8b | cormoran/CompetitiveProgramming | src/contest/topcoder/SRM683div1/Active/ParenthesesDiv1Hard.cpp | #include <vector>
#include <iostream>
#include <stack>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
#define rep(i,j) for(ll i=0;i<j;i++)
#define repeat(i,j,k) for(ll i=(j);i<(k);i++)
#define all(v) v.begin(),v.end()
class ParenthesesDiv1Hard {
public:
string S;
int calc(int &now, int ... | ALGO | 0.99904 | 4.522181 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2016-08-18T12:24:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4797b9a1... |
fd135d7c-bfe6-4e08-986a-e7978092c9f7 | 1119-2916/vim-snippet | FFT.cpp | namespace FFT {
const double pi = M_PI;
std::vector<std::complex<double>> tmp;
size_t sz = 1;
std::vector<std::complex<double>> fft(std::vector<std::complex<double>> a, bool inv = false) {
size_t mask = sz - 1;
size_t p = 0;
for (size_t i = s... | ALGO | 0.999762 | 5.532718 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-10-27T07:41:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d71061419... |
444c6c35-edaa-4534-bc96-045a44a81c4b | zpc930/ImagePlat | OpenCVPlat/Canny.cpp | #include "stdafx.h"
#include "Canny.h"
#define min(a,b) (((a) < (b)) ? (a) : (b))
Canny::Canny()
{
}
Canny::~Canny()
{
}
int Canny::GaussBlur(cv::Mat& grayImage, double nSigma)
{
int nWindowSize = 1 + 2 * ceil(3 * nSigma);//通过sigma得到窗口大小
int nCenter = nWindowSize / 2;
int nWidth = grayImage.cols;
int nHeight =... | ALGO | 0.998756 | 4.269433 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2016-11-16T01: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": "a9d2c5599... |
2488300b-a873-49c1-9358-bc0584c637c0 | Kalpesh910/Problem-Solving | 2409. Count Days Spent Together.cpp | class Solution {
public:
int countDaysTogether(string arriveAlice, string leaveAlice, string arriveBob, string leaveBob) {
int alDa, alMa, bDa, bMa, alDl, alMl, bMl, bDl;
int a, b;
a = (arriveAlice[0]-'0')*10;
b = (arriveAlice[1]-'0');
alMa = a+b;
a = (arriveAlice[3]-... | ALGO | 0.999987 | 4.692547 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2022-08-07T19:27: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": "f25a664cc17... |
44564f97-b401-482d-a9d2-80a1a24c94ca | GamesTrap/TRAP | TRAP/src/ImageLoader/PortableNetworkGraphics/PNGImage.cpp | /*
LodePNG version 20230410
Copyright (c) 2005-2023 <NAME>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including com... | TOOL | 0.950826 | 3.211525 | {
"github_metadata": {
"branch": "master",
"commit_count": 1993,
"repo_created_at": "2019-05-27T21:07:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 1,
"pull_requests": 3
},
"file_meta": {
"content_id": "4c0f38b... |
5268ef31-da00-40f8-b9b4-453e12ebc572 | GAUTHAMPANDALA/Problem-Solving | Bit Manuplation/NumberisSpraseorNot.cpp | // Number is sprase or not //
// Given a number n find whether it is sprase or not => Eg: 12 => 1100, => it is not sprase because of 2 consecutive 1s.
// Sprase number is the number where no two or more consecutive bits are set.
// Algorithm:
// we can notice that if we can use bitwise AND of binary ... | ALGO | 0.999923 | 3.674663 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2020-07-11T08:48: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": "1355fcf89... |
44fa774b-b3a4-4019-a204-0a4f4f28c6e5 | CherryXiang/CPlusPractice | BigDataOperation/BigDataOperation/main.cpp | // 大整数减法处理
#include <iostream>
#include <string>
using namespace std;
// 只处理到ch1>=ch2的情况,ch1<ch2相减得负数的情况还未做处理
void substract(char* ch1, char* ch2)
{
int len1 = strlen(ch1);
int len2 = strlen(ch2);
int* a = (int*)malloc(len1*sizeof(int));
int* b = (int*)malloc(len2*sizeof(int));
// 将字符串类型的被减数和减数逆置存储到整形数组中
for... | ALGO | 0.999868 | 3.756641 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-02-04T08:01:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7d284d20c... |
9ee35e1c-cc52-48c7-968a-1e0311119526 | wh2per/SW-PRO-Algorithm | SW_PRO_Algorithm/사전A-0019(내고장내마을).cpp | #include <iostream>
#include <vector>
#include <climits>
#include <map>
#include <set>
#include <algorithm>
using namespace std;
// 단절선
vector<int> discoverd;
vector<int> ans;
int number;
vector<vector<pair<int, int>>> info;
// map<pair<int, int>, int> einfo;
int dfs(int here, int prev) {
discoverd[here] = ++number... | ALGO | 0.99996 | 4.115773 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2019-09-12T12:03:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f371fcdf... |
0197c089-12c2-4718-829e-d9f2cb1ef10a | Anjum219/Codeforces-problems-and-solutions | nastya_and_door.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t, n, k;
cin>>t;
for( int i = 0; i < t; i++ ){
cin>>n>>k;
int a[n];
for( int j = 0; j < n; j++ ){
cin>>a[j];
}
int peek[n];
for( int j = 1; j < n-1; j++ ){
if( a[j-1] < a... | ALGO | 0.999937 | 3.613394 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2021-06-07T10:27: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": "d7880f257... |
f5cfd5c4-a20c-47a7-bfcc-2a59f03ca191 | itsmedurgesh/Coding-Practice-CPP | imp_algos/prims_adjmat.cpp | #include <bits/stdc++.h>
using namespace std;
int minkey(vector<int> &key, vector<bool> &mstset, int V){
int min = numeric_limits<int>::max(), midx;
for(int i = 0; i < V; ++i){
if(!mstset[i] && key[i] < min){
min = key[i];
midx = i;
}
}
return midx;
}
void pri... | ALGO | 0.999992 | 5.318398 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-07-15T00:37:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb8765010e... |
abbb6426-8d49-4a78-adf1-ddbed136a377 | harshu-1728/LeetCode | Nuts and Bolts Problem.cpp | // Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Driver Code Ends
//User function template for C++
class Solution{
public:
void swap(char *a, char *b){
char temp = *a;
*a = *b;
*b = temp;
}
int partition(char *arr, int l, int r){
int i, j, temp;
... | ALGO | 0.999954 | 5.475525 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2020-12-28T03:40: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": "0b7ad22cb93... |
bb8bb0e1-8bed-47f0-b61d-f2315f1995a4 | HackerTrackerBlood/CPP_PTIT | CPP0135.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define foru(i, a, b) for (ll i = a; i <= b; i++)
#define ford(i, b, a) for (ll i = b; i >= a; i--)
#define ms(a, n) memset(a, n, sizeof(a));
int nt[1000006];
void sang()
{
nt[0] = nt[1] = 0;
foru(i, 2, sqrt(1000005))
{
if (nt[i])
... | ALGO | 0.99954 | 4.765169 | {
"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": "25e3a4852e91... |
929901c5-4ca2-4774-95b9-f094d72eda2a | cms-sw/cmssw | SimTracker/VertexAssociation/src/VertexAssociatorByTracks.cc | #include "SimTracker/VertexAssociation/interface/VertexAssociatorByTracks.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/Common/interface/Ref.h"
#include "DataFormats/Common/interface/RefToBase.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface... | ALGO | 0.970818 | 5.993984 | {
"github_metadata": {
"branch": "master",
"commit_count": 251237,
"repo_created_at": "2013-06-26T14:09:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1144,
"forks": 4480,
"issues": 947,
"pull_requests": 108
},
"file_meta": {
"content_id... |
348a3acf-edb4-46b6-9093-8f71355307c8 | diogjunior100/Competitive_Programming | Atcoder/Contest_391/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const ll oo = {1000000000000000010LL};
const ll MAX = {200010};
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n, m;
cin >> n >> m;
char s[n*n][n*n], t[m*m][m*m];
for (ll i ... | ALGO | 0.999929 | 3.310694 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-04-27T21:22: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": "c582fa6d95d... |
1402514a-9537-4688-a1eb-2822ab17fc71 | Raw-Paradox/data-structure | abstract_structure/huffman_encode.cpp | //
// Created by cyb12 on 2020/2/15.
//
#include <iostream>
#include <cstring>
#include <algorithm>
#include "huffman_encode.h"
void Encoder::initWList(const char *text) {
for (int i = 0; i < 26; ++i) {
wList[i] = 0;
}
while (*text) {
if (*text <= 'z' && *text >= 'a') {
wList[*... | ALGO | 0.999538 | 3.862534 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-03-27T13:32: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": "676b32d717... |
ff76cc06-bfe6-4241-ab8c-8ff57fedf89c | hustlyhang/leetcodeself | problem/542.01-矩阵.cpp | /*
* @lc app=leetcode.cn id=542 lang=cpp
*
* [542] 01 矩阵
*/
// @lc code=start
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
class Solution {
public:
struct Node{
int i,j;
Node(int _i, int _j):i(_i),j(_j){};
};
vector<vector<int>> updateMatrix(vector<vecto... | ALGO | 0.999962 | 6.381257 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2021-04-14T00:59: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": "aff27e028... |
ee8105da-f2ba-4e3d-b874-e3107b5c51b9 | q4x3/sjtu_OJ | 4071.cpp | /**
* 矩阵快速幂求斐波那契
**/
#include <iostream>
#define ll long long
using namespace std;
const ll mo = 1e9 + 7;
struct mat {
ll a11, a12, a21, a22;
mat():a11(0), a12(1), a21(1), a22(1) {}
mat operator*(const mat &other) const {
mat tmp;
tmp.a11 = (a11 * other.a11 % mo + a12 * other.a21 % mo) ... | ALGO | 0.999985 | 4.265856 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2020-03-14T05:59:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42e33fd91... |
42d027e9-6721-4752-af7c-486699bfe737 | Fuushi/Trumbone-Renderer | functions.cpp | #include "functions.h"
#include "mathHelper.h"
#include "baseClasses.h"
#include <cmath> // Required for sqrt
#include <iostream>
#include <iostream>
#include <vector>
//print vec & overloads
void print_v(const std::vector<double> vec) {std::cout << vec[0] << " " << vec[1] << " " << vec[2] << std::endl;}
void print_... | ALGO | 0.986746 | 5.782366 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2024-12-29T15:37: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": "adc18332a4b... |
41d621fe-577b-48ee-a0fe-33d11eef8144 | y-oksaku/Competitive-Programming | AtCoder/abc/170e.cpp | #include <bits/stdc++.h>
using namespace std;
template <class A, class B>
string to_string(pair<A, B> p);
template <class A, class B, class C>
string to_string(tuple<A, B, C> p);
template <class A, class B, class C, class D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) {
return '"' +... | ALGO | 0.999856 | 3.907226 | {
"github_metadata": {
"branch": "master",
"commit_count": 776,
"repo_created_at": "2019-05-26T04: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": "e1b3b5b3... |
1a614ee0-e985-4087-861e-da43d03abe3e | nebccc/RGR | Hughes/cpp/hughes.cpp | #include <iostream>
#include <string>
#include <random>
#include <tuple>
#include <cmath>
#include <cstdint>
using namespace std;
// Declare isPrime function
bool isPrime(int n);
pair<int64_t, int64_t> init() {
int64_t a, p;
cout << "Введите значения (a) и модуля (p): ";
while (true) {
cin >> a... | ALGO | 0.999789 | 4.985877 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-06-20T17:29: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": "460f045a69da... |
01de6c18-2203-48f7-8b0a-aa33fe690365 | hanxiaowein1/WSIQualityJudge | WSIQualityJudge/main.cpp | /*
####测量一张片子的质量是否良好。
####测量标准:1)片子细胞核的个数;
2)片子模糊程度。
####测量方法:抽样采取评测。
*/
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <windows.h>
#include <cstdlib>
#include <time.h>
#include <map>
#include <memory>
#include "NucSegModel.h"
#include "sd... | DATA | 0.95102 | 4.189292 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-07-05T16:05:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45183a0d1b... |
08031329-2720-481a-ad34-7edec1e25a2d | YoonkyungH/Algorithm_cpp-java | 00.Programmers/study04.cpp | // 오픈 채팅방
#include <string>
#include <vector>
#include <sstream> // stringstream
#include <map>
using namespace std;
vector<string> solution(vector<string> record) {
vector<string> answer;
vector<string> uid; // uid만 따로 저장
map<string, string> m; // id, name
stringstream ss; // : 주어진 문자열에서 필요한 정... | ALGO | 0.996457 | 4.704888 | {
"github_metadata": {
"branch": "main",
"commit_count": 253,
"repo_created_at": "2021-01-07T12:25:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3d10d5a50... |
b9041263-ed0a-492d-800b-5f74ace27789 | imaadishjain/Standard-Template-Libraries | Striver STL/Rao Sir Data Structure/ARRAYS/Menu Driven Program of array.cpp | #include<bits/stdc++.h>
using namespace std;
void print(int a[100],int n)
{
int i;
for(i=0;i<n;i++)
{
cout<<a[i]<<" ";
}
}
void insertion(int a[100],int n)
{
int val,pos;
int i;
cout<<"Enter the position=";
cin>>pos;
if(pos>n+1)
{
cout<<"Insertion is not possible"... | ALGO | 0.999734 | 3.448045 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-12-12T13:53: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": "e0ddab5b623c... |
d4b393b1-ec7c-42de-9025-c381ad312551 | CharJon/ScientificMaxcutSolver | include/sms/conshdlr/holes.hpp | #ifndef SMS_HOLES_HPP
#define SMS_HOLES_HPP
#include <optional>
#include "networkit/graph/Graph.hpp"
#include "sms/auxiliary/odd_closed_walk.hpp"
using NetworKit::node;
using NetworKit::edgeweight;
using NetworKit::Edge;
using NetworKit::Graph;
class HoleSeparator {
private:
Graph lpWeightedGraph_;
std::v... | ALGO | 0.98781 | 5.843963 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-03-28T11:19:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b3486d8718... |
38007207-e058-4d9f-bb16-849ee4e18191 | Sourabh9835/DSA | Difficulty: Medium/Add Number Linked Lists/add-number-linked-lists.cpp | //{ Driver Code Starts
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
/* Linked list Node */
struct Node {
int data;
struct Node* next;
Node(int x) {
data = x;
next = NULL;
}
};
Node* buildList() {
vector<int> arr;
string input;... | ALGO | 0.998648 | 6.940718 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2024-09-25T15:11: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": "9d597e9c83... |
328af8ca-6b64-4122-949c-596482e6c5a8 | inglada/OTB | Utilities/ITK/Code/Common/itkImageHelper.h | /*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: itkImageHelper.h,v $
Language: C++
Date: $Date: 2008-10-18 17:18:08 $
Version: $Revision: 1.6 $
Copyright (c) Insight Software Consortium. All rig... | TOOL | 0.937196 | 6.711708 | {
"github_metadata": {
"branch": "master",
"commit_count": 10982,
"repo_created_at": "2011-07-01T06:29:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1de3b... |
1c6d43c4-1304-4fd8-87f6-532c077a63e3 | EMiheeva/University_projects | semester_3_labs_Algorithms_and_data_structures/lab_1__The bracket task_/main.cpp | #include <iostream>
#include <cmath>
#include <vector>
using namespace std;
int main() {
setlocale(LC_ALL, "Rus");
bool check = true; //стек, хранящий открывающие скобки. Оценивает сверху.
vector <char> stack;
string s;
cout << "Введите строку: " << endl;
cin >> s;
for (int i = 0; i < s.... | ALGO | 0.998813 | 4.33562 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-04-29T09:57: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": "b4d4e72fb91... |
652af409-a190-491b-96cf-b998f97d59ee | fireFIST55/regular | CP/Codeforces/cf1601A.cpp | #include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ull unsigned long long
#define ll long long
#define endl '\n'
#define MOD 1000000007
#define ordered_set tree<pair<int, int>, null_type, less<pair<int, int>>, ... | ALGO | 0.999898 | 4.475051 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-12-05T02:22: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": "2a01d0f861e9... |
def8eff6-c483-4ebe-8197-cc6ad08562e3 | PaddlePaddle/Paddle | paddle/cinn/adt/equation_graph.h | // Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required... | ALGO | 0.998723 | 3.106869 | {
"github_metadata": {
"branch": "develop",
"commit_count": 54743,
"repo_created_at": "2016-08-15T06:59:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23037,
"forks": 5770,
"issues": 1009,
"pull_requests": 823
},
"file_meta": {
"content_... |
64948907-15c5-4b84-907f-b81776e1cfed | Terracom12/advent-of-code | 2022/day2/part2.cpp | #include "../../utils.hpp"
int determineGameResult(char opp, char play);
int main() {
std::ifstream file;
file.open("input.txt");
ll score = 0;
ll totalScore = 0;
while(!file.eof()) {
char opp, play;
file >> opp;
file >> play;
if(file.eof()) break;
int s... | ALGO | 0.999654 | 4.216318 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-12-02T00:11: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": "dbf74ce2199... |
861fe8b2-381c-4bb5-985a-3bfef7cfa593 | Shen001/MultilThread-LoadOBJ | gleasymath.h | #ifndef GL_EASYMATH
#define GL_EASYMATH
#include<cmath>
#include<assert.h>
#include<gl\glut.h>
using namespace std;
#define X_1 0
#define Y_1 1
#define Z_1 2
#define W_1 3
static void vZero(float *v)
{
v[X_1] = 0.0;
v[Y_1] = 0.0;
v[Z_1] = 0.0;
}
static void vSet(float *v, float x, float y, float z)
{
v[X_1] = x... | TOOL | 0.968358 | 4.707863 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-03-16T08:28:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c344d0... |
14c473e9-2c33-49a8-9793-8d488c24e9f6 | albertopastormr/tais | j58/main.cpp | // <NAME>
// TAIS22
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <algorithm>
#include <vector>
int opt_num_chairlifts(std::vector<int> & weights, int max_weight_chairlift){
std::sort(weights.begin(), weights.end());
int num_chairlifts = 0, i = 0, j = weights.size() - 1... | ALGO | 0.999935 | 4.292608 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2018-09-16T15:53:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "638554d7f... |
38a689df-9ad3-4d70-91d3-b167d2da49ad | LadnerJonas/bachelor-thesis-implementation | prototype/include/in-place_sort/sort_partition.hpp | #ifndef SORT_PARTITION_HPP
#define SORT_PARTITION_HPP
#include <algorithm>
#include <execution>
#include <iostream>
#include <vector>
template<typename T>
int PartitionFunction(const T value, int num_partitions) {
return value % num_partitions;
}
template<typename T>
int find_partition_start(std::vector<T> &rela... | ALGO | 0.999143 | 6.751108 | {
"github_metadata": {
"branch": "master",
"commit_count": 253,
"repo_created_at": "2024-09-16T19: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": "d99e0ae1... |
c12a22d2-c9ce-4c3e-be98-03325bc1e9d3 | tshu-w/ICPC | training/HDU/3685.cpp | #include <bits/stdc++.h>
#define IOS std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr);
// #define __DEBUG__
#ifdef __DEBUG__
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif
#define filename ""
#define setfile() freopen(filename".in", "r", stdin); freope... | ALGO | 0.999878 | 4.392654 | {
"github_metadata": {
"branch": "master",
"commit_count": 269,
"repo_created_at": "2016-04-24T03:41:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 154,
"forks": 33,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "edbdf... |
bd5c9f49-57c8-4f8d-a434-247edf64e9ee | zj2009/poj | solutions/poj1062.cpp | // poj 1062
// 380K 47MS G++
// bellman ford
// enumerate the possible range of level
#include <cstdio>
#include <cstring>
#include <cmath>
#include <climits>
#include <cstdlib>
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
#define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
#define MAXN 100
int N, M, P, L, X, T, V, cnt, u, v, w;
... | ALGO | 0.999815 | 3.962274 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2015-01-15T00:09: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": "ea1debe52... |
028325e5-e6aa-4028-a41a-fd7a65d9ccc9 | nealwu/competitive-programming | miscellaneous/radix_sort.cc | #include <algorithm>
#include <cassert>
#include <iostream>
#include <limits>
#include <vector>
using namespace std;
struct identity_extract {
template<typename T>
T operator()(const T &x) const {
return x;
}
};
// A stable sort that sorts in passes of `bits_per_pass` bits at a time.
template<type... | ALGO | 0.999921 | 5.893135 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2021-08-09T18:52:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 348,
"forks": 73,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b2d76... |
1d8116a5-2bf3-49f5-8b02-1cde3f7dd325 | TechWithRamaa/DataStructures_and_Algorithms | 0905-length-of-longest-fibonacci-subsequence/0905-length-of-longest-fibonacci-subsequence.cpp | class Solution {
public:
// Approach 3 -> Pair DP
// TC ~ O ( N ^ 2 )
// Extending length from previous subsequence
int lenLongestFibSubseq(vector<int>& arr) {
int n = arr.size();
// Maps arr[i] → i for fast lookup
unordered_map<int, int> index;
// DP table initialized t... | ALGO | 0.999908 | 5.747253 | {
"github_metadata": {
"branch": "main",
"commit_count": 6727,
"repo_created_at": "2024-10-25T17:48:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d07097af... |
c0f661fc-a08f-41ea-a2b9-ee454e24cf21 | tqa3001/CP-Library | ds/segtree/dynamic/dynamic-st.cpp | /*
Dynamic segtree solution for cf periodic rmq.
*/
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int maxN = 1e5 + 5;
const int INF = numeric_limits<int>::max() / 2;
int n, k, q;
int b[maxN], sp[maxN][22], Lg[maxN];
int getMin(int l, int r) {
int Log = Lg[r - l + 1];
return min(sp... | ALGO | 0.999795 | 5.072855 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-09-30T02:42:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "286c8fec656c... |
84ffe236-d330-4f9e-809c-591865d5a21f | Account1-Anurag/PRACTICE-CODES | codeforces/codeforces12111.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
pair<string, long long> smallestLexicographicallyStringAndPaths(int n, const string& row1, const string& row2) {
// dp[i][j]: lexicographically smallest string of length j from top-left to (i, j)
vector<vector<string>> dp(2, vector<st... | ALGO | 0.999991 | 5.693202 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-06-10T18:30: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": "08e35f72e53... |
a02045c9-047f-415c-861e-da3cd41aac66 | pandey2016/CodingExp | Codechef2017/April Cook off/SHOPTRIP.cpp | #include<bits/stdc++.h>
using namespace std;
string str[50];
double x[50];
double y[50];
int n,k;
double D[50][50];
double dp[1<<12][38];
int vis[1<<12][38];
int tc;
int bit[55];
double dist(int i,int j) {
double val = (x[i]-x[j]) * (x[i] - x[j]);
val += (y[i]-y[j]) * (y[i]-y[j]);
return sqrt(val);
}
double sol... | ALGO | 0.999935 | 3.658084 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-09-14T09:18: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": "32293f2b5... |
f74ddb08-0a38-45b2-9743-ae1147da358e | AbiterVX/Learn | LearningProjects/SoftRender/SoftRender/Vector2f.h | #pragma once
#include <immintrin.h>
class Vector3f;
class Vector2f
{
public:
static const Vector2f ZERO;
static const Vector2f UP;
static const Vector2f RIGHT;
Vector2f(float f = 0.f);
Vector2f(float x, float y);
Vector2f(__m128 m) : mmvalue(m) {};
// copy constructors
Vector2f(const Vector2f& rv);
// a... | TOOL | 0.975034 | 5.222459 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2021-02-28T13:25: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": "bab31d91f... |
00f9a5a7-7806-4886-bde8-1bcbb775e926 | OliverPozo/Competitive-Programming-Algorithms | Dijkstra Modificado.cpp |
const ll N = 5005;
vector<pair<ll, ll>> adj[N], agua[N];
ll dis[N][105];
bool vis[N][105];
ll n,m,k;
void dijkstra(ll dis[N][105]){
forn(i,n){
forn(j,k+1){
vis[i][j] = 0;
dis[i][j] = INF;
}
}
dis[0][0] = 0;
//la cola es de dist, agua, nodo
priority_queue<pa... | ALGO | 0.999937 | 3.691103 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-12-27T23:26: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": "107f86fae0... |
2b5e7032-ab26-4862-8f50-39365a6d4a8b | stepp/sgl | lib/privatediff.cpp | /*
* File: diff.cpp
* --------------
* This file contains implementations of functions that perform a text 'diff'
* operation to compare two strings and output the differences.
* See diff.h for documentation of each function.
*
* @author <NAME>
* @version 2021/04/03
* - removed dependency on custom collection... | TOOL | 0.990945 | 7.22591 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-04-07T00:12:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a14aec3502a... |
dff24150-a073-4cdd-a9f6-43da33286b70 | allen9408/Data-Struct-Algo | hw5/q2/q2.cpp | #include "adjListGraph.h"
#include <fstream>
#include <stdlib.h>
int main(int argc, char const *argv[])
{
int ver_num;
int edge_num;
float we;
ifstream in;
in.open(argv[1]);
in >> ver_num;
in >> edge_num;
int *verList = new int[ver_num];
// cout << ver_num <<'\t' << edge_num << endl;
for (int i = 0; i< ver_n... | ALGO | 0.997964 | 3.813212 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-01-31T23:23:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40dc69b38... |
34e66cae-eb46-4287-a3ec-d8b1dc045b97 | kaushik73/DSA__CPP | Search&Sort/BinarySearch.cpp | // Recursive C++ program to reverse a string
#include <bits/stdc++.h>
using namespace std;
//return position of k;
int binary_search(int arr[], int n, int k)
{
int left = 0, right = n - 1;
while (left <= right)
{
int mid = (left + right) / 2;
if (arr[mid] == k)
return mid;
... | ALGO | 0.999965 | 5.179094 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2022-01-07T10:34:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9ab29ac053... |
6fda06cd-d611-4dd1-b81d-b3b847fd826c | HardenedBSD/hardenedBSD-stable | contrib/libstdc++/config/os/aix/atomicity.h | // Low-level functions for atomic operations: AIX version -*- C++ -*-
// Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public Lice... | TOOL | 0.922639 | 6.365476 | {
"github_metadata": {
"branch": "hardened/12-stable/master",
"commit_count": 266553,
"repo_created_at": "2014-09-09T15:36:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 133,
"forks": 32,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
... |
3951003c-1dca-4842-90d6-c8ed0da82d4e | dthinkcs/ejs-challenge | dp/alphaCode.cpp | #include <bits/stdc++.h>
#define ull unsigned long long int
#define mod 1000000007
using namespace std;
int numberOfPossibleDecodings(string s)
{
int n = s.length();
ull* ans = new ull[n];
for (int i = 0; i < n; i++)
ans[i] = 0;
ans[0] = 1;
for (int i = 1; i < n ; i++)
{
if (s[i] != '0')
an... | ALGO | 0.999584 | 4.449026 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2019-01-15T14:57: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": "63d805a40... |
2a94444b-93ba-4ce7-833b-34e446bb9dcd | mishi-a/Competitive-Coding-Problems | codeforces/Part-1/VasyaandRobot.cpp | /*************
Author - am10
******************/
#include<bits/stdc++.h>
#define sync ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(0);
#define endl '\n'
#define ll long long
#define pb push_back
#define PI acos(-1)
#define pii pair <int,int>
#define FI first
#define SE second
const int MAX... | ALGO | 0.999835 | 3.668355 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-07-30T03:37:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "685d02f9f3... |
128e446f-a4e5-4bb6-90dd-3b8af787ade8 | BreakAlgorithm/algorithm-study | source/SeongJin/4주차/boj_1038.cpp | /*
1 ~9 는 감소하는 수
---
2자리
1 1개
2 2개
3 3개
4 4개
5 5개
9 9개
---3자리
1 0개
2 1개 210
3 3개 310 320 321
4 6개 410 420 421 430 431 432
5 10개 510 520 521 530 531 532 540 541 542 543
---4자리
1 0개
2 0개
3 3210 1개
4 4개
5 10개
6 20개
*/
// 이 전꺼 + -10inde... | ALGO | 0.999882 | 4.21224 | {
"github_metadata": {
"branch": "master",
"commit_count": 553,
"repo_created_at": "2020-08-02T01:44:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c0b06c4d... |
77047b6f-dfb5-48a5-afdf-e0da3d93fb82 | kingapili/MPWI_LAB2 | Source.cpp | #include <iostream>
#include <stdio.h>
#include <inttypes.h>
using namespace std;
// task 2.1 line random generator
struct LineGenerator
{
int divisor; // the number to divide by ('M' in task description)
int firstNumber; // prime number ('c' in task description)
LineGenerator(int _divisor, int _firstNumber)
{
... | TOOL | 0.994534 | 3.310663 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-13T13:10: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": "e7e7b51da9... |
94bff689-fe66-41e2-a8d9-77e6aef646e1 | aiden-wenzel/sdl-conways-game-of-life | src/colony.cpp | #include <vector>
#include "colony.hpp"
/*----------Constructors----------*/
Colony::Colony(int rows_in, int columns_in) {
this->rows = rows_in;
this->columns = columns_in;
this->underpopulation_limit = 2;
this->overpopulation_limit = 3;
this->resurection_limit = 3;
initialize_cell_map();
initialize_alive_ce... | ALGO | 0.992116 | 5.485726 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2025-01-11T21:33: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": "44c04ef623a... |
d650ed90-9794-4801-b3af-61520108f88a | adidevmohapatra/CSCE121 | hw_paris_olympics_starter_code/hw_Paris_Olympics_Starter_Code/main.cpp | /******************************************************************************
File: main.cpp
Author: Prof. Lupoli & <NAME>
Date: 2/16/2021
Section:
E-mail: <EMAIL>
Description:
This file contains C++ code that will simulate data collected from a track
event with 9 lanes. The code will sort the order, then display... | DATA | 0.994945 | 4.593177 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-01-16T20: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": "8e13ea60beab... |
12d7321a-4aab-491b-9d53-26d356c16255 | Vector-013/CP-Vector013 | Codeforces/climb/ACT-VI/ed73D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using i64 = long long;
typedef unsigned long long ull;
typedef long double ld;
const int inf = 2e9;
const ll linf = 9e18;
const int mod = 1e9 + 7;
void solve()
{
int n;
cin >> n;
vector<ll> dp(3, linf), ndp(3, linf);
vector<ll> a(n), b... | ALGO | 0.999968 | 4.422521 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2023-10-02T08:27: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": "77062530e... |
bb55eca9-ecb9-425a-bdec-3724e4910f4c | linuxxx/EasyPR_Android | PlateRecognizer/app/src/main/jni/easyPR/include/core/plate_locate.h | //////////////////////////////////////////////////////////////////////////
// Name: plate_locate Header
// Version: 1.2
// Date: 2014-09-19
// MDate: 2014-09-29
// MDate: 2015-03-13
// Author: liuruoze
// Copyright: liuruoze
// Reference: Mastering OpenCV with Practical Computer Vision Projects
// R... | ALGO | 0.997462 | 5.847437 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-01-28T08:28:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 511,
"forks": 249,
"issues": 34,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b3c... |
b72cd38f-5f06-41d3-8ccd-97d5dc0afa55 | sadev-ai/CodePlayground | sanDiegoDataStructres&Algorithms/algorithmic-toolbox/module1-programming-challenges/maxPairWise.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int MaxPairwiseProduct(const vector<int>& numbers) {
int n = numbers.size();
if (n < 2) {
return 0;
}
int first_max = max(numbers[0], numbers[1]);
int second_max = min(numbers[0], numbers[1]);
for (int i =... | ALGO | 0.999949 | 5.077983 | {
"github_metadata": {
"branch": "main",
"commit_count": 272,
"repo_created_at": "2024-05-31T22:52: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": "5b941c32dd... |
85a0e9db-a4b6-402b-9fda-bb1275137a97 | YashadaNalawade/DSA | Problems/1.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <string>
using namespace std;
vector<string> organizeItinerary(vector<string>& cities, vector<int>& days) {
unordered_map<string, int> itinerary;
// Iterate through the cities and days, and sum up the days for each city
for (size_t i ... | ALGO | 0.999364 | 5.68281 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-01-28T09:03: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": "36a1a35b236... |
1c392366-bfb4-4119-a6f6-507f91ba252c | zhaocheng-hub/CPP-- | C++考研整理/this 指针和指向类的指针/源.cpp | /*在 C++ 中,每一个对象都能通过 this 指针来访问自己的地址。
this 指针是所有成员函数的隐含参数。因此,在成员函数内部,它可以用来指向调用对象。
友元函数没有 this 指针,因为友元不是类的成员。只有成员函数才有 this 指针。
一个指向 C++ 类的指针与指向结构的指针类似,访问指向类的指针的成员,需要使用成员访问运算符 ->,
就像访问指向结构的指针一样。与所有的指针一样,您必须在使用指针之前,对指针进行初始化。
*/
#include <iostream>
using namespace std;
class Box
{
public:
// 构造函数定义
Box(double l = 2.0, ... | ALGO | 0.992619 | 5.102177 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-06-22T13:44:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8794234598... |
976108e5-0318-4265-ba2c-c295f0140be4 | hex8541/ic210 | homework/hw22.cpp | //<NAME> 242628
//Process commands involving integers in arrays
#include <iostream>
using namespace std;
// ======================================
// Function prototypes below
// ======================================
int readN(); //Reads in array size
int* readData(int n); //Reads in user input for array of size n
v... | ALGO | 0.998905 | 4.427033 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2021-08-26T02:35: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": "9801da877d... |
9430c968-b54c-4a6e-a32d-5d7a19cea1ac | akshatvermavi/DSA_akshatvermavi | Leetcode_easy_20_Valid_Parentheses.cpp | //Method 01 via stack lifo SC = O(N) TC=O(N)
class Solution {
public:
bool isValid(string s) {
stack<int> st;
for(int i=0;i<s.length();i++)
{
char ch = s[i];
//opening bracket;
if(ch == '(' || ch=='{' || ch=='[')
{
st.push(ch);
... | ALGO | 0.998711 | 5.946913 | {
"github_metadata": {
"branch": "main",
"commit_count": 962,
"repo_created_at": "2023-04-16T07:23:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "202002063b... |
5f6dc956-ecb3-471f-98c4-b307e8b82031 | huzecong/Flow | gamesolver.h | #ifndef GAMESOLVER_H
#define GAMESOLVER_H
#include <QObject>
#include <QDebug>
#include <QTime>
#include <map>
#include <utility>
#include <cassert>
class GameSolver : public QObject {
Q_OBJECT
public:
static const int MAXN = 16;
explicit GameSolver(QObject *parent = 0) : QObject(parent) {
this->timer.start();... | ALGO | 0.990525 | 4.868848 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-08-25T03:10:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 96,
"forks": 11,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5df11fb... |
5110df94-a432-4217-b867-2fa44e7bcabb | ruslanova13/task2 | lu.cpp | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <thread>
#include <vector>
#define MAX(a, b) ((a) > (b) ? (a) : (b)) //максимум из двух элементов
#define MAX3(x, y, eps) (MAX (MAX (x, y), eps)) //максимум из трех элементов
#define ALMOST_EQUAL(x, y, eps) (fabs ((x) - (y)) < ((eps)... | ALGO | 0.999684 | 3.610831 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-11-27T16:37: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": "4138d0fba2d1... |
0c562e27-50ff-4a0d-af79-30d84f4c3e72 | kamyu104/LeetCode-Solutions | C++/numbers-at-most-n-given-digit-set.cpp | // Time: O(logn)
// Space: O(logn)
class Solution {
public:
int atMostNGivenDigitSet(vector<string>& D, int N) {
string str_N = to_string(N);
unordered_set<string> set_D(D.cbegin(), D.cend());
int result = 0;
for (int i = 1 ; i < str_N.length() ; ++i) {
result += pow(D.... | ALGO | 0.999873 | 6.808339 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
6e3cced0-23ee-4fd9-93f0-0655c84980bc | sanjanprakash/Hackerrank | Algorithms/Implementation/cutthesticks.cpp | #include <iostream>
#include <vector>
using namespace std;
void merge (vector<int>& original, vector<int>& first, vector<int>& second) {
original.clear (); //Deleting all the elements in the larger 'original' vector
int i = 0, j = 0; //Iterators
//Until the end of either of the s... | ALGO | 0.999986 | 3.809019 | {
"github_metadata": {
"branch": "master",
"commit_count": 436,
"repo_created_at": "2018-09-01T20:32: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": "2e4559db... |
c26ddb45-c2c7-446c-8989-64e3ba7e37dd | ElcarimQAQ/algorithm | ACM/Train/Tree/yunshujihua.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 400005;
const int M = 25;
#define INF 0x3f3f3f3f
int dep[maxn],pa[M][maxn];
int sum[maxn],dis[maxn],seq[maxn],cnt = 0;
int flca[maxn];
struct edge
{
int u,v,t;
void add(int a,int b,int c){
u = a;
v = b;
... | ALGO | 0.999959 | 4.034786 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2022-03-26T13:18:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03ef99494... |
45332eff-ce07-446c-933b-5e8f6e71c0f7 | sourav-islam/XPSC | Week 7/Day 3/ph_contest_problem/B_Take_it_Easy.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pp(x) cout << x << "\n"
int32_t main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> v(n);
int totalCandies = 0;
for (int i = 0; i < n; ++i)
{
cin ... | ALGO | 0.999891 | 4.159853 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2024-03-16T09:31: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": "6cb31021e9... |
6fb1a8dc-b635-4f64-ba32-6ec5fb40e88c | sounak999/LeetCode-GFG-Submissions | 743-network-delay-time/743-network-delay-time.cpp | class Solution {
public:
int networkDelayTime(vector<vector<int>>& times, int N, int K) {
// assume the distance to from origin node to ith node is infinite
vector<int> dist(N + 1, INT_MAX);
dist[0] = 0;
dist[K] = 0;
// traverse all destinations, N is the worest case
... | ALGO | 0.999981 | 5.6707 | {
"github_metadata": {
"branch": "main",
"commit_count": 1102,
"repo_created_at": "2022-04-21T19:39: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": "5450d096b... |
47b438ac-f8a3-4588-809b-6dc79b08b369 | jgaloguz/GCR-Heliosheath-Modulation | runs/compute_kappa_perpendicular_UNLT.cc | #include "compute_kappa_perpendicular.hh"
using namespace Spectrum;
//! Maximum number of fixed point iterations
const int FP_maxiters = 100;
//! Convergence threshold for fixed-point iterations
const double FP_threshold = 1.0e-10;
//! Phenomenological constant
const double a_UNLT = 0.25;
/*!
\brief Compute the ne... | ALGO | 0.999743 | 5.304854 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2025-01-18T16:31: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": "06214b03e8... |
d8fa6a45-2eff-4093-bba5-e8c6fc5a2d2a | andrescabana86/cpp-training | standard-library/std-bind/main.cpp | #include <iostream>
#include <functional>
#include <numeric>
using namespace std;
// print the elements of the array
template<typename T>
void printv(vector<T> & a) {
for(T &i : a) cout << i << " ";
cout << endl;
}
// print a simple message
void message(const char * s) { cout << s << endl; }
template<typename... | ALGO | 0.997774 | 5.657277 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2022-02-19T23: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": "abc3aa755c8... |
6d1f90d0-7cf3-44a4-a2ac-70b0e5212400 | qcscine/molassembler | src/Molassembler/RankingInformation.cpp | /*!@file
* @copyright This code is licensed under the 3-clause BSD license.
* Copyright ETH Zurich, Department of Chemistry and Applied Biosciences, Reiher Group.
* See LICENSE.txt for details.
*/
#include "Molassembler/RankingInformation.h"
#include "Molassembler/Temple/Adaptors/Zip.h"
#include "Molassembler/... | ALGO | 0.997048 | 7.022843 | {
"github_metadata": {
"branch": "master",
"commit_count": 1497,
"repo_created_at": "2020-11-27T11:27:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 41,
"forks": 7,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "92f2158... |
c80fa81a-72b8-4969-bd80-959cfe113bf7 | Infus3d/CSES-Solutions | cses_solutions/Sorting And Searching/MaximumSubarraySum.cpp | /*
* Problem link : https://cses.fi/problemset/task/1643
*
* One of the easiest ways to solve this problem is with prefix sums.
* As the name suggests, there are n + 1 prefix sums in an array of
* length n where prefix[i] is the sum of all elements j up to i (j <= i).
* For ex:
* array : 1 1 -3 6 -1 7
* ... | ALGO | 0.999911 | 4.073109 | {
"github_metadata": {
"branch": "main",
"commit_count": 212,
"repo_created_at": "2023-01-19T20:15: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": "23940ead50... |
5bf00f81-11b4-4aa8-b518-b9995bab8e33 | ghibli613/cp-coding | coding/usaco/bronze/complete_search_with_recursion/air_conditioning_ii.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N, M;
vector<array<int,3>> cows;
vector<array<int,4>> air_conditioners;
vector<bool> uses;
int min_cost = INT_MAX;
void update()
{
bool is_feasible = true;
for(int i = 1; i <= 100; i++)
{
int cooling = 0;
for(int j = ... | ALGO | 0.999618 | 4.772449 | {
"github_metadata": {
"branch": "main",
"commit_count": 248,
"repo_created_at": "2024-06-30T18:10: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": "87583a904f... |
f83cc709-4929-4af8-916d-b8c45735dd2f | tevil344/CPP-DSA | Assignment10.cpp | #include <iostream>
#include <string>
using namespace std;
struct Job {
int job_id;
int job_priority;
string job_name;
Job* next;
Job* prev;
};
class JobScheduler {
private:
Job* front;
Job* rear;
public:
JobScheduler() {
front = nullptr;
rear = nullptr;
}
//... | ALGO | 0.975746 | 6.033856 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-08-09T07:57: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": "272fc0c713e... |
3346f60f-aed5-4259-a797-37d0e0777977 | Zhenghao-Liu/LeetCode_problem-and-solution | 0707.设计链表/solution.cpp | //采用lc自带的单链表模板,模拟即可
// struct ListNode
// {
// int val;
// ListNode *next;
// ListNode(int _val) : val(_val) { next = NULL; }
// };
class MyLinkedList {
ListNode * dummy;
public:
/** Initialize your data structure here. */
MyLinkedList() {
dummy=new ListNode(-1);
}
/** Get the value ... | ALGO | 0.999917 | 4.550495 | {
"github_metadata": {
"branch": "master",
"commit_count": 3408,
"repo_created_at": "2019-10-22T08:19:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 50,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a021... |
74c354c5-78bd-4a09-bbb8-d9ff202b01ff | ishandutta2007/codeforces-a | awakeanay/normal/1408/C.cpp | #include <iostream>
#include <iomanip>
int a[100006];
signed main() {
int t;
std::cin >> t;
while(t--) {
int n, max;
std::cin >> n >> max;
int a[n+2];
a[0] = 0;
for(int i = 0; i < n; i++)
std::cin >> a[i+1];
a[n+1] = max;
long double l = 0.0, r = max;
while((r-l) > 1e-6)... | ALGO | 0.999761 | 4.010979 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d696782c49d2... |
ad20df6e-7d60-409b-b5d5-25826c1bbe44 | fazlerabbi13/cpp-programs | commonDivisors.cpp | #include <iostream>
#include <cmath>
using namespace std;
// Function to compute GCD
int gcd(int a, int b) {
while (b != 0) {
int tmp = a % b;
a = b;
b = tmp;
}
return a;
}
// Function to count the number of divisors of a number
int countDivisors(int n) {
int count = 0;
for... | ALGO | 0.999923 | 5.948437 | {
"github_metadata": {
"branch": "main",
"commit_count": 159,
"repo_created_at": "2025-01-03T05:47: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": "1aa8250d68... |
1168a43a-22c4-412d-8ab8-ec22feebeba9 | Midway91/HactoberFest2023 | Hacktoberfest-2023/Programming/C++/CHAPTER 7{FUNCTIONS}/3sum triplet.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& arr) {
int n=arr.size();
vector<vector<int>> ans;
sort(arr.begin(), arr.end());
for (int i = 0; i < n; i++) {
//remove duplicates:
if (i != 0 && arr[i] == arr[i - 1]) continue;
//moving 2 pointers:
... | ALGO | 0.999907 | 6.007075 | {
"github_metadata": {
"branch": "main",
"commit_count": 2256,
"repo_created_at": "2023-09-29T12:46:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 1750,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "667b... |
9800046f-a9f1-4f1e-a3cf-b3fc022f8300 | kamyu104/LeetCode-Solutions | C++/insert-delete-getrandom-o1.cpp | // Time: O(1)
// Space: O(n)
class RandomizedSet {
public:
/** Initialize your data structure here. */
RandomizedSet() : gen_(random_device()()) {
}
/** Inserts a value to the set. Returns true if the set did not already contain the specified element. */
bool insert(int val) {
... | ALGO | 0.986577 | 6.491845 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
1333ed7f-5732-467d-8819-46de642aa0a5 | josemiguel/icpc-training | extra/EllysTSP.cpp | // BEGIN CUT HERE
// PROBLEM STATEMENT
// Everybody who has lived in a village knows how expensive the things from the city are. And everybody who has lived in the city knows how expensive the things from the village are. Elly decided to use these observations to make some profit. She will start at some city or village... | ALGO | 0.999888 | 4.166169 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2013-11-04T00:48:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1ec0e2e2... |
e106048a-53c2-49ed-acac-dd507e010066 | dhruv-goel-8113/AdaLab | Lab7/n_queens.cpp | #include <iostream>
#include <vector>
using namespace std;
// Function to print the chessboard
void printBoard(const vector<vector<bool>>& board) {
int N = board.size();
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
if (board[i][j]) cout << "Q ";
else cout << ". ";... | ALGO | 0.999915 | 5.856273 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-04-18T12:51: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": "1269dd3910... |
4a7ba518-89cc-4ba5-b089-b8338b0806d1 | Aeshnajain/DS-Algo | 17 july/graphs.cpp | #include<iostream>
#include<vector>
using namespace std;
class edge
{
public:
int nbr;
int wght;
};
vector<vector<edge> > graph;
void display()
{
for(int i=0;i<graph.size();i++)
{
cout<<i<<":";
for(int j=0;j<graph[i].size();j++)
{
edge ne=graph[i][j];
... | ALGO | 0.999896 | 4.577938 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-04-12T21:46: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": "354c8f873af7... |
498adf07-1a3b-4f05-83bd-84f39192c049 | EunjungHam53/BT03-04 | TandemRepeats.cpp | #include <bits/stdc++.h>
using namespace std;
bool check(string s, int n, int m, int i, int j)
{
if(m - n != j - i) return false;
else
{
for (int h = 0; h < m - n + 1; h++)
{
if(s[n + h] != s[i + h]) return false;
}
}
return true;
}
int occurence(string s, int n, ... | ALGO | 0.99988 | 3.716813 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-02-22T07:02: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": "4c1209af811b... |
20fdac28-b908-4532-a2a1-177715b648c7 | 0Hooni/Lecture | Data Structure/Week 13/W13_P2.cpp | #include <iostream>
#include <string>
using namespace std;
#define MappingSize 501
class vertex
{
public:
vertex *prev;
vertex *next;
int degree;
int data;
vertex(int data)
{
this->degree = 0;
this->data = data;
}
void increase_degree() { this->degree++; }
void dec... | ALGO | 0.999446 | 4.095325 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-09-30T14:06: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": "05844433e4bb... |
09f211d4-66f0-4e46-943c-fefcb8825305 | aditya-agr/LeetCode-POTD | 2081. Sum of k-Mirror Numbers.cpp | class Solution {
public:
bool isPalindrome(string &s){
int n = s.length();
for(int i=0; i<n/2; i++){
if(s[i] != s[n-i-1])
return false;
}
return true;
}
bool isKmirror(string &s, int k){
long long num = stoll(s);
string res = "";
... | ALGO | 0.999943 | 5.185913 | {
"github_metadata": {
"branch": "main",
"commit_count": 498,
"repo_created_at": "2024-03-14T16:05: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": "fbb445ae7a... |
cf56e586-124a-43bd-9e20-32443a515ad5 | harsha0422/CSA1419-compiler-design | 6a. comment or not.cpp | #include <stdio.h>
#include <string.h>
void checkComment(char line[]) {
while (*line == ' ') {
line++;
}
if (line[0] == '/' && line[1] == '/') {
printf("The given line is a single-line comment.\n");
} else if (line[0] == '/' && line[1] == '*') {
int length = strlen(line);
... | ALGO | 0.995023 | 4.277776 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-01-02T03:52: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": "1e0e363d6011... |
0c60b34b-8f4f-418f-8380-d4c49a0693e5 | fengzixue96/IE523-Financial-Computing-Homework | IE523_HW2/Assignment2.h.h | #ifndef sudoku
#define sudoku
#include <iostream>
#include <vector>
#include <fstream>
using std::vector;
using namespace std;
class Sudoku
{
// Private
int puzzle[9][9];
int sum = 0;
// Private member function that checks if the named row is valid
bool row_valid(int row,int a)
{
for (int i = 0; i < 9; i++)
... | ALGO | 0.959258 | 5.630136 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2020-06-14T07:34: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": "b90acf985... |
51453c2d-c7ee-411e-89cf-096ba78c8ea0 | ntd275/Applied-Algorithms | Contest_5/A_GOLD_MINING/main.cpp | /*
Author: DucNT
Date:
*/
#include <bits/stdc++.h>
#define Author "DucNT"
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define M 1000000007
#define PI 3.14159265358979323846264338328
using namespace std;
int n,l,r;
long long a[1000005],f[1000005];
long long st[4000005];
void update(in... | ALGO | 0.99982 | 3.84803 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-05-23T16:10:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "35b99e8905... |
5f304bbe-dee5-4b36-9cc8-ba132b0befde | GuanyiLi-Craig/interview | Array/q282.cpp | /****************************************************************************************************
282. Expression Add Operators
-----------------------------------------------------------------------------------------------------
Given a string that contains only digits ... | ALGO | 0.999686 | 5.994552 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2017-01-01T21:30:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "299c5cbc... |
56e02f5e-907e-4c80-b130-e0d4137afc90 | Yiyi16/Self-supervised-Learning | video-to-image/DejaVu/src/motionRF/MotionPatch.h | /* Motion.h
* Author: <NAME>
*/
#ifndef MOTIONPATCH_H_
#define MOTIONPATCH_H_
#pragma once
#include <Auxiliary.h>
#include <MotionPatchFeature.h>
//==============================================================================
//==============================================================================
//========... | ALGO | 0.905403 | 5.898352 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-04-17T05:04:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6266e5e67... |
e345d098-7d7e-4b4d-9ead-f91c24c5a67b | rbiniwal/hw2 | util.cpp | #include <iostream>
#include <sstream>
#include <cctype>
#include <algorithm>
#include "util.h"
using namespace std;
std::string convToLower(std::string src)
{
std::transform(src.begin(), src.end(), src.begin(), ::tolower);
return src;
}
/** Complete the code to convert a string containing a rawWord
to a ... | TOOL | 0.989076 | 4.799264 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-19T07:24: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": "0264300b44ea... |
71b6a241-c2b0-472f-82a0-d3dd5da93701 | starloving/ccpp-robot | robot_ccpp/include/robot_ccpp/CleaningPathPlanner.h | /***
* @brief: cleaning robot path planning
* @author: Benny
* @date: 2023.10
***/
#ifndef CLEANINGPATHPLANNING_H
#define CLEANINGPATHPLANNING_H
#include <opencv2/opencv.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <vector>
#include <s... | TOOL | 0.952272 | 5.126081 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-10-26T07:59: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": "be563ca09c6... |
f0b5cdaf-0a5e-46d8-8660-023e85918bd5 | vadera11jeet/DataStructure-And-Algorihtm | graph/mother vertex .cpp | // a vertex is known as mother vertex if and only if from this vertex path exist to every other vertex
#include<bits/stdc++.h>
using namespace std;
class Graph
{
int v;
vector<int> *l;
void dfsUtil(vector<bool> &v, int src)
{
v[src] = true;
for(auto x :l[src])
if(!v[x])
... | ALGO | 0.999866 | 4.301254 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-01-02T13:57: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": "fbba6c10a09a... |
c3acda6b-bdd5-4edb-b42b-b3e58ea0e945 | GriffinHackley/Allreduce-Add | main.cpp | #include <iostream>
#include <mpi.h>
#include <unistd.h>
#include <stdlib.h>
#include <numeric>
#include <math.h>
#define MCW MPI_COMM_WORLD
using namespace std;
void allReduce(){
int rank, data, size, value = 0;
MPI_Comm_rank(MCW, &rank);
data = rank;
MPI_Allreduce(&data, &value, 1, MPI_INT, MPI_SU... | ALGO | 0.999887 | 3.547066 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-05-23T18:07:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0161d49a24d9... |
e1a8a298-985b-4e2b-b52e-98582f3418af | AkVaya/CP_Solutions | Codeforces/676C.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<set>
#include<stdio.h>
#include<iomanip>
#include<algorithm>
#include<map>
#include<math.h>
#include<string.h>
#include<ctime>
#include<cmath>
#define ll long long
#define eb emplace_back
#define pb push_back
#define ins insert
#define mp make_pair
#define m... | ALGO | 0.999977 | 3.553429 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2020-01-09T10:12: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": "e76a9274f... |
3d90d1ef-89f0-46c0-bd39-1538a639d0aa | pedropalmeros/Sliding_Mode_1_V1.1 | uav/src/xyPD/xyPD_impl.h | // %flair:license{
// This file is part of the Flair framework distributed under the
// CECILL-C License, Version 1.0.
// %flair:license}
/*!
* \file xyPD_impl.h
* \brief Classe permettant le calcul d'un Pid
* \author <NAME>, Copyright Heudiasyc UMR UTC/CNRS 7253
* \date 2011/05/01
* \version 4.0
*/
#ifndef xyPD... | TOOL | 0.953413 | 6.633986 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-02-26T03:37:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d2df3c2f580... |
4fd1345d-0e62-4ffb-9b57-5b51454a63ab | kam45x/Evolution3D | src/Creature.cc | #include <algorithm>
#include <fstream>
#include <functional>
#include <string>
#include "Creature.h"
Creature::Creature(const Parameters ¶ms) : params_(params) {
root_ = std::make_shared<Link>();
}
Creature::Creature() { root_ = std::make_shared<Link>(); }
std::shared_ptr<Link> Creature::getRoot() const { re... | ALGO | 0.987382 | 5.136081 | {
"github_metadata": {
"branch": "main",
"commit_count": 133,
"repo_created_at": "2025-02-03T17:21: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": "8a6f8415bc... |
aace6a46-6d63-436f-b0b4-28b679e3d5c7 | FedeGauna16/C- | Ejercicios/Ejercicio 1.2.1.6.cpp | #include <iostream>
using namespace std;
// Se ingresan tres valores numéricos enteros,
// diferentes entre sí, informar cuál es el menor,
// cuál está en el medio y cuál es el mayor.
int main()
{
int a, b, c;
cout << "Ingrese los numeros a, b y c: " << endl;
cin >> a;
cin >> b;
cin >> c;
if (a > b &&... | ALGO | 0.9999 | 3.509983 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2022-04-21T23:21: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": "e11cf3fd28... |
0c2d921c-7c04-4092-8d81-de55bd84ecf2 | catalinboja/cpp_examples_2017 | Curs/En/ProjectCourse3/ProjectCourse3/Source.cpp | #include <stdio.h>
#include <iostream>
using namespace std;
void interchange(int a, int b);
void interchange2(int *pa, int* pb);
void interchange3(int *pa, int* pb);
void interchange4(int& a, int& b);
char* getUserName() {
char name[100];
cout << endl << "Your name:";
cin >> name;
return name;
}
char* getUserNam... | ALGO | 0.973656 | 3.302238 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-10-03T02:25:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5cbcc079... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.