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 |
|---|---|---|---|---|---|---|---|
65b57ebd-255d-40e1-ae0b-be3ae7a1d69e | sanshar/Dice | ZSHCI/SHCImake4cHamiltonian.cpp | #include "time.h"
#include "Determinants.h"
#include "SHCIbasics.h"
#include "SHCIgetdeterminants.h"
#include "SHCIsampledeterminants.h"
#include "SHCIrdm.h"
#include "SHCISortMpiUtils.h"
#include "SHCImake4cHamiltonian.h"
#include "input.h"
#include "integral.h"
#include <vector>
#include "math.h"
#include "Hmult.h"
#... | ALGO | 0.964315 | 3.046043 | {
"github_metadata": {
"branch": "master",
"commit_count": 1360,
"repo_created_at": "2017-05-08T02:51:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 24,
"issues": 10,
"pull_requests": 2
},
"file_meta": {
"content_id": "aaf7... |
7a042b71-9ae1-407f-8800-5eb44119b6a1 | inkryp/cp | other/TopTec2021/S2/X.cpp | //
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100;
long long gcd(const long long& a, const long long& b){
if (!a) {
return 1;
}
long long x = abs(a), y = abs(b);
while (y) {
x %= y;
swap(x, y);
}
if (b / abs(b) > 0) {
return x;
}
return -x;
}
long long lcm(const long long& a, cons... | ALGO | 0.998464 | 4.050453 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2020-09-11T22:37: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": "60f88249e... |
2dc89a5a-d808-492c-a191-f8b12fcb10a9 | Demar-Qiu/Algorithm_Prac | sort_test/sort_count.cpp | #include<iostream>
#include<stdlib.h>
using namespace std;
/*
计数排序算法。 (是一种线性时间排序算法)
时间复杂度 O(n+m) n为原始数列规模,m为统计数组规模
把一组无序数列按照元素值构成一组新的统计数组,统计数组的下标包括所有元素值,每个下标对应的值为该元素出现的次数
最后按照这个新数组的顺序遍历输出(有几个次输出几次)就能得到结果。
优化:变形统计数组,从第二个元素开始每个元素都要加上前面元素之和
这样可让统计数组存储的元素值等于相应要排序的位置序号。
局限性:1、不适合于非整数(无法创建对应的统计数组)... | ALGO | 0.999962 | 4.752951 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-05-15T14:18: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": "90147872b2... |
1b07431d-46a7-4529-a73d-a92473c86281 | anant147/Coding-Problems | dynamic_prog/3.boxStalking.cpp | #include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
using namespace std;
// dynamic programming video 3
// box stalking
bool sortvect(const vector<int>& a1,const vector<int>& a2)
{
if (a1[3]==a2[3])
{
if (a1[0]==a2[0])
return a1[1]>a2[1];
else
return... | ALGO | 0.999779 | 4.271125 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-12-11T07:46:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "219bf4c0da... |
3286c9a0-cdf6-481d-b83d-649d3a508f0d | imunir57/CP | algo/SCC.cpp | #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cctype>
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<stack>
#include<queue>
#include<deque>
#include<unordered_set>
#include<map>
#include<utility>
#include<list>
#include<sstream>
using ... | ALGO | 0.999845 | 4.065226 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-03-15T15:59:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36d133add8... |
f7aeb230-848c-4f0d-83fa-d64034507f36 | Rajatsharma2002/Computer_Graphics | Mid_point_circle/main.cpp | #include <GL/gl.h>
#include <GL/glut.h>
#include <iostream>
using namespace std;
float r;
float mx ,my;
void display (void)
{
glClear(GL_COLOR_BUFFER_BIT);
float x=0,y=r;
float p = 1 - r;
glBegin(GL_POINTS);
glVertex2i(mx+x, my+y);
while (x <= y)
{
if (p < 0) {
x+=1;
y=... | ALGO | 0.916497 | 4.257839 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-01-06T11:42: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": "34a0abe9b259... |
ffe9be2c-1963-405c-b8dd-3feab19271c2 | jvff/mestrado-implementacao | include/main/cpp/MinMaxTreeImage.hpp | #ifndef MIN_MAX_TREE_IMAGE_HPP
#define MIN_MAX_TREE_IMAGE_HPP
#include "Image.hpp"
#include "MinMaxTree.hpp"
#include "MinMaxTreeNode.hpp"
#include "SimpleArrayImage.hpp"
template <typename InternalImageType, typename LevelOrderComparator>
class MinMaxTreeImage : public Image<typename InternalImageType::PixelType> {
... | ALGO | 0.96045 | 7.579162 | {
"github_metadata": {
"branch": "master",
"commit_count": 1728,
"repo_created_at": "2015-09-18T14:00: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": "e6ea662... |
fc06f274-fa86-4708-b93b-282d29ac498e | Tiiiger/QPyTorch | qtorch/quant/quant_cpu/bit_helper.cpp | #include "quant_cpu.h"
#include "stdio.h"
unsigned int clip_exponent(int exp_bits, int man_bits,
unsigned int old_num,
unsigned int quantized_num)
{
if (quantized_num == 0)
return quantized_num;
int quantized_exponent_store = quantized_num << 1 >> 1 >> 23;... | ALGO | 0.980291 | 5.414063 | {
"github_metadata": {
"branch": "master",
"commit_count": 246,
"repo_created_at": "2018-07-30T03:10:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 281,
"forks": 76,
"issues": 9,
"pull_requests": 2
},
"file_meta": {
"content_id": "953d4... |
c03ba277-0ea0-45d2-bca3-9350e6bb90a4 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/07/0711/personal_submission/cf1131f_lyxxys.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 200050;
struct dsu {
vector <int> p;
vector<vector<int>> blo;
dsu(){}
dsu(int n): p(n+1), blo(n+1){
for (int i = 0; i <= n; ++ i) blo[i].push_back(i), p[i] = i;
}
bool same(int x, int y){
return roo... | ALGO | 0.999929 | 4.653166 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "3e17... |
1a61666c-8974-49ce-a283-fcce31bf78ce | hallen252/Programming | Lab1/Lab1_3.cpp | //Написать программу, сортирующую список телефонов по возрастанию и использующую сортировку выбором. Телефон задан в виде строки. Например, 23-45-67.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//Сравнивает две строки, представляющие телефоны, и возвращает true, если первый телефон... | ALGO | 0.99976 | 5.464876 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2024-02-02T06:59: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": "b7277fa92... |
f3c774d2-bf32-4200-8607-bcb9069f97f8 | PradeepSahhu/DSA | DSA/stackUsingLinkedinList.cpp | #include <iostream>
using namespace std;
struct Node
{
int data;
struct Node *link;
};
int isFull()
{
struct Node *p = (struct Node *)malloc(sizeof(struct Node));
if (p == NULL)
{
return 1;
}
return 0;
}
int isEmpty(struct Node *ptr)
{
if (ptr == NULL)
{
return 1;
... | ALGO | 0.999483 | 3.783661 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-08-12T13:12: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": "f4d9b0ee7671... |
6874bdcb-457a-471e-85cb-2fd923918694 | MominRifat/Codeforces_Problems_Solutions | 2092B.cpp | // Created By Momin_Rifat
#include<bits/stdc++.h>
using namespace std;
void solve()
{
int n;
cin >> n;
string a,b;
cin >> a >> b;
int one1, one2, zero1, zero2;
one1 = one2 = zero1 = zero2 = 0;
for(int i = 0; i < n; i++)
{
if(i % 2 == 0)
{
if(a[i] == '1') one1... | ALGO | 0.999986 | 4.158734 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-11-13T16:59: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": "681e13a1c58... |
54616b8e-acc7-44bd-a618-ea30db86d17d | code-fans/books-source | 数据结构/第10章 二分图/10.1染色问题/color.cpp | //染色问题-BFS算法
#include<bits/stdc++.h>
using namespace std;
const int maxn = 10020;
vector<int>G[maxn];
int color[maxn];
int V,E;
int Bfs(int x) //非递归方式的BFS
{
queue<int>q; //BFS用队列完成
q.push(x);
color[x] = 1;
while (!q.empty()) //当队列... | ALGO | 0.999944 | 4.49589 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-08-24T10:16:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3e4a21fab6f2... |
602001aa-5f77-4019-afbe-f7646e356f82 | pranavsindura/CompetitiveProgramming | codeforces/C/376c.cpp | #include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl ... | ALGO | 0.999532 | 4.149458 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2021-01-26T05:15:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7040deaa0... |
17dce23a-89cb-4007-9991-926136b9bb39 | aliyun/aliyun-openapi-cpp-sdk | dcdn/src/model/DescribeDcdnDomainTopReferVisitRequest.cc | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... | WEB | 0.989358 | 6.462502 | {
"github_metadata": {
"branch": "master",
"commit_count": 2903,
"repo_created_at": "2017-12-26T02:53:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 104,
"forks": 74,
"issues": 11,
"pull_requests": 2
},
"file_meta": {
"content_id": "9b5f... |
914d489c-6606-451c-b68e-718219ca41b4 | prajnamayeesahu/Assignments-Group-10-ITP | Week-3-Assignment/Anushree-Mohanty_Assignment3/question5.cpp | #include <iostream>
using namespace std;
int main() {
int arr[] = {1, 2, 3, 2, 4, 1, 5};
int n = sizeof(arr) / sizeof(arr[0]);
int unique[n];
int count = 0;
for (int i = 0; i < n; i++) {
bool isDuplicate = false;
for (int j = 0; j < count; j++) {
if (arr[i] == unique[j]... | ALGO | 0.99942 | 5.239074 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2025-03-29T17:31:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c01d528ccc1... |
51309c16-91e1-4442-924f-83bcafbfff5f | DawnteaStudio/TIL | coding-test/Baekjoon/4000/4727.cpp | #include <iostream>
#define fast ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
using namespace std;
int main() {
fast;
int kcal, fat, car, pro;
int max_total, min_total;
while (true)
{
cin >> kcal >> fat >> car >> pro;
if (kcal == 0 && fat == 0 && car == 0 && pro == ... | ALGO | 0.995915 | 3.290198 | {
"github_metadata": {
"branch": "main",
"commit_count": 1633,
"repo_created_at": "2023-04-27T15:22:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99869c757... |
a43b8047-edfa-4109-857c-b0d2a5f2c839 | errai-/euler | hundredplus/137/terrain.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <cstdio>
using std::cout;
using std::endl;
using std::vector;
using std::map;
using std::string;
typedef unsigned long long int ull;
bool ispow2(long double num,long double bagel) {
long double n... | ALGO | 0.999399 | 3.279611 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2017-03-19T19:42: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": "d1fc339da... |
200c6c25-49ef-43dc-a419-6b56c0d23961 | ishandutta2007/codeforces-z | zhukov_dmitry/normal/291/D.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define clr(x) memset((x), 0, sizeof(x))
#def... | ALGO | 0.999783 | 3.16699 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43: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": "1700973496e1... |
74146ade-964b-47b5-aa9c-447bbfe7a658 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/06/0604/personal_submission/cf1133f2_jerry66.cpp | #include <bits/stdc++.h>
#define int long long
#define x first
#define y second
using namespace std;
typedef pair<int, int> PII;
const int N = 2e5 + 100;
int n, m, k;
PII a[N];
int fa[N];
int find(int x)
{
if (fa[x] != x) fa[x] = find(fa[x]);
return fa[x];
}
bool out[N];
void solve()
{
cin >> n >> m ... | ALGO | 0.999975 | 3.370483 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "3807... |
8db42d6c-8563-46ff-9285-a936bf987409 | UdaySharmaGitHub/DSA-CPP | GFG/HARD/Subtraction_in_Linked_List.cpp | /*
Subtraction in Linked List
You are given two linked lists that represent two large positive numbers. From the two numbers represented by the linked lists, subtract the smaller number from the larger one. Look at the examples to get a better understanding of the task.
Example 1:
Input:
L1 = 1->0->0
L2 = 1->2
Output... | ALGO | 0.999764 | 5.332911 | {
"github_metadata": {
"branch": "main",
"commit_count": 292,
"repo_created_at": "2023-11-19T16:25:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "107fc53c0e... |
f6c36b33-f7f7-407d-a0fe-06d896a8cf14 | batz02/LLVM-assignments | 3/LoopWalk.cpp | #include "llvm/Transforms/Utils/LoopWalk.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/InstrTypes.h"
#include <cmath>
using namespace llvm;
std::vector<Instruction*> ToMove;
std::set<Instruction*> Invariants;
bool isOpInv(Value *operan... | ALGO | 0.979914 | 6.703592 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-04-02T08:27: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": "5e2c06eaaae... |
dfe9a3dd-ef00-417a-87e4-178e4a10bf57 | AI-ARana/CPP | jan25/precedence.cpp | #include <iostream>
using namespace std;
int main() {
int a, b, c;
cout << "Enter three numbers: ";
cin >> a >> b >> c;
cout << "\nDemonstrating Operator Precedence:\n";
// Case 1: Multiplication before Addition
cout << "a + b * c = " << (a + b * c) << " (Multiplication has highe... | ALGO | 0.993755 | 5.315598 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-03-11T09:18:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4b89b15836... |
e92042fe-1d37-4337-8867-e60ed430305e | als982001/baekjoon-solve | 프로그래머스/lv3/43163. 단어 변환/단어 변환.cpp | #include <string>
#include <vector>
#include <queue>
#define MAX 12
using namespace std;
bool checked[MAX];
bool CanChange(string from, string to)
{
int diffNum = 1;
for (int i = 0; i < from.size(); ++i)
{
if (from[i] != to[i])
{
if (--diffNum < 0)
return ... | ALGO | 0.999997 | 5.074772 | {
"github_metadata": {
"branch": "main",
"commit_count": 517,
"repo_created_at": "2023-02-03T01:14:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79afceefeb... |
4b98c622-d578-4fdb-b640-7da51b6385ed | GungCheoul/CppAlgorithm | CppAlgorithm/BFS/2583.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
#define X first
#define Y second
int board[102][102];
bool visited[102][102];
int dx[4] = { 1, 0, -1, 0 };
int dy[4] = { 0, 1, 0, -1 };
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int m, n, k;
cin >> m >> n >> ... | ALGO | 0.999776 | 3.031767 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2022-01-13T01:15: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": "dac62602d... |
ae70bf8f-a69a-4a49-9f58-033cafb0eeed | wlsl4239/Algorithm-study | SW-expert-academy/CPP/[pro]3954.cpp | #include <iostream>
using namespace std;
int n;
bool notPrime[1000010];
int phi[1000010];
long long sum[1000010];
int gcd(int a, int b) {
if (!b) return a;
return gcd(b, a%b);
}
int main() {
notPrime[0] = true;
notPrime[1] = true;
for (int i = 2; i <= 1000; i++) {
if (notPrime[i]) continue;
for (int j = i + ... | ALGO | 0.999889 | 4.508403 | {
"github_metadata": {
"branch": "master",
"commit_count": 426,
"repo_created_at": "2018-12-26T00:44:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb5ada10... |
94e082aa-a97d-4538-8bfe-186e0e1c6e4c | root-project/root | tmva/tmva/src/TSpline2.cxx | // @(#)root/tmva $Id$
// Author: <NAME>, <NAME>, <NAME>
/**********************************************************************************
* Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
* Package: TMVA *
* Class :... | ALGO | 0.967731 | 5.923135 | {
"github_metadata": {
"branch": "master",
"commit_count": 93033,
"repo_created_at": "2013-06-27T10:46:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2899,
"forks": 1363,
"issues": 467,
"pull_requests": 269
},
"file_meta": {
"content_id"... |
c924f9ba-8d1e-4c66-b876-ddb1e98ac689 | premc5731/LOGIC-BUILDING | program-0229.cpp | #include<iostream>
using namespace std;
int Maximum(int Arr[], int iSize)
{
int iMax = 0, iCnt = 0;
iMax = Arr[0];
for(iCnt = 1; iCnt < iSize; iCnt++)
{
if(Arr[iCnt] > iMax)
{
iMax = Arr[iCnt];
}
}
return iMax;
}
int main()
{
int *ptr = NULL;
int ... | ALGO | 0.999699 | 3.941298 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-15T07:43:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1aa521a53adc... |
06f58d42-1a67-406a-8850-61cc0b229006 | sangdo913/Algorithms | StudyAlone/2020_09_12_kakao/6.cpp | #include <string>
#include <vector>
#include<queue>
#include<cstdio>
#include<memory.h>
#include<iostream>
using namespace std;
struct MINFO{
int r,c,r2,c2, chk;
};
#include<string.h>
int dr[4] = {-1,0,1,0};
int dc[4] = {0,1,0,-1};
int chk[1<<12][4][4][5][5];
int solution(vector<vector<int>> board, int r, int c) ... | ALGO | 0.999718 | 4.503492 | {
"github_metadata": {
"branch": "master",
"commit_count": 850,
"repo_created_at": "2018-01-06T13:25:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "badf76f6... |
58ef2266-b678-4bd6-819f-a149c04c5f2d | tksgo2582/Echico | 문제풀이/bfs/dfs/16.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M;
int mat[8][8];
int temp[8][8];
int dx[4] = {1, 0 ,-1, 0};
int dy[4] = {0, 1, 0, -1};
int result = 0;
void virus(int x, int y){
for(int i =0; i< 4; i++){
int nx = x+dx[i];
int ny = y+dy[i];
if(nx>=0&&nx<N&&ny>=0&&ny<M)
if(t... | ALGO | 0.999923 | 4.151945 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2021-02-06T17:22: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": "c39ed327f... |
16cfd265-307c-4078-844d-7e95519e7352 | ntxq/PS-Baekjoon | 17000~17999/17069.cpp | #include <algorithm>
#include <iostream>
#include <limits>
#include <numeric>
#include <vector>
using std::vector;
using Board = vector<vector<bool>>;
using DP = vector<vector<vector<long long>>>;
void moveHorizontal(int sx, int sy, const int N, DP& dp, const Board& board) {
int ny = sy + 1;
if (ny >= N || bo... | ALGO | 0.999958 | 5.254533 | {
"github_metadata": {
"branch": "main",
"commit_count": 620,
"repo_created_at": "2022-01-01T06:58: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": "9992b5a1f0... |
410acf9f-2f30-44c0-b408-63aa00d3a951 | Imzogelmo/catastrophe | Engine/src/Core/Math/Easing.inl | // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//... | ALGO | 0.97115 | 6.563345 | {
"github_metadata": {
"branch": "master",
"commit_count": 264,
"repo_created_at": "2015-06-14T03:49: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": "d2c16315... |
3943aedf-303e-4953-a96f-df93fc43757f | EhsanQA/ACM-ICPC_Trainings | SubsetSumProblemCodeWars.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
int a[MAXN];
vector<int> v;
int getSum(int l, int r) {
return a[r] - a[l] + v.at(l);
}
int maxSequence(const vector<int>& arr){
v = {};
for (int i : arr) {
cout << i << endl;
}
bool allNegative = true;
for (int i : arr) {
... | ALGO | 0.999948 | 3.888578 | {
"github_metadata": {
"branch": "master",
"commit_count": 390,
"repo_created_at": "2021-04-08T13:25:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8db4f80e... |
2caee55b-752b-4312-b087-99a5adcdf827 | keshavnandan/Topcoder | TeamPhoto.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cstring>
#include <climits>
using namespace std;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<vs> vvs;
int c, a1, a2;
class TeamPh... | ALGO | 0.999949 | 4.241738 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2014-04-21T08:52:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5bf34f... |
b4334641-f19a-4da7-b6d0-534a092158a8 | G3rarrd/CSES-300-Solutions | Sorting_and_Searching/Subarray_Sums_I.cpp | #include <bits/stdc++.h>
using namespace std;
int subArraySums(vector<int> nums, int n, int target) {
int j = 0;
int curSum = 0;
int count = 0;
for (int i =0 ; i < n; i ++) {
curSum += nums[i];
while (curSum > target && j < i) {
curSum -= nums[j];
j++;
}
... | ALGO | 0.999937 | 5.078712 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2024-07-10T12:51: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": "445ef30eb02... |
6cb824fe-fea3-419a-ab6f-624dd4f27c0e | minhpvo/Tmp | Ulti/GeneralUlti.cpp | #include "GeneralUlti.h"
#include "../Geometry/Geometry1.h"
#include "../Geometry/Geometry2.h"
#include <Eigen/SVD>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
using namespace cv;
void mySleep(int ms)
{
#ifdef _WINDOWS
Sleep(ms);
#else
usleep(ms);
#endif
return;
}
void myGetCurDir(int size,... | ALGO | 0.987441 | 5.083047 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-12-19T00:09: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": "8b6ca0d5d7fe... |
7d0cb186-76f6-4edb-8166-175195ec2cbd | jeete121/Coding | Programs/Practice/Prac/GraphAlgorithms/reformat_date.cpp | #include <bits/stdc++.h>
using namespace std;
//function to reformat the given date
string reformatDate(string s)
{
int n = s.size();
int i = 0;
string str = "";
while (i < n && s[i] >= '0' && s[i] <= '9')
{
str += s[i];
i++;
}
while (s[i] != ' ')
i++;
i++;
s... | TOOL | 0.981352 | 4.346989 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2023-05-06T10:00:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd7d68cf6... |
4210eafa-b920-47e3-ae28-a9494cd2efa9 | VarickQ/ACM | HaveDone/POJ/拓扑+dp+题意3272.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <map>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
const int inf = 1000000000;
const int M = 50005;
const int N = 5005;
struct edge{
int v,next;
}e[M],e1[M];
int ... | ALGO | 0.999952 | 3.437302 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-03-01T12:13: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": "54557d58fd... |
80674729-9b2b-4fe5-ada9-b351b7915cc7 | MiRoboticsLab/cyberdog_nav2 | navigation2/nav2_smac_planner/include/nav2_smac_planner/node_basic.hpp | // Copyright (c) 2020, Samsung Research America
//
// 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.984156 | 6.525638 | {
"github_metadata": {
"branch": "rolling",
"commit_count": 833,
"repo_created_at": "2023-05-04T07:16:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 26,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "029532b... |
f5892725-1492-4b54-82c7-5fd71c2a8d7e | ishandutta2007/codeforces-w | waynetu/normal/855/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10, lg = 20;
vector<pair<int, int>> G[maxn];
int dep[maxn], p[lg][maxn], tid[maxn], t;
bool edge[2][lg][maxn];
struct dsu {
int par[maxn], sz[maxn];
void init() {
for (int i = 0; i < maxn; ++i) par[i] = i, sz[i] = 1;
}
int fi... | ALGO | 0.999941 | 4.776446 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34: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": "510aa49126c5... |
6478a112-6d4e-48d2-8304-1943a17a267f | Simonhancrew/SCL | Math/高斯消元/高斯消元解异或线性方程组.cpp | #include <algorithm>
#include <iostream>
using namespace std;
const int N = 110;
int n;
int a[N][N];
int xor_gauss() {
int c, r;
for (int c = 0, r = 0; c < n; c++) {
int t = r;
for (int i = r; i < n; i++) {
if (a[i][c] == 1) {
t = i;
break;
}
}
if (!a[t][c]) continue... | ALGO | 0.999991 | 4.458197 | {
"github_metadata": {
"branch": "main",
"commit_count": 738,
"repo_created_at": "2021-08-08T02:13:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25c6f39c11... |
34904975-9035-42c4-8884-c9772d846f51 | Johnicholas/Hello-Github | educational-vms/turing_machines/TuringMachineAlexJohn8.cpp | // Universal Turing machine implementation, released under ISC/BSD license:
// Copyright (c) 2009, <NAME> <<EMAIL>>, <NAME> <<EMAIL>>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this perm... | ALGO | 0.998674 | 3.647801 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2011-06-22T14:21:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06c6c5a4... |
14b71c4f-4092-412e-bc4e-e0aa587d7ce9 | haitaibrowser/haitaibrowser | content/child/blob_storage/blob_message_filter.h | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_
#define CONTENT_CHILD_BLOB_STORAGE_BLOB_MESSAGE_FILTER_H_
#include <stddef.h>
#include <string... | TOOL | 0.914264 | 7.658026 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-10-28T07:01:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 8,
"issues": 0,
"pull_requests": 13
},
"file_meta": {
"content_id": "05fc77523... |
3e935bff-7cd0-425d-a37b-ecb0167d3188 | AdnanMuzavor/PDS | BST/Sum_of_left_leaves.cpp | /*
404. Sum of Left Leaves
Easy
2969
234
Add to List
Share
Given the root of a binary tree, return the sum of all left leaves.
Example 1:
Input: root = [3,9,20,null,null,15,7]
Output: 24
Explanation: There are two left leaves in the binary tree, with values 9 and 15 respectively.
Example 2:
Input: root = [1]
... | ALGO | 0.999977 | 6.17044 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2022-01-11T06:39: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": "a2ea9bc8... |
afe5d545-5f00-446c-a620-462e574614b1 | weEQxuw/AISD-lab1 | include/set/set.h | #pragma once
#include <iostream>
using namespace std;
namespace set
{
struct Node
{
int _value;
Node* _left;
Node* _right;
Node() : _left(nullptr), _right(nullptr) {};
Node(int value) : _value(value), _left(nullptr), _right(nullptr) {};
};
int size(Node* ptr)
{
if (ptr == nullptr)
return 0... | ALGO | 0.979265 | 3.832014 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-09-18T21:30: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": "93839070e1... |
dd51af10-c984-4075-8792-806d18f34405 | RainPPR/oi-archive | 20231029 qdez2023/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, x) for (int i = 0; i < (x); ++i)
#define rr read()
inline int read() {
int num = 0, flag = 1, ch = getchar();
for (; !isdigit(ch); ch = getchar()) if (ch == '-') flag = -1;
for (; isdigit(ch); ch = getchar()) num = num * 10 + ch - '0';
retu... | ALGO | 0.999974 | 3.670827 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2024-06-30T12:59: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": "514cba6fa2d... |
cc1752a0-3d71-4f35-ad26-1f676de17938 | renaissanceMan92/cplusplus-ExercisesCollection | Function exercises/Fractions.cpp | //============================================================================
// Name : Fractions.cpp
// Author : <NAME>
// Description : Task 6. App for calculating the four
// standard operations on fractions.
//============================================================================
#include <... | TOOL | 0.926775 | 5.962483 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-03-07T07:48: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": "ca0fa7420b33... |
e4d648cc-7772-4dce-ae9f-eafedc9f1578 | Maheeenasad/Daily-LeetCode-Sync | 1370-count-number-of-nice-subarrays/count-number-of-nice-subarrays.cpp | class Solution {
public:
int numberOfSubarrays(vector<int>& nums, int k) {
// Transform the array into a binary array where 1 represents an odd number and 0 represents an even number
for (int& num : nums) {
num = num % 2;
}
// Use a hash map to count prefix sums
... | ALGO | 0.999985 | 6.45855 | {
"github_metadata": {
"branch": "main",
"commit_count": 278,
"repo_created_at": "2024-05-24T09:37: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": "cb4fba7fb1... |
ccadbc30-cc77-4e9b-aaad-ca6249340b9d | dkwkekzz/algorithms | source/else/baekjoon/2157_여행.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <string.h>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <cmath>
using namespace std;
typedef unsigned long long uint64;
const int MAX_K = 100000;
int n, m, k;
vector<pair<int, int> > adj[MAX_K];
int C[M... | ALGO | 0.999912 | 3.419073 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-06-11T00:59: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": "f5d41d517f... |
69308473-9581-4b2c-9b78-1d5b66c08059 | anish-rajan/Cp-algos | contests/maycircuits20/a.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define mp make_pair
#define v vector
#define inp_push(no, v) \
ll no; \
cin >> no; \
v.push_back(no);
#define pb push_back
#define fi first
#define se second
#define ALL... | ALGO | 0.999461 | 4.482411 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-05-19T07:45: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": "0c4b242a6... |
34a97363-9415-4803-981e-11a985fafee0 | aben20807/oj_code | google_code_jam/2018/Qualification_Round/p2_Trouble_Sort.cpp | // TLE in hidden test case
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
int v[100001];
int n;
void troublesort()
{
bool done = false;
while (!done) {
done = true;
for (int i = 0; i < n - 2; i++) {
if (v[i] > ... | ALGO | 0.999767 | 3.942827 | {
"github_metadata": {
"branch": "master",
"commit_count": 239,
"repo_created_at": "2018-02-09T11:23:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57d36ba3... |
6efc423d-cdf7-48b4-8c08-03f4755494ad | Alexchiuu/programming_contest_code | ZeroJudgeC++/d539/main.cpp | #include <bits/stdc++.h>
using namespace std;
int st[2000000] = {};
int arr[500001] = {};
void build(int index, int l, int r){
if(l == r){
st[index] = arr[l];
}else{
int mid = (l + r) / 2;
int lson = index * 2, rson = lson + 1;
build(lson,l,mid);
build(rson,mid + 1,r);... | ALGO | 0.999996 | 5.431844 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-04-25T06:24: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": "15268bb31bfd... |
dd6ab031-79c1-425e-9264-1b347f71f3a3 | yzhang951/MD-utility | Pt_atom_tracking/strain.cpp | /* Read JPEG image
* Author : <NAME>
* Version : 1.3
* Date : Oct 18th 2016 */
#include <stdio.h>
#include <jpeglib.h>
#include <jerror.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "strain.h"
#define PNG_DEBUG 3
#include <png.h>
int read_input(){
... | TOOL | 0.97483 | 3.789798 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-07-19T19:17:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f140a9224da... |
de028fd9-ef12-4181-b6ac-88596ff271dc | rushyam/lane-_detection | hough.cpp | #include "cv.hpp"
#include "stdio.h"
#include "math.h"
struct INFO
{
float i,j;
};
int main()
{
Mat img1=imread("Roads.JPG");
Mat img(img1.rows,img1.cols,CV_8UC1);
cvtColor(img1,img,CV_BGR2GRAY);
GaussianBlur(img, img, Size(7,7), 0, 0);
Canny(img,img, 100,150, 3);
imshow("sgh",img);
INFO info[img.row... | ALGO | 0.988201 | 3.67231 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-11-30T08:54: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": "fde23112b... |
50faa624-3207-4822-8509-f14da1612264 | kronbichler/adaflo | source/navier_stokes.cc | // --------------------------------------------------------------------------
//
// Copyright (C) 2009 - 2016 by the adaflo authors
//
// This file is part of the adaflo library.
//
// The adaflo library is free software; you can use it, redistribute it,
// and/or modify it under the terms of the GNU Lesser General Pub... | ALGO | 0.996131 | 6.256736 | {
"github_metadata": {
"branch": "master",
"commit_count": 310,
"repo_created_at": "2016-03-24T16:27:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 14,
"issues": 3,
"pull_requests": 5
},
"file_meta": {
"content_id": "222f44... |
5d1a609e-878f-43c1-be0c-b9f26cb2f2f8 | SenecatLoic/GraphicsProject | src/CollisionPerso.cpp | #include "CollisionPerso.h"
#include <Cube.h>
CollisionPerso::CollisionPerso(){}
void CollisionPerso::addCollision(CollisionElement& collision) {
collisions.push_back(collision);
}
void CollisionPerso::setParticles(std::vector<Particle>& particles) {
this->particles = particles;
}
bool CollisionPerso::contains(co... | ALGO | 0.988424 | 3.62077 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2021-04-02T14:11:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a79c253fed... |
b8d4162b-1953-4418-ad87-55983669778d | ntanthedev/Cpp | Du Tuyen/Seg and BIT/AtCoder-abc357_f.cpp | //Written by: ntannn_
//created in 13:18:57 - Wed 17/07/2024
#include <bits/stdc++.h>
// #pragma GCC optimize("O3,unroll-loops,no-stack-protector")
// #pragma GCC target("sse4,avx2,fma")
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end(... | ALGO | 0.999934 | 5.395426 | {
"github_metadata": {
"branch": "main",
"commit_count": 482,
"repo_created_at": "2023-06-11T15:32:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ca5154550... |
6147c44c-3547-4162-8f31-e09062978dfc | WWWanghhhao/Parallel-Programming | 多线程相关编程实验代码/normal.cpp | #include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <numeric>
#include <omp.h>
#include <pthread.h>
#include <queue>
#include <random>
#include <sstream>
#include <string>
#include <sys/time.h>
#include <vector>
using namespace std;
enum DisType {
... | ALGO | 0.99698 | 3.24321 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-03-09T01:58: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": "3eabef1a426... |
53fe2784-6c58-4788-9b92-f648297c8f7e | rolandjansky/athena | Tracking/TrkVertexFitter/TrkVertexFitterInterfaces/TrkVertexFitterInterfaces/IVertexAnalyticSeedFinder.h | /*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// IVertexAnalyticSeedFinder.h, (c) ATLAS Detector software 2019
///////////////////////////////////////////////////////////////////
#ifndef TRKVERTEXFITTERINTERFACE_IVER... | ALGO | 0.996249 | 6.043121 | {
"github_metadata": {
"branch": "master",
"commit_count": 100549,
"repo_created_at": "2022-08-07T05:54:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96e29... |
0373852e-568a-4901-b109-19ddc4c33343 | abhi2425/3rd-sem-assignments-cpp | polymorphism/polymorphism.cpp | #include <iostream>
using namespace std;
class Vehicle
{
public:
virtual void run() //virtual function
{
cout << "Vehicles are meant to run" << endl;
}
};
class Car : public Vehicle
{
public:
void run()
{
cout << "Car runs at high speed." << endl;
}
};
class Bike : public Vehicl... | TOOL | 0.988986 | 5.968608 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-04-09T08:19: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": "eafe1ad6fa... |
f71c2e08-07ff-4450-96e3-20db38c5717b | Gurpreetsingh9465/Cp-And-Leetcode | workShop/queingSystem.cpp | #include<bits/stdc++.h>
using namespace std;
bool comparator(pair<float,char> left, pair<float,char> right) {
return right.first>left.first;
}
void printMerge(vector<pair<float, char>> combined) {
for(auto &i: combined) {
cout<<i.first<<" => "<<i.second<<endl;
}
}
pair<pair<vector<float>,map<floa... | ALGO | 0.997952 | 4.572377 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-08-08T05:06: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": "0646b6aba... |
5a093cbf-3d5c-4cff-a39a-a7b0f6900aa4 | DropD/CQP | Ex/Common/numerov.hpp | #ifndef CQP_NUMEROV
#define CQP_NUMEROV
namespace cqp
{
template<typename T>
class numerov
{
private:
T dx;
T dx_fac;
public:
numerov(double dx) : dx(dx), dx_fac(dx * dx / 12) {}
template<typename F>
T step(T x, F k, T psi_nm1, T psi_n)
{
... | ALGO | 0.985639 | 4.192152 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2012-05-18T15:16:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac0e59c42f... |
80f3ceb0-b613-43e9-968f-6e782c8cede3 | Mahmoud-Ameen/Problem_Solving | Dynamic Programming/UVA 10337 Flight Planner.cpp | /*
* Problem link: https://vjudge.net/problem/UVA-10337
* */
#include <bits/stdc++.h>
using namespace std;
const int oo = 1e8;
vector<vector<int>> wind;
vector<vector<int>> memo;
int x;
int solve(int steps, int alt){
if(steps * 100 == x) {
if (alt == 0)
return 0;
else return oo;
... | ALGO | 0.999901 | 3.708441 | {
"github_metadata": {
"branch": "main",
"commit_count": 244,
"repo_created_at": "2023-07-01T10:58: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": "07ac6dfcd1... |
60e59e32-8e1d-402c-94e8-26a1af660a9a | quangloc99/CompetitiveProgramming | Codeforces/CF48-D12-E.cpp | // graph, bfs, DAG, cycle detection
/**
* Author: <NAME> (darkkcyan)
* Editorial: https://codeforces.com/blog/entry/948
* Idea: each of the dragon's state can be thought as a vertex, and if we can go from one state to another by doing a cut, then we got an edge.
* To encode a state (head, tail) into a vertex, I use... | ALGO | 0.999939 | 3.651515 | {
"github_metadata": {
"branch": "master",
"commit_count": 306,
"repo_created_at": "2018-10-30T16:35:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d40535d6... |
614e7e95-3024-4008-8ab2-6e30822f5fc6 | ClickHouse/ClickHouse | src/Coordination/RaftServerConfig.h | #pragma once
#include <base/defines.h>
#include <base/types.h>
#include <fmt/format.h>
#include <libnuraft/srv_config.hxx>
#include <optional>
#include <variant>
#include <vector>
namespace DB
{
// default- and copy-constructible version of nuraft::srv_config
struct RaftServerConfig
{
int id;
String endpoin... | CONFIG | 0.942766 | 7.855344 | {
"github_metadata": {
"branch": "master",
"commit_count": 183246,
"repo_created_at": "2016-06-02T08:28:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 41764,
"forks": 7471,
"issues": 4250,
"pull_requests": 622
},
"file_meta": {
"content_... |
c02783c5-a5eb-40cb-b9a8-fa892d274c9a | jerry7991/Competitive-Programming-Lib | Target LeetdCode 200/WordLadderIIOp.cpp | class Solution {
public:
vector<vector<string>> findLadders(string bw, string ew, vector<string>& wl) {
unordered_set<string> aw(wl.begin(), wl.end());
aw.erase(bw);
unordered_map<string, vector<vector<string>>> level;
level[bw] = {{bw}};
while (level.size()) {
u... | ALGO | 0.999966 | 5.958304 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-10-15T07:46:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e339959d7... |
7a6b18f4-3a24-47db-bd94-36fe44b218bd | nguyentrongvanviet/competitive-programming | 2023/DAILY.cpp | /***************************************************************
* Author : <NAME> *
* Age : 17 *
* School : 12T2 Le Khiet High School for the Gifted *
* Hometown : Quang Ngai , Viet Nam . *
* Khanh An... | ALGO | 0.999871 | 3.971213 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2023-11-07T16:18:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb8f122136... |
2436228b-a38e-4b6e-8c19-fdb80537d715 | wizardxz/GA | generation.cpp | #include <cassert>
#include <cmath>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include "generation.h"
Generation::Generation(vector<Individual*> &ind_points, int ind_num)
{
this->ind_points = ind_points;
this->ind_num = ind_num;
}
Generation::~Generation()
{
for (unsigned int i = 0; i < i... | ALGO | 0.990578 | 4.575187 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2012-03-18T23:17:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32e6c7209b... |
f96ca7d9-b286-4665-b6d0-7c2fb7fa8944 | goodgood619/Problem-Solving | BOJ 2/9339.cpp | #include <cstdio>
#include <algorithm>
#include <string.h>
#include <cstdint>
#include <vector>
using namespace std;
typedef int64_t ll;
typedef int32_t Int;
struct p {
int index,num,hour,minute;
};
bool compare(const p &a,const p &b) {
if (a.hour != b.hour) return a.hour < b.hour;
if (a.minute != b.minute)... | ALGO | 0.999339 | 3.201581 | {
"github_metadata": {
"branch": "master",
"commit_count": 248,
"repo_created_at": "2019-09-07T16:13:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "827b518e... |
fcff3855-8413-4c0f-b327-b5bf16c27580 | 38609/cpp_lab_1 | main.cpp | #include <iostream>
#include <map>
using namespace std;
unsigned long convertFromReadable(string value);
int main() {
cout << convertFromReadable("4") << endl; // Not found unit in units map -> return 0
cout << convertFromReadable("4S") << endl; // Not found unit in units map -> return 0
cout << convertF... | TOOL | 0.927136 | 4.636493 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-03-24T12:05: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": "55870c300f... |
0c89bfa6-9b7f-4ba9-905a-bc0e94d14850 | dlalsrn/Baekjoon | 백준/Gold/1238. 파티/파티.cc | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
typedef pair<int, int> pi;
vector <vector<int>> all_dist;
vector <vector<pi>> node;
priority_queue <pi, vector<pi>, greater<pi>> q;
int N, M, X, u, v, w, mx;
void dijk(int s)
{
while (!q.empty())
{
int next = q.top().s... | ALGO | 0.999983 | 4.545327 | {
"github_metadata": {
"branch": "main",
"commit_count": 845,
"repo_created_at": "2022-10-18T11:21: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": "c120135666... |
9449adc1-1957-4a26-b588-0b038e977fbf | ishandutta2007/codeforces-h | he_ren/normal/1290/C.cpp | #include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
const int MAXN = 3e5 + 5;
const int MAXM = 3e5 + 5;
const int MAXP = MAXM*2;
int n,m;
int fa[MAXP],size[MAXP],must[MAXP];
int find(int u){ return fa[u]==u? u: fa[u]=find(fa[u]);}
inline void connect(int u,int v)
{
int fu=find(u), fv=find(v);
... | ALGO | 0.999912 | 3.590774 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "7900051e234d... |
4bcae404-9ee6-4df4-91c1-585b96382c31 | kamaleshwaran-p/Algorithms | Sequence/Approximate Sequence Matching/JaroDist.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
double jaroDist(string a, string b) {
int n1 = a.length(), n2 = b.length();
if (n1 == 0)
return n2 == 0 ? 1.0 : 0.0;
int matchDist = max(n1, n2) / 2 - 1;
bool a_match[n1], b_match[n2];
fill(a_match, a_match + n1, false);
fill(b_match, b_ma... | ALGO | 0.999736 | 4.288591 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-01-10T07:43: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": "914b6108e... |
4987d23f-47cd-4bac-9bdc-234c42093d7e | DongChengrong/ACM-Program | UVA/1500-1599/1597.cpp | #include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<sstream>
#include<iostream>
using namespace std;
const int maxr=1500+10;
const int maxa=100+10;
string A,B;
struct Node
{
vector<string> context;
}articles[maxa];
int query(int pos,int way)
{
int ok=1;
if(way==0)
{
... | ALGO | 0.999726 | 3.550082 | {
"github_metadata": {
"branch": "master",
"commit_count": 215,
"repo_created_at": "2017-07-26T00:35:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c193ad4... |
fcd37cc6-6491-4b18-b382-d70baab538f9 | wesllhey/competitive-programming-4 | chapter-02/section-03/e-hash-table-map-easy/uva-11348.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int tests, friendNumber, stampNumber, type;
cin >> tests;
for (int test = 1; test <= tests; ++test) {
cin >> friendNumber;
unordered_map<int, int> stamps;
vector<unordered_set<int>> friend... | ALGO | 0.992604 | 4.530967 | {
"github_metadata": {
"branch": "main",
"commit_count": 116,
"repo_created_at": "2021-05-13T17:43:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63dcfe3f6e... |
6a72b652-4bcc-42dc-9498-57bfd1077e5c | Yawn-Sean/Daily_CF_Problems | daily_problems/2025/02/0201/personal_submission/cf1070i_tsreaper.cpp | #include <bits/stdc++.h>
#define MAXN 600
#define MAXM 600
#define INF ((int) 1e9)
using namespace std;
int n, m, K, ans[MAXM + 5];
int deg[MAXN + 5];
struct Edge {
int fn, nxt, cap;
} e[(MAXN + MAXM * 3) * 2 + 5];
int S, T, eid, p[MAXN + MAXM + 5];
int dep[MAXN + MAXM + 5], cur[MAXN + MAXM + 5];
void adde(int ... | ALGO | 0.999937 | 3.644084 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "d96f... |
0ac132bb-1f20-4b82-89c0-0aaf62562390 | pastapeter/Algorithm | 알고리즘/pro_1844.cpp | #include<vector>
#include<queue>
#include<iostream>
using namespace std;
int board[101][101];
int bfs(pair<int, int> start, int n, int m) {
queue<pair<int, int>> q;
q.push(start);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
while (q.size() != 0) {
pair<int, int>... | ALGO | 0.999966 | 4.291881 | {
"github_metadata": {
"branch": "master",
"commit_count": 300,
"repo_created_at": "2021-05-03T17: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": "6017021f... |
cf0ee436-da41-4daa-a755-f75456ef44e4 | KaranBararwal/PW | Lec71_TopView.cpp | #include <iostream>
#include<vector>
#include <queue>
#include<map>
using namespace std;
class Node
{
public:
int value;
Node *left;
Node *right;
Node(int data)
{
value = data;
left = right = NULL;
}
};
vector <int> topViewBinaryTree(Node * rootNode){
vector<int> ans;
... | ALGO | 0.999991 | 4.957504 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-07-13T13:59:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9211618e048... |
e29fc3bf-2356-4559-85e5-9c0eee49a6fc | manicki/psi-toolkit | tools/translators/bonsai/translator/Transformation.hpp | #ifndef TRANSFORMATION_H__
#define TRANSFORMATION_H__
#include <vector>
#include <set>
#include <sstream>
#include <boost/shared_ptr.hpp>
#include "TransferTypes.hpp"
#include "LmContainer.hpp"
namespace poleng
{
namespace bonsai
{
class Transformation {
public:
Transformation(Symbol, SListPtr, SListPtr, dou... | TOOL | 0.9725 | 5.432762 | {
"github_metadata": {
"branch": "master",
"commit_count": 2740,
"repo_created_at": "2013-02-14T09:07:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "295a079... |
59949ab9-a6e5-4581-9b9a-20843f94569a | ManuelLoaizaV/competitive-programming-solutions | UVA/10066_The_Twin_Towers.cpp | //
// Created by ManuelLoaiza on 03/05/2018.
//
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100;
int firstTower[MAX_N], secondTower[MAX_N];
int dp[MAX_N][MAX_N];
int LCS(int n, int m) {
if (n < 0 or m < 0) return 0;
if (dp[n][m] != -1) return dp[n][m];
dp[n][m] = 0;
if (firstTower... | ALGO | 0.999376 | 4.182353 | {
"github_metadata": {
"branch": "master",
"commit_count": 545,
"repo_created_at": "2018-08-14T21:07:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79081f67... |
fbf3f3ec-b4c4-46c4-92f0-f2aa36674542 | MunawarJohar/DSA-Series | Day 5/hometask.cpp | #include <iostream>
using namespace std;
// Function to check if a number is prime
bool isPrime(int num) {
if (num <= 1)
return false; // Numbers 1 and below are not prime
for (int i = 2; i <= num / 2; i++) {
if (num % i == 0)
return false; // If divisible by any number other... | ALGO | 0.999179 | 5.144206 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-09-03T07:13:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1807fc27d06... |
c1994bf2-04b9-4402-8f45-eb49d052625b | akitomoya616/PE4 | TicTacToe.cpp | #include <iostream>
#include<vector>
struct Position {
int row;
int col;
bool operator==(const Position &other) {
return row == other.row && col == other.col;
}
};
//create a board using a 2d vector, a vector that contains another vector which stores string values
std::vector<std::vector<std::string>> CreateBoa... | ALGO | 0.997874 | 5.412176 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-02-08T23:12: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": "d947cc81089... |
6ae3a5b1-8c1a-4c0b-a795-e5f1c6f0d7c0 | Adiana3308/CrackYourPlacement | Linked List/4.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
ListNode* solve(ListNode*list... | ALGO | 0.99999 | 5.902804 | {
"github_metadata": {
"branch": "master",
"commit_count": 402,
"repo_created_at": "2024-07-21T09:19:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac798380... |
750702f8-f862-4f36-aae5-96dd3f12c425 | javierborja95/JB_CSC17a | Assignments/Review/Gaddis_8thEd_Chap08_Prob11_FileStringSort/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on September 15, 2016, 1:00 PM
* Purpose: Inputs names from file and sorts
*/
//System Libraries
#include <iostream> //Input/ Output Stream Library
#include <string>
#include <iostream>
#include <fstream>
using namespace std; //Namespace of the System Libraries... | ALGO | 0.998253 | 4.614197 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2016-08-30T00:20: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": "3bbe7df03... |
09525267-66a0-4036-8a0b-8fc7884334a2 | birdhumming/usaco | done/rut2.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef pair<int, int> ii;
const int N = 1010;
int n;
struct cow {
int x, y, len = 2 * 1e9;
} cows[N];
int east[N], north[N];
int east_size, north_size;
int stopped[N];
bool is_stopped[N];
bool cmp(int a, int b) {
return cows[a].... | ALGO | 0.999974 | 4.046299 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2019-09-16T20:36: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": "854fb338... |
3677d539-96c6-4a5f-895c-823b11bb7c71 | Kedyi/LeetCode | Maximum length Bitonic Subarray - GFG/maximum-length-bitonic-subarray.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
// Function to find length of longest bitonic
// subarray
int bitonic(vector<int> arr, int n) {
// code here
int inc[n];
int dec[n];
int i,max;... | ALGO | 0.999583 | 5.4236 | {
"github_metadata": {
"branch": "master",
"commit_count": 658,
"repo_created_at": "2022-05-15T12:36: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": "d506d215... |
936a8c99-80b1-466d-9db2-89e209718db7 | dsc-iem/TheAlgorithms | CPlusPlus/math/check_prime.cpp | /**
* Copyright 2020 @author omkarlanghe
*
* @file
* A simple program to check if the given number if prime or not.
*
* @brief
* Reduced all possibilities of a number which cannot be prime.
* Eg: No even number, except 2 can be a prime number, hence we will increment
* our loop with i+2 jumping on all odd numb... | ALGO | 0.998848 | 5.318003 | {
"github_metadata": {
"branch": "main",
"commit_count": 183,
"repo_created_at": "2021-10-01T18:56:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 49,
"forks": 34,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "d4036dcfe... |
24378733-50cb-417e-a7f8-de022a4a23ce | choi818/SKKU | 17-2/Algorithm/mst.cpp | #include <cstdio>
#include <queue>
#include <limits>
using namespace std;
// Global variables
int ver_num, edge_num, smst_weight = 0;
class Edge {
public:
int u, v, weight;
Edge() { }
void print() {
printf("(%d %d)\n", u, v);
}
bool operator> (const Edge& edge) const {
return weight... | ALGO | 0.99989 | 3.974102 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-01-12T19:45:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00e330ac5... |
063f4007-21ea-465c-a512-83a3ee1d620a | NVIDIA-AI-IOT/trt_pose | trt_pose/parse/refine_peaks.hpp | #pragma once
namespace trt_pose {
namespace parse {
void refine_peaks_out_hw(float *refined_peaks, // Mx2
const int *counts, // 1
const int *peaks, // Mx2
const float *cmap, // HxW
const int H, const int W, c... | ALGO | 0.912659 | 5.908005 | {
"github_metadata": {
"branch": "master",
"commit_count": 262,
"repo_created_at": "2019-07-29T19:42:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1011,
"forks": 299,
"issues": 137,
"pull_requests": 6
},
"file_meta": {
"content_id": "c7... |
72108023-d86e-428a-86e2-9283f46c4be4 | Ewenwan/MVision | PCL_APP/Basic/Features/Globally_Aligned_Spatial_Distribution.cpp | /*
pcl版本 >= 1.9才有
全局一致的空间分布描述子特征
Globally Aligned Spatial Distribution (GASD) descriptors
可用于物体识别和姿态估计。
是对可以描述整个点云的参考帧的估计,
这是用来对准它的正则坐标系统
之后,根据其三维点在空间上的分布,计算出点云的描述符。
种描述符也可以扩展到整个点云的颜色分布。
匹配点云(icp)的全局对齐变换用于计算物体姿态。
使用主成分分析PCA来估计参考帧
三维点云P
计算其中心点位置P_
计算协方差矩阵 1/n × sum((pi - P_)*(pi - P_)转置)
奇异值分解得到 其 特征值eigen values 和特征向... | ALGO | 0.971574 | 5.080328 | {
"github_metadata": {
"branch": "master",
"commit_count": 3396,
"repo_created_at": "2017-09-24T06:25:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8384,
"forks": 2800,
"issues": 17,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
c698d0d4-4a84-4738-907a-9c2788a281c4 | mualloc/leet-code-solutions | Patterns/Word-Squares.cpp | // https://www.codingninjas.com/studio/problems/word-squares_1235203
#include <bits/stdc++.h>
// https://walkccc.me/LeetCode/problems/0425/
struct TrieNode {
void Insert(string &word) {
auto curr = this;
for (const auto &c : word) {
auto child_index = ChildIndex(c);
if (nullptr == curr->children... | ALGO | 0.999975 | 6.496297 | {
"github_metadata": {
"branch": "master",
"commit_count": 107,
"repo_created_at": "2023-01-07T11:21: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": "fdab8546... |
74a34639-0153-465a-a8a9-1f7c4307f9fb | Lmumu1123/HUST-CSE-Courses | 程序设计综合课程设计/程序设计hash/file_op.cpp | #include "tree.h"
extern std::unordered_map<std::string, TreeNode*> nodeIndex;
extern TreeNode* rootNode;
/**
* @brief 从根节点开始寻找指定节点的父节点
* @param root 目录树的根节点
* @param node 要寻找父节点的目标节点
* @return 返回目标节点的父节点指针,若不存在则返回 NULL
*/
TreeNode* find_parent(TreeNode* root, TreeNode* node) {
TreeNode* stack[MAX_STACK] = {}... | TOOL | 0.940623 | 4.247446 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-10-31T05:18:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6185ac2c63e... |
9bcd55f6-ec25-46b7-9793-d8b22ac6d9df | jessicazhang236/Competitive | CCC/CCC08S3.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int N, R, C, dis[24][24], movement[4][2]={{1,0},{-1,0},{0,1},{0,-1}};
queue<pii> path;
bool vis[24][24];
bool check(int i, int j) {
if (i>0&&j>0&&i<=R&&j<=C&&!vis[i][j])
return true;
return false;
}
int main() {
scanf("%d", &N... | ALGO | 0.999977 | 3.687503 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-09-23T23:36:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23dc5bc33... |
8ccf1c58-8744-4823-b972-3315239dd07a | fuookami/CompilerCurriculumDesign | compiler/compiler/main.cpp | #include "LexicalAnalysis.h"
#include "LR1.h"
#include "Translator.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <memory>
using namespace std;
int main(void)
{
ifstream fin("src\\syntax.txt");
LR1 *pLR1(SingleTon<LR1>::instance());
LexicalAnalysis *pLex... | TOOL | 0.967672 | 4.054891 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-04-22T18:13: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": "2bcecfb217... |
a7e40dca-0cac-4d2f-bdde-02396acdbbf6 | InsightSoftwareConsortium/ITK | Modules/Filtering/Convolution/include/itkConvolutionImageFilter.h | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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
*
* https://www.apache.o... | TOOL | 0.911456 | 7.775639 | {
"github_metadata": {
"branch": "main",
"commit_count": 57165,
"repo_created_at": "2010-07-27T15:48:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1517,
"forks": 701,
"issues": 268,
"pull_requests": 49
},
"file_meta": {
"content_id": "3... |
a664ac71-1c81-47f3-88b1-7b74937fec0f | trishantsaxena/Project_DSA | GFG/RotateArray.cpp | #include<iostream>
#include<vector>
void getSize(int &size){
std::cout<<"Enter size:\t";
std::cin>>size;
}
void getElements(std::vector<int> &arr,int size){
std::cout<<"\nEnter Elements:\t";
for (int i = 0; i < size; i++)
{
std::cin>>arr[i];
}
... | ALGO | 0.998736 | 4.71096 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2024-04-27T10:42: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": "e4e48d504... |
1d16b43c-8504-41b1-80af-1d727f54ea26 | huhhh1/DSA | LAppu.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(), (a).end()
#define sz() long long int(.size())
#define popcount __builtin_popcount
#define popcountlong long int __builtin_popcountlong long int
// #define rast(1, y1, 2, y2) (1 - 2) * (1 - 2) + (y1 - y2) * (y1 - y2)
#define dict make_pair
#defin... | ALGO | 0.999982 | 4.345751 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-30T02:41: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": "95b7ab8dd897... |
26d28f66-0fd4-45bc-8671-318defa676f3 | KevinLTT/LeetCode | 0032_longestValidParentheses.cpp | #include "u.h"
class Solution {
public:
inline bool indexValid( string s, int i )
{
if( s.empty() || i >= s.size() || i < 0 )
return false;
else
return true;
}
inline bool pair( string s, int i, int j )
{
if( !indexValid( s, i ) || !indexValid( s, j ... | ALGO | 0.999774 | 4.873267 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2018-04-12T13:44: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": "484a8a15e... |
fce18504-1cd1-47fb-868c-2560cd99c84c | ishandutta2007/codeforces-k | kilo_5723/normal/1267/K.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 2e6+5;
int n;
typedef vector<int> vi;
typedef vector<LL> vl;
typedef pair<int, int> pii;
vl convert(LL x) {
vl res;
for (int i=2; x; ++i) {
res.push_back(x%i);
x /= i;
}
return res;
}
bool operator == (v... | ALGO | 0.999744 | 3.972912 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "0fb83cb36a6e... |
84dd2494-c5ac-4228-a168-584e757cfa5c | anyflow/practice | algorithm/cpp/lib/Tree.hpp | #ifndef TREE_HPP
#define TREE_HPP
#include <sstream>
#include <string>
#include <vector>
namespace anyflow {
struct Node {
int data;
Node* left;
Node* right;
};
class Tree {
public:
static Node* create(std::string treeNotation) {
using namespace std;
stringstream stream(treeNotation);
string te... | ALGO | 0.963893 | 4.902013 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2017-06-20T15:27:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "0f7963d0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.