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 |
|---|---|---|---|---|---|---|---|
8db03f17-d251-4184-b0ed-8625741c6b3a | muratcancicek/Assignment-Projects | CS201/select/select/AlgorithmSortK.cpp | /* Coded by <NAME> S004233 Computer Science */
#include "AlgorithmSortK.h"
#include <iostream>
AlgorithmSortK::AlgorithmSortK(int k, std::string myfile)
{
this->k = k;
this->myfile = myfile;
}
void AlgorithmSortK::BubbleSort(int num[], int numLength)
{
int i, j, flag = 1; // set flag to 1 to start first pass
... | ALGO | 0.999455 | 3.859626 | {
"github_metadata": {
"branch": "master",
"commit_count": 978,
"repo_created_at": "2016-05-04T02:20: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": "8ad33133... |
10cc0279-f43b-4894-b03f-71cb66d1f0a5 | ASENNIU/Coding | Graph2-3-MinimumSpanningTree/P1195.cc | //
// Created by 13345 on 2023/12/6.
//
#include <cstdio>
#include <algorithm>
#define MAXM 10005
#define MAXN 1005
struct edge{
int u, v, w;
}edges[MAXM];
int cnt, n, m, k, tot, u, v, w, ans;
int fa[MAXN];
bool root[MAXN];
void add(int u, int v, int w) {
edges[cnt].u = u;
edges[cnt].v = v;
edges[... | ALGO | 0.999977 | 4.754557 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2023-06-12T14:34:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "337f15f5f20... |
6602a1b6-2d2a-4970-9731-5cea5bb46d73 | 1iyiwei/noise | RainbowNoise/src/Shuffling/EnergySort.hpp | /*
EnergySort.hpp
keeping sorted lists pointing to energy samples across multiple classes
<NAME>
08/25/2009
*/
#ifndef _ENERGY_SORT_HPP
#define _ENERGY_SORT_HPP
#include <vector>
using namespace std;
#include "EnergySample.hpp"
class EnergySort
{
public:
EnergySort(void);
EnergySort(const int num... | ALGO | 0.997245 | 5.670092 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2016-11-06T09:14:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffe72850... |
461b5ed4-bc07-42cb-b767-72986e1bbe3f | Logeswaran123/Leveling-up-Leet | #297 Serialize and Deserialize Binary Tree/297_serialize_and_deserialize_binary_tree.cpp | /*
---
HARD
297. Serialize and Deserialize Binary Tree
---
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer enviro... | ALGO | 0.999799 | 7.25542 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2022-05-31T03:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10639a8127... |
1881c69a-c9ad-40f5-9a4a-1b43fbfb685f | wisdompeak/LeetCode | Others/347.Top-K-Frequent-Elements/347.Top-K-Frequent-Elements_v2.cpp | class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k)
{
unordered_map<int,int>freq;
for (auto x: nums)
freq[x]++;
vector<pair<int,int>>arr;
for (auto x: freq)
arr.push_back(x);
int f = quickselect(arr, 0, arr.size()-1, k);
... | ALGO | 0.999997 | 6.724577 | {
"github_metadata": {
"branch": "master",
"commit_count": 8912,
"repo_created_at": "2017-03-01T10:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6018,
"forks": 1314,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "7... |
469bd207-cd32-422c-85db-8bde009c5181 | Adjuzi/UVA | uva10879.cpp | #include <iostream>
using namespace std;
int main()
{
int cases;
int K;
int A, B, C, D;
int counter;
cin >> cases;
for(int i = 0; i < cases; i++){
counter = 0;
cin >> K;
for(int j = 2; j < K/2; j++){
if(counter == 2){
... | ALGO | 0.999788 | 4.56476 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2018-02-26T17:33:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4faf873a8... |
186f88c1-6c86-4f5e-863f-5074f56012fd | Morcki/DataStructureTest | MySTD/HuffmanTree.h | #pragma once
#ifndef HUFFMANTREE_H
#define HUFFMANTREE_H
#include <queue>
using namespace std;
template<class T,typename Tw>
class HMnode
{
public:
T value;
Tw weight;
HMnode<T, Tw> *left;
HMnode<T, Tw> *right;
HMnode() :value(0), weight(0), left(0), right(0) {};
HMnode(T data,Tw w) :value(data), weight(w), left(... | ALGO | 0.999854 | 3.474021 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-11-25T12:22:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a68c71feb... |
06c5b1b4-ab48-470e-b8bd-c2a1fae78971 | AbhinavTiwari2705/GFG_and_Codingninjas_Solutions | Triplet Family.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool findTriplet(vector<int>& arr) {
// Your code
unordered_map<int,int> mep;
for(int i=0;i<arr.size();i++){
mep[arr[i]]++;
}
for(int i=0;i<arr.... | ALGO | 0.994709 | 5.804349 | {
"github_metadata": {
"branch": "main",
"commit_count": 409,
"repo_created_at": "2023-09-26T18:01: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": "53a2476a6b... |
8dcc2875-5f67-4e1e-b32b-9e1b6f75e727 | jhnaldo/problem-solving | acmicpc/cpp/2985.cc | #include <stdio.h>
int main(){
int a, b, c;
char left, right;
scanf("%d %d %d", &a, &b, &c);
if (a+b == c) { left = '+'; right = '='; }
else if (a-b == c) { left = '-'; right = '='; }
else if (a*b == c) { left = '*'; right = '='; }
else if (a == b+c) { left = '='; right = '+'; }
else if... | ALGO | 0.99995 | 3.675511 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-02-25T16:12: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": "901fb9baa... |
16e588c0-21af-4fc9-b6b8-863f4fffa089 | lemonson03/Hello-World- | UnsortedTypeDoublylinkedlist.cpp | #include <iostream>
template <typename T>
class Node {
public:
T data;
Node* next;
Node* prev;
Node(T value) : data(value), next(nullptr), prev(nullptr) {}
};
template <typename T>
class DoublyLinkedList {
private:
Node<T>* header;
Node<T>* trailer;
public:
DoublyLinkedList() {
h... | ALGO | 0.970345 | 6.837565 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-11-06T09:39:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "235ea17a71ff... |
f67d28a1-34b2-4401-aa81-9f43c7f9fdc0 | ik48655/Object-oriented-programming | KOLOKVIJ 2 27012022/Zadatak2/Zadatak2.cpp | /*Napisite template funkciju koja kao parametre ima vektor elemenata,
* i dva elementa x i y. Funkcija vraca true ako je pozicija prvog pojavljivanja elementa
* x u vektoru manja od pozicije prvog pojavljivanja elementa y u vektoru, inace vraca false.
* A jednog od elemenata x ili y nema u vektoru, funkcija baca iznimk... | ALGO | 0.999184 | 5.271623 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2021-10-15T18:58: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": "05999b788... |
e5476224-216b-462f-84e9-9f4e264782f4 | Prajwal-ak-0/binary-search | DSA/BinarySearch/Applications/MedianOfTwoSortedArrays.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
/*
Idea: Find the median of two sorted arrays using binary search.
Approach:
1. Use binary search on the smaller array to partition both arrays.
2. Calculate the left and right parts of the partition.
3. Adjust the search range based on th... | ALGO | 0.999999 | 7.162459 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-05-03T01:36: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": "c0706063e2e... |
eff82770-33f1-4910-88ee-a23fee6376df | ishandutta2007/codeforces-q | quang/normal/1070/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
int n_days, n_cores, m;
vector< pair<int, int> > E[N];
int64_t sumC[N];
int64_t sumPC[N];
void update(int64_t bit[], int i, int64_t v) {
for (; i < N; i += i & -i) {
bit[i] += v;
}
}
int64_t get(int64_t bit[], int i) {
int64_t res = 0;
for... | ALGO | 0.999722 | 4.714974 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:56: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": "584e768d83c5... |
8c949787-501b-4fef-8684-053318d1a18e | LeeJJ07/Algorithm | 백준/Gold/1916. 최소비용 구하기/최소비용 구하기.cc | #include <iostream>
#include <vector>
#include <queue>
#include <limits.h>
using namespace std;
typedef pair<int, int> edge;
static vector<int> mdistance;
static vector<bool> visited;
static vector<vector<edge>> mlist;
static priority_queue<edge, vector<edge>, greater<edge>> q;
int main() {
ios::sync_with_stdio(fals... | ALGO | 0.999995 | 4.382357 | {
"github_metadata": {
"branch": "main",
"commit_count": 875,
"repo_created_at": "2023-08-10T18:39: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": "b5d2e43274... |
5bf6511c-b275-444f-a3f4-91f2420c9ab7 | AbubakrAlwi/Cpp-Nanodegree-Program | Project_1_Route_Planning/src/route_planner.cpp | #include "route_planner.h"
#include <algorithm>
RoutePlanner::RoutePlanner(RouteModel &model, float start_x, float start_y, float end_x, float end_y): m_Model(model) {
// Convert inputs to percentage:
start_x *= 0.01;
start_y *= 0.01;
end_x *= 0.01;
end_y *= 0.01;
// TODO 2: Use the m_Model.Fi... | ALGO | 0.933203 | 5.50862 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2025-04-23T06: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": "91bb4b31569... |
2bf97c41-68ee-4d14-924f-f91d1a6d3f94 | MOMA7777/PS-solutions | Sinking_Ship.cpp | //problem link : https://codeforces.com/problemset/problem/63/A
#include <bits/stdc++.h>
using namespace std;
/*
* unordered map dont gurantee ordering "Mazen 2025"
*
* How to sort elements based on your priorites ? give them hashes.
*
* rats 0
* women/children 1
* men 2
* cap... | ALGO | 0.999891 | 4.007169 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2024-08-26T15:17:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9118b2f412... |
6a89f436-ea67-4287-8674-df67e8248673 | saket-b/OOPS | student_detail/main.cpp | //******************************************************************************
// Online C++ compiler to run C++ program online
#include <bits/stdc++.h>
using namespace std;
class student{
private :
string name;
int roll_no;
unordered_map<string, int>sub_mark;
public:
void add_detail();... | TOOL | 0.906569 | 3.481461 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2023-07-23T15:13: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": "6241ac915... |
f7e013c5-16a7-4e6d-9bc3-1adc001ff685 | imran-shuvo/Samsung-Advance-Test-Coding-Preparation | src/onmnious.cpp | /*
https://www.geeksforgeeks.org/samsung-interview-experience-set-40-campus-white-box-testing/
https://www.geeksforgeeks.org/samsung-rd-sri-noida-on-campus-interview-experience/
https://code.hackerearth.com/01ac52j?key=<KEY>
Company A is discarding product numbers that contain few specific digits a specific number of... | ALGO | 0.998736 | 4.545245 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-03-09T06:50:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f53acf270728... |
6235d32e-3057-418e-9b0b-4c27466c1c23 | Ajaymalviy/DSA-with-CPP | priority_heap_mix.cpp | #include<iostream>
#include<functional>
#include<vector>
#include<queue>
using namespace std;
int main(){
// plus<int> aj;
// int sum = aj(3,4);
// cout<<"ye dikh rhaa "<<sum<<endl;
// minus<int>minus;
// int res=minus(2,2);
// cout<<"result of minus is "<<res<<endl;
// divides<int>de... | ALGO | 0.989651 | 3.778522 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2024-01-11T11:44: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": "e0635e7a8c... |
26b7a2d8-f4e3-43aa-8481-21c147e29212 | leimingshan/mycode | poj/2187.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#define MAXN 101
using namespace std;
struct point
{
int x;
int y;
};
point *p;
int max(int a,int b)
{
return a>b?a:b;
}
int dis(point p1,point p2)//两点的距离的平方
{
return (p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y);
}
//叉积,结果小于表示向量p0... | ALGO | 0.999859 | 3.680583 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2013-03-14T02:11:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccdad3332... |
127e170d-4b7f-4ac2-84d2-cf0bd34234e1 | aadishv/usaco | archives/bronze-jan/mooloo.cpp | // echo "clear && clang++ main.cpp -std=c++17 -Wall -Wextra -O2 -lm && time ./a.out < input.txt" > ~/.runner_settings
// cp template.cpp main.cpp
#include <bits/stdc++.h>
#define vi vector<int>
#define all(a) a.begin(), a.end()
using namespace std;
void setIO(string name = "", bool maxio = false) {
if (name.size... | ALGO | 0.99995 | 4.618414 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-01-03T18:22: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": "1cb1c8b4c88... |
e9537eba-7005-413b-9959-ab433d4bdd08 | sourav-islam/XPSC | Week 19/C_Chef_s150/Equal_Pairs_Easy.cpp | #include <bits/stdc++.h>
using namespace std;
// typedef long long int ll;
#define int long long
#define pp(x) cout << x << "\n"
int32_t main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
vector<int> a(n);
for (in... | ALGO | 0.999728 | 3.731758 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2024-03-16T09:31:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e40e97a97b... |
0d938d30-565c-4f86-b582-a28589b055ad | ishandutta2007/codeforces-r | riverhamster/normal/1190/C.cpp | #include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
using namespace std;
#define File(IO_Filename) freopen(IO_Filename".in", "r", stdin), freopen(IO_Filename".out", "w", stdout)
typedef long long ll;
template<typename T> inline void in(T &x){ //Read Positive Integer.
char ch; x = 0;
// int f =... | ALGO | 0.999945 | 3.447126 | {
"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": "9aa9dab28fe6... |
d4710a9f-8f71-4ddd-be7d-aa387ff23de7 | ishandutta2007/codeforces-r | rush_d_cat/normal/1064/D.cpp | #include <bits/stdc++.h>
using namespace std;
struct Nod {
int x, y, l, r;
};
int main() {
ios::sync_with_stdio(false);
cout.tie(0);
int n, m;
cin >> n >> m;
int r, c;
cin >> r >> c;
r --, c --;
int X, Y;
cin >> X >> Y;
vector<string> s(n);
for (int i = 0; i < n; i ... | ALGO | 0.999513 | 3.933284 | {
"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": "a64d7d770a27... |
affdc1bd-8dab-4453-af75-717e9fa9f9e6 | elerac/EventEllipsometer | Arduino/EventEllipsometry/EventEllipsometry.ino | #include <PID_v1.h>
#define DEBUG 0
#define DEBUG_LITE 1
// Baud rate
unsigned long baudRate = 115200;
// Pin assignment
pin_size_t pinIn_x1 = 2;
pin_size_t pinOut_x1 = 5;
pin_size_t pinIn_x5 = 3;
pin_size_t pinOut_x5 = 6;
pin_size_t pinOut_trig = 12;
// PID parameters
double setpoint_x1 = 15.0;
double setpoint_x5 =... | TOOL | 0.91502 | 5.75663 | {
"github_metadata": {
"branch": "main",
"commit_count": 246,
"repo_created_at": "2024-07-19T07:24:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f8e6c868... |
2f415403-ef48-45ea-941c-a958e09e58cc | BJIaduk/C-in-university-01.02.2022-20.05.2022- | tasks_3/15(3).cpp | #include <iostream>
#include <cmath>
#include <clocale>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
double r, x, y;
cout << "¬ведите радиус круга:";
cin >> r;
cout << "¬ведите координаты точки x, y:";
cin >> x >> y;
if ((y < x) && (x < r) && (r < sqrt(pow(x, 2) + pow(y, 2))))
cout << "точка... | ALGO | 0.993124 | 4.212878 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-09-03T17:24: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": "a24de722f2... |
2bab75db-2058-467b-ab27-823e195b9dbd | ishandutta2007/codeforces-x | xyf007/normal/1207/G.cpp | #include <cstring>
#include <iostream>
#include <queue>
#include <utility>
#include <vector>
template <typename T>
void checkmax(T &x, T y) {
if (x < y) x = y;
}
template <typename T>
void checkmin(T &x, T y) {
if (x > y) x = y;
}
int n, m, ch[800001][26], tot, pos[400001], ans[400001], fail[800001],
dfn[800001... | ALGO | 0.999835 | 4.26528 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68a7a388fefc... |
556a46f8-8e54-4a4c-be15-2c00544ab074 | marceloneil/contest | zproblems/hci16policev2_cheapest_operation_ever.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define INF 0x3f3f3f3f
#define EPS 1e-9
#define PI 3.141592653589793238462
#define MOD 1000000007
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define ll long long
#define US ... | ALGO | 0.999926 | 3.651179 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-01-23T01:11: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": "7ed8828f6... |
58f452b3-1959-46a7-8aa2-71f0c78a1bee | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/06/0625/personal_submission/cf863c_Deemo_ML.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
int ga[10][10];
int gb[10][10];
int memo[10][10];
int win[10][10];
vector<PII> seq;
void init()
{
win[1][1]=0;
win[1][2]=-1;
win[1][3]=1;
win[2][1]=1;
win[2][2]=0;
win[2][3]=-1;
win[3][1]=-1;
... | ALGO | 0.999907 | 4.120444 | {
"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": "0367... |
cfe2211d-2021-4cf5-8821-38ba00994de5 | Ujk768/DSA | DSA/dynamicPrograming/striversDPproblems/minimuminsertionstomakestringpalindromic.cpp | #include<stdio.h>
#include<vector>
#include<string>
using namespace std;
/**
* @brief
*
* s="abcaa"
*
* you can insert any char anywhere
*
* if you add the reversed string to the original string then it will become palindromic
*
* max operations = len(S);
*
*
* abcaa=> aabcbaa palindrome 2 insertio... | ALGO | 0.999975 | 5.389499 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-08-16T04:52:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90ece726447e... |
ee7ede6c-f52e-4cb6-9a33-f6b2640ffb36 | mioteck/MachineLearning | ML/ML/function.cpp | #include "function.h"
template<typename T>
Eigen::MatrixXd CreateMatrixEntries(T* arr, int s, int o)
{
int rows = s / o;
int cols = o + 1;
int cpt = 0;
Eigen::MatrixXd mat(rows, cols);
for (int y = 0; y < rows; y++)
{
for (int x = 0; x < cols; x++)
{
if (x == 0) mat(y, x) = 1;
else
{
mat(y, x... | ALGO | 0.999577 | 3.918866 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-10-10T17:15: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": "5c3bd71a6... |
4107a68f-f31e-4a3f-bc3a-fde45e40a5ca | elemental/Elemental | src/optimization/prox/SVT/Cross.hpp | /*
Copyright (c) 2009-2016, <NAME>
All rights reserved.
This file is part of Elemental and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
*/
#ifndef EL_SVT_CROSS_HPP
#define EL_SVT_CROSS_HPP
namespace El... | ALGO | 0.998882 | 6.983877 | {
"github_metadata": {
"branch": "master",
"commit_count": 3773,
"repo_created_at": "2012-05-06T08:37:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 513,
"forks": 110,
"issues": 38,
"pull_requests": 7
},
"file_meta": {
"content_id": "869... |
288c0593-ef80-4699-a2be-ab44248473e0 | ryuspace/Algorithm | BOJ/16199.cpp | //https://www.acmicpc.net/problem/16199
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
struct Date
{
int year;
int month;
int day;
};
int main()
{
Date last, now;
char str[2][11];
cin.getline(str[0], 11);
cin.getline(str[1], 11);
last.year = atoi(strtok(str[0], " "));
last.mon... | ALGO | 0.999444 | 3.221098 | {
"github_metadata": {
"branch": "master",
"commit_count": 637,
"repo_created_at": "2020-04-28T09:49:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e1e8d1a... |
8fec4088-ffea-4781-bb94-98ef429d755a | hyeonos/CodingTestStudy | Baekjun/code.plus/num9370/prob4375.cpp | #include <iostream>
#include <cmath>
using namespace std;
long long GetRest(long a, long b, int c);
int main(void) {
while (true) {
int input = 0;
cin >> input;
cin.ignore();
int digit = int(log10(input)) + 1; // 입력된 숫자의 자릿수
cout << "입력된 숫자의 자릿수 : " << digit << endl;
int num = 1; // 나머지가 구해질 숫자
... | ALGO | 0.999456 | 3.565226 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2024-01-10T09:02:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8c08a4c4cb... |
e83356e9-4d51-4477-a7f4-8ea4fbf28e64 | xoyojank/nebula3 | code/extlibs/OGDF/src/planarity/PlanarSubgraphPQTree.cpp | /*
* $Revision: 2599 $
*
* last checkin:
* $Author: chimani $
* $Date: 2012-07-15 22:39:24 +0200 (So, 15. Jul 2012) $
***************************************************************/
/** \file
* \brief Implementation of the class PlanarSubgraphPQTree.
*
* Implements a PQTree with added features for the pl... | ALGO | 0.992335 | 4.578122 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2012-11-23T19:29:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 62,
"forks": 38,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce523c6c... |
7de00559-0adf-40f7-9622-69b7255ddf9f | danyalmendigali/competitiveProgramming | Codeforces/1700A.cpp | #include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#define ll long long
#define F first
#define S second
#define pb(a) push_back(a)
#define sz size()
#define mendigalitrue ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std... | ALGO | 0.999942 | 3.851034 | {
"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": "01ea87a24... |
7adb405a-6761-428f-9d80-8bf827f65b39 | gyan2976/Competitive-Programming | Matrix/Column Wise Sum of a Matrix.cpp | #include <bits/stdc++.h>
#include <limits.h>
#include <stdio.h>
#include <climits>
#include <stdlib.h>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
using namespace std;
void columnWiseSum(c... | ALGO | 0.999886 | 3.933239 | {
"github_metadata": {
"branch": "main",
"commit_count": 342,
"repo_created_at": "2022-10-05T19:35: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": "249bc1589a... |
b089cfe0-9545-40be-b9d7-b40f84bc4a6c | starsep/asd | mal/mal.cpp | #include <cstdio>
#include <vector>
#define scanf(args...) scanf(args) ? 0 : 0
class Tree {
private:
int x;
enum SubTreeState {
BlackSubTree,
WhiteSubTree,
UnknownSubTree
};
class Node : std::pair<int, SubTreeState> {
public:
int &whites() {
return first;
}
SubTreeState &state() {
return seco... | ALGO | 0.999955 | 4.144287 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-11-03T12:27: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": "061d6b6871... |
95d6bd8f-39d3-44c5-b691-33ee297ab4bb | fgsect/magicfern | main.cpp |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// The implementation of digital camera fingerprint extraction is based on an existing matlab code from <NAME> et. al. //
// "http://dde.binghamton.edu/download/camera_fingerprint/" - 28th... | ALGO | 0.983602 | 5.817563 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-10-14T00:34:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b054bf6cbc6... |
8acf6f0a-7774-4248-97e5-95f26f1a48c1 | meysamaghighi/Kattis | Suffidromes/a.cpp | // <NAME>
#include <iostream>
#include <cstring>
using namespace std;
bool is_palindrome(string s){
if (s.size()==0) return true;
int n = s.size();
for (int i=0;i<n/2;i++) if (s[i] != s[n-1-i]) return false;
return true;
}
int main(){
string a,b;
while (getline(cin,a) && getline(cin,b)){
... | ALGO | 0.999991 | 3.48405 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2016-04-06T09:04:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fced077dd... |
b3f1bbdf-55e6-4608-88b9-59a13dc5f3d3 | Rick-Indranil/Learn-Basic | C++/LINK_CPP.CPP | #include<iostream>
#include<stdlib.h>
using namespace std;
class node
{
public:
int data;
node *next;
};
class linklist
{
private:
node *start;
public:
linklist()
{
start=NULL;
}
void insend();
void list();
void insbeg();
void insbet();
void del();
};
vo... | ALGO | 0.944712 | 3.597027 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-23T11:49: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": "167526cfc440... |
e4106cdf-2925-49fd-967f-ce477349cd7e | thilio/Competitive-programming-team | Trainings/2018, XI Samara Regional Intercollegiate Programming Contest/b.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define fst first
#define snd second
#define fr(i,n) for (int i = 0; i < n; i++)
#define frr(i,n) for (int i = 1; i <= n; i++)
#define endl '\n'
#define gnl cout << endl
#define chapa cout << "oi meu chapa" << endl
#define fastio ios_base::syn... | ALGO | 0.999965 | 3.896732 | {
"github_metadata": {
"branch": "main",
"commit_count": 391,
"repo_created_at": "2021-01-09T16:55:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20fed6470c... |
b26849cb-b147-4158-ba6f-163c3e9172b7 | AvaLovelace1/competitive-programming | solutions/codeforces/1023C.cpp | /*
Solution to Bracket Subsequence by <NAME>
Key concepts: greedy algorithms
*/
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define FILL(a, b) memset(a, b, sizeof(a))
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef... | ALGO | 0.999958 | 4.112383 | {
"github_metadata": {
"branch": "master",
"commit_count": 782,
"repo_created_at": "2018-03-04T18:04:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "965f8c5e... |
2b8adbf3-f013-415c-a6ed-901cf8905c76 | prajapati-sumit/Competitive-Programming | AtCoder/BeginnerContest207/D.cpp | //~ author : <NAME>
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll long long
#define int long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb p... | ALGO | 0.999983 | 4.524448 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2021-05-21T16:10:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a821bf93... |
e322a164-0903-4634-b58f-a337b8dab471 | cran/gmwm | src/guess_values.h | /* Copyright (C) 2014 - 2015 <NAME>, <NAME>, <NAME>
*
* This file is part of GMWM R Methods Package
*
* The `gmwm` R package is free software: you can redistribute it and/or modify it
* under the terms of the Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
* as the LICENSE file.
*
* Th... | ALGO | 0.982822 | 5.999786 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-12-16T02:05:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d664d776a7c... |
a9ca0784-3954-409d-9146-c9abb82aa7dc | tej777K/DSA1.0 | DSA supream/Linked_List/KgroupReverse.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 {
... | ALGO | 0.999954 | 4.518667 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-10-16T15:51: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": "dc1e13f9e6f... |
c83c081e-6660-4f5a-9e98-a8b514926a65 | gwkdgwkd/leetcode | c_c++/string/trie/面试题1715最长单词.cpp | /*
给定一组单词words,找出其中的最长单词,且该单词由这组单词中的其他单词组合而成。
若有多个长度相同的结果,返回其中字典序最小的一项,若没有符合要求的单词返回""。
示例:
输入:["cat","banana","dog","nana",
"walk","walker","dogwalker"]
输出:"dogwalker"
解释:"dogwalker"可由"dog"和"walker"组成。
提示:
0 <= len(words) <= 200
1 <= len(words[i]) <= 100
*/
// 字典树
typedef struct TrieNode {
bool isEnd;
stru... | ALGO | 0.999851 | 5.790715 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2019-11-27T11:32: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": "ac135bba... |
51590b95-2fa7-4f78-9d21-26812435de0e | RyMikky/cpp-game-server | src/loot_generator.h | #pragma once
#include <chrono>
#include <functional>
namespace loot_gen {
struct LootGeneratorConfig {
double period_ = 0.0; // период генерации задается в СЕКУНДАХ!!!!!
double probability_ = 0.0; // вероятность генерации лута за указанный период
LootGeneratorConfig& SetP... | ALGO | 0.937136 | 5.918719 | {
"github_metadata": {
"branch": "linux_final",
"commit_count": 31,
"repo_created_at": "2023-04-14T19:50: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": "b7b8... |
78c03a8b-0f2d-44f2-a287-ba5afcdce76d | s0urav6529/Codeing | Leetcode/97.cpp | https://leetcode.com/problems/interleaving-string/description/
int dp[101][101][201];
int solve(int i, int j, int k, string& s1, string& s2, string& s3 ){
if(i == s1.size() && j == s2.size() && k == s3.size()) {
return 1;
}
if(dp[i][j][k] != -1) return dp[i][j][k];
if((i < s1.size... | ALGO | 0.999847 | 5.871835 | {
"github_metadata": {
"branch": "main",
"commit_count": 697,
"repo_created_at": "2022-05-30T14:13:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec2c64fe8e... |
090fc57b-6d95-41c9-9d7a-5131d3730ad8 | gaiablade/my-leetcode-solutions | 1-Two_Sum/C++/source.cpp | #include <algorithm>
#include <iostream>
#include <unordered_map>
#include <vector>
/*
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
... | ALGO | 0.999992 | 6.505185 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-03-10T22:15: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": "6e82ff03a7... |
c651d03a-26a2-40ee-9482-f28e17decec3 | opencv/opencv_contrib | modules/bioinspired/src/retinafilter.cpp | /*#******************************************************************************
** IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
**
** By downloading, copying, installing or using the software you agree to this license.
** If you do not agree to this license, do not download, install,
** copy or u... | TOOL | 0.943239 | 6.106239 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 4557,
"repo_created_at": "2013-09-11T13:28:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9757,
"forks": 5828,
"issues": 553,
"pull_requests": 88
},
"file_meta": {
"content_id": "0c... |
c362d324-3495-4e40-8cdd-bd7631f8aa2c | arkapg211002/LeetCode-from-8-5-23 | XOR of all elements - GFG/xor-of-all-elements.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
// Function to calculate XOR of array elements
vector<int> getXor(vector<int> A, int N)
{
int XOR = 0;
// calculate XOR of array
for (int i = 0; i < N; i++)
... | ALGO | 0.999746 | 5.57256 | {
"github_metadata": {
"branch": "main",
"commit_count": 1696,
"repo_created_at": "2023-05-08T08:05:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab5b5e1e2... |
1f0a7b9f-07c0-4942-b08a-6191d155d741 | AmarKumar-AK/College-Courses | operating-system-sivaselvan/endsem/sem.cpp | #include<bits/stdc++.h>
#include<semaphore.h>
#include<pthread.h>
#include<string.h>
#include<stdlib.h>
// #include<mutex.h>
#include<unistd.h>
using namespace std;
int northWait = 0; // no one waiting
int southWait = 0; // no one waiting
int northBound = 0; // no one in tunnel
int southBound = 0; // no one in tunn... | ALGO | 0.998783 | 4.986319 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2020-10-22T18:33:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c29d0f3adfd... |
0e4501fb-f84c-4ed5-8c27-4f067325bdd0 | rubengm11/ie0217 | Trabajos_previos/trabajo_previo_2/sesion_1/sobrecarga_operadores.cpp | #include <iostream>
using namespace std;
// Definicion de la clase Fraccion
class Fraccion {
int numerador, denominador;
public:
// Constructor de la clase Fraccion
Fraccion(int n, int d) : numerador(n), denominador(d) {}
// Sobrecarga del operador '+'
Fraccion operator+(const Fraccion &f) {
... | TOOL | 0.967168 | 5.749653 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2024-01-03T19:36:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a0fc8f5a3e... |
5ec8d067-d64d-449a-8ae7-483ff5d4c566 | Tris666w/Flow-Field-Pathfinding | _FRAMEWORK/source/framework/EliteMath/EMatrix2x3.h | #pragma once
#include <vector>
struct Matrix2x3
{
// -------------------------
// Constructors
// -------------------------
// Default constructor results in a unity matrix
explicit Matrix2x3( Elite::Vector2 dirX = Elite::Vector2{ 1, 0 }, Elite::Vector2 dirY = Elite::Vector2{ 0, 1 }, Elite::Vector2 origTrans = E... | TOOL | 0.906885 | 7.318844 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-01-07T15:56:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdb96dc97c... |
e4c002fe-64d9-41ab-bb82-f14c6fba1b75 | SIA-systemControl/SIA-Exos-Impedance | ButterWorthLP.cpp | //
// Created by yc on 2021/6/28.
//
#include "ButterWorthLP.h"
#include <cmath>
ButterworthLP::ButterworthLP(const double normalizedCutoffFrequency, const size_t filterOrder) :
_numSOS(0)
{
if (!coefficients(normalizedCutoffFrequency, filterOrder))
{
throw std::domain_error(std::string("Faile... | ALGO | 0.99915 | 5.69417 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-08-25T08:49:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9584eb67ad848... |
70af327f-209a-4bbf-9073-f56766ca5416 | li-chiun-lin/GoogleCodeJam | 2014_1A/charging_chaos.cpp | /*
TLE
*/
#define _USE_MATH_DEFINES
#include <algorithm>
#include <climits>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <cmath>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <string>
#include <tuple>... | ALGO | 0.999956 | 5.245848 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2023-05-07T06: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": "0364adc4f... |
f9b61e5b-605b-4104-9bef-6f3073c49605 | liuguofengswjtu/DataStruct_Review | 循环队列及其操作.cpp | #include <iostream>
#include <string.h>
using namespace std;
//这里可以改变变量的类型
typedef int ElemType;
typedef struct CircularQueue
{
//data数组,用于存储队列的元素
ElemType *data;
int front;
int rear;
size_t Maxsize;
}CircularQueue;
//初始化一个循环队列,队列的实际元素个数由Maxsize给出,数组的长度则是Maxsize+1
CircularQueue* Init(size_t Maxsize)... | ALGO | 0.998646 | 3.626751 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2022-01-28T09:45: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": "86f077f00... |
b0e63872-2a7e-4402-9125-3198740f8d2e | satl-it-e/parallel_solutions | additionals/solutions.h | //
// Created by <NAME> on 2019-04-03.
//
#ifndef PARALLEL_SOLUTIONS_SOLUTIONS_H
#define PARALLEL_SOLUTIONS_SOLUTIONS_H
int min_value = 1;
int max_value = 200;
#include <mutex>
std::mutex mutex;
int count_number_of_solutions(int min_w, int max_w) {
int number_of_solutions = 0;
int w, x, y, z;
for (w ... | ALGO | 0.998856 | 3.864486 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-03-20T15:24:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f5089a6690... |
f1a288d3-688b-4149-ab00-fca43363c31b | korektur/AdventOfCode22 | day22/day22.cpp | #pragma clang diagnostic push
#pragma ide diagnostic ignored "cppcoreguidelines-narrowing-conversions"
#include <iostream>
#include <string>
#include <fstream>
#include <algorithm>
#include <unordered_map>
using namespace std;
vector<string> map;
constexpr pair<int, int> rotate(char changeDirection, const pair<int,... | ALGO | 0.999924 | 5.927676 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2022-12-02T22:28:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3dc59898... |
2690cc1e-6ab4-4220-9faa-5b60a91cc892 | Razzis/projet_ECMA | src/solution.cpp | /*
* solution.cpp
*
* Created on: 9 janv. 2016
* Author: hassan
*/
#include "solution.hpp"
Solution::Solution(){
}
Solution::Solution(Instance& inst){
for(int i = 1; i <= inst.get_n(); i++){
for(int j = 1; j <= inst.get_m(); j++){
Coordinate coord(i,j);
this->Choix_maille[coord] = false;
}
}
t... | ALGO | 0.999544 | 4.2679 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2016-01-09T09:58: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": "b1e0cb006... |
cb0e89c8-a472-48cc-8042-6942fccebde5 | evamayerova/BVH_visualization_tool | BVH_visualization_tool/src/BVHNode.h | #pragma once
#include "Scene.h"
#include <cstdint>
#include <QVector3D>
struct ray
{
QVector3D orig, dir, norm, dirfrac;
/** Parameter, which indicates the distance of the intersected object */
float t;
int BVHListNode;
ray(const QVector3D & o, const QVector3D & d) : orig(o), dir(d), t(std::numeric_limits<float>... | ALGO | 0.991446 | 4.901464 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-04-20T20:48:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f24f68c8... |
58029144-d6c4-467a-a045-3abe1ccc7645 | boussaffawalid/FeatureSelection | extern/FST3lib/_src_search/seq_step_hybrid.hpp | #ifndef FSTSEARCHSEQSTEPHYBRID_H
#define FSTSEARCHSEQSTEPHYBRID_H
/*!======================================================================
Feature Selection Toolbox 3 source code
---------------------------------------
\file seq_step_hybrid.hpp
\brief Implements hybrid selection step in sequential ... | ALGO | 0.999374 | 6.728103 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2014-07-31T01:28:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1056593a4... |
71e735d0-9d6e-4266-ade7-1b9a09335cf0 | dongyi-kim/Implementation-of-fast-median-filter | filters.cpp | #include "filters.h"
#include<memory.h>
#include <algorithm>
#include<vector>
using namespace std;
void Image::addGaussianNoise()
{
int dc = (rand() % 7) - 3;
int i = rand() % height;
int j = rand() % width;
int org = bitmap[i][j];
bitmap[i][j] = min(255,max(0, org + dc));
}
void Image::addSaltAndPepperNoise() ... | ALGO | 0.997999 | 4.799722 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-06-07T12:36:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ba9242af... |
f65c729d-ec16-4096-a7a6-5ddb72656a7e | Senthy30/colocviu-af | Tema 3/Tema obligatorie/243_Cringanu_Denis-Florin_6a.cpp | #include <bits/stdc++.h>
#define MAX 131072
using namespace std;
const int NMAX = 11;
const int DIMMASK = (1 << NMAX);
int dp[2][1002];
// dp[i][j] = subsirul de lungime maxima daca am parcurs i elemente din primul sir si j elemente din al doilea
int longestCommonSubsequence(string text1, string text2) {
int li... | ALGO | 0.999973 | 4.20521 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-25T22:53:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "354d37163b07... |
68ceb111-ef2f-4652-bf10-8bf8f9434f31 | JeremiahBoothe/OpenGL_3D_Graphics_Programming | JBCustomOpenGLSetup/Utilities.cpp | #include <vector>
#include <glm/glm.hpp>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstddef>
#include "Utilities.h"
/**************** For Experimental BuildCircle and Normalization functions ****/
std::vector<float> C1vertices;
std::vector<unsigned int> C1in... | TOOL | 0.972121 | 3.585973 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-02-24T12:56: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": "88ef3eb60009... |
9cc65ccf-4388-4c47-8298-7e472812e344 | damiles/blendocv | extern/eltopo/common/sparse/cgsolver.h | #ifndef CGSOLVER_H
#define CGSOLVER_H
#include <fstream>
#include "sparse/sparsematrix.h"
#include "sparse/sparseilu.h"
#include "sparse/sparsemilu.h"
#include "wallclocktime.h"
#include "vector_math.h"
#define MODIFIED
//#define DEBUG_MATLAB_DUMP
template <class T>
class CGSolver {
//Incomplete cholesky fac... | ALGO | 0.996067 | 4.904071 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2013-11-25T16:37:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 18,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6ed604... |
01701742-9228-4a77-8098-fc57563d6205 | misterperson/Dark-Souls-2-Armor-Optimizer | SotFSArmorOptimizer/AOptimizer.hpp | #ifndef AO_OPTIMIZER_HPP
#define AO_OPTIMIZER_HPP
#include <vector>
#include <array>
#include <list>
#include "AOArmor.hpp"
struct Armor;
struct Constraint
{
size_t min;
size_t max;
};
struct AOSettings
{
float equipload; // the equipload of the player (based on vit)
float build_weight; // weight of oth... | CONFIG | 0.945804 | 5.026035 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-06-09T00:03:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "7626ee081... |
4cb371c2-628d-4170-8a66-628bebffe0ae | kimjane7/manybody_phy | oldnqs/src/neuralquantumstate/neuralquantumstate.cpp | #include "neuralquantumstate.h"
NeuralQuantumState::NeuralQuantumState(int n_particles, int n_hidden, int dimension, double sigma){
random_device rd;
random_engine_ = mt19937_64(rd());
setup(n_particles, n_hidden, dimension, sigma);
}
NeuralQuantumState::NeuralQuantumState(int n_particles, int n_hidd... | ALGO | 0.994129 | 3.861143 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2018-05-30T14:32:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "bf89fb22... |
25fb0456-8d53-40a3-89a7-6d5435d3a1a2 | yyytir777/Codes | C++/BubbleSort.cpp | #include <bits/stdc++.h>
#include <time.h>
using namespace std;
void swap(int *arr, int a, int b) {
int tmp = arr[a];
arr[a] = arr[b];
arr[b] = tmp;
}
void bubbleSort(int* arr, int n) {
int key, j;
for(int i = 0; i < n - 1; i++) {
for(int j = 0; j < n - i - 1; j++) {
if(ar... | ALGO | 0.999702 | 5.119622 | {
"github_metadata": {
"branch": "main",
"commit_count": 343,
"repo_created_at": "2023-01-13T17:49: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": "eee3819502... |
35c6a968-ab55-4a4a-a1be-02dcb51e7c61 | VictoryaG97/Data-Structures-and-Algorithms | ExamPreparation1/ReversePolishNotation.cpp | #include<iostream>
#include <string>
using namespace std;
template <typename T>
struct Node
{
T data;
Node* next;
};
template <typename T>
class LStack
{
Node<T>* topNode;
void copy(Node<T>*);
void eraseLStack();
void copyLStack(LStack const&);
public:
LStack();
LStack(LStack const&);
LStack& operator=(LSt... | ALGO | 0.999634 | 4.148379 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-11-08T12:35: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": "da74312c9... |
f1a0ce60-c6ec-432d-b93a-c587850be660 | ishandutta2007/codeforces-r | rama_pang/normal/1467/B.cpp | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int TT = 1;
cin >> TT;
while (TT--) {
int n;
cin >> n;
vector<int> a(n);
for (auto &i : a) cin >> i;
int cnt = 0;
for (int i = 1; i + 1 < n; i++) {
if (a[i] <... | ALGO | 0.999086 | 4.330607 | {
"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": "d0834db03ce4... |
ba464324-5914-4133-aee5-1a35ef4b18d7 | changmingyang28/MasterProject-CSPO | plugins/omegaaut/src/omg_rabinctrlpartialobs.h | /** @file omg_rabinctrlpartialobs.h
*
* Rabin control synthesis under partial observation
*
* This module implements high-level API functions for supervisory control
* synthesis of Rabin automata under partial observation constraints.
*
* @ingroup OmegaautPlugin
*/
#ifndef FAUDES_OMG_RABINCTRLPARTIALOBS_H
... | ALGO | 0.935273 | 7.269362 | {
"github_metadata": {
"branch": "main",
"commit_count": 237,
"repo_created_at": "2025-06-01T13:51:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0707a616e8... |
b54dc683-6043-44ca-9d0b-5090f2ccacf2 | Tora416/MultiCodeEmbed | dataset/dataset_raw/gcj_cpp/sohelH/8294486_5681755159789568_sohelH.cpp | #include <bits/stdc++.h>
using namespace std;
int n, q;
vector<int> d, s;
int D[105][105];
double G[105][105];
void bfs(int u) {
double dp[105];
for (int i = 0; i < n; i++)
dp[i] = 1e15;
dp[u] = 0;
queue<int> Q;
Q.push(u);
while (!Q.empty()) {
int A = Q.front();
Q.pop();
if (dp[A] > d[u... | ALGO | 0.99966 | 4.250725 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2025-07-10T08:38: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": "b235ab768... |
be80f9ef-cc08-4fca-876a-224007e17983 | spearo2/DataStructures | Graph/Graph.cpp | #include <iostream>
using namespace std;
#include "Stack.cpp"
#include "Queue.cpp"
#define MAX_VERTICES 50
typedef struct t_node {
int vertex;
struct t_node *link;
} node;
class Graph {
private:
node *graph[MAX_VERTICES]; // Adjacency list
bool visited[MAX_VERTICES]; // Visited verte... | ALGO | 0.999887 | 5.344482 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-28T02:23: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": "96f019a92fb3... |
b4893090-401c-49eb-9b4a-3363cdd267dc | Hdbcoding/leetcode_problems | solutions/cpp_solutions/p21.cpp | // definition provided by the problem
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) {}
};
// Merge Two Sorted Lists - Easy
// Merge two sorted linked lists and return ... | ALGO | 0.999931 | 6.061936 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2020-05-16T14:59: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": "6c1a9b722... |
cf6b10bc-1296-4928-9176-9ee93aa91131 | sssrdezh/Cpp-Primer | Chapter 003/Exercise 021/main.cpp | /*
练习3.21:请使用迭代器重做3.3.3节(第94页)的第一个练习。
*/
#include <iostream>
#include <vector>
#include <string>
using std::cout;
using std::endl;
using std::vector;
using std::string;
vector<int> v1; // 元素数量:0
vector<int> v2(10); // 元素数量:10,值:0
vector<int> v3(10, 42); // 元素数量:10,值:42
vector<int> v4{ 10 }; // 元素数量:1,值:10
vector<int>... | TOOL | 0.943666 | 4.100755 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2016-08-09T07:20: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": "41ba66ea3... |
60140e73-02ff-438e-b123-19bd2f632642 | viennamath/viennamath-dev | viennamath/compiletime/ct_equation.hpp | #ifndef VIENNAMATH_COMPILETIME_CT_EQUATION_HPP
#define VIENNAMATH_COMPILETIME_CT_EQUATION_HPP
/* =======================================================================
Copyright (c) 2012, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
... | TOOL | 0.939978 | 6.042883 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2013-07-17T22:49:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8328c5ce... |
82b6aef4-8e1a-423b-816e-489673e7b7bf | amalazimroshan/softbody | include/softbody/collision.hpp | #pragma once
#include <iostream>
#include <softbody/vector.hpp>
namespace softbody {
struct collision {
Vector<float, 2> normal{0.f, 0.f};
float depth = -std::numeric_limits<float>::infinity();
};
collision plane_collision(Vector<float, 2> const& position,
Vector<float, 2> const& plane_no... | ALGO | 0.992646 | 6.157302 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-11-17T14:55: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": "ff3aaa90981a... |
51ee95b6-b9fe-441d-8e17-a3c3dc4c4c15 | NachiaVivias/cp-library | Cpp/Include/nachia/graph/graph.hpp | #pragma once
#include <vector>
#include <utility>
#include <cassert>
#include "../array/csr-array.hpp"
namespace nachia{
struct Graph {
public:
struct Edge{
int from, to;
void reverse(){ std::swap(from, to); }
int xorval() const { return from ^ to; }
};
Graph(int n = 0, bool undir... | ALGO | 0.99973 | 5.592918 | {
"github_metadata": {
"branch": "main",
"commit_count": 419,
"repo_created_at": "2021-08-07T14:15:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 1,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "e14d106cc... |
3635b949-79c0-4b72-a6a4-c7003997f38f | stevevista/nbla-go-zero | nnabla/src/nbla/function/depthwise_convolution.cpp | // Copyright (c) 2017 Sony Corporation. 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 ... | ALGO | 0.940867 | 7.856236 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-02-07T09:25: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": "c3e51e1e7... |
e29bba56-ee1c-4749-a4b9-936eff369440 | ishandutta2007/codeforces-k | krijgertje/normal/702/B.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.99965 | 3.524177 | {
"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": "3704efcc0a9c... |
fcd573c6-79e2-4dbc-b098-a036c1711d7f | tirth0/practice | module4/cookOff/consdel.cpp | #include<iostream>
#include<vector>
#include<stack>
#include<queue>
#include<cstring>
#include<algorithm>
#include<string>
#include<map>
#include<utility>
using namespace std;
#define mod 1000000007
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define bits(x) __builtin_popcountll(x)
#define endl "\n"... | ALGO | 0.999776 | 3.745196 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2020-11-08T21:51: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": "a150ed5991d... |
2c4a3b0b-3ea8-4d75-87c3-933e971c9a72 | LeThinh2511/DoAnGiaiThuatLapTrinh | DOAN_GTLT/Matrix.h | #ifndef MATRIX_H
#define MATRIX_H
#include <iostream>
#include <iomanip>
using namespace std;
typedef struct Matrix
{
int** m;
int n;
}Matrix;
// Ham tao ma tran bang cach copy tu ma tran o
void copyMatrix(Matrix& matrix, Matrix& o)
{
matrix.n = o.n;
matrix.m = new int*[matrix.n];
for (int i = 0; ... | ALGO | 0.99172 | 3.653618 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-12-30T05:33: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": "4ce579e3a7... |
e4adf162-0d3f-4268-aca8-4ba56b679226 | OpenEmu/Mednafen-Core | mednafen/snes_faust/cpu_loop_body.inc | /******************************************************************************/
/* Mednafen Fast SNES Emulation Module */
/******************************************************************************/
/* cpu_loop_body.inc:
** Copyright (C) 2015-2019 Mednafen Team
**
** This pr... | ALGO | 0.916065 | 5.785147 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2013-04-08T02:20:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30,
"forks": 22,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "45325a... |
ee4122a5-a4a6-4b5a-bab1-fb1c1a02d470 | abhiabhi0/Algo-Data-Structure | Binary_Tree/vertical_order_traversal.cpp | //If Vertical Order doesn't matter
// map<distance, list of nodes>
std::unordered_map<int, std::vector<int> > um;
// starts dist with 0
void vertical_order_traversal(TreeNode* root, int dist)
{
if (root == NULL)
return NULL;
if (um.find(dist) == um.end())
{
um.insert({dist, {}});
}
um[dist] = root->val;
v... | ALGO | 0.999996 | 5.459862 | {
"github_metadata": {
"branch": "master",
"commit_count": 405,
"repo_created_at": "2018-01-09T12:07:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44d53e... |
c99f085b-72e8-471e-a6c2-5c4438101b5f | smacdo/scottsandbox | snippets/objreader-qt.cpp | #include "stdafx.h"
#include "sandbox.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <map>
#include <vector>
#include <cassert>
struct Vec3
{
Vec3( float x, float y, float z )
: x(x), y(y), z(z)
{
}
float x, y, z;
};
struct Vec2
{
Vec2( float x, fl... | TOOL | 0.907223 | 5.630201 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2010-12-01T01:11:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f43e756... |
d98e7ab6-e2cf-476b-afef-b7e5c6d16f10 | aldehydkrotonowy/cpp | norbert/cppHistory/Prime_Numbers/Prime_Numbers.cpp | ////////////////////////////////////////////////////////////////////////////////////
// Prime Number Generator
// author: <NAME>
// homepage: www.ai-search.4t.com
// Threw history,prime numbers has always be a great fascination for mathematicians.
// Even in modern times,primes numbers continues to fascinate many peopl... | ALGO | 0.997986 | 4.743189 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-11-17T16:17: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": "6540c7e93... |
63228f7a-aae4-46f2-9587-8197829d04c5 | sameerwalke1/CPP | PhoneBook.cpp | #include<iostream>
using namespace std;
int a;
struct Phonebook
{
public:
double Mob_no;
string Contact_name;
};
Phonebook sam[10];
void Search()
{
string name;
cout<<"Enter Contact you want to search : "<<endl;
cin>>name;
// bool t=true;
for (int i = 0; i < a; i++)
{
... | TOOL | 0.97875 | 3.33507 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-04-14T12:57: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": "70a5156bf8d3... |
ff63d362-90fd-4e01-844e-a944a4704ce5 | itsharveyciphersbase/Competitive-Programming | Codeforces/PST - Senior Training Qualification Contest 2017/E.cpp | #include<bits/stdc++.h>
using namespace std;
int cases = 1;
int n, x, z;
string in;
bool check(int a, int b, int step){
for(int i = 1; i <= step; ++i){
if(in[a + i] != in[b + i - 1])
return false;
}
return true;
}
int main(void){
freopen("palindrome.in", "r", stdin);
scanf("%... | ALGO | 0.999957 | 3.7108 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2017-12-06T23:41: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": "577357ac1... |
0cbc241a-9a2e-4f92-9d46-0ac596ffd0fb | MrSaurabh75/CPP_DSA | IntroStack.cpp | // Stack Functions :
// #include<iostream>
// using namespace std;
// #define n 100
// class Stack{
// int* arr;
// int top;
// public:
// Stack(){
// arr = new int[n];
// top = -1;
// }
// void push(int x){
// if(top==n-1){
// cout<<"Stack Overflow"<<endl;
//... | ALGO | 0.97696 | 3.799178 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2024-05-29T03:22: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": "0f55b9b472b... |
640fc9b6-b5de-40c1-a43d-e80dceacfede | NuRifat/Phitron-batch-5 | Semester 2/Basic Data Structure/Module 14.5 Practice Stack & Queue/Problem1.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node* next;
Node* prev;
Node (int val)
{
this->val = val;
this->next = NULL;
this->prev = NULL;
}
};
class myStack
{
public:
Node *head=NULL;
Node *tail=NULL;
int sz=0;
void push(in... | ALGO | 0.999985 | 3.696153 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-07-13T22:33: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": "b32b913e014... |
6b0445d3-db78-48df-bab7-409de0fa5ad8 | JMUWRobotics/3DTK | src/gps/gpstools.cc | /**
* @file
* @brief Collection of functions to deal with GPS measurements
* @author <NAME>.
*/
#include "gps/gps.h"
#include <fstream>
#include <iostream>
/**
* Convert from the standard right handed ECEF coordinate system to ENU
* coordinates
*/
void ECEF_rtoENU(double lat, double lon, double alt, double... | TOOL | 0.938421 | 3.554713 | {
"github_metadata": {
"branch": "main",
"commit_count": 2385,
"repo_created_at": "2018-02-06T15:15:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 103,
"forks": 32,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f733c... |
cdd7440d-85c7-417f-af49-2b6e47d53e35 | behdadetezadi/DS-AUT | DS Gheibi/Assignment 3/Bitter My Answer.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define p 101
#define MOD 1000000007
struct Query
{
int L, R;
};
unsigned long long int modPow(unsigned long long int base, unsigned long long int exponent)
{
if (exponent == 0)
return 1;
if (exponent == 1)
return base;
... | ALGO | 0.999992 | 4.040898 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-09-12T17:00: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": "ba70dece2a... |
0047a514-746a-4039-94ec-b637ac7cf613 | MinghaoSBU/AMS595HW7 | main.cpp | //
// main.cpp
// AMS595ASSI7
//
// Created by 罅 on 2024/12/15.
//
#include <iostream>
#include <string>
using namespace std;
// Problem 1
void number_value() {
int n;
cout << "Enter a number: ";
cin >> n;
switch (n) {
case -1:
cout << "negative one" << endl;
break;... | ALGO | 0.987474 | 6.151069 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-12-16T03:06: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": "fbf50bb154b3... |
1ebe1b62-d8b2-4fd7-8bab-6dc938de96c9 | testgithubrites/BFS-Algorithm | barchart.cpp | //bar chart in row form
#include<iostream>
using namespace std;
void bar(int a[],int n)
{
int k;
for(int i=0;i<n;i++)
{
k=i;
for(int j=0;j<a[i];j++)
{
cout<<"*";
}
cout<<endl;
}
}
int main()
{
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i]... | ALGO | 0.999971 | 4.753511 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-12-22T05:16:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d719319c177... |
370b3984-ba9f-45da-9761-4e29094aac8a | RafalPinek/GummybearsProject | source_code/Contours.cpp | #include "Contours.h"
#include <algorithm>
bool compareContoursBySize(vector<Point> contourOne, vector<Point> contourTwo) {
return contourArea(contourOne) < contourArea(contourTwo);
}
void rejectPixelsCloseToEdge(Mat& imageGray) {
if (imageGray.cols > imageGray.rows) {
for (int i = 0; i < imageGray.rows; i++) {
... | ALGO | 0.998997 | 4.510832 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2016-02-23T19:59: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": "65028a205... |
a79e50fe-8a32-4bbd-b104-f03dbd0923b5 | fevrem/TROPIC | casadi/casadi-windows-matlabR2016a-v3/include/casadi/core/integrator_impl.hpp | /*
* This file is part of CasADi.
*
* CasADi -- A symbolic framework for dynamic optimization.
* Copyright (C) 2010-2014 <NAME>, <NAME>, <NAME>,
* <NAME>. All rights reserved.
* Copyright (C) 2011-2014 <NAME>
*
* CasADi is free software; you can redistribute it and/or
... | ALGO | 0.975426 | 6.842703 | {
"github_metadata": {
"branch": "develop",
"commit_count": 325,
"repo_created_at": "2020-02-18T15:49:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 12,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "62118... |
a6818444-d279-436e-a893-141c0f4a569e | szybenyk/Algorithms | Binary Search/BinarySearch.cpp | #include <array>
#include <iostream>
int binarySearch(const int* array, int target, int min, int max)
{
do{
int center{ (min + max) / 2 };
if ( array[center] == target )
return center;
else if (array[center] > target)
max = center - 1;
else
min =... | TEST | 0.999368 | 6.128824 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-01-08T14:57:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f9330ccf8e8... |
e9614cde-39b7-4c59-b1db-5156e582fcbf | cctbx/cctbx_project | scitbx/matrix/special_matrices.h | #ifndef SCITBX_MATRIX_SPECIAL_MATRICES_H
#define SCITBX_MATRIX_SPECIAL_MATRICES_H
#include <scitbx/array_family/versa.h>
#include <scitbx/array_family/versa_matrix.h>
namespace scitbx { namespace matrix {
template <typename NumType>
af::versa<NumType, af::c_grid<2> > identity(int n) {
af::versa<NumType, af::... | ALGO | 0.969962 | 6.988895 | {
"github_metadata": {
"branch": "master",
"commit_count": 38660,
"repo_created_at": "2015-07-22T13:36:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 256,
"forks": 121,
"issues": 120,
"pull_requests": 31
},
"file_meta": {
"content_id": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.