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
b1501a73-0902-49c5-9a1f-b0679fc15adc
chiao45/ams562-notes
other/stl/algorithm/basics/basic1.cpp
// In this example, we show how to copy // two vectors using std::copy #include <algorithm> #include <iostream> #include <vector> // size of vector #define N 20 int main() { // // Construct two vectors std::vector<int> v1(N), v2(N); // // Assign values to v1 for (int i = 0; i < N; ++i) v1[i] = i + 1...
ALGO
0.993024
5.510493
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2018-08-01T23:27:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 5, "issues": 0, "pull_requests": 3 }, "file_meta": { "content_id": "140295b6...
fb23a5dd-3166-491d-956b-bd2f3e870940
ping29065147/YZU-sophomore
Introduction to Algorithms/mid 1/s1083321_10534.cpp
#include <iostream> #include <vector> using namespace std; int main() { int n; while (cin >> n) { vector<int> str(n); for (int i = 0; i < n; ++i) cin >> str[i]; vector<int> lis; vector<int> lds; lis.emplace_back(str[0]); lds.emplace_back(str[n - 1]); vector<int> num1(n); vector<int> num2(n); n...
ALGO
0.999875
3.491855
{ "github_metadata": { "branch": "main", "commit_count": 30, "repo_created_at": "2020-11-16T15:23: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": "f5adb0952e4...
b0b52145-87c9-4339-9de5-54d17921981d
huegli/SDL2-Tutorial
Lesson_29/main.cpp
// Using SDL, SDL_image, standard IO, and strings #include <SDL.h> #include <SDL_image.h> #include <SDL_render.h> #include <stdio.h> #include <string> #include <vector> // Screen dimension constants const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; //A circle structure struct Circle { int x, y; int r; ...
TOOL
0.953413
5.603681
{ "github_metadata": { "branch": "main", "commit_count": 50, "repo_created_at": "2023-05-01T18:09: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": "ad3ff1192da...
b9533a2b-394d-4848-9660-4ee6e1d04ccb
orperel/DecomposeForPacking
DecomposeForPacking/DecomposeForPacking/Packing.cpp
#include "Packing.h" #include "PackingPartFitVisitor.h" #include "Point.h" using std::get; /** Constructs a new packing object from a box and decomposition result. Extracts the parts count list and the parts count by size from this decomposition. */ Packing::Packing(WorldPtr box, std::shared_ptr<DecomposeResult> dec...
ALGO
0.99896
5.997341
{ "github_metadata": { "branch": "master", "commit_count": 163, "repo_created_at": "2018-02-04T09:57:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f5e955f4...
30598f5b-1a64-47fc-8078-3c69bfa8e8ff
opencv/opencv
samples/cpp/tutorial_code/snippets/core_reduce.cpp
/** * @file core_reduce.cpp * @brief It demonstrates the usage of cv::reduce . * * It shows how to compute the row sum, column sum, row average, * column average, row minimum, column minimum, row maximum * and column maximum of a cv::Mat. * * @author <NAME> * @date August 2017 */ #include <iostream> #include...
ALGO
0.995723
6.266664
{ "github_metadata": { "branch": "4.x", "commit_count": 35401, "repo_created_at": "2012-07-19T09:40:17.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 83079, "forks": 56217, "issues": 2595, "pull_requests": 138 }, "file_meta": { "content_id"...
09516a17-e257-464e-8344-51765afed06a
ishandutta2007/codeforces-s
saketh/normal/1672/F2.cpp
#include <bits/stdc++.h> using namespace std; // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define mt make_tuple #define lb lower_bound #define ub upper_bound #define f first #define s second #define resz resize #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() ...
ALGO
0.999868
3.633706
{ "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": "8bed652a07f9...
3031ed07-aad9-4ba9-9d68-e86089dea35e
mimibetty/CP-Training-
COMPETITION/OLP Sinh Vien/khong chuyen 2020/2 Phan So/1.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<double,double> pdd; typedef pair<long long, long long> pll; typedef double ld; #define For(i, l, r) for (int i = l; i < r; i++) #define REP(i, l, r) for (int i = l; i <= r; i++) #define FordE(i, l, r) for (int...
ALGO
0.999952
3.467842
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2024-04-12T06:16: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": "f7454451e58...
514db000-fcce-47fe-aaec-8113b48645c2
IEEE-WIE-VIT/Everything-CPP
Maths/Nim_Game2.cpp
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a[n]; int x = 0; for(int &e : a) { cin >> e; e = e % 4; x ^= e; } if(x == 0) cout << "second\n"; else cout << "first\n"; } // There are n heaps of st...
ALGO
0.999945
3.998559
{ "github_metadata": { "branch": "main", "commit_count": 407, "repo_created_at": "2021-10-02T06:05:33.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 17, "forks": 89, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "0337d42bc...
1b7b4e55-5a4a-4097-9b0b-a0e4064689dc
pradeepgangwar/Programming-Codes
Codechef/SNCKQUAL-SameSnake.cpp
#include <bits/stdc++.h> using namespace std; int main() { long long int t,x11,x12,x21,x22,y11,y12,y21,y22; cin>>t; while(t--) { cin>>x11>>y11>>x12>>y12; cin>>x21>>y21>>x22>>y22; if( (y11==y12) && (y21==y22) && (y11==y21)) { if( (min(x11,x12)<=min(x21,x22) && max(x11,x12)>=min(x...
ALGO
0.999802
4.221059
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2017-02-23T07:25:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fd1e06643...
aa863bb7-85f9-413a-abcd-2a9374d9f1b8
siddharthshiv1201/Data-Structures-And-Algorithms
Difficulty: Medium/Count distinct elements in every window/count-distinct-elements-in-every-window.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends class Solution { public: vector<int> countDistinct(vector<int> &arr, int k) { vector<int> v1; unordered_map<int, int> freq; // Hash map to store frequencies int distinct_count = 0...
ALGO
0.998571
6.665851
{ "github_metadata": { "branch": "main", "commit_count": 1120, "repo_created_at": "2025-02-04T14:58:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1c136db2b...
5dc59dcb-d099-43af-acf1-6427ae09e35d
SongHayoung/LeetCode
733-flood-fill/733-flood-fill.cpp
class Solution { public: vector<vector<int>> floodFill(vector<vector<int>>& image, int sr, int sc, int newColor) { if(image[sr][sc] == newColor) return image; queue<pair<int, int>> q; int targetColor = image[sr][sc], n = image.size(), m = image[0].size(); int dx[4] = {0,1,0,-1}, dy[4...
ALGO
0.997992
6.582673
{ "github_metadata": { "branch": "master", "commit_count": 13354, "repo_created_at": "2021-01-06T12:46:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "538f8b...
7d106558-dde1-4b8c-b094-b72067eae0b2
CheckHarry/LeetCodeRepo
67. Add Binary/addBinary.cpp
#include <string> #include <algorithm> using namespace std; string addBinary(string a, string b) { int overhead = 0; int a_size = a.size() , b_size = b.size(); string to_return = ""; for (int i = 0 ; i < max(a_size , b_size) ; i ++){ if ((a_size - 1- i) >= 0 && (b_size-1 -...
ALGO
0.999978
5.375623
{ "github_metadata": { "branch": "main", "commit_count": 162, "repo_created_at": "2021-11-23T11:07:11.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a74a785b8c...
12fe91af-af00-46b5-a8d3-8b99fe98a893
k-ye/mcmc-viz
SpaceSearcher.hpp
#ifndef SPACE_SEARCHER_HPP #define SPACE_SEARCHER_HPP /** @file Space.hpp * @brief Define the SpaceSearcher class for making spatial searches. */ #include <cassert> #include "mesh/CS207/Point.hpp" #include "BoundingBox.hpp" #include "MortonCoder.hpp" /** @class SpaceSearcher * @brief Class for making spatial sear...
ALGO
0.995888
3.039105
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2014-12-08T06:31:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "7205ceeb8...
f77aa726-9106-43b3-8c68-b695b24e95ac
shoumitro-cse/data-structure-solving
Hashing/Intermediate/print_groups_shifted_string.cpp
// C/C++ program to print groups of shifted strings together. // g++ print_groups_shifted_string.cpp && ./a.out #include <bits/stdc++.h> using namespace std; const int ALPHA = 26; // Total lowercase letter // Method to a difference string for a given string. // If string is "adf" then difference string will be // ...
ALGO
0.999855
5.181079
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2020-11-22T18:06: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": "6c3c6ecd401...
62a8cb81-455b-49da-a265-64f299d33e95
squirrel-project/squirrel_nav
squirrel_dynamic_filter/external/mlpack/src/mlpack/core/optimizers/gradient_descent/gradient_descent_impl.hpp
/** * @file gradient_descent_impl.hpp * @author <NAME> * * Simple gradient descent implementation. * * mlpack is free software; you may redistribute it and/or modify it under the * terms of the 3-clause BSD license. You should have received a copy of the * 3-clause BSD license along with mlpack. If not, see ...
ALGO
0.999625
7.165321
{ "github_metadata": { "branch": "indigo_dev", "commit_count": 701, "repo_created_at": "2014-04-30T09:51:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 10, "issues": 3, "pull_requests": 0 }, "file_meta": { "content_id": "6efd...
e1759bef-ade9-4343-8d89-c26ec7eda355
EagleEyeKestrel/Leetcode
1301-1400/1312. 让字符串成为回文串的最少插入次数/O(n3).cpp
// // main.cpp // 第一遍写了个O(n3)的。。还过了 // 穷举最后字符串的中心字符(1个或2个) // 1个的情形,求出两边字符串最多几个字符回文(相当于最长公共子串问题),然后添加不同的 // 2个的情形,注意,两个字符一定都是相等的(也是原来s就有的),因为如果有一个是新加的字符,这个字符完全可以不加 // // Copyright © 2021 <NAME>. All rights reserved. // class Solution { public: int f(string& a, string& b) { int m = a.size(), n = b.si...
ALGO
0.999119
5.460639
{ "github_metadata": { "branch": "master", "commit_count": 124, "repo_created_at": "2020-09-16T16:16:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "4236a093...
f69f0abd-f9d1-438e-825e-0cdda8272687
OpenNJet/OpenNJet
auto/lib/modsecurity/src/utils/system.cc
/* * ModSecurity, http://www.modsecurity.org/ * Copyright (c) 2015 - 2021 Trustwave Holdings, Inc. (http://www.trustwave.com/) * * 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 * * If any of the fil...
TOOL
0.904482
5.671705
{ "github_metadata": { "branch": "main", "commit_count": 3442, "repo_created_at": "2024-04-02T03:42:38.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1147, "forks": 28, "issues": 33, "pull_requests": 0 }, "file_meta": { "content_id": "73d08...
0362eb5c-dc77-4132-b057-b93223b60a05
Shabes7171/DSA-Final
Stack/Max_rectangle.cpp
#include <bits/stdc++.h> using namespace std; vector<int> nextSmallerElement(vector<int> &arr, int n) { stack<int> s; s.push(-1); vector<int> ans(n); for (int i = n - 1; i >= 0; i--) { while (s.top() != -1 && arr[s.top()] >= arr[i]) { s.pop(); } ans[i] = s.top(); ...
ALGO
0.999929
5.860095
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2025-02-10T17:11:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "96d87887f9f4...
070febed-c65a-4a66-84fb-03f544f8403a
LuhJunior/Estrutura-de-Dados
BinaryTree/BinaryTree.cpp
//###################################### BinaryTree.cpp ###################################### #include <iostream> #include "BinaryTree.h" using namespace std; template<class T> BTnode<T>*& BTnode<T>::rightMost(BTnode<T>*& node){ if(node != nullptr){ if(node->right == nullptr){ return node; ...
ALGO
0.999874
3.961405
{ "github_metadata": { "branch": "master", "commit_count": 43, "repo_created_at": "2017-09-01T03:20: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": "511fcfa3b...
7649ae71-9909-43b0-af2d-2be9aae80b4c
thilio/Competitive-programming-team
Trainings/ECPC 2019 Kickoff/k.cpp
#include "bits/stdc++.h" using namespace std; #define pb push_back #define mp make_pair #define fst first #define snd second #define fr(i,n) for(int i=0;i<n;i++) #define frr(i,n) for(int i=1;i<=n;i++) #define ms(x,i) memset(x,i,sizeof(x)) #define dbg(x) cout << #x << " = " << x << endl #define all(x) x.begin(),x.en...
ALGO
0.99999
3.201474
{ "github_metadata": { "branch": "main", "commit_count": 391, "repo_created_at": "2021-01-09T16:55:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d2aa080301...
10b68b1c-3196-45a0-b1a7-dd5b91bc0651
jackjr07/cs350p2
mysterysort2.cpp
/*<NAME> HW2 CS350 * Mystery sort */ #include<iostream> #include<cstring> using namespace std; void printNums(int z[], int count, int i){ if(i == count) { cout << endl; return; } cout << z[i] << " " ; return printNums(z, count, ++i); } int swap(int * p1, int * p2){ int hold = ...
ALGO
0.999973
4.311227
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2021-04-10T05:47:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d95dc5616a...
aafd86cc-a487-429a-9dd1-d81e63e95ddb
dyrisingsunlight/Solutions-that-written-on-the-paper-code-set
AcWing92递归实现指数型枚举/Code.cpp
//Coded by Dy. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #define gc getchar() #define pc(x) putchar(x) inline int sc() { int xx = 0, ff = 1; char cch = gc; while(!isdigit(cch)) { if(cch == '-') ff = -1; cch = gc; } while(isdigit(cch)) { xx = (xx << 1) + (x...
ALGO
0.999928
3.991382
{ "github_metadata": { "branch": "master", "commit_count": 132, "repo_created_at": "2019-09-28T15:59: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": "bcc5d541...
e3532b6a-cad6-4159-9ce3-e75d51c63a82
ishandutta2007/codeforces-i
icecuber/normal/1294/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while (t--) { int n; cin >> n; vector<pair<int,int>> p(n); for (auto&[x,y] : p) cin >> x >> y; sort(p.begin(), p.end()); string ans; int cx = 0, cy ...
ALGO
0.999948
4.192541
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T05:39: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": "511b27c841e0...
2a60d7b8-1ac3-4913-b18e-8994554edbab
ishandutta2007/codeforces-a
andrew/normal/1097/B.cpp
#include <bits/stdc++.h> #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #define fi first #define se second #define p_b push_back #define pll pair<ll,ll> #define m_p make_pair #define all(x) x.begin(),x.end() #define ld long double #define sset ordered_set using namespace std; using namesp...
ALGO
0.999931
3.912371
{ "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": "17f5a6d0244e...
f50b64f2-d932-4cd3-9a0e-877cd67948fa
shyu61/program-competition
code/ant/013.cpp
// Traveling by Stagecoach(POJ 2686) // http://poj.org/problem?id=2686 // https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1138&lang=ja // メモ化再帰での解法 #include <bits/stdc++.h> using namespace std; // 有向グラフの2点間最短距離問題なので、ダイクストラかDPを検討する // DAGであることがわかる(前後関係を規定できる)のでDPで解くことを考える // 状態遷移は、明らかに残り使えるチケットに依存するのでまずbit列で使...
ALGO
0.999845
4.099268
{ "github_metadata": { "branch": "main", "commit_count": 719, "repo_created_at": "2024-08-14T11:39: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": "1889989c50...
3adba7d3-0224-4017-bb9d-aa44a73afdd0
Vitor-Lacerda/TCC-OpenCV
PrototipoTCC/Main.cpp
#include <opencv\cv.h> #include <opencv\highgui.h> #include <stdio.h> #include <string.h> #include <math.h> #include <sstream> #include "Structs.h" #include "SegmentadorVagas.h" #include "VerificadorVagas.h" using namespace cv; using namespace std; int contaImagens = 121; struct MouseParams { Mat img; int pontosMa...
TOOL
0.924945
3.598716
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-07-29T12:35:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "22ebcae798...
513a7253-0df6-4db1-a9c5-f641debbc3b6
AmraPacariz/QtWinSoftIntership
stl_domashni/domashna8/domashna8-1.cpp
#include <iostream> #include <vector> #include <iterator> #include <algorithm> #include <numeric> using namespace std; class Vraboten { public: string ime; int bodovi; Vraboten(string ime, int bodovi) { this->ime = ime; this->bodovi = bodovi; } int getBodovi(){return bodovi;} }; b...
ALGO
0.999651
4.813449
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2023-02-21T21:36:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "efe50695f11...
314cc2a9-e550-4d21-8c8b-f9b81a7a3163
Landvibe-DataStructure-2024/Donghun-Mentee
week 12 practice/22_p01.cpp
#include <iostream> #include <string> using namespace std; #define no_item 0 #define available 1 #define is_item 2 class entry { public: int key; string value; int valid; entry() { key = 0; value = ""; valid = no_item; } entry(int k, string s) { key = k; value = s; valid = is_item; } void erase...
ALGO
0.998832
4.645842
{ "github_metadata": { "branch": "main", "commit_count": 51, "repo_created_at": "2024-03-13T05:09:29.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c3945cffb271...
ae60c0c0-d889-484d-b1de-1e241cd41f0d
Kodsport/liu-coding-challenge-2018
pokemon/submissions/accepted/pokemon_mw.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; enum class Square { Ice, Wall, Walkable, Grass }; struct Position { int x, y; Position(int _x, int _y) : x(_x), y(_y) { } Position operator+(const Position& other) const { return Position(x + other.x, y + other....
ALGO
0.99995
4.317595
{ "github_metadata": { "branch": "master", "commit_count": 63, "repo_created_at": "2018-02-07T19:49:58.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "58fb78b6c1...
117c7ca7-e5fd-457a-9dc9-c3a781008913
preksha108/oodp-lab
week-6/CompareString.cpp
// C++ program to compare two Strings // using Operator Overloading #include <cstring> #include <iostream> #include <string.h> using namespace std; // Class to implement operator overloading // function for concatenating the strings class CompareString { public: // Classes object of string char str[25];...
TOOL
0.959629
5.527538
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-10-26T09:20: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": "c622fc836482...
2c8235c3-c0d3-4cea-8383-982cf17dcc6d
ishandutta2007/codeforces-a
arsijo/normal/510/B.cpp
/* * Author: arsijo; */ #include <bits/stdc++.h> using namespace std; #define input freopen("input.txt", "r", stdin); #define files(x) freopen(x ".in", "r", stdin); freopen(x ".out", "w", stdout); #define sync ios_base::sync_with_stdio(0); cin.tie(0); #define ll long long void happyEnd() { cout << "Yes"; exit...
ALGO
0.999995
3.89446
{ "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": "38737d251685...
3e127204-7df4-4151-8b90-70f1403d1f2b
Iambharatkolhe/SY-PRACTICAL
DSPS-PRACTICAL/Linked List/dll.cpp
#include <iostream> using namespace std; class Node { public: int data; Node* next; Node* prev; }; Node* get_data() { Node* newnode = new Node; cout << "Enter Data: "; cin >> newnode->data; newnode->next = NULL; newnode->prev = NULL; return newnode; } Node* doubly() { Node *ne...
ALGO
0.940025
6.015635
{ "github_metadata": { "branch": "main", "commit_count": 87, "repo_created_at": "2024-08-18T09:51:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f2325678ee0...
5b5a3e33-c79a-4513-92f4-f67c036e6437
Zhima-Mochi/algorithm-problem-solving
cpp/1483.kth-ancestor-of-a-tree-node.cpp
/* * @lc app=leetcode id=1483 lang=cpp * * [1483] Kth Ancestor of a Tree Node */ #include <vector> #include <unordered_map> using namespace std; // @lc code=start // t:O(nlogn) s:O(nlogn) class TreeAncestor { int _n; vector<vector<int>> records; public: TreeAncestor(int n, vector<int> &parent) { ...
ALGO
0.999905
6.20582
{ "github_metadata": { "branch": "main", "commit_count": 128, "repo_created_at": "2022-03-09T05:47:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0e368b087d...
6669db0f-9984-40a9-bcd9-5c4532719496
tier4/qp_benchmark
src/trajectory_utils.hpp
#pragma once #include "motion_utils/trajectory/trajectory.hpp" #include "tier4_autoware_utils/geometry/geometry.hpp" #include "autoware_auto_planning_msgs/msg/trajectory_point.hpp" #include "geometry_msgs/msg/pose.hpp" #include <map> #include <optional> #include <tuple> #include <vector> namespace trajectory_utils ...
ALGO
0.99877
6.958576
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2023-01-17T09:47:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7849eadec447...
d211dbc5-25b0-4a27-8a64-7ba6775866a2
Yang-Shuo-YS/opencv
modules/calib3d/include/opencv2/calib3d.hpp
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, instal...
ALGO
0.995385
5.867786
{ "github_metadata": { "branch": "master", "commit_count": 22610, "repo_created_at": "2020-06-20T14:22:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "72e6ca...
0962261e-236e-428d-af67-4fdaa07110e2
Revanth15114073/ass2
solution3.cpp
#include <iostream> #include <cmath> #include <vector> using namespace std; int Key(std::vector<int> &v, int l, int n, int key) { while (n-l > 1) { int m = l + (n-l)/2; if (v[m] >= key) n = m; else l = m; } return n; } int LIS(std::vector<int> &v) { if (v.size() =...
ALGO
0.999868
3.973683
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-02-27T17:16:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "36ff0878b7...
2bb797fa-8ff4-40a7-8766-f737082e9cc7
bbom16/study_algorithm
algorithm_2019_cplus/algorithm_2019_cplus/1244_samsung.cpp
// // 1244_samsung.cpp // algorithm_2019_cplus // // Created by <NAME> on 2019. 5. 23.. // Copyright © 2019년 <NAME>. All rights reserved. // #include <stdio.h> #include <iostream> #include <string> #include <vector> #include <stdlib.h> using namespace std; vector<int> max_value; bool zero_chk; /* 최댓값 찾기 */ void ...
ALGO
0.999909
4.455913
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2019-01-13T06:23: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": "347f90754...
225e123d-dd44-434f-bd9f-03b61fc91084
kanhaiyabaranwal/my-programs-old
Jitendra_ALGO/ALGO/069_T41_IsBinarySearchTree.cpp
/* https://www.youtube.com/watch?v=MILxfAbIhrE http://www.geeksforgeeks.org/a-program-to-check-if-a-binary-tree-is-bst-or-not/ Check if Binary Tree is Binary Search Tree A program to check if a binary tree is BST or not */ #include<iostream> using namespace std; namespace NS69 { struct node { int data; struct no...
ALGO
0.999959
4.867733
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-10-26T08:57: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": "835b520b59...
b4271c30-8eae-4ffa-b951-6387f821b8f0
yaoyaoding/ac-record
cf440/C.cpp
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; const int Mod = 1e9 + 7; int n; int xx[N], yy[N]; int fa[N]; map<int,vector<int> > mpx, mpy; vector<int> vcs[N]; vector<int> vcsx[N], vcsy[N]; int find(int a) { return a == fa[a] ? a : fa[a] = find(fa[a]); } void unon(int a, int b) { fa[find(a)]...
ALGO
0.999842
4.22487
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2017-09-26T03:40: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": "19959100d6...
a7bfd1cb-931f-470a-afef-44d15e4add7e
zaid1912/CS221-DSA-COURSE
Practice/singly_linked_list.cpp
#include<iostream> using namespace std; template<class T> class list{ private: struct node{ node *next; T data; }; node *headptr; public: list(){ headptr = NULL; } void insertAtHead(T key){ node *newnode = new node; newnode->data = key; ...
ALGO
0.999575
4.6059
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2022-11-18T13:58: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": "71b135682b...
466e7d5d-9da0-4aa4-9c50-09959a1b8d20
SaquibAnwar/Cpp-playground
8. Linked List - 1/inputList.cpp
#include<iostream> #include "linkedList.cpp" using namespace std; Node * takeInput() { int data; cin >> data; Node *head = NULL; while(data != -1){ Node *newNode = new Node(data); if(head == NULL){ head = newNode; } else{ Node * temp = head; ...
ALGO
0.999559
4.357896
{ "github_metadata": { "branch": "master", "commit_count": 120, "repo_created_at": "2019-05-31T16:29:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "849a87a6...
beab7b24-5a66-4dc6-ad72-16290e045ccc
tamaranjagulovic/PA_Homework
Project3/Project3/Source.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include "PrintOp.h" #define DATASETS 10 #define MAX_LENGTH 100 int main() { srand(time(NULL)); // Define an array with 10 datasets char datasets[DATASETS][MAX_LENGTH + 1]; char target[] = "func(myFunction)"; for (in...
ALGO
0.97249
4.599402
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-05-23T20:50:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5717c7606473...
532e6e18-1d75-46f7-a757-b7d42c68b026
biswanaths/competition
spoj/hallow.cpp
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
ALGO
0.999959
3.158596
{ "github_metadata": { "branch": "master", "commit_count": 83, "repo_created_at": "2015-02-26T12:45: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": "49484ef53...
e4e593c9-585b-43ed-b8b8-907a48baf78a
jqxallen/LeetCode
Algorithms/Course Schedule II/Source.cpp
/* * Author: <NAME> * Date: May 17, 2015 * Link: https://leetcode.com/problems/course-schedule-ii/ * Description: * There are a total of n courses you have to take, labeled from 0 to n - 1. * Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed ...
ALGO
0.999964
6.877291
{ "github_metadata": { "branch": "master", "commit_count": 257, "repo_created_at": "2013-11-01T07:45:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69d922c8...
d1dd1bc0-2679-4165-9d70-9ab161c924f8
janH-21/Untersuchung-zu-evolutionaeren-Aspekten-der-Genregulation
Modell/model_fd0Loops.cpp
#include <string> #include <vector> #include <algorithm> #include <iostream> #include <fstream> #include <sstream> #include <map> #include <deque> #include <math.h> #include <stdlib.h> #include <stdio.h> using namespace std; void ErrorhandlerExit(const char* p1,const char* p2="") { cerr << p1 << " " << p2 << endl;...
ALGO
0.989502
3.914767
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-01-27T19:22:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "050ac87f62b...
32c1e218-ed12-44eb-b130-48b506be63cc
Flinsch/flangee77
flangee77/src/MathLabs/Vector2.cpp
#include "Vector2.h" namespace ml7 { const Vector2 Vector2::ZERO = {0.0f, 0.0f}; const Vector2 Vector2::X = {1.0f, 0.0f}; const Vector2 Vector2::Y = {0.0f, 1.0f}; // ############################################################################# // Construction / Destruction /...
ALGO
0.939474
7.285233
{ "github_metadata": { "branch": "main", "commit_count": 406, "repo_created_at": "2023-08-14T12:13:52.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "7609520a6c...
760e9ba5-9c06-4daf-821a-1012e0f1cb2a
rabbitmjh/BaekjoonRabbitmjh
백준/Silver/1455. 뒤집기 II/뒤집기 II.cc
#include <bits/stdc++.h> using namespace std; #define FIO ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); typedef long long ll; typedef pair<ll, ll> p; typedef pair<int, p> pp; int n, m, arr[105][105], ans; char c[105][105]; void reverse(int y, int x) { for (int i = 0; i <= y; i++) for (int j = 0; j <=...
ALGO
0.999959
3.511961
{ "github_metadata": { "branch": "main", "commit_count": 185, "repo_created_at": "2022-10-31T03:09: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": "273b1947c4...
4bf71da9-3854-40b3-837f-967059815e33
jupitersnow1/DS_Library
4.Queues/applications_queues/moveNthFront.cpp
#include <iostream> #include <queue> using namespace std; void moveNthFront(queue<int> &q, int n) { int size = q.size(); if (n <= 0 || n > size) { return; } // step 1: Move n-1 elements to the rear ( (n = 5, move 4 elements) || (n = 3, move 2 elements) etc) for (int i = 1; i < n - 1; ...
ALGO
0.999783
5.008598
{ "github_metadata": { "branch": "main", "commit_count": 25, "repo_created_at": "2022-12-30T01:09:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": { "content_id": "fb8c3effa01...
08589b5c-b304-4ef6-b588-efdd020c20de
residencia18/240004-albert-silva-de-jesus
modulo-01-programacao-imperativa/semana1/solucoes-praticas/PI-P005/exercicio5/c.cpp
/*Exercício 5: Operadores bit a bit ● Uma pesquisa monitora 8 genes de uma planta para avaliar como cada um deles influencia na resposta a uma determinada praga. Os pesquisadores optaram por representar a informação dos genes de cada planta com um inteiro sem sinal, onde cada bit da representação binária identifica se ...
ALGO
0.992003
4.788083
{ "github_metadata": { "branch": "main", "commit_count": 308, "repo_created_at": "2024-02-20T19:21:28.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b14704830f0...
f131b0d8-f3df-4cce-a670-5cf36d0114d0
tsurumeso/AtCoder
abc/149/d.cpp
#include <bits/stdc++.h> #include <algorithm> using namespace std; #define sqr(x) ((x) * (x)) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() typedef vector<int> vi; typedef pair<int, int> pii; typedef long long ll; void solve() { int N, K, R, S, P; string T; cin >> N >> K >> R ...
ALGO
0.995093
4.15503
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2019-11-05T15:00: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": "0e9268802...
64b078bb-1536-47e9-8999-e6d7dcda4fe9
zhedahht/CodingInterviewChinese2
62_LastNumberInCircle/LastNumberInCircle.cpp
/******************************************************************* Copyright(c) 2016, <NAME> All rights reserved. Distributed under the BSD license. (See accompanying file LICENSE.txt at https://github.com/zhedahht/CodingInterviewChinese2/blob/master/LICENSE.txt) *****************************************************...
ALGO
0.999731
5.062384
{ "github_metadata": { "branch": "master", "commit_count": 100, "repo_created_at": "2016-11-21T05:04:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5377, "forks": 2163, "issues": 60, "pull_requests": 9 }, "file_meta": { "content_id": "1...
36f73b55-8849-45fd-b3ea-944b69931f23
apache/doris
be/src/http/action/compaction_score_action.cpp
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
WEB
0.967912
7.070557
{ "github_metadata": { "branch": "master", "commit_count": 26499, "repo_created_at": "2017-08-10T12:13:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13962, "forks": 3497, "issues": 2697, "pull_requests": 616 }, "file_meta": { "content_i...
dc520d22-f75b-485d-af40-c64c8bf3c69f
Ananya200305/c-assignment
Assignment/assignment6.cpp
#include <iostream> using namespace std; struct node { int data; node * prev; node * next; }; node * head = NULL; void display(){ if(head == NULL){ cout << "Doubly Circular Linked List is empty." << endl; return; } node * temp = head; do{ cout << temp -> data <...
ALGO
0.995619
5.22817
{ "github_metadata": { "branch": "main", "commit_count": 21, "repo_created_at": "2024-09-06T09:45: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": "59a474b9233...
4b3ef171-0af4-4ee5-b6eb-1259cbf1e4fe
dolmatovDan/competitive-coding-library
Sorts/fool_sort.cpp
#include <bits/stdc++.h> using namespace std; vector<int> input_vector() { vector<int> A; string line; getline(cin, line); stringstream line_stream(line); while (not line_stream.eof()) { int x; line_stream >> x; A.push_back(x); } return A; } void print_vector(vector<int> A) { for (auto &x ...
ALGO
0.999906
5.376963
{ "github_metadata": { "branch": "main", "commit_count": 65, "repo_created_at": "2022-02-28T15:14: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": "c067565a9ea...
ab1fb4bc-6686-422d-b130-ec6251bb8b2f
peixinli/leetcode
Median of Two Sorted Arrays.cpp
class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { int m = nums1.size(); int n = nums2.size(); int k = (m + n + 1) /2; double med = (double) findkth(nums1, nums2, 0, m , 0, n , k); cout<<med<<endl; if((m + n) % 2 == 0){ ...
ALGO
0.999991
5.769007
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2015-07-23T11:16: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": "adddc1e944...
48445185-ee91-4e8b-96d4-3cb333cca0d8
HelesHeller/Equation.hw21
Equation.hw21/Main.cpp
#include <iostream> #include <cmath> #include<windows.h> class Equation { public: virtual void solve() = 0; }; class LinearEquation : public Equation { private: double a, b; public: LinearEquation(double coefA, double coefB) : a(coefA), b(coefB) {} void solve() override { if (a == 0) { ...
ALGO
0.997407
4.594705
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-07-17T12:53:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1a00c4704e...
291b5675-584e-44a6-8c23-31cadbf08039
conggaro/Hoc_OOP_co_Xuyen
bài giảng OOP của cô Xuyến/Tuần 3/Bài tập thực hành_chấm tự động_tuần 3/phan_2-5.cpp
// Yêu cầu: // 1. nhập số n từ bàn phím // 2. nhập các phần tử a[0] đến a[n-1] // 3. đếm số lượng các SỐ NGUYÊN TỐ có trong dãy #include <iostream> #define SIZE 1000 using namespace std; // hàm kiểm tra số nguyên tố // số 1 không phải số nguyên tố bool KiemTra_SNT(int thamSo){ bool khoi_tao; int dem = 0; ...
ALGO
0.999839
4.7625
{ "github_metadata": { "branch": "main", "commit_count": 34, "repo_created_at": "2023-05-25T05:53: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": "0818d393117...
47c1d472-1e46-4031-bfee-bad5c8c699b9
EmptyDust/Algorithm-Codes-and-writeups
codes/-0x30_competition/-0x39_xcpc/icpc_2024_shenyang/I.cpp
#include <bits/stdc++.h> #define ranges std::ranges #define views std::views using u32 = unsigned; using i64 = long long; using u64 = unsigned long long; using pii = std::pair<int, int>; using a3 = std::array<i64, 3>; using a4 = std::array<int, 4>; const int N = 1e6; const int MAXN = 1e6 + 10; const int inf = 1e9; ...
ALGO
0.999645
4.136797
{ "github_metadata": { "branch": "main", "commit_count": 172, "repo_created_at": "2023-11-03T02:38:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "493b2cfa1e...
91441ee6-b581-4f4e-8c63-4c0e56768a70
BardoBard/Bardrix
Bardrix/src/bardrix/physics.cpp
// // Created by Bardio on 04/06/2024. // #include <bardrix/physics.h> namespace bardrix { force calculate_force(mass m, acceleration a) noexcept { return m * a; } mass calculate_mass(force f, acceleration a) { if (nearly_equal(a, 0)) UNLIKELY throw std::invalid_argument("Acceleration cannot be zero...
ALGO
0.904783
6.391827
{ "github_metadata": { "branch": "master", "commit_count": 183, "repo_created_at": "2024-03-04T00:00:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "46375576...
9f91116e-9d6e-46a8-8dd9-3440d155d7e2
ariloc/CompetitiveProgrammingCodes
CodeForces/1493C (v2, Implementation).cpp
#include <bits/stdc++.h> //#pragma GCC optimize("Ofast,unroll-loops") //#pragma GCC target("avx,avx2,fma") #define forn(i,n) for(int i = 0; i < int(n); i++) #define forsn(i,s,n) for(int i = int(s); i < int(n); i++) #define dforn(i,n) for (int i = int(n)-1; i >= 0; i--) #define dforsn(i,s,n) for(int i = int(n)-1; i >=...
ALGO
0.999762
3.515676
{ "github_metadata": { "branch": "master", "commit_count": 183, "repo_created_at": "2020-08-19T01:48:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "257932d0...
785256c4-3f48-4997-bdec-66a563f76ad2
Arpit-2678/Competitive-Programs
Symmetric Tree.cpp
// LINK=https://practice.geeksforgeeks.org/problems/symmetric-tree/1/?problemStatus=unsolved&problemType=functional&difficulty[]=-2&difficulty[]=-1&difficulty[]=0&page=1&sortBy=submissions&category[]=Tree&query=problemStatusunsolvedproblemTypefunctionaldifficulty[]-2difficulty[]-1difficulty[]0page1sortBysubmissionscate...
ALGO
0.999924
6.060132
{ "github_metadata": { "branch": "main", "commit_count": 900, "repo_created_at": "2021-03-24T14:19: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": "5ad265b88d...
d94e2003-f0a3-4857-8d8e-bae184819b4e
imuxiaobai/lm_test
backend/problem.hpp
#ifndef LM_TEST_PROBLEM_H #define LM_TEST_PROBLEM_H #include <unordered_map> #include <map> // #include <memory> #include "edge.hpp" #include "vertex.hpp" #include "types.hpp" namespace lm_test{ class Problem{ /*先假设是普通最小二乘问题 */ public: typedef std::map<Id_type, std::shared_ptr<Vertex>> WholeVertex; type...
TEST
0.98617
3.837863
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-08-23T06:59: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": "9d5a2e16d2...
3b813d2a-c493-4f26-a0cc-979a36f83350
tshu-w/ICPC
training/Uva/10391.cpp
// written at 19:56 on 09 May 2017 #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".i...
ALGO
0.999118
3.169091
{ "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": "253ce...
2fe23deb-ecca-475c-be80-bc7da9add285
keer25/Algorithm-Implementations
Basics/Graphs/hamiltonian.cpp
# include <iostream> # include <unordered_map> # include <queue> # include <stack> # include <vector> using namespace std; typedef unordered_map<int, vector<int> > al; void initialize_graph(al& graph, int n) { // Graph with nodes from 0 to n-1 is a good generalization o.w have a mappign of the nodes to these indices ...
ALGO
0.999925
4.668498
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-06-27T20:12: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": "0d8b95330f...
e100d29f-48e8-4f1c-8b64-7597574af79b
thisisdos1984/modernCppExamples
dataStructures/zeroMatrix.cpp
#include <iostream> #include <vector> typedef const std::vector<int> const_int; void printMatrix(const std::vector <std::vector<int>> &input) { for (auto &x : input) { for (auto &y : x) std::cout << y << " "; std::cout << std::endl; } } void zeroRow(std::vector <std::vector<int>> &input, int index) { fo...
ALGO
0.999765
5.626258
{ "github_metadata": { "branch": "master", "commit_count": 24, "repo_created_at": "2017-11-14T15:44: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": "ec7c4848d...
2178ffa2-7f14-4d75-b191-cc65e658a3a4
uinstall/gc
Flood_fill_4_conn.cpp
//Name:<NAME> //Roll no:240 #include <graphics.h>// // header file that provides functions and data types for graphics programming. here putpixel(), boundaryFill() void flood(int x, int y, int new_col, int old_col)/* This line defines the flood function, which is responsible for performing the flood fill operation. I...
ALGO
0.955566
3.985213
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-07-14T06:10: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": "dd7184a25b8e...
cb785476-c4e6-482d-b11e-ca0f6039d8c0
Reavolt/basics-of-c-plus-plus-development-red-belt
Week_2/03 Practice Programming Assignment/Source/slow.cpp
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; class RouteManager { public: void AddRoute(int start, int finish) { reachable_lists_[start].push_back(finish); reachable_lists_[finish].push_back(start); } int FindNearestFin...
ALGO
0.999029
5.209876
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2020-11-16T15:27:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 30, "forks": 18, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1ca65f0f26...
063fb68e-c21f-4238-8899-16ae05a383d2
sudoshivesh/leetcode-problem-solution
hard/Minimum Total Distance Traveled.cpp
//2463. Minimum Total Distance Traveled //My submission Link: https://leetcode.com/contest/weekly-contest-318/submissions/detail/838161239/ class Solution { public: typedef long long ll; int n, m; vector<vector<int>>factories; vector<int>robots; vector<vector<vector<ll>>>dp; ll findAns(int i, ...
ALGO
0.999987
5.464312
{ "github_metadata": { "branch": "sudo", "commit_count": 179, "repo_created_at": "2022-10-10T19:27: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": "f02e4e045d...
0ec75498-3dfb-4f38-9e86-d00257af3030
vmhl87/oly
cses/minimizing_coins.cpp
// Minimizing Coins - https://cses.fi/problemset/task/1634 // // Yet another shameless DP bash - compute for each sum s the // minimum number of coins required recursively, adding one coin // on at a time according to which is optimal #include <iostream> #include <vector> using namespace std; // i am really just to...
ALGO
0.999977
4.814466
{ "github_metadata": { "branch": "main", "commit_count": 516, "repo_created_at": "2023-08-30T20:15:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "075305e6c5...
465cbed8-c110-4db0-830a-d281578187f3
YoungWanHeeMOng/Vector_Quque_List_Pair_etc
cpp_Vector/Source1.cpp
#include <iostream> #include <algorithm> #include <vector> #include <set> using namespace std; void add2(int i) { cout << i+2 << endl; } template <int val> void addVal(int i) { cout << val+i << endl; } set<int> myset={3,1,25,7,12}; set<int, less<int>> myset2={3,1,25,7,12}; // sort function 1 bool lsb_less(in...
ALGO
0.990376
4.210082
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2020-12-11T11:36:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "2788522546...
97128f45-c6e1-482b-9e68-7336fb8cc8ea
bigwookiee/hafb-cpp-fundamentals
Module1/LA1-3/util.cpp
#include <iostream> #include <array> #include "util.h" using namespace std; /** * @brief adds two numbers. * * @param x * @param y * @return int */ int sum(int x, int y){ return x + y; } /** * @brief increments num by one; * * @param step */ void updateStep(int step){ cout << "Step is: " << ste...
TOOL
0.933909
4.007287
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2019-12-16T16:10:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 20, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "953bbde7...
16db598f-6ac9-4fa9-aaff-fbc174ea8920
combo667/SDE
Merge Two Sorted Array WithOut Extrta Space/method-2-Pntr.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pb push_back #define mp make_pair #define rep1(i, n) for (int i = 0; i < n; i++) #define rep2(i, n) for (int i = 1; i <= n; i++) #define rep(i, a, b) for (int i = a; i < b; i++) #define REPD(i, n) for (int i = n - 1; i >= 0; i--) #define FORD(i...
ALGO
0.999996
3.670403
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-10-03T17:23:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e197196e42...
38860970-7a14-40a0-bb17-4fe429857c57
Zovube/CP-library
Strings/Simple/pi2z.cpp
#pragma GCC optimize("O3") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx") #define __USE_MINGW_ANSI_STDIO 0 #include<bits/stdc++.h> using namespace std; #define PI acos(-1) #define pb push_back #define fi first #define se second #define TASK "invtrans" #define sz(a) (int)...
ALGO
0.999986
3.636667
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-01-13T07:17: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": "5cbb0095b...
5f34bba1-f4e5-4433-8caf-c84722d4d98b
paolofrance/trajectory_plotter
src/human_traj_estimation.cpp
#include <trajectory_plotter/human_traj_estimation.h> #include <trajectory_plotter/utils.h> #include <ros/package.h> TrajEstimator::TrajEstimator(ros::NodeHandle nh) :nh_(nh) { w_b_ .setZero(); dW_ .setZero(); velocity_.setZero(); if ( !nh_.getParam ( "sampling_time", dt_) ) { ROS_WARN_STREAM...
ALGO
0.969015
5.788629
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2021-11-23T16:08: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": "0965245a1...
f6933aee-db30-43a9-9323-3a499634d554
Runarok/GeeksForGeeks-solutions
Difficulty: Medium/The Infinite String/the-infinite-string.cpp
//{ Driver Code Starts // Initial Template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends // User function Template for C++ class Solution { public: // Function to calculate the character at the given position in the infinite sequence char posInfinite(long long pos){ //...
ALGO
0.999892
4.779374
{ "github_metadata": { "branch": "main", "commit_count": 6962, "repo_created_at": "2025-01-14T04:19:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9d8242ab9...
8e9067aa-2a0d-452f-9f32-61d5fd3b8d8d
shashank9aug/DSA_CB
Recurssion/ImpletationBased/string_generation.cpp
/* we have given mapping of number in which : 1->A 2->B 3->C .... 26->Z we have to generate all the possible strings from set of array elements ip : 1234 1234 -> ABCD (12)34 -> LCD 1(23)4 -> AWD 12(34) -> not possible */ #include<iostream> #include<string> #include...
ALGO
0.999418
4.030891
{ "github_metadata": { "branch": "master", "commit_count": 77, "repo_created_at": "2021-05-23T17:51:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "00c68adba...
b0048172-ab50-4d2b-938a-1c742ac7d9ee
Waleed-Ahmed-05/Programming-Fundamentals
Week_04/PD/UAMS.cpp
// First Version of UAMS System #include <iostream> #include <windows.h> using namespace std; void Print_Menu(); float Calculate_Aggregate(string, float, float, float); void Compare_Marks(string, float, string, float); int main() { string Choice; while(true) { system("cls"); Print_Menu();...
TOOL
0.939352
3.311259
{ "github_metadata": { "branch": "main", "commit_count": 26, "repo_created_at": "2024-05-29T18:28:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8025ed082a3...
a5eff5ec-2170-45fa-87e5-f884f8c96192
KhoiBui16/28Tech_Code_Online
Data structure algorithm/Source Code DSA Contest/BackTracking/Bai06_NQueen1.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int n , c[25] , d1[50] , d2[50] , res; void Try(int i) { for(int j = 1 ; j <= n ; j++) { if(!c[j] && !d1[i - j + n] && !d2[i + j - 1]) { c[j] = d1[i - j + n] = d2[i + j - 1] = 1; ...
ALGO
0.999978
3.753565
{ "github_metadata": { "branch": "main", "commit_count": 104, "repo_created_at": "2024-01-13T13:33:18.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d78672d41a...
53eb8b23-1abe-4c7e-ae5d-21bac7da1432
joeyst/chess-engine
diagonal_positions.h
#include <cstdint> #include "constants.h" #include "mask.h" #ifndef DIAGONAL_POSITIONS_H #define DIAGONAL_POSITIONS_H class DiagonalSituation { public: uint64_t board; uint8_t square; DiagonalSituation(uint64_t b, uint8_t s); uint8_t get_up_left_diagonal_number(); uint8_t get_up_right_diagonal_...
ALGO
0.9852
5.858211
{ "github_metadata": { "branch": "master", "commit_count": 51, "repo_created_at": "2022-08-14T03:39:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "82394c23d...
38b6c56b-641c-4b6a-8f76-0ab57ff667ee
pankajgupta3/Coding-Ninjas--Data-Structures-and-Algorithms-in-Cpp
Arrays & Strings/Reverse string Word Wise.cpp
/*Code: Reverse string Word Wise Reverse the given string word wise. That is, the last word in given string should come at 1st place, last second word at 2nd place and so on. Individual words should remain as it is. Input format : String in a single line Output format : Word wise reversed string in a single line Constr...
ALGO
0.999995
4.797433
{ "github_metadata": { "branch": "main", "commit_count": 199, "repo_created_at": "2021-02-20T04:04:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dd0ae3ec3d...
c628f92b-0604-4c0e-888b-bf40883e1ad8
zouzh/graph
shaolei_2.cpp
// shaolei.cpp -- achieve shaolei using c++ // the region of game is at least 10*10, and at most 30*30 // when someone begin the game, he won't step at landmine // and there hasn't any landmine around the first // click position. So we must arrange the landmin...
ALGO
0.996488
3.05297
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2016-06-26T02:33: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": "f57e086e5...
d52b3cd4-e924-4ec0-a2ba-5699e6674632
DerekSlagle/perspective3D
perspective_types/persPt.cpp
#include "persPt.h" float persPt::X0 = 1000.0f, persPt::Yh = 300.0f;// view point in window float persPt::Z0 = 400.0f;// for perspective scaling of x and y coordinates vec3f persPt::camPos = vec3f(0.0f,0.0f,0.0f);// camera position in scene vec3f persPt::zuCam = vec3f(0.0f,0.0f,1.0f);// direction pointed vec3f persPt:...
TOOL
0.924616
5.215767
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2025-04-05T16:36: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": "5710021e505b...
fe35db9c-4d0d-4a57-93d1-d93e6960cc58
Redleaf23477/ojcodes
codeforces/edu104/B.cpp
// by redleaf23477 #include <bits/stdc++.h> // iostream macros #define endl '\n' #define var(x) "[" << #x << "=" << x << "]" // chrono macros #define chrono_now std::chrono::high_resolution_clock::now() #define chrono_duration(t1, t2) std::chrono::duration<double>(t2-t1).count() #define chrono_rand_seed chrono_now.tim...
ALGO
0.999964
4.219911
{ "github_metadata": { "branch": "master", "commit_count": 183, "repo_created_at": "2017-10-19T06:38: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": "8d9cc888...
975c004c-fa92-4f1b-a07a-e42b416d173e
Nico0oblr/mcwf
src/HSpaceDistribution.cpp
#include "HSpaceDistribution.hpp" vec_t HSpaceDistribution::draw() const { return m_states.at(linear_search(m_probabilities)); } HSpaceDistribution::HSpaceDistribution(const std::vector<double> & probabilities, const std::vector<vec_t> & states) :m_probabilities(probabilities), m_states(states) {} HSpace...
ALGO
0.990033
4.50766
{ "github_metadata": { "branch": "master", "commit_count": 42, "repo_created_at": "2023-03-07T10:11: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": "1ae08b38c...
aed1b078-e5c5-4ad5-b892-6270d69085c5
yukirin/coder
atcoder/abc073/D/main.cpp
#include <bits/stdc++.h> #ifdef _DEBUG #define debug(x) cerr << "line: " << __LINE__ << ", func: " << __func__ << " -> " << #x << " = " << x << endl #else #define debug(x) #endif #define all(s) begin(s), end(s) #define rall(s) rbegin(s), rend(s) #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a,...
ALGO
0.999935
4.571347
{ "github_metadata": { "branch": "master", "commit_count": 383, "repo_created_at": "2017-03-27T09:23:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e119ee00...
0917a192-f19a-4810-9694-76b120020eef
klasma/BaxterAlgorithms
Tracking/Viterbi/Tree.cpp
#include "Tree.h" #include <cstddef> // To get NULL. #include <map> #include <stdio.h> #include <assert.h> #include "Apoptosis.h" #include "CellNode.h" #include "Event.h" #include "LogStream.h" #include "State.h" using namespace std; Tree::Tree(int aNumT) : mNumT(aNumT), mIteration(1) { mActiveCell = NULL; } // Th...
ALGO
0.9394
4.416947
{ "github_metadata": { "branch": "master", "commit_count": 29, "repo_created_at": "2018-12-03T19:48:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 40, "forks": 13, "issues": 5, "pull_requests": 2 }, "file_meta": { "content_id": "413652a...
fd598031-5c76-456a-9a1d-9126eadda580
ns-sck/Competitive-Programming
inzva/advanced/printing_lis.cpp
#include<bits/stdc++.h> #define inf INT_MAX #define ll long long #define pb(a) push_back(a) #define mp(a,b) make_pair(a,b) #define fri(b) freopen(b,"r",stdin) #define fro(b) freopen(b,"w",stdout) #define bassifir(a) __builtin_clz(a) #define sonsifir(a) __builtin_ctz(a) #define birsay(a) __builtin_popcount(a) #define UP...
ALGO
0.999991
4.311111
{ "github_metadata": { "branch": "main", "commit_count": 54, "repo_created_at": "2024-02-10T13:27:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "273e07bcb04...
5a3f1c3c-2f26-4634-90e1-84cc24db41d8
Ayushd70/LeetCodeSolutions
CPP/HouseRobber2.cpp
// Leetcode Problem : 213 House Robber II // Link : (https://leetcode.com/problems/house-robber-ii/) #include <bits/stdc++.h> using namespace std; class Solution { public: int rob(vector<int> &nums) { // if there are no houses we can't rob any money if (nums.size() == 0) return 0; ...
ALGO
0.999965
5.380181
{ "github_metadata": { "branch": "master", "commit_count": 513, "repo_created_at": "2020-10-01T04:50:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 68, "issues": 0, "pull_requests": 8 }, "file_meta": { "content_id": "88cd0d...
f7a8375e-8bf0-4f5e-9520-88ce15a85aab
prateeksahu-me/DSA4
Heap/Merge K sorted array/Merge K sorted arrays.cpp
#include <bits/stdc++.h> using namespace std; typedef pair<int, pair<int, int> > ppi; vector<int> mergeKSortedArrays(vector<vector<int>> arr){ vector<int> output; // Create a min heap with k heap nodes. Every // heap node has first element of an array priority_queue<ppi, vector<ppi>, greater<ppi> ...
ALGO
0.999993
5.17731
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2022-08-04T17:58: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": "d60ef210817...
238ec395-ef28-41ec-82e9-e6e924c167d4
statco19/codeforces-problems
1795D.cpp
#include <bits/stdc++.h> using namespace std; #define pii pair<int, int> #define vt vector #define ll long long #define pb push_back #define ioa insert_or_assign #define umap unordered_map #define prq priority_queue #define F first #define S second #define all(c) (c).begin(), (c).end() #define rev(c) (c).rbegin(), (c)...
ALGO
0.999986
4.561204
{ "github_metadata": { "branch": "main", "commit_count": 154, "repo_created_at": "2022-10-22T03:21: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": "b60ba70a5b...
63a475a7-3d93-4588-97db-e586fc1e7b73
zyxivy/MyStudyProject
MyStudyProject/298 - Binary Tree Longest Consecutive Sequence.cpp
//Given a binary tree, find the length of the longest consecutive sequence path. //The path refers to any sequence of nodes from some starting node to any node in the tree along the parent - child connections.The longest consecutive path need to be from parent to child(cannot be the reverse). //For example, //1 //\ //3...
ALGO
0.99998
5.164374
{ "github_metadata": { "branch": "master", "commit_count": 113, "repo_created_at": "2017-05-09T04:28:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "71c9412d...
12c63cf4-d66b-4da2-83d1-e477f5730ea6
NIA/D3DMorphing
tessellate.cpp
#include "tessellate.h" const DWORD TESSELATE_DEGREE = 150; const Index TESSELATED_VERTICES_COUNT = (TESSELATE_DEGREE+1)*(TESSELATE_DEGREE+2)/2; const DWORD TESSELATED_INDICES_COUNT = 3*TESSELATE_DEGREE*TESSELATE_DEGREE; namespace { void add_triangle( Index i1, Index i2, Index i3, Index *indices, DWORD &current_i...
ALGO
0.971488
5.652766
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2009-10-04T10:26:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "af79d9f9e...
4f4a75a5-b1ca-4f46-855f-ff81edb4dee5
Moctader/Introduction-to-Algorithms---Problem-Solving-Part---III
Week 08 Knapsack/Module 27 Theory exam/test2.cpp
#include<iostream> #include <vector> #include <algorithm> #include <unordered_map> int robUtil(vector<int>& nums, int start, int end, unordered_map<string, int>& memo) { if (start > end) { return 0; } string key = to_string(start) + "-" + to_string(end); if (memo.count(key)) { ...
ALGO
0.999864
5.011046
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2023-05-01T08:38: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": "a4772fc28...
fb38b6bd-1bb4-48ed-923b-0a48bae2926d
oneseedfruit/UTMSPACE_2019-2020-sem2_SCSJ2013_Data_Structures_-_Algorithm
final_exam/linked_list_01.cpp
// SCSJ 2013 - DATA Structures And Algorithms // Practical Exam // Semester 20192020 - 02 // Question 1 - linkedlist_01.cpp // Student detail // Name: <NAME> // Matric No.: SX180357CSJS04 #include <iostream> #include <string> using namespace std; // Class definitions. ///////////////////////////////////////////////...
ALGO
0.993931
4.722499
{ "github_metadata": { "branch": "master", "commit_count": 68, "repo_created_at": "2020-02-15T22:26:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "081d65243...
b57cb002-f95f-4691-add0-da449dee34d5
andrewqt/Competitive-Programming
CodeForces/_0590_C_ThreeStates/_0590_C_ThreeStates.cpp
// Problem : C. Three States // Contest : Codeforces - Codeforces Round #327 (Div. 1) // URL : https://codeforces.com/contest/590/problem/C // Memory Limit : 512 MB // Time Limit : 5000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> using namespace std; int N, M; char mp[...
ALGO
0.999823
3.957271
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2018-09-08T12:27:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1ceaff184...
7f61abb3-1339-4488-8929-29e05bbb534b
victorsenam/treinos
ojs/vjudge/172461/C/C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll,ll> pii; #define pb push_back const int N = 300; const int M = 1e6; const ll MOD = 1e9+7; int n, m; ll deg[N]; ll adj[N][N]; int v[M][2]; ll dp[2][4][4]; ll choose (ll a, ll b) { ll r = 1; for (int i = 0; i < b; i++) ...
ALGO
0.999944
3.972618
{ "github_metadata": { "branch": "master", "commit_count": 844, "repo_created_at": "2015-08-23T22:27:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ba08ef53...
25d370a6-19e8-493b-9150-ef2d8bd03440
Sd-Invol/shoka
TheWaySoFar-Training/2015-03-13/B.cpp
#include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 100005; char str[N]; int n; int u[N][4]; int len[N] , f[N]; int nodecnt , root; void extend(int i , int c) { int p = root; while (str[i - 1 - len[p]] != str[i]) p = f[p]; int& pp = u[p][c]; if (!pp) { pp ...
ALGO
0.999796
4.102145
{ "github_metadata": { "branch": "master", "commit_count": 348, "repo_created_at": "2013-10-04T08:20:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 37, "forks": 11, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "86436f...
d1729669-a70a-4f34-bcc3-d4db1da224f6
IIMixaII/C_Laba8
FileName.cpp
#include <iostream> struct TQueue { int* array; int capacity; int size; int front; int rear; }; // Создание динамической структуры void InitQueue(TQueue& Q, int capacity) { Q.array = new int[capacity]; Q.capacity = capacity; Q.size = 0; Q.front = 0; Q.rear = -1; } // Добавлени...
ALGO
0.994383
5.335112
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2024-08-22T20:07: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": "9146bb27eb...
6517d1ee-0343-4a10-8165-374b17c83e44
oldrichvlachzostravy/MortarC
src/GaussianQuadrature.cpp
#include "GaussianQuadrature.h" double GaussianQuadrature::GAUSSPOINTS[3][3] = { { 0, 0, 0 }, { -1 / sqrt(3), 1 / sqrt(3), 0 }, {-sqrt(3.0 / 5), 0, sqrt(3.0 / 5) } }; double GaussianQuadrature::GAUSSWEIGHTS[3][3] = { { 2.0, 0, 0 }, { 1, 1, 0 }, { 5.0 / 9, 8.0 / 9, 5.0 / 9 } }; double * GaussianQuadrature...
ALGO
0.997247
5.798235
{ "github_metadata": { "branch": "master", "commit_count": 50, "repo_created_at": "2015-02-17T10:38: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": "91556d067...
f351654c-5e67-4d31-a20e-c37064a7cdd7
carlosDAC2020/u_codes
5to_semestre/struct_data/lista simple/copia.cpp
#include <iostream> using namespace std; struct nodo { int num; struct nodo *sig; }; nodo *prim = NULL, *ultm, *nuevo; void menu(); void pedirDatos(); void entrarDatos(int); void quitarDatos(); int validar(int, struct nodo *); void borrarDatos(int, struct nodo *); void imprimir(struct nodo *); void insertarAntes(...
ALGO
0.983914
3.702103
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2021-11-21T21:15:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fbb99d691...