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
1fc63325-5db2-43c7-9299-6e069eb85c6a
tcmmichaelb139/Competitive-Programming
Usaco/2015-2016/December/GoldP2.cpp
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); freopen("feast.in","r",stdin); freopen("feast.out","w",stdout); int t, a, b; cin >> t >> a >> b; bool dp[t+1][2]; memset(dp, false, sizeof(dp)); dp[0][0] = true; for (int i = 0; i <= ...
ALGO
0.999919
3.000763
{ "github_metadata": { "branch": "main", "commit_count": 267, "repo_created_at": "2021-02-18T22:39:03.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2be3f4b287...
8cff718f-cf6f-48d4-9892-f9227b002923
Rosnaky/Competitive-Programming-Solutions
ccc12s3.cpp
#include <vector> #include <algorithm> #include <iostream> #include <vector> #include <queue> #include <set> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); vector<int> count(1001); int n; cin >> n; for (int i = 0; i < n; i++) { int x; cin >> x; coun...
ALGO
0.999977
3.82781
{ "github_metadata": { "branch": "main", "commit_count": 110, "repo_created_at": "2023-12-20T14:40: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": "bb8519af8c...
8e788a75-8498-4980-b777-4880fd9a4875
shindexro/cp-train
cf/1535/c/c.cpp
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() typedef long long ll; typedef pair<int, int> pii; void __print(int x) { cerr << x; } void __print(long x) { cerr << x; } void __print(long long x) { cerr << x; } void __print(unsigned x) { cerr ...
ALGO
0.999953
4.153208
{ "github_metadata": { "branch": "main", "commit_count": 11, "repo_created_at": "2021-11-11T23:42:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "53931530039...
0657da5c-2b8b-4e91-aadd-624993377992
kassonlab/gmxapi
src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_double.h
/* * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2014,2015,2016,2017,2018 by the GROMACS development team. * Copyright (c) 2019,2020, by the GROMACS development team, led by * <NAME>, <NAME>, <NAME>, and <NAME>, * and including many others, as listed in the AUTHORS file in the...
TOOL
0.96069
6.416912
{ "github_metadata": { "branch": "master", "commit_count": 19315, "repo_created_at": "2017-05-25T14:05:14.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 53, "forks": 13, "issues": 93, "pull_requests": 2 }, "file_meta": { "content_id": "410f...
4dfaf3b9-0ea4-402d-9ef2-08450a25dbad
awesomekling/serenity
Userland/Utilities/tree.cpp
/* * Copyright (c) 2020, <NAME> <<EMAIL>> * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #include <AK/LexicalPath.h> #include <AK/QuickSort.h> #include <AK/String.h> #include <AK/StringBuilder.h> #include <AK/Vector.h> #include <LibCore/ArgsParser.h> #include <LibCor...
TOOL
0.912765
6.740873
{ "github_metadata": { "branch": "master", "commit_count": 39956, "repo_created_at": "2021-11-03T23:54:17.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "SerenityOS/serenity", "stars": 46, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "con...
9ee06fe2-7c13-4121-b60e-f3d763343cbe
Tishj/AoC2020
Day17/day17part1.cpp
/* ************************************************************************** */ /* */ /* :::::::: */ /* day17part1.cpp :+: :+: ...
ALGO
0.99978
4.509833
{ "github_metadata": { "branch": "master", "commit_count": 4, "repo_created_at": "2020-12-01T08:23: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": "f6f478a58e...
fd51b855-8aa9-4f31-9aa7-1ce268e6329c
mjayalam/ACM-ICPC
Gran Premio Mexico y Centroamerica 2017/Fecha 1/A.cpp
#include <bits/stdc++.h> using namespace std; #define dprint(v) cerr << #v"=" << v << endl //;) #define forr(i,a,b) for(int i=(a); i<(b); i++) #define forn(i,n) forr(i,0,n) #define dforn(i,n) for(int i=n-1; i>=0; i--) #define forall(it,v) for(typeof(v.begin()) it=v.begin();it!=v.end();++it) #define sz(c) ((int)c.size()...
ALGO
0.999801
3.552578
{ "github_metadata": { "branch": "master", "commit_count": 16, "repo_created_at": "2017-02-05T23:58:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0f6454a4f...
ab15f5ca-5c32-4814-be4d-c1fec232ad0b
kobe24o/LeetCode
程序员面试金典/17.13.re-space-lcci.cpp
class trie { public: trie* cur; trie* next[26] = {NULL}; bool isEnd = false; void insert(string& s) { cur = this; for(int i = s.size()-1; i >= 0; --i)//反向插入 { if(cur->next[s[i]-'a'] == NULL) { cur->next[s[i]-'a'] = new trie(); } cur = cur->next[s[i]-'a']; } cur->isEnd = true; } }; clas...
ALGO
0.999953
4.990734
{ "github_metadata": { "branch": "master", "commit_count": 2735, "repo_created_at": "2019-07-24T05:05:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 33, "forks": 17, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6737d...
d8a56287-c70a-4a7c-b7d4-5c2c18fcb4f2
ShahjalalShohag/code-library
Number Theory/Prime Basis.cpp
#include<bits/stdc++.h> using namespace std; // https://codeforces.com/blog/entry/108053 // for a set of n elements S, computes the basis of the set S // any element of S will be representable using the elements of the basis. // gcd(basis[i], basis[j]) == 1 for all i < j // all x * y, x / y, gcd(x, y) and lcm(x, y) f...
ALGO
0.999998
4.575947
{ "github_metadata": { "branch": "main", "commit_count": 952, "repo_created_at": "2018-11-18T08:49:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3240, "forks": 840, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "5007d...
042372c8-0b45-4bbd-89b8-cf4e62862066
Quantum999/Hackerearth
magicalword.cpp
#include <bits/stdc++.h> using namespace std; bool sieve[100]; int main(){ int t; cin >> t; bool sieve[1000]; for(int i = 0; i < 1000; i++) sieve[i] = true; for(int i = 2; i * i <= 130; i++) if(sieve[i]) for(int j = i * i; j <= 130 ; j += i) sieve[j] = false; while(t--){ int n, j, k; cin >> n; str...
ALGO
0.999902
3.91396
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-09-11T17:48:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6dd6ae6a2c...
e1d8f0e1-7e61-4224-9182-ca9e399c1666
LuciusKyle/LeetCode
0731_My_Calendar_II/0731.cc
#include <map> #include <vector> using std::map; using std::vector; class MyCalendarTwo { public: MyCalendarTwo() {} bool book(int start, int end) { bool triple_booking = false; vector<std::pair<int, int>> temp_overlaped; for (const auto &event : events_) if ((event.first <= start && start < ...
ALGO
0.999344
5.659926
{ "github_metadata": { "branch": "master", "commit_count": 727, "repo_created_at": "2018-04-11T07:43: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": "f6344073...
667007e8-db2c-436f-87e2-2655f63840b0
cmuparlay/Cluster-BFS
benchmark/cluster_BFS.cpp
#include <iostream> #include <string> #include <parlay/primitives.h> #include <parlay/sequence.h> #include <parlay/internal/get_time.h> #include <parlay/slice.h> #include "cluster_BFS.h" // #include "BFS_ligra.h" #include "graph_utils.h" #include "parseCommandLine.h" #include "utils.h" #ifndef label using label = ...
ALGO
0.961541
5.188268
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2024-09-11T07:24:13.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "951fa7598677...
1d4cb971-b513-48ce-91e1-1ec05ed5914a
aayushdw/Competitve
Codeforces/295B.cpp
#include<bits/stdc++.h> #define si(x) scanf("%d",&x) #define sl(x) scanf("%lld",&x) #define pr(x) printf("%d\n",x) #define prll(x) printf("%lld\n",x) #define ll long long int #define ull unsigned long long int #define F first #define S second #define rep(i,x,y) for(ll i=x;i<y;i++) #define ii pair<int,int> #defin...
ALGO
0.999978
3.542046
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-12-15T08:24: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": "bb149e2e97...
181123eb-b00a-47b4-a2ef-16eec560a1c5
SyGame-Engine-Team/SyGame-Engine
Scarab-Engine/Source/Lib/Math/Algebra/Matrix/SingularDecomposition3.inl
///////////////////////////////////////////////////////////////////////////////// // File : Lib/Math/Algebra/Matrix/SingularDecomposition3.inl ///////////////////////////////////////////////////////////////////////////////// // Version : 1.0a // Began Code : 29/05/2010 // Status : Alpha // Portability : Any ///////////...
ALGO
0.999385
5.896358
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2015-09-29T19:53:46.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "dcc8bcd8890...
a3f2973f-57b8-4461-a902-0ffc9271e7fd
forestgump22/Algorithms-Data-Structures
ADS/ADS/PC02.hpp
#include<iostream> #include<string> #include<fstream> #include<functional> typedef long long ll; using namespace std; using namespace System; template<class T> class DLCL; template<class T> class Node { private: T element; Node<T>* next; Node<T>* back; DLCL<T>* child; friend class DLCL<T>; public: Node(T eleme...
ALGO
0.998975
3.814123
{ "github_metadata": { "branch": "main", "commit_count": 9, "repo_created_at": "2022-04-26T21:40:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b208e4945e22...
e483ec66-672d-40c2-8c17-cc2e7ef87e40
Akatsukis/ACM_Training
Online/2012/Jinhua/A.cpp
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define pii pair<int, int> #define pb push_back #define mk make_pair #define fi first #define se second #define ALL(A) A.begin(), A.end() #define sqr(x) ((x)*(x)) #define sc(x) scanf("%d", &x) #define pr(x) printf(">>>"#x"...
ALGO
0.99997
4.194493
{ "github_metadata": { "branch": "master", "commit_count": 409, "repo_created_at": "2017-09-12T14:47:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "86d614fb...
e62bbf3d-cf2f-491f-aa4b-790bcb69b905
truongsonkmhd/CTGL-GT
C_PLUS_PLUS/src/sinh_ke_tiep/thuat_toan_sinh_c2.cpp
#include <bits/stdc++.h> using namespace std; int n; int a[100]; bool thuanNghich(){ int left = 1, right = n; while(left < right){ if(a[left] != a[right]) return false; left++; right--; } return true; } void testCase(){ cin>>n; // cau hình đầu tiên: for(int i = 1 ; ...
ALGO
0.999948
3.588921
{ "github_metadata": { "branch": "main", "commit_count": 15, "repo_created_at": "2025-02-10T04:26: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": "ee17be7f1c1...
6a8839d8-472a-4fdf-a467-3889666274c0
assassint2017/leetcode-algorithm
Number of Matching Subsequences/Number_of_Matching_Subsequences.cpp
// 如果字典中只要一个单词的话,使用线性的时间复杂度就可以解决,但是现在的问题在于有多个单词 // 如果假设单词的个数为k,string的长度为m,那么最笨的方法也可以使用km的时间来解决问题 // 所以需要一个加速算法,大概的思路就是用维护一个记录表来进行快速的查找 // Runtime: 188 ms, faster than 70.73% of C++ online submissions for Number of Matching Subsequences. // Memory Usage: 42.7 MB, less than 100.00% of C++ online submissions for Number ...
ALGO
0.99995
5.272388
{ "github_metadata": { "branch": "master", "commit_count": 646, "repo_created_at": "2018-10-10T03:44:10.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "470a3371...
a00ad83d-4092-4ab8-8cac-d54d69940339
ishandutta2007/codeforces-r
romka/normal/37/C.cpp
#include <cstdio> #include <iostream> #include <vector> #include <utility> #include <string> #include <cmath> #include <set> #include <map> #include <algorithm> #include <ctime> #include <cassert> using namespace std; #define forn( i,n ) for ( int i=0; i<(int)(n); i++ ) #define pb push_back typedef long long ll; typed...
ALGO
0.999944
3.636685
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:58: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": "96a679ea5011...
a0ef8b09-e9d6-4b53-b78d-30f5040d2bbb
erickborquez/competitive-programming
code-forces/627 Div 3/C.cpp
#include <bits/stdc++.h> #define ENDL '\n' #define deb(u) cout << #u " : " << (u) << ENDL; #define deba(alias, u) cout << alias << ": " << (u) << ENDL; #define debp(u, v) cout << u << " : " << v << ENDL; #define pb push_back #define F first #define S second #define lli long long #define pii pair<int, int> #define pll p...
ALGO
0.999402
4.180532
{ "github_metadata": { "branch": "master", "commit_count": 61, "repo_created_at": "2020-04-06T06:04:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "41db1d937...
02d36230-f80d-49c3-a5b4-873a0ce5bddf
dickynovanto1103/CP
Online Judges/AtCoder/Alsing Programming Contest 2020/e.cpp
#include <bits/stdc++.h> using namespace std; #define inf 1000000000 #define unvisited -1 #define visited 1 #define eps 1e-9 #define mp make_pair #define pb push_back #define pi acos(-1.0) #define uint64 unsigned long long #define FastSlowInput ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define d...
ALGO
0.999574
3.929945
{ "github_metadata": { "branch": "master", "commit_count": 212, "repo_created_at": "2018-08-22T06:40: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": "732b05d7...
fa987697-de3d-4954-b559-265ccb008574
mayukh-B/Leetcode-Solutions
1448-count-good-nodes-in-binary-tree/1448-count-good-nodes-in-binary-tree.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999768
6.076785
{ "github_metadata": { "branch": "main", "commit_count": 288, "repo_created_at": "2022-08-05T19:49: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": "028b165cac...
c689ee47-4a93-43fd-9e38-dbad33df29a1
imchao9/2021_SU_Algorithms
第15课 课件+四种语言模板+代码/【Dijkstra模板】acwing850.cpp
#include<bits/stdc++.h> using namespace std; const int MAX_N = 150005, MAX_M = 150005; vector<int> ver[MAX_N]; // 出边数组 - 另一端点 vector<int> edge[MAX_N]; // 出边数组 - 边权 int n, m, d[MAX_N]; bool v[MAX_N]; // pair<-dist[x], x> priority_queue<pair<int, int>> q; // 插入一条从x到y长度z的有向边 void add(int x, int y, int z) { ver[x].pus...
ALGO
0.999966
3.982652
{ "github_metadata": { "branch": "main", "commit_count": 36, "repo_created_at": "2022-03-31T00:00: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": "180ea60b76b...
df1c4199-22bd-4178-8948-d5fd499df280
GalaxyNET/Dragomir-Sotirov
Data Structures/2/main.cpp
#include <iostream> #include "List.h" using namespace std; template< typename D >void merge( List< D > &, List< D > &, List< D > & ); int main() { List< int > list1; List< int > list2; List< int > result; int i; for ( i = 1; i <= 9; i += 2 ) list1.insertAtBack( i ); list1.print(); for ...
ALGO
0.998687
5.266207
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2014-09-05T09:04:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2e4f5f686c...
0e568712-35e1-46b1-8a41-165299994e8b
alexandraback/datacollection
solutions_5756407898963968_0/C++/aropan/A-small.cpp
#include <iostream> #include <cstdio> #include <cassert> #include <ctime> #include <cstring> #include <string> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <map> #include <set> using namespace std; template <typename T> T sqr(T x) { return x * x; } template <typename T> T abs(T x)...
ALGO
0.998628
3.46818
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2839bd5ba...
73273401-266c-4eef-b2dc-cfb90e2b7114
cognitive-robots/SimCARSv2
include/ori/simcars/agents/ped_outcome.hpp
#pragma once #include <ori/simcars/geometry/typedefs.hpp> #include <cstdint> #include <cmath> #include <iostream> namespace ori { namespace simcars { namespace agents { struct PedOutcome { geometry::Vec pos; FP_DATA_TYPE min_neighbour_dist; bool action_done; friend bool operator ==(PedOutcome const...
TOOL
0.920128
5.707619
{ "github_metadata": { "branch": "master", "commit_count": 177, "repo_created_at": "2024-05-17T03:16:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ab72b67d3...
fb492355-a7f4-4d88-9a4d-d4b9ff52f0c8
Yuki-Wada/competitive_programming
cpp/src/at_coder/abc350_e.cpp
// include //------------------------------------------ #include <string> #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <complex> #include <s...
ALGO
0.999034
3.922212
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2019-11-09T16:42: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": "ef8381d22...
5bdeb62d-a76b-49d2-91b5-33da8c3e3877
lucasz93/visionworkbench
src/vw/Camera/CameraUtilities.cc
// __BEGIN_LICENSE__ // Copyright (c) 2006-2013, United States Government as represented by the // Administrator of the National Aeronautics and Space Administration. All // rights reserved. // // The NASA Vision Workbench is licensed under the Apache License, // Version 2.0 (the "License"); you may not use this f...
TOOL
0.993312
4.397279
{ "github_metadata": { "branch": "master", "commit_count": 4689, "repo_created_at": "2021-05-03T12:34:33.000Z", "is_fork": true, "is_org_owned": false, "forked_from": "visionworkbench/visionworkbench", "stars": 0, "forks": 0, "issues": 0, "pull_requests": 1 }, "file_meta": ...
d0cc956c-1085-4e69-ba73-0a2967561612
vocasle/learn-directx11
vector-math/vector-math.cpp
// vector-math.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <DirectXMath.h> using namespace DirectX; std::ostream& operator<<(std::ostream& out, FXMVECTOR v); void FloatingPointErrorExample(); int main() { const XMVECTOR n = XMVectorSet(...
ALGO
0.950572
6.333705
{ "github_metadata": { "branch": "master", "commit_count": 63, "repo_created_at": "2021-12-19T09:25: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": "1476b82f2...
71af3020-eb8f-46cc-adb2-cfaeb55f6ba6
Edumarek123/GA_FUZZY_CONTROLLER
src/genetic_alg_lib/genetic_alg_lib.cpp
// // Created by Edumarek on 06 / 02 / 2023. // #include "genetic_alg_lib.hpp" GAsandbox::GAsandbox(int _tamanhoPopulacao, _ponto min_uK, _ponto max_uK, _ponto coeficienteMutacao) { tamanhoPopulacao = _tamanhoPopulacao; populacao = (Individuo **)malloc(tamanhoPopulacao * sizeof(Individuo *)); for (int i =...
ALGO
0.999303
5.050694
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-05-13T17:36: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": "834c4571f65a...
af77392c-3a2d-47ec-96a4-ada224222e71
passagemath/upstream-LiDIA
src/number_fields/include/LiDIA/number_fields/qo_sieve.h
// -*- C++ -*- //============================================================================================== // // This file is part of LiDIA --- a library for computational number theory // // Copyright (c) 1994--2001 the LiDIA Group. All rights reserved. // // See http://www.informatik.tu-darmstadt.de/TI/LiDIA/ /...
ALGO
0.986098
4.805431
{ "github_metadata": { "branch": "master", "commit_count": 57, "repo_created_at": "2014-10-04T22:46:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 30, "forks": 9, "issues": 7, "pull_requests": 0 }, "file_meta": { "content_id": "38b4e078f...
81eb2763-5dba-4b25-b761-4024c06f1fda
yhfyhf/JourneyToGreatness
RegularExpressionMatching.cc
#include <iostream> using namespace std; /* Idea stolen from <NAME>'s code * http://www.cs.princeton.edu/courses/archive/spr10/cos333/beautiful.html */ class Solution { public: bool isMatch(const char *s, const char *p) { char *text = (char *)s; char *regexp = (char *)p; return match(regexp, text); ...
ALGO
0.999562
4.065917
{ "github_metadata": { "branch": "master", "commit_count": 68, "repo_created_at": "2015-06-23T07:53:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8b9834d98...
45a8472c-bcef-4d12-a167-c05c6d7fcd3a
jgogo01/CS37-231DataStr
LAB06/02-Prem.cpp
#include <iostream> #include <queue> using namespace std; bool ckMove(int x, int y, int n, const int grid[][100], bool visited[][100]) { return x >= 0 && x < n && y >= 0 && y < n && grid[x][y] == 0 && !visited[x][y]; } bool bfs(int n, const int grid[][100]) { bool visited[100][100] = {false}; queue<pair<...
ALGO
0.999958
6.073752
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2023-07-22T11:31: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": "88744a72194d...
3e3f1df7-cc9a-48f6-9190-4dbe95045396
shay-ff/cpp-files
CodeChef/177/Flip_or_Reverse.cpp
/** * created: 2025-03-12 20:18:55 **/ #include<bits/stdc++.h> using namespace std; #ifndef ONLINE_JUDGE #include "../debug.cpp" #else #define debug(...) #define debugArr(...) #endif #define int long long #define show(x) cout << x << endl #define sz(x) (int)(x.size()) /* You are given a binary string A A and want t...
ALGO
0.999964
4.247982
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-05-08T13:22: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": "f8f04ab1a6d3...
3fc5c471-c515-4301-8de8-812c75d2254a
Qixyimoe/Delta
Luogu/3369/3369.cpp
#include <bits/stdc++.h> using i64 = long long; constexpr int N = 1e5 + 7; // #define DEBUG 1 // 调试开关 struct IO { #define MAXSIZE (1 << 20) #define isdigit(x) (x >= '0' && x <= '9') char buf[MAXSIZE], *p1, *p2; char pbuf[MAXSIZE], *pp; #if DEBUG #else IO() : p1(buf), p2(buf), pp(pbuf) {} ~IO() { fw...
ALGO
0.999833
4.238088
{ "github_metadata": { "branch": "master", "commit_count": 205, "repo_created_at": "2024-07-30T05:57: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": "bd2875fc...
60805f96-e71d-4a30-837e-92471fee573b
moranzcw/LeetCode-NOTES
Algorithms/50.Pow(x,-n)/solution.cpp
class Solution { public: double pow(double x, int n) { long long index = n; double result = 0; int flag = 1; if (x<0 && n%2!=0) x = -x, flag = -1; if (index < 0) result = powI(x, -index); else result = powI(x, index); ...
ALGO
0.999964
5.438782
{ "github_metadata": { "branch": "master", "commit_count": 82, "repo_created_at": "2016-04-05T13:15:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 195, "forks": 77, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "027cbc...
8d386fc2-3493-4b61-b024-a6b39317585e
iolab-uniud/osp-ls
easylocal-3/include/solvers/simplelocalsearch.hh
#pragma once #include <future> #include "helpers/solutionmanager.hh" #include "solvers/localsearch.hh" #include "runners/runner.hh" namespace EasyLocal { namespace Core { /** The Simple Local Search solver handles a simple local search algorithm encapsulated in a runner. @ingroup Solvers ...
ALGO
0.982023
6.345709
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2024-04-03T09:39: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": "b551f122b42fc...
0647013c-d47b-4348-886b-7c12076f7381
leggedrobotics/ocs2
ocs2_thirdparty/include/cppad/core/sparse_hessian.hpp
# ifndef CPPAD_CORE_SPARSE_HESSIAN_HPP # define CPPAD_CORE_SPARSE_HESSIAN_HPP /* -------------------------------------------------------------------------- CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-18 <NAME> CppAD is distributed under the terms of the Eclipse Public License Version 2.0. ...
ALGO
0.991654
6.87242
{ "github_metadata": { "branch": "main", "commit_count": 7465, "repo_created_at": "2021-07-08T07:09:10.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1106, "forks": 258, "issues": 50, "pull_requests": 3 }, "file_meta": { "content_id": "d14b...
f027ad8e-32ca-4455-8079-a5d8852d0c4e
larkinrd/multithreading
secondmtexample.cpp
/***************************************************************************** * https://cs.lmu.edu/~ray/notes/trivialcpexamples/ * TO COMPILE USE: g++ -pthread <filename.cpp> -o <outputfilename> * RESULTED IN: CAN'T FIGURE OUT WHAT IT IS REALLY DOING, GET COMPILER WARNING * * summer.cpp * * Short program illustrating...
ALGO
0.999744
6.000867
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2020-02-11T03:28: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": "0566d068a6...
4e092ca0-8b21-4a17-bdcb-d69467a6796f
ishandutta2007/codeforces-m
maximumshot/normal/1105/A.cpp
#include <bits/stdc++.h> // pbds #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/detail/standard_policies.hpp> using namespace __gnu_pbds; // gp_hash_table<int, int> table; using namespace std; #define vec vector #define ALL(x) begin(x), end(x) typedef unsigned long long ull; typedef unsigned int ui; t...
ALGO
0.999933
3.827661
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-06-06T01:03: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": "c34a4ef2d56f...
01d92526-eb7f-46ef-a2e3-2e13e8e8b46f
anveshi/Competitive-Programming
Topcoder/ProblemSetsEasy.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.999641
4.353747
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2016-02-12T06: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": "2cf18918d3...
efacaab2-c7b5-453d-9cc3-7937d2d12780
Kartikey246/DSA
Leetcode/linked list cycle II.cpp
/* Part 1 : Detecting the cycle The algorithm states that if we move a fast pointer which jumps twice at a time and a slow pointer which jumps once at a time. Then if a cycle exists, they are bound to meet. Proof: If no cycle exists , fast pointer will reach the end and we will detect no cycle. If there is a cycle , t...
ALGO
0.999951
5.28762
{ "github_metadata": { "branch": "master", "commit_count": 230, "repo_created_at": "2021-12-09T07:06: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": "0002b009...
97759b98-622a-4807-b539-8cd6e339fe40
serserar/ModelConverter
src/util/PoissonDiskAlg3D.h
/* * Copyright 2018 <copyright holder> <email> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable la...
ALGO
0.999118
6.518131
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2018-09-08T19:10: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": "7a246f7c47...
1e3c7f2a-caba-402b-a9aa-cb4f934d17ec
Zeratul352/OOP_Lab_Class_Overload_from_17.09.2019
OOP_Lab_Class_Overload_from_17.09.2019/Polynom.cpp
#include<string> #include<iostream> #include "pch.h" #include "Polynom.h" #include "except.h" using namespace std; Polynom::Polynom() { deg = 0; koef = new double[deg + 1]; koef[0] = 0.0; } Polynom::Polynom(int new_deg, double* new_koef) { deg = 0; for (int i = 0; i <= new_deg; i++) if (new_koef[i] != 0) deg...
ALGO
0.994797
3.320457
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2019-09-22T18:29: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": "dd826fcbbc...
4ab467d6-ae2f-4ed7-8a2f-388f2216996b
rahul-anand/ale
ALE/clustering.cpp
#include <stdio.h> #include <string.h> #include <math.h> #include "clustering.h" template class LClustering<double>; template class LLatticeClustering<double>; template class LKMeansClustering<double>; template <class T> LClustering<T>::LClustering(const char *setClusterFolder, const char *setClusterFile, int setBand...
ALGO
0.999179
4.597589
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2015-05-01T13:18:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 5, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d02ed8a271...
7726f087-b2aa-4dfb-a6e6-8b282fb47810
SamChien/Competitive-Programming
uva_online_judge/401-Palindromes.cpp
#include <cstdio> #include <iostream> using namespace std; int main() { string str; while (cin >> str) { int strSize = str.size(); bool isPali = true; bool isMirror = true; int revTable[200] = {}; revTable[(int)'A'] = 'A'; revTable[(int)'E'] = '3'; revT...
ALGO
0.999253
3.68246
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2016-06-30T10:47: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": "a0c74557a...
b92d4c2b-8987-4f13-bcae-227f482070cc
negruj1/projectorCalibration
OpenCVTemplate/projectionMatrix.cpp
/* * projectorCalib.cpp * * Created on: Oct 24, 2012 * Author: cai * * * compute the projection matrix P (at least 6 points, and at least 3 points in different z) * 1. result: * Projection matrix : P * Camera intrinsic parameter matrix: M * rotation matrix : R * translation vector : T * * ...
ALGO
0.998729
4.766199
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-04-22T11:10: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": "e0f1d174ab...
7626b36a-2303-4dbd-94ad-cd3b8ef897cb
kiwibrowser/src
third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/prebuilt_include/llvm/include/llvm/CodeGen/PBQP/Solution.h
//===- Solution.h - PBQP Solution -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
TOOL
0.97489
6.796056
{ "github_metadata": { "branch": "master", "commit_count": 672, "repo_created_at": "2020-04-18T07:16:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2888, "forks": 414, "issues": 0, "pull_requests": 5 }, "file_meta": { "content_id": "496...
b4536424-2f1c-4e05-ad8b-516974618882
ZoranPandovski/al-go-rithms
data_structures/Graphs/graph/c++/IanPaixao_DFS.cpp
void GraphDFS(int start, int end) { stack int s; Create a stack of ints bool visited = new bool[n]; Boolean array to represent which vertices we've visited for (int i = 0; i n; ++i) Initialize all elements of visited to false { visited[i] = false; lengths[i] = 0; } s.push(start); Push the vertex onto th...
ALGO
0.999154
4.029811
{ "github_metadata": { "branch": "master", "commit_count": 7457, "repo_created_at": "2017-06-05T19:20:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1359, "forks": 1929, "issues": 20, "pull_requests": 44 }, "file_meta": { "content_id": ...
ad8076dc-a5cc-455f-aa6d-c6c94cc41fbc
AniketHend/LeetCode-Solutions
19-remove-nth-node-from-end-of-list/remove-nth-node-from-end-of-list.cpp
/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ #pragma GCC optimize("O3", "unroll-loops") class Solution { public: ListNode* removeNthFromEnd(ListNode* head, int n) { ListNode* fast = head; ListNode* slow = head; ...
ALGO
0.999963
6.070541
{ "github_metadata": { "branch": "main", "commit_count": 876, "repo_created_at": "2024-02-19T09:07: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": "4a2782222c...
62157e4e-92c0-4fea-8855-e95e95485b44
masayukisobe/atcoder
problems/bootcamp/hard/92/main.cpp
// #define _GLIBCXX_DEBUG // #pragma GCC optimize("O2,unroll-loops") #include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define uint unsigned int #define ii pair<int,int> #define iii tuple<int,int,int> #define vi vector<int> #define vvi vector<vi> #define vll vector<ll> #...
ALGO
0.99999
4.537111
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2024-04-15T13:28: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": "a740fa632...
65686be4-b925-41d9-a11a-1158ef6d37ff
danyalmendigali/competitiveProgramming
Codeforces/560A.cpp
#include <bits/stdc++.h> #include <windows.h> #define optimus_prime cin.tie(0); cout.tie(0) #define all(a) a.begin() , a.end() #define endl "\n" #define vll vector<long long> #define FOR(i, a, b) for(int i = a; i < b; i++) #define pb(a) push_back(a) #define sz size() #define ll long long #define F first #define S sec...
ALGO
0.999295
3.362219
{ "github_metadata": { "branch": "main", "commit_count": 1207, "repo_created_at": "2022-12-10T15:47:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8d511b23b...
b9e865b5-16d1-4670-97a5-d994f3976bfb
ishandutta2007/codeforces-l
lomk/normal/1736/D.cpp
/*input 4 2 1010 3 100010 2 1111 2 1110 */ #include <bits/stdc++.h> using namespace std; #define int long long #define sp ' ' #define endl '\n' #define fi first #define se second #define bit(x, y) ((x >> y) & 1) #define loop(i, l, r) for (int i = (int)l; i <= (int)r; ++i) #define rloop(i, l, r) for (int i = (int)l; i...
ALGO
0.995633
4.020638
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-04-11T06:17:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "183e7d118839...
168a9f2a-688d-496b-923d-7576fee2c9c0
Puellaquae/Algorithms
Math/Geometry/hdu1348.cpp
// Wall #include <algorithm> #include <cmath> #include <cstdio> #include <vector> using namespace std; typedef pair<int, int> point; point operator-(point a, point b) { return make_pair(a.first - b.first, a.second - b.second); } int det(point a, point b) { return a.first * b.second - a.second * b.first; } int dot...
ALGO
0.999816
4.229599
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2021-04-27T14:17: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": "ff10f0f46...
05d0a44a-0ed1-4a26-a651-b31ac8cd8fa3
alibaba/MNN
tools/train/source/models/MobilenetV2.cpp
// // MobilenetV2.cpp // MNN // // Created by MNN on 2020/01/08. // Copyright © 2018, Alibaba Group Holding Limited // #include <algorithm> #include "MobilenetV2.hpp" namespace MNN { namespace Train { namespace Model { using namespace MNN::Express; class _ConvBnRelu : public Module { public: _ConvBnRelu(std::...
DATA
0.922953
6.43224
{ "github_metadata": { "branch": "master", "commit_count": 2067, "repo_created_at": "2019-04-15T07:40:18.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 12546, "forks": 2006, "issues": 91, "pull_requests": 9 }, "file_meta": { "content_id": "...
e114340e-9416-4dee-b99e-a03471b5e3db
SYCstudio/OI
Practice/2018/2018.5.9/BZOJ4383.cpp
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #define mem(Arr,x) memset(Arr,x,sizeof(Arr)) #define lson (now<<1) #define rson (lson|1) const int maxN=101000; const int maxQ=201000; const int maxNode=(maxN<<2)+maxQ; const int maxM=...
ALGO
0.999998
3.629263
{ "github_metadata": { "branch": "master", "commit_count": 585, "repo_created_at": "2018-06-07T14:07:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "90d9ee98...
78f50811-fead-435d-9126-75df40f23134
amit-c-ai/CP
Codeforces/Solutions Folder 2/A_Domino.cpp
#include <bits/stdc++.h> using namespace std; #define PI 3.1415926535897932384626 #define MOD 1000000007 #define all(x) x.begin(), x.end() #define mem(a, elem) memset(a, elem, sizeof(a)) #define ff first #define ss second #define pb push_back #define eb emplace_back #define pob pop_back #define mp make_pair #define mt ...
ALGO
0.99999
3.492627
{ "github_metadata": { "branch": "main", "commit_count": 235, "repo_created_at": "2021-05-11T12:39:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "524406d4b1...
0ac52ee0-7f21-4db5-9803-a33de09702f6
harukoya/AtCoder
ABC150/c.cpp
#include <iostream> #include <vector> #include <cstdlib> #include <algorithm> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int n; cin >> n; vector<int> p(n), q(n); rep(i, n) cin >> p[i]; rep(i, n) cin >> q[i]; vector<int> v(n); rep(i, n) v[i] = i+1; int a, b; int ...
ALGO
0.999967
3.577648
{ "github_metadata": { "branch": "master", "commit_count": 38, "repo_created_at": "2021-01-18T01:38: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": "ba7b400b3...
3f9d992d-5a63-4016-9fa4-63311ea50b0e
YessineJallouli/Competitive-Programming
IEEEXTREME16/Combo Locks.cpp
//34% #include <bits/stdc++.h> #define ll long long #define pp pair<ll,string> using namespace std; int main() { /*freopen("input.txt", "r", stdin); int n = 7647; string s[n]; map<char,int> occ[200]; for (int i = 0; i < n; i++) { cin >> s[i]; s[i]+= ' '; for (int j = 0; j < ...
ALGO
0.999863
3.092889
{ "github_metadata": { "branch": "main", "commit_count": 107, "repo_created_at": "2021-05-13T16:32:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 6, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2cf7841504...
15f08323-e58e-490e-ada5-346791bfdf95
stevia0829/cpppractice
剑指offer/剑指 Offer 32 - I. 从上到下打印二叉树/剑指 Offer 32 - I. 从上到下打印二叉树/levelOrder.cpp
#include<vector> #include<iostream> #include<queue> #include<algorithm> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; // 第一问 //class Solution { //public: // vector<int> levelOrder(TreeNode* root) { // ve...
ALGO
0.999989
4.655169
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2020-07-08T08:38:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e5e676283f...
5bd3467b-d461-47c5-9e74-e03230345864
ackerman29/Codes
closesttotheleft.cpp
#include<bits/stdc++.h> using namespace std; int binarySearch(int a[], int k, int n) { int l = 0; int h = n - 1; int result = n+1; while (l <= h) { int mid = l + (h - l) / 2; if (k <= a[mid]) { result = mid + 1; h = mid - 1; l = mid +...
ALGO
0.99998
4.966556
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-09-25T13:45:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e9c3e714e6...
12f81b95-049e-4be6-bfd6-b567f841543a
MalvinoTan/uhunt-onlinejudge-solution
Back to Intermediate Math - 10773.cpp
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 using namespace std; typedef pair <int,int> pii; typedef pair <int,pii> piii; int dx[4] = {0,0,1,-1}; int dy[4] = {1,-1,0,0}; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int tc, cnt = 1; cin >> tc; while (...
ALGO
0.999398
4.793113
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2022-03-23T06:43: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": "b79dd077e2...
16065b71-2b04-4165-91fb-22e2040477cf
juliannehong/algorithm-and-datastructure
graph-and-tree/graph/closest_value.cpp
// https://leetcode.com/problems/closest-binary-search-tree-value/description/ #include <iostream> #include <vector> #include <cmath> using namespace std; struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; double get_gap(int val, double target){...
ALGO
0.999996
5.697978
{ "github_metadata": { "branch": "master", "commit_count": 77, "repo_created_at": "2017-11-01T04:14: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": "33e09ba1a...
011154f6-f737-4187-9c2d-c2b711415ebc
jatin69/coding-practice
hackerrank/cpp/cpp-maps.cpp
/* * Author : <NAME> * Date : 5/12/2017 * * Editor : Dev c++ 5.11 * Compiler : g++ 5.1.0 * flags : -std=c++11 * */ /* test case 7 1 Jesse 20 1 Jess 12 1 Jess 18 3 Jess 3 Jesse 2 Jess 3 Jess */ #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <set> #include <map> #inclu...
ALGO
0.998974
3.957578
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2017-10-10T17:19:51.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d49812cd6...
d6587803-c582-4710-9932-d9ff0c99cd6b
limou3434/work-test-code
2023归档/my_code_2023_8_26/my_code_2023_8_26/mian.cpp
#include <iostream> using namespace std; namespace limou3434_vector { /* 本质是写了一个结构体模板,该结构体为自定义的迭代器类型,可以使用普通迭代器,也可以使用const迭代器 */ template<class Iterator, class Ref, class Ptr> //Ref是引用,Ptr是指针,分别支持 * 和 -> 的返回值 //可以被一起替换成iterator迭代器的返回值和conts_iterator迭代器的返回值 //1.反向迭代器的结构体(没有正向迭代器结构体的原因是,vector的正向迭代器本身底层为指针,没有必要再...
ALGO
0.988708
4.458151
{ "github_metadata": { "branch": "main", "commit_count": 959, "repo_created_at": "2025-04-02T08:18: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": "ab4427c9a6...
1ecbba59-c7fa-463b-830e-b162f5e98fa8
rutura/The-C-20-Masterclass-Source-Code
16.Functions/16.23constexprFunctions/main.cpp
#include <iostream> //Marking a function as constexpr gives it the potential //to be evaluated at compile time constexpr int get_value(int multiplier){ return 3 * multiplier; } int main(){ /* For the evaluation to take place at compile time, we have to remember to store the return value in...
TOOL
0.945502
4.890074
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2021-08-18T06:59:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1997, "forks": 1024, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f8bd8...
717880b3-cb8f-4721-88c5-8ea3976f08e9
J2001d/Leetcode-Daily-Challenge
129. Sum Root to Leaf Numbers.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), right(nullptr) {} * TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} * TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l...
ALGO
0.999962
5.778528
{ "github_metadata": { "branch": "main", "commit_count": 63, "repo_created_at": "2023-01-19T10:34: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": "da3029b49f3...
6d4b4598-209b-40d1-893b-2ba39d5fc7cf
nasailja/gensimcell
examples/game_of_life/parallel/no_dccrg.cpp
/* Parallel program playing Conway's Game of Life that requires only MPI. Copyright 2015, 2016 <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the ab...
ALGO
0.999502
6.017167
{ "github_metadata": { "branch": "master", "commit_count": 132, "repo_created_at": "2013-12-18T03:12:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5a27db77...
853871b0-f047-440e-95f3-474396432a16
rocos-sia/Admittance_experiment_on_UR
src/ur_examples/3_party_library/kdl/include/kdl/chainfdsolver.hpp
// Copyright (C) 2018 <NAME> <ruben dot smits at intermodalics dot be> // Version: 1.0 // Author: <NAME> <ruben dot smits at intermodalics dot be> // Author: <NAME> <craigc at ssl dot umd dot edu> // Maintainer: <NAME> <ruben dot smits at intermodalics dot be> // URL: http://www.orocos.org/kdl // This library is f...
TOOL
0.914661
6.045656
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2022-05-26T11:46:57.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 3, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "c966334527d...
50149006-011d-4d2a-b951-0d5c77cb4247
zhangyuhangk/LeetCodePractices
LeetCodePractices/Q95_Unique_Binary_Search_Trees_II.cpp
#include "Q95_Unique_Binary_Search_Trees_II.h" #include "common.h" //Definition for a binary tree node. struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class Solution { public: vector<TreeNode*> generateTrees(int n) { if (n <...
ALGO
0.999906
5.882237
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2017-05-01T16:30:02.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3d5fddf75d...
07730523-f99e-4ddd-b94c-975326b133cb
ahnyeji/C_Algorithm
BOJ/BinarySearch/1920.cpp
/* BOJ - 1920 : 수 찾기 02.March.2021 */ /* [Binary Search] # 수열 A를 정렬하여 찾으려는 수의 범위를 좁혀갈 수 있도록 한다 # 가운데 있는 수와 찾으려는 수를 비교 - 가운데 수 == 찾으려는 수 : 이미 수를 찾았으므로 해당 수 탐색 종료 - 가운데 수 > 찾으려는 수 : 수열의 왼쪽 절반에서 다시 탐색 (가운데 수 제외; hi = mid - 1) - 가운데 수 < 찾으려는 수 : 수열의 오른쪽 절반에서 다시 탐색 (가운데 수 제외; lo = mid + 1) ...
ALGO
0.999999
4.677261
{ "github_metadata": { "branch": "main", "commit_count": 136, "repo_created_at": "2021-01-27T00:04: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": "75746f1498...
91b57e79-acb2-4ec7-8df4-5884cbaacbdf
btbytes/ci
ga_fs/popuint.cpp
#include "popuint.h" int search(int); /* search the second Kid index */ void reorder(int *,int, int); /* reorder the remain individual indexs */ //constructors PopulationInt::PopulationInt(int a,int b): length(a),width(b),c_rate(0),m_rate(0) { ptr=new IndividualInt[length]; assert(ptr !=...
ALGO
0.99909
4.343299
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2009-02-12T02:56:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "74ca7d80e...
884d527c-b53e-4479-bcb2-5bd6b214529a
PeterPlevko/STU-FIIT
Fyzikálne základy počítačových hier/riesenia/zad8.cpp
#include <stdio.h> #include <GL/gl.h> #include <GL/glut.h> #include <GL/glu.h> #include <math.h> const int step = 25; const float Lmax = 10.0f; float t = 0.0f; float old = 0.0f; float period = 5.0f; float threshold = 5.0f; bool first = false; bool second = false; double twicePi = 2.0 * 3.142; double radius = 0...
ALGO
0.999527
4.332658
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-01-31T12:04:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 22, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "23b8b1aa149...
2c8547c4-d423-4d51-9a40-a3f7e69cf2d3
Prateek307/Leetcode-Solutions
Unique_Paths.cpp
// link to the problem ---> https://leetcode.com/problems/unique-paths/description/ // recursive solution class Solution { public: int solve(int i, int j, int n, int m, vector<vector<int>> &dp) { if (i >= n || j >= m) return 0; else if (i == n - 1 && j == m - 1) return...
ALGO
0.999984
6.11802
{ "github_metadata": { "branch": "main", "commit_count": 195, "repo_created_at": "2023-11-25T19:20: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": "52672e1e29...
3c010581-0d23-4cb3-b236-9dbbdff7021a
adavis10006/2014-NP
project2/code/temp/temp select/select/client_list.cpp
#include "client_list.h" //*********************************************** int CLIENT_LIST::find_smallest() { int client_id = 1; for(int i = 0; i < client_list.size(); i++) if(client_id == client_list[i]->client_id) client_id++; else return client_id; //*---------------------------------------------* retu...
TOOL
0.959699
4.093249
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2017-11-30T15:41: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": "dc8a2ce212...
cc74bfb7-d668-4e78-b282-110ed8b05b4b
lazybones1/Algorithms
백준알고리즘/단계별로 풀어보기/17. 수학 3/P_Number_2981.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; int gcd(long long a, long long b) { return b ? gcd(b, a%b) : a; } int main() { ios::sync_with_stdio(false); cout.tie(NULL); cin.tie(NULL); int N, i, t; long long n; vector<int> v; cin>>N; long long arr[N]; for (i = 0;...
ALGO
0.999996
3.709451
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2020-04-06T01:18:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fc58c8ea...
19463d72-1aa6-42ea-8cab-47bf4804659e
egorsharonov/lab_works
lab 8.1.cpp
/* * Даны два одномерных массива целых чисел A и В. * Вычислить одномерный массив С, который содержит: * положительные элементы массива A, * присутствующие в массиве B несколько раз. */ #include <iostream> #define lmax 30 using namespace std; void read(int &n, int* a,char c){ cout << "write len of array " <<...
ALGO
0.999657
3.266766
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2022-03-11T09:26:05.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ca2a3ea74c...
2bf3bb34-43e4-43f8-90ea-f5489841823d
ishandutta2007/codeforces-i
i_love_dasha_karpenko/normal/1342/D.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef long long ll; typedef long double ld; typedef pair<ll,ll> pp; typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> super_set; typ...
ALGO
0.999986
3.646458
{ "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": "3b7e9ad2df7b...
03d41394-f9a1-430e-b0df-00eee830d83c
appleseedhq/appleseed
src/appleseed/foundation/math/knn/knn_answer.h
// // This source file is part of appleseed. // Visit https://appleseedhq.net/ for additional information and resources. // // This software is released under the MIT license. // // Copyright (c) 2010-2013 <NAME>, Jupiter Jazz Limited // Copyright (c) 2014-2018 <NAME>, The appleseedhq Organization // // Permission is ...
ALGO
0.998947
7.393943
{ "github_metadata": { "branch": "master", "commit_count": 11152, "repo_created_at": "2010-07-02T16:33:51.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2238, "forks": 337, "issues": 423, "pull_requests": 35 }, "file_meta": { "content_id": ...
4883d9bc-1283-482b-b4ef-c5b6b5887719
Prahmodh-Raj1/DSA-Solutions
Binary Search/Kth smallest element in a sorted matrix.cpp
//Problem link: https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/ //TC: O(M+N)LOG(max-min) SC:O(1) class Solution { public: int m, n; int kthSmallest(vector<vector<int>>& matrix, int k) { m = matrix.size(), n = matrix[0].size(); // For general, the matrix need not be a square ...
ALGO
0.999999
6.537592
{ "github_metadata": { "branch": "main", "commit_count": 510, "repo_created_at": "2022-01-07T11:57: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": "9297f28545...
f9627ac3-f5c0-473b-b90c-24e38d9039c0
leonyan18/MyCode
acm/牛客多校4G.cpp
#include<bits/stdc++.h> #define IO ios_base::sync_with_stdio(0),cin.tie(0) using namespace std; const int N = 100050; struct ss{ int x, cnt, y; }f[N]; bool cmp(ss p, ss q) { if(p.cnt == q.cnt) { return p.x > q.x; } return p.cnt > q.cnt; } int tmp[N]; map<int, int> myMap; int main(){ IO; ...
ALGO
0.999996
3.569311
{ "github_metadata": { "branch": "master", "commit_count": 53, "repo_created_at": "2018-07-24T02:14:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0bcf1adc8...
e4a8f624-327c-40b3-aeb4-887f6ad79ee8
grapemoli/Database_Structures
kSmallestNumber/tree.cpp
/* Name: tree.cpp By: <NAME> Date: 05 October 2022 Purpose: the Tree class is a binary tree which contains Node (another class). - understand recursion to create a balanced tree given a data set - understand recursion to traverse a tree in-order - understand the properties of a binary tree to return the k...
ALGO
0.999729
5.650842
{ "github_metadata": { "branch": "main", "commit_count": 47, "repo_created_at": "2023-03-17T10:50: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": "9d8f49d324f...
5425633b-6f44-44cf-87eb-ff87f35c7841
TheUnicat/competitive-pwogramming
usaco/silver/2019/January/2_icy_perimeter.cpp
// // Created by TheUnicat on 2024-08-01. // #include <fstream> #include <vector> #include <algorithm> using namespace std; int n; vector<vector<char> > icecream; vector<vector<bool> > visited; vector<vector<pair<int, int> > > components; vector<pair<int, int> > current_component; int find_perimeter(const vector<pa...
ALGO
0.999921
4.63908
{ "github_metadata": { "branch": "main", "commit_count": 290, "repo_created_at": "2024-05-12T07:59: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": "c0866c67e6...
43b5ee2e-e451-471d-acd8-72b7bf898261
Liuyi-Wang/LeetCode
src/0721_Accounts_Merge.cpp
class Solution { public: int find(int a) { int r = a; while (d_r[r] != r) { r = d_r[r]; } while (d_r[a] != r) { int t = d_r[a]; d_r[a] = r; a = t; } return r; } void merge(int a, int b) { int ra = fi...
ALGO
0.999953
6.39316
{ "github_metadata": { "branch": "master", "commit_count": 1115, "repo_created_at": "2019-07-12T01:15: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": "ffc6cd6...
62a5e908-5be7-45ef-a09e-5c71c822b0c8
TheUnicat/competitive-pwogramming
codeforces/other/maximum_median.cpp
// // Created by TheUnicat on 2024-07-29. // #include <iostream> #include <vector> #include <algorithm> using namespace std; using ll = long long; ll n, k; int main() { cin >> n >> k; vector<ll> numbers(n); for (int i = 0; i < n; i++) cin >> numbers[i]; sort(numbers.begin(), numbers.end()); vect...
ALGO
0.99999
4.754604
{ "github_metadata": { "branch": "main", "commit_count": 290, "repo_created_at": "2024-05-12T07:59: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": "504140ab4c...
2b706b79-3444-46a6-ad86-afd4f40b10f1
AgriculturalModelExchangeInitiative/SQ_Wheat_Phenology
src/cpp/SQ_Wheat_Phenology/Gaimean.cpp
#ifndef _GAIMEAN_ #define _USE_MATH_DEFINES #include <cmath> #include <iostream> #include <vector> #include <string> #include <numeric> #include <algorithm> #include <array> #include <map> #include <tuple> #include "Gaimean.h" using namespace std; Gaimean::Gaimean() { } double Gaimean::gettTWindowForPTQ() {return this...
ALGO
0.976859
4.851726
{ "github_metadata": { "branch": "master", "commit_count": 144, "repo_created_at": "2018-11-26T16:12:34.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 5, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a1a23afd...
1aae11ba-c4b6-4aaa-b404-20760c8d03f4
BrandoZhang/Inverse_Kinematics_with_Skinning
EigenSolveExample.cpp
#include <Eigen/Dense> #include <iostream> #include <vector> using namespace std; // A simple example on how to use Eigen to solve linear systems. // CSCI 520 Computer Animation and Simulation // <NAME>, <NAME> int main() { // a 3x3 system matrix A vector<double> sysMatrix = { 1, 2, 1, 2, 1, 0, 1, 0, 3...
ALGO
0.999407
5.244394
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2023-04-06T21:02:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 10, "forks": 2, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e09395a8586...
8a5f1899-5417-40df-ab0b-1709504c2e33
mgnr7/concurrente19b_manuel_fernandez
ejercicios/mpi/prime_hybrid_sep/prime_hybrid_sep.cpp
#include <algorithm> #include <cstdlib> #include <iomanip> #include <iostream> #include <mpi.h> #include <omp.h> int calculate_start(int worker_id, int workers, int finish, int begin) { int range = finish - begin; return begin + worker_id * (range / workers) + std::min(worker_id, range % workers); } int calculate_f...
ALGO
0.999875
4.312445
{ "github_metadata": { "branch": "master", "commit_count": 98, "repo_created_at": "2019-08-13T16:24:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a372132e4...
cb353614-049e-4d86-ad34-5ac2974cac7a
wattlebird/leetcode-2019
424_longest-repeating-character-replacement.cpp
#include "util.h" #include <map> using namespace std; class Solution { public: int characterReplacement(string s, int k) { if (s.size() == 0) return 0; map<char, int> G; int rtn = k+1; int d = s[0]; for(int i = 0; i <= k; i++) { G[s[i]]++; if (G[d] <...
ALGO
0.999908
5.073575
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2019-04-07T14:54:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "00cdff82d...
5e16bad0-f21a-4de2-bef3-2c4409670f51
KirillReyzi/AaDS_Laba2
Support_functions.h
#pragma once #include <iostream> #include <fstream> using namespace std; const int N = 20; //filling one array with the values of another void mix(int first_array[], int second_array[], int lengh) { for (int i = 0; i < lengh; i++) second_array[i] = first_array[i]; } int input_arra_int(int array_int[]) { ...
TOOL
0.911337
3.551058
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2021-12-06T19:18: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": "98ee1b428727...
ea241528-134b-4763-90c0-8992d46ae8b5
protCAD/protcad
src/tests/pdbtest.cc
#include "pdbReader.h" #include "pdbWriter.h" #include "ran.h" #include <time.h> int main() { time_t startTime,endTime,runTime; string filename = "temp.pdb"; molecule* pTheProtein1 = pdbReader(filename); if (pTheProtein1 == 0) { return 1; } cout << "number of residues generated: " << residue::getHowMany() << en...
ALGO
0.987383
3.806492
{ "github_metadata": { "branch": "master", "commit_count": 688, "repo_created_at": "2014-06-03T21:20:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 17, "forks": 25, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "020442...
48ea216d-077c-4a42-baa9-c26b91ff89a6
cmuparlay/parlaylib
examples/set_cover.h
#include <limits> #include <functional> #include <cmath> #include <algorithm> #include <atomic> #include <utility> #include <parlay/primitives.h> #include <parlay/sequence.h> #include <parlay/utilities.h> #include "helper/speculative_for.h" // ************************************************************** // Set Cov...
ALGO
0.993666
7.280426
{ "github_metadata": { "branch": "master", "commit_count": 221, "repo_created_at": "2019-12-10T19:52:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 369, "forks": 71, "issues": 17, "pull_requests": 3 }, "file_meta": { "content_id": "cde27...
ce43b770-ee46-4b9e-a03d-3fb94cdabf26
PhilippStaedter/Solver_Study
Models/amici_import/bachmann2011_figs9-user/model0_bachmann2/model0_bachmann2_dwdp.cpp
#include "amici/symbolic_functions.h" #include "amici/defines.h" #include "sundials/sundials_types.h" #include <cmath> #include "w.h" #include "tcl.h" #include "p.h" #include "k.h" #include "x.h" void dwdp_model0_bachmann2(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, con...
ALGO
0.999718
4.553084
{ "github_metadata": { "branch": "master", "commit_count": 133, "repo_created_at": "2020-04-05T15:46:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 4, "pull_requests": 2 }, "file_meta": { "content_id": "8b0c957f...
17dbaf3b-b640-49e7-9948-20177493f93a
Louisrelax/Code
CSS223/HW/HW3/HW3_2.cpp
// Multi-column-sorting #include <iostream> using namespace std; struct multicolumn { int firstcol; int secondcol; int thirdcol; }; void sort(multicolumn arr[], int n) { multicolumn temp; for (int i = 0; i < n; i++) { for (int j = i; j < n; j++) { if (arr[i].firstcol > arr[j...
ALGO
0.999916
5.47384
{ "github_metadata": { "branch": "main", "commit_count": 80, "repo_created_at": "2022-12-07T14:08:49.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "85d10f9436a...
1ca14931-13aa-4c1d-8fc7-7e5b4fc3466f
YuktaS14/CP-Practise-Problems
Practise Problems/PalindromicNumbers.cpp
#include <bits/stdc++.h> #include <set> using namespace std; #define ll long long //#define fo(i,n) for(ll i=0;i<n;i++) #define vvi vector<vi> #define pii pair<int,int> #define rep(i,a,b) for(ll i = a; i<b; i++) #define ff first #define ss second const int N= 1e7, MOD = 1e9+7; int main() { int t; cin>>t; ...
ALGO
0.99987
4.154342
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-01-13T18:37: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": "a88f442161...
af573cc8-e0c6-4b54-b46f-a33ead5f106d
constGaurav/DSA
Sortings.cpp
// #include <bits/stdc++.h> #include <iostream> #include <climits> using namespace std; void bubbleSort(int a[], int n){ for(int i=0;i<n;i++){ for(int j=0;j<n-1-i;j++){ if(a[j] > a[j+1]){ int temp = a[j]; a[j] = a[j+1]; a[j+1] = temp; } } } } void selectionSort(int a[], int n){ for(int...
ALGO
0.999841
4.137853
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2022-06-30T18:07: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": "1f7e3b9ecfc6...
a14cfca6-803d-4fee-af94-96461cf77804
Akashkarmokar/CP
Codeforces/CFR_674/a.cpp
#include "bits/stdc++.h" using namespace std; #define nl '\n' #define ll long long #define ull unsigned long long #define debug(x) { cerr << #x << " = " << x << endl; } #define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); const int Max = (int)2e5+5; //functions ll lcm(ll a,ll b)...
ALGO
0.999768
4.257594
{ "github_metadata": { "branch": "master", "commit_count": 160, "repo_created_at": "2020-06-29T20:29: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": "69a0f1fa...
43cb4040-6d5a-4304-ad8a-001aa1a635b8
trdln/ADS-Autumn-2021
Additional/History/ADS2020-main/!Quizes/Algo3Quiz/b_quiz3.cpp
#include <bits/stdc++.h> #define ll long long #define sep " " using namespace std; const int MX_SIZE = 3000; ll p = 31; ll powers[MX_SIZE]; void getPowers() { powers[0] = 1; for (int i = 1; i < MX_SIZE; i++) powers[i] = powers[i - 1] * p; } ll getSubHash(string s, int l, int r) { ll sum = 0; ...
ALGO
0.999966
4.711511
{ "github_metadata": { "branch": "main", "commit_count": 16, "repo_created_at": "2021-09-01T03:33: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": "64ff865cfa9...
054aafda-7585-4151-9d8e-166c74b9abf4
manujagrawal/controls_on_beagle_bone
main_controls/src/controls/src/vx_pid.cpp
#include <iostream> #include "vx_pid.h" using namespace std; VxPid::VxPid(): Vx_t_lock() , Alpha_lock() , Vl_Vr_a_lock() { } double VxPid::getMinMax(int Cur_Var,int max,int min){ if(Cur_Var>max) return max; else if(Cur_Var<min) return min; else return Cur_Var; } void VxPid::vxTargetUpd...
ALGO
0.991949
4.90544
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2015-05-12T10:02: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": "3084a660fc...
0ba8af59-0b8d-46ca-a2b1-29042128351f
AbdallahHemdan/Algorithmic-Toolbox-San-Diego
week3_programming_challenges/5_maximum_number_of_prizes/different_summands.cpp
/*Author : <NAME> */ /***********************************************/ /* Dear online judge: * I've read the problem, and tried to solve it. * Even if you don't accept my solution, you should respect my effort. * I hope my code compiles and gets accepted. * ___ __ * |\ \|\ \ * \ \ \_\ \ * \ \ ___ \emdan * \ ...
ALGO
0.999865
3.997497
{ "github_metadata": { "branch": "master", "commit_count": 140, "repo_created_at": "2018-12-03T02:05:25.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 110, "forks": 80, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "7554a...