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 |
|---|---|---|---|---|---|---|---|
d381f10d-b9d1-457a-a74f-e735bd1a614a | PedoBearJB/programare | SDA-TEMA1.cpp | #include <iostream>
#include<string.h>
using namespace std;
template <typename T>
class Array {
private :
int d;
T*a;
public :
Array(int s) {
d = s;
a = new T[s];
}
Array() {
if (a) {
free(a);
a = NULL;
}
}
T operator[](int i) {
return a[i];
}
void setArray(int pos, T val) {
a[pos] = val;
}... | ALGO | 0.999097 | 3.58424 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-01-01T22:50: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": "7aa96f8bea... |
1a9b1b42-c4b9-4fc5-85bb-2e71583bd944 | wide777/AtCoder | ABC/ABC157/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
int main() {
int n, m;
cin >> n >> m;
vector<int> s(m), c(m);
REP(i, m) {
cin >> s[i] >> c[i];
if(n > 1 && s[i] == 1 && c[i] == 0) {
cout << -1 << endl;
... | ALGO | 0.999949 | 3.44853 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2021-04-23T01:38:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c69f04a7... |
c1a6cdcf-f391-44ac-b48b-50f24bf01958 | 200221192/graphs-and-dp | cycledetect_bfs.cpp | #include<iostream>
#include<map>
#include<unordered_map>
#include<list>
#include<queue>
// detect cycle in undirected graph using bfs
using namespace std ;
class graph{
public:
// creating adjacency list
void addEdge(unordered_map<int , list<int>> &adj , int u , int v , bool direction){
// direction = 0 -> und... | ALGO | 0.999936 | 4.861771 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2023-01-24T19:40: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": "fdbc847190... |
8bc8802b-9427-4e46-b70b-8260baf62545 | Andwerpz/Competitive-Programming-Practice | - cpp -/cyclicoperations.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
//Codeforces - 1867D
//if we interpret the array A as a graph, where the index is the node id, and the element at A[i] is the outgoing edge
//we can interpret the operation done by the array L as forcibly adding a cycle into A... | ALGO | 0.999903 | 4.881203 | {
"github_metadata": {
"branch": "main",
"commit_count": 339,
"repo_created_at": "2021-02-26T19:38:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "966f3b7841... |
178decdc-1c84-4589-82d1-12db8b0a518f | jaimelay/competitive-programming | Solutions/URI Online Judge/Matematica/1212.cpp | #include <iostream>
#define endl '\n'
using namespace std;
unsigned long findCarry(unsigned long a, unsigned long b){
unsigned long x, y, c, op;
c = 0;
op = 0;
while(1){
x = a % 10;
y = b % 10;
a = a/10;
b = b/10;
if((x + y + c) >= 10){
op++;
... | ALGO | 0.999857 | 3.983903 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2019-02-27T01:47:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0085a441... |
2544dda7-2bef-4594-912c-72be552bbb03 | lucastle6969/comp371 | src/entities/Trees/LeafContainerC.cpp | /*
* ^
* <-[]->
* [x]
* <--[-]-->
* [x]
* <--[-]-->
*
* Goes up alternating leaf angle ending with a top leaf
* Double sided index on leaves
* Sets index after. Read comments carefully. Not intuitive.
*/
#include <cmath>
#include <cstdio>
#include <iostream>
#include "LeafContainerC.hpp"
#includ... | ALGO | 0.98628 | 3.010286 | {
"github_metadata": {
"branch": "master",
"commit_count": 541,
"repo_created_at": "2017-10-22T18:29:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 15,
"pull_requests": 1
},
"file_meta": {
"content_id": "23ce249... |
f237ee29-786a-4cb5-aefc-9136988cacfd | pphamducminh/CP | A_thuattoan/Tree/LCA/LCA_getmin.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <algorithm>
#include <string>
#include <queue>
#include <cctype>
#include <cstring>
#include <iomanip>
#include <deque>
#include <rand... | ALGO | 0.999922 | 4.240778 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-03-26T13:29:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa49b686cdf... |
b25be6bf-effa-47d7-8129-67bde8a57317 | Polikir/Laboratory-works-Algorithms-2-sem | LABA3/BinaryTree.h | #include <iostream>
#include "Function.h"
#include <queue>
#pragma once
using namespace std;
template <typename T>
class BinaryTree {
private:
struct Node {
Node* Left;
Node* Right;
Node* Parent;
T* Value;
};
BinaryTree<T>* RoundForMap(T* (*Fun)(T*), Node* Original, BinaryTree<T>* Result);
BinaryTree<T>* ... | ALGO | 0.999126 | 3.743611 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-10-05T11:59:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91f9109f2c... |
f2843a49-93b4-4232-a90e-04af6eb44dfa | Joshitha18/problem-solving | Random/sort_hashmap.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
bool cmp1(pair<int, int> a, pair<int, int> b) {
return a.first < b.first;//Ascending order for first
}
bool cmp2(pair<int, int>a, pair<int, int> b) {
return a.second < b.second;//Ascending order for second
}
int ma... | ALGO | 0.999561 | 4.62462 | {
"github_metadata": {
"branch": "master",
"commit_count": 160,
"repo_created_at": "2020-05-27T21:47:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aab41aa8... |
5ddb339e-36d6-40c5-b6be-617bbccfb002 | shashwatmishra76/Data-Structures | CustomLinkedList.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename T> class CustomLinkedList{
// Members of Linked List class
struct Node{
T data;
Node *next;
};
Node *head;
Node *tail;
int len;
public:
CustomLinkedList(){
head = new Node();
tail =... | ALGO | 0.964696 | 5.13283 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-08-15T12:34: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": "49b1ccd8dfa1... |
82f9e238-b76e-4879-8151-cfc3c16832ad | PaddlePaddle/PaddleDetection | deploy/third_engine/demo_mnn/main.cpp | // Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required... | DATA | 0.960456 | 5.71932 | {
"github_metadata": {
"branch": "release/2.8.1",
"commit_count": 2322,
"repo_created_at": "2019-10-25T07:21:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13598,
"forks": 2961,
"issues": 935,
"pull_requests": 38
},
"file_meta": {
"conte... |
9cd61496-af83-4ce5-b9cb-58c856f0e1bb | supreets2002/BE-Programs | High Performance Computing/dfs_dynamic.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <omp.h>
using namespace std;
class Graph
{
int V;
vector<vector<int>> adj;
public:
Graph(int V) : V(V), adj(V) {}
void addEdge(int v, int w)
{
adj[v].push_back(w);
}
void parallelDFS(int startVertex)
{
vec... | ALGO | 0.999976 | 6.217907 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-08-23T05:47: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": "48b4b81da25... |
806b24a8-6687-429b-be21-672eda933fc8 | FittsJayden/CSCE121 | Exam1Code/exam2.cpp | #include <iostream>
unsigned int rightShift(unsigned int num, unsigned int digits_to_shift) {
int numBuffer;
int size;
int sizeFinder = num;
int firstInt = 10;
while (sizeFinder != 0) {// finds size of num
size += 1;
sizeFinder /= 10;
}
if (digits_to_shift > size) { //... | ALGO | 0.993131 | 4.612403 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-05-06T20:35: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": "444a0e848046... |
a0c17a49-16d9-49f8-8c37-dfe733f61160 | cbwood/algorithm | leetcode/leetcode-19.cpp | #include<bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n) {
int k = 0;
ListNode * he = head;
while(head != NULL){
hea... | ALGO | 0.999983 | 4.639438 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2021-09-13T02:43:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bb2aabe3f... |
fe61d441-9350-402a-b6a7-1e39fa2e71bb | hitode221/SearchFunctionDescription | main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <vector>
using namespace std;
int main(){
vector<string> in;
string temp;
int startTag;
int number = 0;
bool isTag = false, isComment = false;
fstream file("code.txt");
if (!file.is_open()) return -1;
while (file){
getline(f... | TOOL | 0.986104 | 3.370668 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-03-10T19:44: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": "189fbfb469... |
59974411-75ce-4af4-b4ce-9da98b616489 | parcio/adios2 | source/adios2/helper/adiosXML.cpp | /*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* adiosXML.cpp
*
* Created on: May 17, 2017
* Author: <NAME> <EMAIL>
* <NAME> <EMAIL>
*/
#include "adiosXML.h"
/// \cond EXCLUDE_FROM_DOXYGEN
#include <algorithm> //st... | TOOL | 0.913006 | 7.176967 | {
"github_metadata": {
"branch": "master",
"commit_count": 7821,
"repo_created_at": "2019-07-12T11:44:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "5690cdc5... |
a3e29717-b6ea-4c3a-b67b-ff21f090de69 | vamos/Perly-moudrosti | ims/src/cellular_automaton.h | /* VUT FIT IMS Project:
*
* Modeling voles population in Cellular automaton
*
* File: cellular_automaton.h
* Authors: <NAME> (xvodak05)
* <NAME> (xdvora2t)
*/
#include <exception>
#include <stdint.h>
#include <vector>
#include <string>
#include <stdlib.h> // abs
#define CELL_ARR_SIZE 60
#define ITERATI... | ALGO | 0.983975 | 5.213547 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-01-21T16:23: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": "2ed97cd38ed... |
0912804b-1866-4df5-90ca-de8475ede28a | Spencer-Walker/Maxwell-TDSE | Linear_algebra.cpp | #include "Linear_algebra.h"
// Constructor
Linear_algebra::Linear_algebra()
{
}
// Destructor
Linear_algebra::~Linear_algebra()
{
}
void Linear_algebra::real_thomas_algorithm(double *a, double *b, double *c, double *d, double *x, int n)
{
double w;
for(int i=1;i<n;i++)
{
w = a[i-1]/b[i-1];
b[i] = b[i]-w*c... | ALGO | 0.999559 | 3.708571 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-01-22T19:01: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": "78de765ceb... |
e2694f9e-4785-4daf-97d2-c530bc4d65eb | ishandutta2007/codeforces-i | -imc-/normal/687/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long li;
int main()
{
int n, k;
scanf("%d %d", &n, &k);
vector<int> c(n);
for (int i = 0; i < n; i++)
scanf("%d", &c[i]);
static bool d[1005][1005];
static bool can[505];
d[0][0] = true;
for (int i ... | ALGO | 0.999971 | 3.485887 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d8120689e82... |
badf0ab8-b5c6-46b8-96a8-27d095b5abd2 | Manuel1711/Neural-Networks | harm_osc/include/recursive_functions.hpp | #ifndef __REC_FUNC
#define __REC_FUNC
#ifdef ACT_ERF
inline complex mathT(const complex a, const complex b, const complex c, const complex d){
return 2./datum::pi * asin( 2.* b / sqrt((1.+2.*a)*(1.+2.*d)));
}
inline complex mathTp(const complex a, const complex b, const complex c, const complex d){
/*
a... | ALGO | 0.988686 | 5.360378 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2023-04-19T14:52:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e168f477... |
8373f184-921d-4a87-8efe-7211e5c2b468 | firewood/topcoder | srm_5xx/srm_591/TheTree.cpp | // BEGIN CUT HERE
/*
SRM 591 Div1 Easy (275)
問題
-ある頂点Xを始点とする木がある
-Xからの距離ごとの頂点の数が与えられる
-制約条件を満たす木のうち、任意の頂点の距離の最大値を求める
*/
// END CUT HERE
#include <string>
#include <vector>
#include <iostream>
#include <sstream>
using namespace std;
class TheTree {
public:
int maximumDiameter(vector <int> cnt) {
int h = (int)cnt.... | ALGO | 0.999654 | 4.241945 | {
"github_metadata": {
"branch": "master",
"commit_count": 4451,
"repo_created_at": "2011-04-18T02:33:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b67fd... |
966e14d5-4b24-41dc-9ebb-4b0b1bcbc3dd | data-dungeon/25ToLife | Avalanche/GameLib/container/skiplist.hpp | /********************************************************************
created: 2003/12/22
created: 22:12:2003 15:28
filename: c:\dev\avalanche\gamelib\container\skiplist.hpp
file path: c:\dev\avalanche\gamelib\container
file base: skiplist
file ext: hpp
author: <NAME>
purpose: Implementation of a template... | TOOL | 0.984015 | 3.862143 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2025-07-09T07:15:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a01a3c738f... |
3543e426-ba61-4de9-839b-88c05ed7948b | mofarrell/HOGextractor | features_madmex.cc | // Original Code by <NAME>
// Modified by <NAME> Bram to include
// Intel vector intrinsics.
//
#include <math.h>
#include "vector_intrinsics.h"
#include "mex.h"
// small value, used to avoid division by zero
#define eps 0.0001
#include "util.h"
static const vreal veps = set_real(eps);
static const vreal point5 = s... | ALGO | 0.995983 | 6.442086 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2014-05-29T07:53:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dd1e3220... |
f392acb4-9c5b-46db-8f93-5d34b3fe7ba8 | DOCUTEE/Docute_2022_2023_Competitive_Programing | TRR/Bai1.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
const int inf = 1e18;
int n,m;
vector<pair<int,int>>adj(100000);
vector<char>edge(100000);
vector<int>bac(100000);
int a[1000][1000];
void canhsongsong()
{
cout << "Cac cap canh song song la: ";
for(int i = 1; i <= m; i++)
... | ALGO | 0.99972 | 3.775131 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-01T17: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": "250dd8b523bb... |
0d11d560-298a-45eb-90d4-e5f0bacb8456 | wishescsnow/Competitive-Programming | Chapter 4 Graph/Minimum Spanning Tree/Standard/11631.cpp | /*input
7 11
0 1 7
0 3 5
1 2 8
1 3 9
1 4 7
2 4 5
3 4 15
3 5 6
4 5 8
4 6 9
5 6 11
3 2
0 1 2000000
1 2 1
0 0
*/
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> ii;
priority_queue<ii> pq;
vector<vector<ii> > adjList;
vector<bool> taken;
void process(int vertex)
{
take... | ALGO | 0.999898 | 3.735736 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-03-12T13:39:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "510238df4b... |
854c3d88-f524-4e9b-bfde-5d1c749fddc0 | vikashkumar2020/Internity-internship-DSA-2021 | Day 6 sorting and linked list/Problem1.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node* next;
Node(int val)
{
data = val;
next = NULL;
}
};
void loopHere(Node* head, Node* tail, int position)
{
if(position==0) return;
Node* walk = head;
for(int i=1; i<position; i++)
... | ALGO | 0.999964 | 3.613697 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2021-06-07T16:15: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": "5f8205757... |
41796220-4961-42f0-bada-23fc7a836941 | BoChenYS/satellite-pose-estimation | pose_refinement/SA-LMPE/ba/openMVG/multiview/rotation_averaging_common.hpp | // This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
// Copyright (c) 2012, 2013 <NAME>.
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#i... | ALGO | 0.945274 | 7.244888 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2019-07-09T14:39:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 13,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea6f3fb... |
cb947217-26bf-4dbe-857e-69bc91e3ac1b | Vitor-labs/Trabalhos_ufc | testes/Grafos/Grafo.cpp | #include <iostream>
#include <list>
#include <algorithm>
using namespace std;
/* Matriz de Adjacência: O(n)^2 -> É mais rápida para detectar a
existencia de alguma aresta
int grafo[5][5]{
{0, 0, 1, 0, 0},
{0, 0, 1, 0, 0},
{1, 1, 0, 1, 1},
{0, 0, 1, 0, 1},
{0, 0, 1... | ALGO | 0.998796 | 5.186851 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-09-08T10:30:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ccad54d2d3c... |
6ff53194-8d86-4e21-aaca-8c42bdbb9126 | lujiazho/LeetCode-Record | LeetCode/1770-maximum-score-from-performing-multiplication-operations.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////
// classic memorization, but this gives TLE
////////////////
// Time Complexity: O(2^n), should be less than this
// Space Complexity: O(n)
////////////////////////////////////////////////////////////////////////////////////... | ALGO | 0.999955 | 5.83929 | {
"github_metadata": {
"branch": "main",
"commit_count": 1213,
"repo_created_at": "2021-09-07T14:40:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "750bfa2ff... |
3273abf0-75e6-43c6-be2c-ec15d366654b | adityapadaria/src | emc/rs274ngc/interp_g7x.cc | #include <list>
#include <tuple>
#include <fstream>
#include <iostream>
#include <deque>
#include <memory>
#include <complex>
#include "interp_internal.hh"
constexpr std::complex<double> I(0,1);
template <class T>
std::string to_string(T &d)
{
std::ostringstream out;
out << d;
return out.str();
}
//////... | ALGO | 0.984772 | 4.850355 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-04-28T14:55: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": "0c8d8feeba12... |
f0716a0a-089c-46fa-9a5d-5b1339221490 | alexandraback/datacollection | solutions_6404600001200128_1/C++/mitaki28/a.cc | #include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <bitset>
#include <com... | ALGO | 0.999799 | 3.315742 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5ef7277f... |
ef890b31-a869-479f-8b6b-1624d005d95f | slupov/Softuni-Homeworks | C++ Programming/МyHomeworks/Homework-slupov-Exam/Task1/Source.cpp | #include <iostream>
#include <string>
#include <math.h>
#define PI 3.14159265
using namespace std;
int main()
{
int x1, x2, x3;
int y1, y2, y3;
int z1, z2, z3;
scanf("%d, %d, %d; %d, %d, %d; %d, %d, %d;", &x1, &y1, &z1, &x2, &y2, &z2, &x3, &y3, &z3);
double a, b, c;
a = sqrt((x2 - x1)*(x2 - x1) + (y2 - y1)*... | ALGO | 0.999617 | 3.902174 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2017-07-13T14: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": "49a646247... |
ada88aa3-356d-4132-95a0-8a2e1c1c573e | fedorovplaton/telegram-ML-Competition-2023 | deploy/forest.cpp | // #include <stdlib.h>
// #include <stdio.h>
#include <iostream>
// #include <math.h>
#include <vector>
#include <array>
#include <map>
#include <algorithm>
#include <future>
#include "children_left.h"
#include "children_right.h"
#include "feature.h"
#include "threshold.h"
#include "value.h"
#include "forest.h"
int ... | ALGO | 0.998061 | 6.160863 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2023-10-09T20:37:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4cecce588... |
98f3482a-2389-4fa8-928c-f39a92db8c9d | PakinDioxide/temp | tumso/20/tumso20_mathmath2.cpp | #include <bits/stdc++.h>
#include "mathmath2.h"
using namespace std;
int main() {
int n = init();
vector <int> ans(n);
for (int i = 0; i < n; i++) {
int a = i%n, x = (i+1)%n, b = (i+2)%n, c = (i+3)%n, d = (i+4)%n;
long long abc = (LCM(a, b, c) * GCD(a, b) * GCD(b, c) * GCD(a, c))/GCD(GCD(a... | ALGO | 0.999907 | 3.324382 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-10T10:36: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": "9b23f521482... |
9b943033-da25-46c0-b770-e4251dc3f541 | HaiderQadri/MS_Data_Science_FAST_Resources | Data Structures (DS)/Coding/queues_implementation_arrays.cpp | #include <iostream>
using namespace std;
class Queue {
private:
int queueSize;
int *queueArray;
int front, rear;
int numOfItems;
public:
Queue(int);
~Queue(void);
bool isEmpty(void);
bool isFull(void);
void enqueue(int);
int dequeue();
void clear(void);
};
// Constructor
Q... | ALGO | 0.975696 | 5.330415 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2024-09-05T07:51: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": "d0cb151df90... |
899ce6df-74a1-4b9f-8d3d-a707679c9c12 | xujie-nm/learning | 0809/LCS/REAL_LCS2.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int Min(int a1, int a2, int a3)
{
if(a1 < a2)
{
if(a1 < a3)
return a1;
else
return a3;
}
else
{
if(a2 < a3)
return a2;
else
return a3;
}
}... | ALGO | 0.999898 | 4.186139 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2014-08-11T08:03: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": "fb88c5375... |
491f197e-e99b-4c8b-abd5-9e1bbe7515f8 | Course-Project/DataStructureProject | DataStructure/MST/Cli.cpp | //
// Cli.cpp
// DataStructure
//
// Created by <NAME> on 7/15/14.
// Copyright (c) 2014 <NAME>. All rights reserved.
//
#include "Cli.h"
#include <ctime>
using namespace NO_8;
using namespace std;
string getInputWithMessages(const string &messages) {
string input;
char buf[80];
time_t nowtime =... | ALGO | 0.925923 | 4.647351 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2014-07-14T13:51:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cca61995aa... |
cec33c09-eefc-49ff-a3b2-fe90d21462da | alexandraback/datacollection | solutions_5670465267826688_0/C++/crappylight/c.cpp | #include <iostream>
#include <fstream>
#include <cstring>
#include <cmath>
using namespace std;
fstream inputf("C-small-attempt0.in");
fstream outputf("output.txt");
string tt;
bool geti,getk,ans;//0=1 1=i 2=j 3=k
int cs,cd,n,m,i,j,k,cur,tot;
void muli() {
int ncd;
switch (cd) {
case 0:
ncd = 1;
break;
case... | ALGO | 0.999924 | 3.51277 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "392f4d3a3... |
3cb3bd07-a517-4abd-8e3d-c97c05d667cd | hyturing/Competitive-Programming | Codeforces/1425A.cpp | /* Author: hyturing - <NAME> */
#include "bits/stdc++.h"
using namespace std;
#define ll long long
const ll MOD = 1e9+7;
void solve(){
// code here
ll n;
cin >> n;
ll ans = 0;
while(true){
if(n == 0) break;
if(n&1){
ans++;
n--;
if(n==0) break;
if(n%4 == 0 & n != 4){
n--;
if(n==0) ... | ALGO | 0.999966 | 4.171559 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2021-06-22T01:38:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65b996e1ae4... |
440061fe-bc5f-4463-b426-c9c0927df5d1 | stefkla91/Master_Project | CONTROLLERS/backprobagation.cpp | //
// Created by stefan on 16/09/15.
//
#include "backprobagation.h"
Backprobagation::Backprobagation(){
}
void Backprobagation::compute_genotype_length() {
/*Input and hiddenlayer each have a BIAS node therefor + 1 */
genotype_length = (((num_input+1) * hiddenlayersize) + ((hiddenlayersize + 1) * num_outpu... | ALGO | 0.99795 | 3.882044 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2015-07-07T12:06:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a3b578e... |
d92a417f-e6b8-4135-bba8-0d8b408cc46d | Saravjeet0806/DSAcourseLectureCodes | dynamicProgramming/3_dp_on_subsequences/3_array_partition_minimum_difference.cpp | // https://www.naukri.com/code360/problems/partition-a-set-into-two-subsets-such-that-the-difference-of-subset-sums-is-minimum_842494?leftPanelTabValue=PROBLEM
//bottom up
int minSubsetSumDifference(vector<int>& nums, int n)
{
int totsum = 0;
for(int i = 0; i < n; i++) totsum += nums[i];
vec... | ALGO | 0.999723 | 5.955071 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2024-02-24T01:40: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": "14058d19ef... |
89a1aae3-0985-4a56-b6b8-859efb0acd65 | AntaresSimulatorTeam/Antares_Simulator | src/solver/optimisation/opt_init_contraintes_hydrauliques.cpp | /*
** Copyright 2007-2024, RTE (https://www.rte-france.com)
** See AUTHORS.txt
** SPDX-License-Identifier: MPL-2.0
** This file is part of Antares-Simulator,
** Adequacy and Performance assessment for interconnected energy networks.
**
** Antares_Simulator is free software: you can redistribute it and/or modify
** it u... | TOOL | 0.974337 | 4.506436 | {
"github_metadata": {
"branch": "develop",
"commit_count": 2355,
"repo_created_at": "2018-07-03T14:05:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 70,
"forks": 28,
"issues": 10,
"pull_requests": 16
},
"file_meta": {
"content_id": "580... |
ad7c908b-fd30-4708-bbc8-d3ec2aa66b18 | gcjyzdd/BFGS | src/phr/phr.hpp | //Copyright (c) 2018, Changjie
//All rights reserved.
//
//Redistribution and use in source and binary forms, with or without
//modification, are permitted provided that the following conditions are met:
//
//* Redistributions of source code must retain the above copyright notice, this
// list of conditions and the fo... | ALGO | 0.999777 | 5.028629 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2018-04-29T11:00:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c4f0aff1... |
f8196f14-6f0a-48aa-8330-b3bb60806002 | SHL0915/BOJ_Problem_Solving | 백준/Platinum/8214. Party/Party.cc | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
int N, M, cnt;
int adj[3005][3005];
int mark[3005];
void solve() {
cin >> N >> M;
for (int i = 0; i < M; i++) {
int a, b;
cin >> a >> b;
adj[a][b] = 1;
adj[b][a] = 1;
}
for... | ALGO | 0.999991 | 3.574244 | {
"github_metadata": {
"branch": "main",
"commit_count": 2813,
"repo_created_at": "2022-08-29T05:15: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": "b3a7286d1... |
acf70e19-2961-4c88-a319-0a238c06dc95 | mrmohim/All-OJ-Contest-Problem-Solution | CodeForces/round 369/opp.cpp | /* ===================================*/
/* Author : <NAME> */
/* Email : <EMAIL> */
/* Institute: HSTU */
/* ===================================*/
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <algorithm>
#includ... | ALGO | 0.999989 | 3.114129 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-12-02T10:47:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1eaa9930c... |
e76e5e6a-0709-4cfc-a472-1127bdf12b5e | PeanoTaylor/CPP_Boost | Day13/ChainMode.cpp | #include <iostream>
#include <vector>
#include <memory>
using std::cout;
using std::endl;
using std::shared_ptr;
using std::vector;
class Handle
{
public:
virtual void handleRequest(int res) = 0;
void setNextHandle(const shared_ptr<Handle> &ph)//智能指针,指向下一个处理者对象,实现责任链的“链式”连接,每个节点都能转发请求到下一个
{
m_pNext... | WEB | 0.996409 | 4.978176 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-07-05T06:55: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": "f77cd7a182b... |
ba959137-2aac-4d1d-aa1e-44aafeb445b4 | mobinaghrz/RecSys-Collab-Filtering | Main/main.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cctype> // For isdigit()
#include <vector>
#include <algorithm> // For sort
using namespace std;
// Function to check if a string consists only of digits
bool isNumeric(const string& str) {
for (size_t i = 0; i < str.length(); +... | TOOL | 0.997836 | 6.98737 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-03-01T16:31:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea6432eafc52... |
72340f26-9634-4b0f-aca2-7ef852c29e50 | zhuli19901106/leetcode-zhuli | algorithms/0001-0500/0090_subsets-ii_1_AC.cpp | // medium
#include <unordered_map>
using std::unordered_map;
class Solution {
public:
vector<vector<int>> subsetsWithDup(vector<int>& nums) {
unordered_map<int, int> um;
int n = nums.size();
int i;
for (i = 0; i < n; ++i) {
++um[nums[i]];
}
vecto... | ALGO | 0.999846 | 6.096932 | {
"github_metadata": {
"branch": "master",
"commit_count": 234,
"repo_created_at": "2016-12-03T04:46:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 557,
"forks": 157,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12ed... |
f8e5139b-685d-40ab-856a-2d9a011d32e8 | BDFYB/LeetCode_Round1 | problem67_add_binary/right_solution/src/main.cpp | #include "solution.h"
using std::string;
string Solution::addBinary(string a, string b) {
int a_cur_length = a.size();
int b_cur_length = b.size();
bool upload = false;
string result;
while (a_cur_length > 0 || b_cur_length > 0) {
int abit = a_cur_length > 0 ? a[a_cur_length - 1] - '0' : ... | ALGO | 0.999923 | 5.508729 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-03-29T11:11: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": "3214dfaa05... |
6829c71e-a2f5-4911-b17f-ac66638b1f12 | HappyCerberus/cpp-coding-interview-companion | solutions/lists/loop_fix/loop.cc | #include "loop.h"
void loop_fix(List &list) {
// Phase 1, detect the loop.
List::Node *slow = list.head;
List::Node *fast = list.head;
List::Node *before = nullptr;
do {
// nullptr == no loop
if (slow == nullptr)
return;
if (fast == nullptr || fast->next == nullptr)
return;
slow =... | ALGO | 0.996092 | 5.455851 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-05-03T13:26:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6828a8059f... |
173804d3-7ae8-4459-a4e4-2612846a6e91 | ClearPurely/AlgorithmLearning | LeetCode/_21_MergeTwoLists.cpp | #include "_21_MergeTwoLists.h"
ListNode* _21_MergeTwoLists::mergeTwoLists1(ListNode* list1, ListNode* list2)
{
if (list1 == nullptr || list2 == nullptr) {
return list1 == nullptr ? list2 : list1;
}
ListNode* head = list1->val > list2->val ? list2 : list1;
ListNode* cur1 = head->next;
ListNode* cur2 = cur1 == li... | ALGO | 0.999765 | 5.756701 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2022-08-03T08:41: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": "121e1bf8e... |
ac7664de-e15c-45d6-bacc-6454e37140cc | lemolatoon/Tessoku | a56/main.cpp | #include <bits/stdc++.h>
using namespace std;
const uint64_t mod = 998244353ul;
const uint64_t base = 100;
int main() {
uint64_t n, q;
cin >> n >> q;
string s;
cin >> s;
vector<uint64_t> radixes;
radixes.reserve(n);
radixes.emplace_back(1);
for (const auto i : views::iota(1ul, n)) {
radixes.emplac... | ALGO | 0.999947 | 5.137393 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2023-11-24T08:31: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": "cd847475f... |
2027454a-663d-49d6-80f9-4ebc721aa232 | devhimanshuu/LeetCode_Solutions | Arrays/Count_of_distinct_after_reverse.cpp | /**2442. Count Number of Distinct Integers After Reverse Operations
Solved
Medium
Topics
Companies
Hint
You are given an array nums consisting of positive integers.
You have to take each integer in the array, reverse its digits, and add it to the end of the array. You should apply this operation to the original intege... | ALGO | 0.999836 | 5.871844 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2024-02-09T12:12: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": "8e46f5b624b... |
7d5a23d3-0a48-43df-93be-6cf1891a5c07 | itsarianr/salary | main.cpp | #include <iostream>
#include <locale>
using namespace std;
#define JOBS_COUNT 5
#define WORK_HOURS 160
#define QUIT_CODE -999
struct Job {
char expertise[20];
long int base_salary;
long int overtime_salary;
long int undertime_salary;
};
Job JOBS[JOBS_COUNT] = {
{"Senior Engine... | TOOL | 0.93061 | 3.674632 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-01-07T17:20: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": "7067c7ab51... |
115b65c3-23c9-4e77-9c35-cc1755484174 | divyanshu0x16/Competetive_Programming | Online_Submissions/LearnDSA/Week2/Pied_Piper_vs_Holi.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
bool lose(int A, int X, int B, int Y, int Z) {
int t1 = (Z - A + X - 1) / X;
int t2 = (Z - B + Y - 1) / Y;
return t1 >= t2;
}
void solve() {
int N, A, B, X, Y, Z;
cin >> N >> A >> B >> X >> Y >> Z;
priority_queue<int> C;
for(int i = 0; i < N; ... | ALGO | 0.999846 | 3.544203 | {
"github_metadata": {
"branch": "master",
"commit_count": 171,
"repo_created_at": "2020-04-11T12:50: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": "02bd2f60... |
d05392af-29a9-4dc6-8449-8100591f93d6 | NobleLex64/first_project | src/haffman.h | #ifndef PROJECT02_SRC_HAFFMAN_H_
#define PROJECT02_SRC_HAFFMAN_H_ 1
/// produced.. Noble_lex 64, 05.2024
/// algoritm Haffmana (compression and decompression)
/// used my libs "myAlg.h"
/* STL libraries */
#include <string>
#include <unordered_map>
#include <queue>
/* My libraries */
#include "myalgoritm.h"
namesp... | ALGO | 0.999647 | 3.998002 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2024-05-07T10:55: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": "ebfab8448... |
751da77b-9d29-497e-b532-968a14607dce | ars-longa-vita-brevis/CSES | Dynamic_Programming/arrayDescription.cpp | #include<bits/stdc++.h>
using namespace std;
#define ln '\n'
typedef long long ll;
const int mod = 1e9+7;
int main()
{
int n, m;
cin >> n >> m;
vector<int> values(n);
for(int i = 0; i < n; i++)
cin >> values[i];
vector<vector<ll>> numberOfArrays(n,vector<ll>(m+1,0));
if (values[0] != 0... | ALGO | 0.999991 | 4.001021 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-07-27T13:55:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b21f417d6... |
31a99991-68d1-4dfd-9f58-711cd884ef21 | pchintan243/InterviewPreparation | String/Palindrome.cpp | // C++ program to check whether two strings are anagrams
// of each other
#include <bits/stdc++.h>
using namespace std;
/* function to check whether two strings are anagram of
each other */
bool areAnagram(string str)
{
// Get lengths of both strings
return true;
}
// Driver code
int main()
{
string str ... | ALGO | 0.999792 | 5.764843 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2023-07-02T10:49: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": "77ff004e5... |
e73566e8-5c16-4d49-9f2c-eac91f4fb0d6 | Leonid349/middle | mainik.cpp | #include "middle.h"
using namespace std;
void itc_num_print(int number){
cout << number;
}
int itc_len_num(long long number){
int a;
a = 0;
if (number == 0){
return 1;
}
else{
while (number != 0){
number = number / 10;
a ++;
}
return a;
... | ALGO | 0.998945 | 3.01414 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-04-01T12:11: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": "41a008f6c548... |
bc498cae-3cc7-41dc-a248-28010ba68ebc | PaddlePaddle/Anakin | saber/funcs/impl/x86/saber_arithmetic.cpp |
#include "saber/funcs/impl/x86/saber_arithmetic.h"
#include "mkl.h"
#if defined(__AVX2__) and defined(__FMA__)
#include "saber/funcs/impl/x86/saber_avx2_funcs.h"
#endif
#include <cmath>
namespace anakin{
namespace saber {
template <DataType OpDtype>
SaberStatus SaberArithmetic<X86, OpDtype>::init(
const std:... | ALGO | 0.967309 | 6.896931 | {
"github_metadata": {
"branch": "master",
"commit_count": 788,
"repo_created_at": "2018-05-18T05:32:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 533,
"forks": 134,
"issues": 53,
"pull_requests": 15
},
"file_meta": {
"content_id": "c1b... |
2a336c32-8a07-466c-8221-54a1431d8929 | udonyang/acmps | acdream/4/A/Miss Kitty and Her Little Ice Cream Shop.cpp | #include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
#define Rep(c, a, b) for (int c = a; c < b; c++)
#define MAXN (11000000)
int m, a, b, c, d, e, f, g, h, i, j, k;
int H2(int a, int b, int c, int x)
{
return a * x * x + b * x + c;
}
bool chk(int x)
{
int pf = 0, cl;
Rep(tx, 1,... | ALGO | 0.999826 | 3.372793 | {
"github_metadata": {
"branch": "master",
"commit_count": 269,
"repo_created_at": "2013-04-01T00:39:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6cc301aa... |
02a45e03-da00-4455-a36b-744c5aef773e | ojasvagupta/Leetcode | 0148-sort-list/0148-sort-list.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 {
public:
ListNode* merge(ListNode*... | ALGO | 0.999998 | 6.170606 | {
"github_metadata": {
"branch": "main",
"commit_count": 2097,
"repo_created_at": "2024-06-18T07:56: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": "78c6f180f... |
33981f43-ba3c-47bd-8688-d3f3bfd081a8 | r4pidstart/problems | by_category/bruteforce/1548.cpp | // https://www.acmicpc.net/problem/1548
// 2024-06-13 23:11:04
#include"bits/stdc++.h"
#define scanf(...) do not use this
#define printf(...) do not use this
using namespace std;
int main(void)
{
#ifndef LOCAL
cin.tie(nullptr)->sync_with_stdio(false);
#endif
int n; cin >> n;
vector<int> arr(n);
for(int... | ALGO | 0.999948 | 4.960362 | {
"github_metadata": {
"branch": "master",
"commit_count": 1680,
"repo_created_at": "2021-02-19T09:57:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41916d8... |
91d2461b-e5f3-4bed-81cb-db6b22a61a15 | liujiapeng678/AlgorithmPracticing | 计数类DP,整数划分/7.15.cpp |
//完全背包解法:每一个数使用次数是无限的f[i][j]集合是从前i个物品中选,容量恰好为j的所有方案,属性:注意是数量
//状态转移方程:第i个拿0个。。。。一直到拿s个(小于等于背包容量)f[i][j] = 数量要都加起来,不是max(),f[i-1][j]+f[i-1][j-i]+...+f[i-1][j-s*i]
//再按照完全背包方法优化:写出f[i][j-i],所以f[i][j] = f[i-1][j]+f[i][j-i]
//再删掉第一维,f[j] = f[j] + f[j-1],注意循环顺序
#include<bits/stdc++.h>
using namespace std;
const int N = 1... | ALGO | 0.999991 | 4.088708 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2024-06-11T14:55:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4cb6408c0... |
93188307-71c0-4c8b-b016-fc7ecc6687e4 | Thalisson-Alves/Competitive-Programming | submissions/AtCoder/abc179/b.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include "debug.cpp"
#else
#define dbg(...)
#endif
#define all(x) x.begin(), x.end()
using ll = long long;
using ull = unsigned long long;
void solve() {
int n;
cin >> n;
vector<bool> g(n);
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >>... | ALGO | 0.999984 | 4.221116 | {
"github_metadata": {
"branch": "main",
"commit_count": 1114,
"repo_created_at": "2023-05-15T00:16:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2e99fbf2... |
f2f3a514-528f-4805-8e9e-467375067814 | yampml/DS-sem3 | LinkedList/LinkedList.cpp | #include<stdio.h>
#include<stdlib.h>
struct node
{
int item;
struct node *next;
};
void init(struct node **head, int *count);//
void insert(struct node **head, int item, int index, int *count);//
void del(struct node **head, int index, int *count);//
bool isEmpty(struct node *head);//
void printList(struct node *hea... | ALGO | 0.999635 | 3.456232 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2016-12-09T01:03:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f62bef97e... |
c5f5d2ce-fe94-4f65-b31a-6da4af6d707e | Liuchenlong/acm | codeforces/300/375/D.cpp | #include <bits/stdc++.h>
using namespace std;
int n,m,k;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
bool intable(int x,int y)
{
if(x>=0&&x<n&&y>=0&&y<m)return true;
return false;
}
char tab[55][55];
bool vis[55][55];
set<pair<int,pair<int,int> > >s;
void bfs(int x,int y)
{
queue<pair<int,int> >q;
q.pu... | ALGO | 0.999989 | 3.264087 | {
"github_metadata": {
"branch": "master",
"commit_count": 776,
"repo_created_at": "2016-05-18T16:06:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb818881... |
34c6c52e-33a6-4d39-9a6b-734a5caa0167 | alikhanmurat/ADS | Lab9/H.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
vector <int> prefixFunction(string s){
vector <int> v(s.size());
for(int i = 1; i < s.size(); i++){
int j = v[i-1];
while(j > 0 && s[j] != s[i]){
j = v[j-1];
}
if(s[j] == s[i]){
v[i] =... | ALGO | 0.999973 | 3.642217 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-05-08T16:29: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": "b6c4cbeb853d... |
b4ff9bb0-22b7-4bcd-9465-e3ffd3292a91 | pnthuc/C | 5-24120228/practice5.4/process1.cpp | #include "process1.h"
#include <iostream>
#include <sstream>
void input(Date dates[], ll &N) {
char line[100];
do {
std::cout << "Enter the number of dates: ";
fgets(line, 100, stdin);
} while ((std::stringstream(line) >> N).fail() or N <= 0);
for (int i = 0; i < N; ++i) {
do{
... | ALGO | 0.99924 | 4.568427 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-08T04:38:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f544e405c353... |
88bc0885-1b35-45db-8e6c-cbc98918e508 | eungaaee/ProblemSolving | 백준/Gold/1238. 파티/파티.cc | #include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N, M, X;
cin >> N >> M >> X;
vector<pair<int, int>> m[N+1];
vector<pair<int, int>> rev_m[N+1];
int s, e, c;
for (int i = 0; i < M; i++) {
ci... | ALGO | 0.999974 | 4.302382 | {
"github_metadata": {
"branch": "main",
"commit_count": 605,
"repo_created_at": "2024-08-30T03:58: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": "a8000450f2... |
96acafff-6518-4b48-940a-d965fe4bf311 | priya-ts7/Coding-Exercises | knight_path.cpp | # Knight path on chess board
/* Question: You are given a rows * cols chessboard and a knight that moves like in normal chess.
Currently knight is at starting position denoted by start_row th row and start_col th col, and want to reach at ending position
denoted by end_row th row and end_col th col. The goal is to ca... | ALGO | 0.99989 | 5.738958 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2021-01-28T08:47:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54ccb33c9... |
53bafa39-5bd5-41b4-b04b-1ff0b93b74d8 | Lemon-Armin-Cake/Petri_dish_Library | Bacterium.cpp | #include<cstdio>
#include <cmath>
#include <iostream>
#include <cstdlib>
#include <ctime>
#include"Bacterium.h"
#include "Growth_medium.h"
#include "Nutrient_particle.h"
#define _USE_MATH_DEFINES
#include <math.h> //без этого M_PI не определяется
const float a = 20; //линейный размер среды вдоль оси X
const float b... | ALGO | 0.991171 | 3.648096 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-05-13T19: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": "d5de33e53c... |
2f7963fc-5b06-4fb1-b51a-626f40613025 | wandukong/Algorithm | 백준/7682_틱택톡.cpp | #include <iostream>
#include <algorithm>
using namespace std;
string arr;
bool firstWin()
{
for (int i = 0; i < 3; i++)
if (arr[i * 3] == 'X' && arr[i * 3] == arr[i * 3 + 1] && arr[i * 3 + 1] == arr[i * 3 + 2]) // 행
return true;
for (int i = 0; i < 3; i++)
if (arr[i] == 'X' && arr[... | ALGO | 0.999981 | 4.265525 | {
"github_metadata": {
"branch": "master",
"commit_count": 464,
"repo_created_at": "2020-04-25T13:05:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0020eec... |
be30dc55-f651-417e-8e26-db3beb80862f | nbatho/Cautruc_dulieu_giaithuat | DSA01007 - Xau AB co do dai n.cpp | #include <bits/stdc++.h>
using namespace std;
int a[1005];
int n;
bool Last = false;
void ktao() {
for (int i = 1; i <= n; i++) {
a[i] = 0;
}
}
void sinh() {
int i = n;
while (i > 0 && a[i] == 1) {
a[i] = 0;
--i;
}
if (i <= 0) Last = true;
else {
a[i] = 1;
... | ALGO | 0.999865 | 3.975242 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2024-08-11T14:12:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf2bf6b2f6... |
f6589e2b-1648-41a3-a10b-a10dc613185a | ACELab-SHU/ACE-Echo | dsl/heft_new/include/HEFTPlanningAlgorithm.hpp | #ifndef HEFT_PLANNING_ALGORITHM_H
#define HEFT_PLANNING_ALGORITHM_H
#include <iostream>
#include <vector>
#include <map>
#include <unordered_set>
#include <queue>
#include <functional>
#include <unordered_map>
struct Task {
int taskId;
double computationCost;
std::vector<std::tuple<int, int, std::string, ... | ALGO | 0.999975 | 6.515376 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2025-04-13T10:11:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dade0a5df... |
08918684-070a-412a-8c34-be882a8e252e | aiswarya18122006/CSA0306 | hashing using linear probing method.cpp | #include <stdio.h>
#define SIZE 10
int hashTable[SIZE];
// Initialize all slots to -1 (empty)
void init() {
for (int i = 0; i < SIZE; i++)
hashTable[i] = -1;
}
// Hash function
int hash(int key) {
return key % SIZE;
}
// Insert using linear probing
void insert(int key) {
int index = hash(key);
... | ALGO | 0.999865 | 5.709048 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-05-01T11:42: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": "4ff859cf36a9... |
c41cca09-711c-43e4-b8d0-f7f3d3fab8b1 | ShailabChauhan/competitive-coding | cses/Sum_of_Two_Values_correct.cpp | #include <bits/stdc++.h>
using namespace std;
void is_sum_available(vector < pair < int, int> > &v, int x, int n)
{
int i = 0, j = n - 1, k = 0;
while(i < j)
{
int sum = v[i].first + v[j].first;
if(sum < x)
{
i++;
}
else if(sum > x)
{
... | ALGO | 0.999989 | 4.128768 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-01-28T12:16:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8422a3203a4... |
f1cffee6-316b-4f08-8506-2adfb89ca4a9 | DanRadulescu962/ProjectAPP | OpenMP/tema.cpp | #include <bits/stdc++.h>
#include <omp.h>
#include <sys/time.h>
using namespace std;
ifstream fin("input.txt");
ofstream fout("output.txt");
vector< pair<double, double> > clusters[100];
vector< pair<double, double> > centroids;
vector< pair<double, double> > points;
omp_lock_t Mutex[100];
vector<int> final_resul... | ALGO | 0.999954 | 4.768603 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-12-01T13:32: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": "010eef3a5f... |
e08e75df-b5cb-422b-946d-b5b613c8fa43 | marc-hanheide/cogx | systems/css-2011-teams/yellow/subarchitectures/execution.sa/Golem/trunk/src/Golem/Math/Mat33.cpp | /** @file Mat33.cpp
*
*
* @author <NAME> (The University Of Birmingham)
*
* @version 1.0
*
*/
#include <Golem/Math/Mat33.h>
#include <Golem/Math/Quat.h>
//------------------------------------------------------------------------------
using namespace golem;
//------------------------------------------------... | TOOL | 0.979774 | 6.647085 | {
"github_metadata": {
"branch": "master",
"commit_count": 21234,
"repo_created_at": "2019-11-04T09:11:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b015b4... |
3f4dde63-a6ee-4824-8a41-5fe68a2445ec | cnyali-czy/code | others/BZOJ/4059.cpp | /*
Problem: 4059.cpp
Time: 2020-03-22 23:08
Author: CraZYali
E-Mail: <EMAIL>
*/
#define REP(i, s, e) for (register int i(s), end_##i(e); i <= end_##i; i++)
#define DEP(i, s, e) for (register int i(s), end_##i(e); i >= end_##i; i--)
#define DEBUG fprintf(stderr, "Passing [%s] in Line %d\n", __FUNCTION__, __LINE... | ALGO | 0.999272 | 3.418133 | {
"github_metadata": {
"branch": "master",
"commit_count": 1593,
"repo_created_at": "2018-02-24T06:16:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f24eb5a... |
44a3de4a-c4f3-45eb-8380-0b12e3360c81 | bws/HECIOS | src/common/lru_mesi_cache.h | #ifndef LRU_MESI_CACHE_H
#define LRU_MESI_CACHE_H
//
// This file is part of Hecios
//
// Copyright (C) 2007,2008,2009 <NAME>
//
// This file is distributed WITHOUT ANY WARRANTY. See the file 'License.txt'
// for details on this and other legal matters.
//
#include <cassert>
#include <functional>
#include <list>
#inclu... | TOOL | 0.951334 | 7.167634 | {
"github_metadata": {
"branch": "master",
"commit_count": 533,
"repo_created_at": "2009-08-14T14:53: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": "77fa3444... |
777ed4b0-4fa2-4b28-8e9e-66d40c5f1273 | F1-GTR/mentor-old | m_mflab.cpp | #include <stdio.h>
#include "m_expressions.h"
#include "m_mflab.h"
char *mflab01 (const range& r, char *text)
{
char buf[10][BUFSZ]; chprintf(text, "");
int a,b;
do{
a=rnd(r.f,r.t);
b=rnd(r.f,r.t);
}while (a==0 || b==0);
catprintf(text,"String(\"Укажите уравнение свободных колебаний... | ALGO | 0.970261 | 3.111013 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2014-07-10T18:30:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "78e2f9bd... |
6fa91523-037a-47b7-a69d-f7f2818352f4 | rahanuma228/190041228-CSE-4302 | Lab 6/228 task1 lab6.cpp | #include<iostream>
using namespace std;
class Counter
{
private:
int count;
int n;
public:
Counter():count(0),n(1)
{
}
Counter(int c):count(c)
{
}
Counter(int c,int _n):count(c),n(_n)
{
}
void setIncrementStep(int step_val)
{
if(step_val>0)
{
... | TOOL | 0.969177 | 4.973661 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2021-07-05T08:07: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": "bfc97d1b0... |
cd6e0ab4-f496-4b5b-8056-03cae61b6283 | AJStorteeboom/leetcode | 279-perfect-squares/main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <unordered_set>
using namespace std;
class Solution {
public:
int numSquares(int n) {
int mem[101] = {0};
//Store perfect squares up to 10.000;
for(int x = 1; x <= 100; x++) mem[x] = x*x;
unordered_set<int> visited;
... | ALGO | 0.999862 | 4.913391 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2022-01-25T18:21: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": "b450b25c... |
fbe31d96-23a9-424e-8a28-1d18ffd20d56 | kovaxis/progcomp | problems/codeforces/ed/ed118/e_up.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REPGET(_1, _2, _3, NAME, ...) NAME
#define rep3(i, b, n) for (int i = (int)(b); i < (int)(n); i++)
#define rep2(i, n) rep3(i, 0, (n))
#define rep(...) REPGET(__VA_ARGS__, rep3, rep2)(__VA_ARGS__)
#define invrep3(... | ALGO | 0.999468 | 3.903617 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2021-05-24T02:10:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22a57f72... |
1371295c-45da-477f-811a-2732c69580cf | Rohitpawale23/180_Days_of_coding | Day_94.cpp |
// **** DAY 94 - Josephus Problem || Predict The Winner *****
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
// BruteForce
int Bwinner(vector<bool> &person, int n, int index, int p_left, int k)
{
// Base case
if (p_left == 1)
{
for (int i = 0; i < n; i++)
{
... | ALGO | 0.999996 | 4.768962 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2023-09-30T14:50:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f335c811536... |
a726ec80-ea91-44e2-a204-b98c6643ef9f | Aadi-23/Mario-Copy | Source/utils.cpp | //<NAME>
#include "utils.h"
#include <cmath>
#include "myMath.h"
bool AABBVsAABB(const Vector2 pos1, const Vector2 pos2, const Vector2 size1, const Vector2 size2)
{
bool CollisionX = pos1.x + size1.x >= pos2.x && pos2.x + size2.x >= pos1.x;
bool CollisionY = pos1.y + size1.y >= pos2.y && pos2.y + size2.y >= pos1.... | ALGO | 0.999784 | 5.753201 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-08T19:04: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": "74d09bf8c1c2... |
701b9782-05e8-46a0-8e25-8f97d162b5f6 | haoyuanliu/hihoCoder | DP_动态规划/ex1_加分二叉树/demo.cpp | #include <iostream>
using namespace std;
int n;
int score[55] = {0};//分数
int root[55][55] = {0};//根节点
int m[55][55] = {0};//最大点;
void show()
{
for(int i = 0; i <= n; ++i)
{
for(int j = 0; j <= n; ++j)
{
cout << m[i][j] << " ";
}
cout << endl;
}
}
void solve()
{
... | ALGO | 0.999991 | 3.551347 | {
"github_metadata": {
"branch": "master",
"commit_count": 479,
"repo_created_at": "2016-03-06T12:29:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0b9a4e7... |
0f78cab3-0507-4b72-ad4b-bfc3cd839af0 | ksah3756/Algorithm | 프로그래머스/3/72413. 합승 택시 요금/합승 택시 요금.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
// 11:00
// 합승을 한다는건 특정 지점까지는 돈을 한번만 내는거고
// S, A, B 각 지점에서 나머지 노드까지 최단 거리를 구하고 모든 중간 지점에 대해 값을 더해봐서 최소값을 구하기
const int INF = INT_MAX;
vector<vector<pii>> cost(201, vector<pii>());
int dist[3][201];
void dijkstra(int start, int idx) {
prior... | ALGO | 0.999715 | 4.253961 | {
"github_metadata": {
"branch": "main",
"commit_count": 210,
"repo_created_at": "2025-01-29T13:40: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": "b24a26a119... |
0773a9fb-ed04-471c-8176-181e282bbeb0 | Galfurian/numint | include/numint/stepper/stepper_euler.hpp | /// @file stepper_euler.hpp
/// @author <NAME> (<EMAIL>)
/// @brief Simplification of the code available at:
/// https://github.com/headmyshoulder/odeint-v2
#pragma once
#include "numint/detail/it_algebra.hpp"
#include "numint/detail/type_traits.hpp"
namespace numint
{
/// @brief Stepper implementing the Euler ... | ALGO | 0.996008 | 7.4956 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2022-07-05T14:47:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b91cd83ae3... |
a35be551-6d2d-4e3d-9bfc-f79bd6bf496e | Md-Noman-Biswas/Codeforces_problems | B_Difference_of_GCDs.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define nl "\n"
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define pb push_back
#define llmx LONG_LONG_MAX
#define llmn LONG_LONG_MIN
#define mod 1000000007
const int N = 1e5 + 7;
const int INF = 1e9 + 10;
ll target_multiple(ll n, ll k){
... | ALGO | 0.999657 | 3.17877 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2023-07-24T09: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": "c4236ea4231... |
e64a73f4-e925-4d91-b823-b4fe07480ff9 | mende1/projetos-da-faculdade | laboratorio-de-programacao/Prova 2 Jude/A.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
int main () {
int *inicio, *fim, *meio, *aux;
int i, tam, n_tam, extra, m;
cin >> tam;
inicio = (int*) calloc (tam, sizeof (int));
for (aux = inicio, i = 0; i < tam; i++, aux++){
cin >> *aux;
}
fim = inicio+(tam-1);
m = (tam/2);
meio = inic... | ALGO | 0.999513 | 3.21636 | {
"github_metadata": {
"branch": "main",
"commit_count": 202,
"repo_created_at": "2020-05-06T16:11:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "724494000... |
f6524c1d-bda6-4854-8a6c-abf88c591374 | fepaf/Competitive-Programming | Meu-Codebook/Grafos/binary_lifting_minimum_between_vertices_in_tree.cpp | #include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);
#define endl '\n'
#define INF 0x3f3f3f3f
#define MAX (1<<20)
#define i64 long long
#define all(x) (x).begin() , (x).end()
#define sz(x) (int)(x).size()
#define ii pair<int, int>
#define fs first
#define sc second
#define eb emplace_back
#define vi vector<i... | ALGO | 0.999941 | 4.116109 | {
"github_metadata": {
"branch": "master",
"commit_count": 620,
"repo_created_at": "2016-08-26T13:01:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c8283e... |
ca6dd05f-7883-4a80-a665-196add7bb898 | VivekYadav98/DSA | Clone Graph - GFG/clone-graph.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
#include <sstream>
using namespace std;
struct Node {
int val;
vector<Node*> neighbors;
Node() {
val = 0;
neighbors = vector<Node*>();
}
Node(int _val) {
val = _val;
neighbors = vector<Node*>... | ALGO | 0.999673 | 6.199383 | {
"github_metadata": {
"branch": "main",
"commit_count": 2139,
"repo_created_at": "2023-01-14T10:26: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": "fa1d7ee15... |
d865daad-937e-4944-ab04-1a89aef88ec7 | kinetic-rb/kinetic-rb.github.io | code/P1131.cpp | #include <iostream>
#include <list>
using namespace std;
using vt = int_fast64_t;
constexpr vt Hat_N = 500000;
struct Rs {
vt to, cost;
Rs() = default;
Rs(vt to, vt cost) : to(to), cost(cost) {}
};
list<Rs> G[Hat_N];
vt f[Hat_N], dist[Hat_N];
void dp(vt u, vt fa) {
for (auto&& [v, w] : G[u]) {
if (v ==... | ALGO | 0.999701 | 3.950096 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2022-11-19T06:37: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": "2b1b4f57b8c... |
af5280e2-de16-42bc-9820-505ad02ec30c | jonathanpaulson/ml | mnist_lda.cc | #include <fstream>
#include <iostream>
#include <iterator>
#include <vector>
#include <cassert>
#include <string>
#include <cmath>
#include "io.hpp"
#include "math.hpp"
#include "lda.hpp"
using namespace std;
int main() {
ll n1 = 60000;
ll n2 = 10000;
ll R = 28;
ll C = 28;
mat X1 = read_data(n1, R, C, "tra... | TEST | 0.918861 | 5.150823 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-12-30T15:19: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": "ebe72c22ad... |
f420b1e5-cf57-4889-9aea-ddf683c536df | amro-coder/Competitive-Programming.cpp | Graph/bellman_ford.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef pair<int,int> pi;
typedef tuple<int,int,int> tup;
#define F first
#define S second
#define PB push_back
#define MP make_pair
void print(vl x) {... | ALGO | 0.999994 | 3.730827 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2022-01-20T17:19: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": "fabed6a1434... |
3e4359db-6579-4637-9cc8-de5fcea06d7a | remcous/Programming-Principles-and-Practice | Ch12/exercise12.cpp | /*
exercise12.cpp
draw a superellipse using N points
abs(x/a)^m + abs(y/b)^n = 1
for m,n>0
Revision History:
*/
#include "../std_lib_facilities.h"
#include "Simple_window.h"
#include "Graph.h"
#include <cmath>
/****************************************
* FUNCTION PROTOTYPES
**********... | ALGO | 0.998554 | 4.819763 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2020-07-06T04:00:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcb2a85b0... |
8f5073fe-e7e3-4308-bd0a-6887930709d2 | lemonmungchi/programmerss | programmers/p_p76.cpp | #include <string>
#include <vector>
#include <map>
using namespace std;
map<string, int> dic;
int num = 1;
vector<int> solution(string msg) {
vector<int> answer;
//A ~ Z 까지 사전에 등록
for (char c = 'A'; c <= 'Z'; c++) {
string s = "";
s += c;
dic[s] = num++;
}
//사전추가 과정
strin... | ALGO | 0.999879 | 4.577167 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2023-11-07T12:29:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f092868c0f1... |
8ebe04f1-2b95-4b9c-b85a-d7cde9343560 | hyperplasma/Ultimate-Solutions | PAT_Basic_Level/cpp/PAT_B1104/solution.cpp | #include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
int n, k;
LL m;
LL gcd(LL a, LL b) {
return !b ? a : gcd(b, a % b);
}
LL getSum(LL a) {
LL sum = 0;
while (a) {
sum += a % 10;
a /= 10;
}
return sum;
}
bool i... | ALGO | 0.999987 | 3.545851 | {
"github_metadata": {
"branch": "master",
"commit_count": 259,
"repo_created_at": "2024-12-30T12:59: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": "bab6059b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.