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 |
|---|---|---|---|---|---|---|---|
72a99960-1556-4d79-b17e-27310c009c0e | Loc-1/School-Assignments | University/457 - OS/stats.cpp | /**********************************************
* Last Name: Moore
* First Name: Lachlan
* Student ID: 30030228
* Course: CPSC 457
* Tutorial: 01
* Assignment: 2
* Question: Q5
*
* File name: stats.cpp
*********************************************/
#include <stdio.h>
#include <ostream>
#inclu... | ALGO | 0.998298 | 4.023361 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-06-05T22:27: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": "e100714c42... |
b249f355-384a-4b8f-af28-118e085d1108 | Harsh-pate1/u23ai125_OOP | assignment_3/6b_complex_multi.cpp | // Experiment 6b: Write a C++ Program to implement the arithmetic operations multiplication on complex numbers using the concept of this pointer, inline functions and scope resolution operator.
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
class Complex
{
private:
float real;
float ima... | ALGO | 0.980987 | 6.096562 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-27T06:11: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": "dfd038365aca... |
228e8875-f38c-4f12-b178-d3e511b547f4 | alexandraback/datacollection | solutions_5744014401732608_1/C++/IlyarSM/main.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <ctime>
#include <cstdio>
#include <string>
#include <sstream>
#include <queue>
#include <map>
#include <vector>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <memory>
#include <bitset>
#include <f... | ALGO | 0.99996 | 4.156764 | {
"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": "e901a293d... |
ce3cacf5-b38d-4869-99ac-563ba3d4dccf | Nirmakaya/CPP-DSA | ZigZagTraversalBST.cpp | #include<iostream>
#include<stack>
using namespace std;
//Time Complexity : O(2n) which equals to O(n)
struct Node{
int data;
Node* left;
Node* right;
Node(int val){
data = val;
left = NULL;
right = NULL;
}
};
void zigzagTraversal(Node* root){
... | ALGO | 0.999999 | 5.140843 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-05T18:19: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": "3fb31ca510b1... |
fb56ace0-6ee0-40ec-85db-23a03b74527b | AzamAzam/DSALabsAssignments | towerof hanoi.cpp | //BCSF15M017
//<NAME>
#include <iostream >
#include <math.h>
using namespace std;
int moves = 0;
void tower(int m, char a, char b, char c){
moves++;
if (m == 1){
cout << "Move disc " << m << " from " << a << " to " << c << endl;
}
else{
tower(m - 1, a, c, b);
cout << "Move disc " << m << " from " << a << "... | ALGO | 0.999756 | 4.208706 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-07-22T10:48: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": "4f381ed0d4... |
4e5efa01-f8be-4032-a241-eda9bdb6a689 | Vortexx2/DSA-questions | leetcode/medium/19-remove-nth-node/two-pointers.cpp | /**
* @file two-pointers.cpp
* @author Vortexx2
* @brief Problem 19 - Remove Nth Node from End of List
* @approach Using 2 pointers
* @date 07-10-2022
*
* Runtime - 3 ms O(n)
* Memory Usage - 10.7 MB O(1)
*/
#include <iostream>
using namespace std;
/**
* Definition for singly-linked list.
*/
struct ListNo... | ALGO | 0.999964 | 6.455446 | {
"github_metadata": {
"branch": "main",
"commit_count": 474,
"repo_created_at": "2021-06-15T05:19:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82264c6080... |
8e78e4da-afd1-448d-bbf3-810ea2f56ff8 | Zishan-Alam/LeetCode | Heap/1834-single-threaded-cpu.cpp | class Solution {
public:
typedef pair <int,int> P; // Pair jo duration aur index ko store karega
vector<int> getOrder(vector<vector<int>>& tasks) {
int n = tasks.size();
vector<int> result; //to return the answer
priority_queue< P, vector<P>, greater<> > p... | ALGO | 0.999993 | 5.913535 | {
"github_metadata": {
"branch": "main",
"commit_count": 560,
"repo_created_at": "2024-09-26T11:58: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": "6f7a4bc442... |
61e1ddb5-133c-4af2-802d-f033d418387a | LucaBarden/CompetetiveProgramming | woche5homework/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define CIN \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define mod 1000000007
#define db double
#define ft float
#define int long long
#define vi vector<int>
#... | ALGO | 0.999978 | 4.71628 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-11-20T22:13:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c6c11c854... |
116b4e3f-e859-4008-bba9-55d2e1b3c512 | KirillKomarov1993/OpenTuCo | OpenPH/electrostatics/kernals/src/coulombkernal.cpp | #include "coulombkernal.h"
namespace ph {
CoulombKernal::CoulombKernal() :
GreenKernel()
{
index = 1;
name = "coulomb";
}
CoulombKernal::CoulombKernal(std::string _system) :
GreenKernel(_system)
{
name = "coulomb";
}
double CoulombKernal::getFunction(Vector3d _P, Vector3d _Q)
{
return coef / ... | ALGO | 0.987564 | 5.587657 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2020-10-15T16:26: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": "4b50d2f55d55... |
6b6a8608-138b-46a2-a0a3-c5091de65ce5 | Tudor67/Competitive-Programming | Codeforces/#690#div3/F/F_sol1.cpp | #include <bits/stdc++.h>
using namespace std;
bool sortIncX(const pair<int, int>& LHS, const pair<int, int>& RHS){
return (LHS.first < RHS.first);
}
bool sortIncY(const pair<int, int>& LHS, const pair<int, int>& RHS){
return (LHS.second < RHS.second);
}
bool lowerBoundY(const pair<int, int>& IT, const int& Y... | ALGO | 0.999932 | 4.647649 | {
"github_metadata": {
"branch": "master",
"commit_count": 615,
"repo_created_at": "2020-02-27T19:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb11f6df... |
9249ac66-537f-4a9f-aff6-9620805041d8 | sidrusiya/CP-AlgorithmsSol | ddlj.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool saddy(pair<int,int> a,pair<int,int> b){
if(a.first<b.first)
return true;
else if(a.first>b.first)
return false;
else{
if(a.second<b.second)
return true;
else
return false... | ALGO | 0.999926 | 3.838202 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-04-27T18:23: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": "20a3c09842... |
18a3344d-9ac9-42cd-9780-f33e97a13d4b | Ayjay/aoc | 2024/day23.cpp | #include "aoc2024.h"
#include <map>
#include <string_view>
#include <tuple>
#include <utility>
#include <vector>
#include <fmt/core.h>
#include <fmt/ostream.h>
#include <fmt/ranges.h>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/connected_components.hpp>
#include <boost/unordered_map.hpp>
#include... | ALGO | 0.996007 | 5.255836 | {
"github_metadata": {
"branch": "master",
"commit_count": 231,
"repo_created_at": "2022-12-02T22:10: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": "710481f5... |
b55aef26-98e4-4228-b0c7-a849715b83c2 | sarvesh821/DSA | 2dARRAY/07_spiralprint.cpp | #include <iostream>
using namespace std;
void spiralprint(int arr[][1000], int m, int n)
{
int sr = 0;
int sc = 0;
int er = m - 1;
int ec = n - 1;
while (sr <= er && sc <= ec)
{
// print first row
for (int i = sr; i <= ec; i++)
{
cout << arr[sr][i] << " ";
... | ALGO | 0.999981 | 4.417416 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2022-12-27T04:40: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": "d142b9c3c... |
61af2436-5f6d-41cf-8854-3ff82d2fb9cd | parikshit223933/Coding-Ninjas-Competitive-Programming | Language Tools/Warm_Recepetion_Another_Approach.cpp | /* There is only one beauty parlour in the town CodingNinjasLand. The receptionist at the beauty parlor is flooded with appointment requests because the “Hakori” festival is round the corner and everyone wants to look good on it.
She needs your help. The problem is they don’t have chairs in reception. They are ordering... | ALGO | 0.999902 | 4.229071 | {
"github_metadata": {
"branch": "master",
"commit_count": 677,
"repo_created_at": "2020-03-09T07:20:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 555,
"forks": 299,
"issues": 4,
"pull_requests": 7
},
"file_meta": {
"content_id": "71a1... |
6aa8795f-8be9-449c-a896-4ad333a1d445 | soheil-h/FREE | trajectory-following/arduino/trajectory.ino | // Trajectory Following
// Created: October 4, 2019 by <NAME>
// Control rotation of a single FREE
// Arduino output routes to pressure transducer attached to FREE
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>
// create sensor object
Adafruit_BNO055 bno = Ad... | ALGO | 0.97824 | 4.289903 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-02-24T03:53: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": "ef7564bae08f... |
2285b35e-bbca-4fa9-8ae6-bc6fd0a96e35 | IHaoMing/CryptographyLab | lab2/RC4.cpp | // RC4.cpp : 定义控制台应用程序的入口点。
//
//-----------------RC4加密算法------------------------------------
//头文件声明
#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
//函数声明
void swap_value(int &a, int &b);
void init_s(string k);
void display(int S[], int len);
string output(string input);
//显示s盒子的内容
v... | ALGO | 0.999238 | 3.834321 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-09-23T06:04: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": "e730e96ee... |
e9e75d3d-e6f4-40b1-8cf3-5b0505612a6c | anushka-kathil/LeetCode | 2903-insert-greatest-common-divisors-in-linked-list/2903-insert-greatest-common-divisors-in-linked-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:
int gcd(int i1, int i... | ALGO | 0.999954 | 5.741703 | {
"github_metadata": {
"branch": "main",
"commit_count": 864,
"repo_created_at": "2025-02-26T10:30: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": "6467fd3c2a... |
2584f18b-dae6-4473-9187-2cc1e5b7395e | HolicKW/codetree-TILs | 250310/독서실의 거리두기 5/study-cafe-keeping-distance-5.cpp | #include <iostream>
#include <string>
#include <climits>
using namespace std;
string str;
int main() {
int n;
cin >> n;
cin >> str;
int ans = 0;
for (int i = 0; i < n; i++) {
if (str[i] == '1') continue;
str[i] = '1';
int min_dis = INT_MAX;
for (int j = 0; j < ... | ALGO | 0.999993 | 4.310867 | {
"github_metadata": {
"branch": "main",
"commit_count": 1735,
"repo_created_at": "2024-07-17T06:00: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": "892604787... |
d0ab1822-3dc6-47e6-91de-7bc3e84c64cd | saifullah-talukder/Competitive_Programming | Codes/Codeforces/Accepted/CF_161_D.cpp | #include <bits/stdc++.h>
using namespace std;
long long ans;
bool vis[50005];
int m, k, t, DP[50005][505];
vector<int> edges[50005];
bool dfs(int u)
{
if (vis[u])
return false;
vis[u] = true;
DP[u][0] = 1;
int i, j, v, n;
bool chk;
n = edges[u].size();
for (i = 0; i < n; i++)
... | ALGO | 0.999964 | 3.839681 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-05-10T06:16: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": "06780662d119... |
0907b024-44c6-4746-a08e-a68986b7d5ac | somyaknotfound/dsa-patterns | pattern4.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<"enter number of rows"<<endl;
cin>> n;
char c = 'A'-1;
for (int row = 1; row<=n;row++) {
for(int col = 1 ;col<=row;col++) {
cout<< char(c+row+col-1)<<" ";
} cout<<endl;
}
... | ALGO | 0.99988 | 3.621413 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-09T03:44: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": "3bddf17c9498... |
56fb8773-4dc6-4a46-abf5-fa17d0b6c0f2 | yjl9903/XCPC | CometOJ/coj0/b.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <utility>
#ifdef XLor
#define dbg(args...) do {cout << #args << " -> "; err(args);} while (0)
#else
#define dbg(...)
#endif
void err() {std::cout << std::endl;}
template<typename T, typename...A... | ALGO | 0.999818 | 3.61634 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-25T19:33:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce4d9856bb3b... |
a1b97ea8-c39e-4306-a556-d7478516c5f1 | StasJ/testing | lib/vdc/Grid.cpp | #include <iostream>
#include <vector>
#include "vapor/VAssert.h"
#include <numeric>
#include <cmath>
#include <time.h>
#ifdef Darwin
#include <mach/mach_time.h>
#endif
#ifdef _WINDOWS
#include "windows.h"
#include "Winbase.h"
#include <limits>
#endif
#include <vapor/utils.h>
#include <vapor/Grid.h>
using namespace s... | ALGO | 0.917532 | 5.262206 | {
"github_metadata": {
"branch": "3rdPartyLibs",
"commit_count": 4467,
"repo_created_at": "2020-12-25T04:06:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9... |
097663f9-eb04-4e9c-8e9c-d5c2e17c14d5 | ssfc/assignment | graph_dfs.cpp | #include<iostream>
#include<vector>
using namespace std;
int num_v;
vector<bool> adjacency_matrix;
vector<bool> visited;
vector<int> OpenTable;
vector<int> CloseTable;
struct Node
{
int key;
int level;
vector<int> child;
};
vector<Node> tree;
vector<int> sequence;
void print_SearchTree();
void print_OpenTable(... | ALGO | 0.99998 | 4.138702 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2018-05-10T09:38:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 22,
"pull_requests": 0
},
"file_meta": {
"content_id": "009f16d1... |
f5004138-101c-43eb-8ac6-d204750057f1 | norbinorbert/Elso_ev | Gráfalgoritmusok/L03_bnim2219/L03_bnim2219_3/L03_bnim2219_3.cpp | //<NAME>, 511
#include <iostream>
#include <vector>
#include <fstream>
#include <stack>
using namespace std;
void beolvas(int&, int&, vector<vector<int>>&);
void StrongConnect(int, int, vector<vector<int>>&);
void DFS_SCC(int, int&, vector<int>&, vector<int>&, vector<bool>&, vector<vector<int>>&, int&, stack<int>&, ... | ALGO | 0.999335 | 4.804121 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2022-12-11T14:58:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10604f676a... |
9d6ccb7d-39f2-4c5f-a2d5-73771c3e1f7b | choijaewon323/PS | 백준/Gold/2206. 벽 부수고 이동하기/벽 부수고 이동하기.cc | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
#define MAX 1000
#define INF 1000000000
#define NOT_DESTROY 0
#define DESTROY 1
int N, M;
int matrix[MAX + 1][MAX + 1];
int dy[] = { -1, 0, 1, 0 };
int dx[] = { 0, -1, 0, 1 };
bool inRange(int y, int x) {
... | ALGO | 0.99994 | 4.049258 | {
"github_metadata": {
"branch": "master",
"commit_count": 829,
"repo_created_at": "2021-09-04T02:57: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": "ccff64d0... |
cab2edba-0c90-45bf-bf8c-886f55cf79f1 | ftxj/2th-SummerHO | 1-CLRS-Solution/C15-Dynamic-Programming/Problem/code/15.3.cpp | #include <iostream>
#include <climits>
#include <cmath>
using namespace std;
const int N = 7;
int Graph[N][2] = {
{1,7},
{2,1},
{3,4},
{6,5},
{7,2},
{8,6},
{9,3}
};
double dis(int* a, int* b){
int x1 = a[0];
int y1 = a[1];
int x2 = b[0];
int y2 = b[1];
double res = sqrt((... | ALGO | 0.999258 | 3.408632 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-01-28T14:24:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c67b2c8041... |
b5d13278-cbd9-4e31-adcf-89a2b15a8157 | coffeexing/oj-collection | 程序设计竞赛/23级-程序设计综合训练I-练习1/G 看病要排队.cpp | #include <bits/stdc++.h>
using namespace std;
struct patient {
int id, prior;
bool operator < (const patient &p) const {
return prior < p.prior || (prior == p.prior && id > p.id);
}
};
int main() {
int t;
while (cin >> t) {
vector<priority_queue<patient, vector<patient>>> pq(t + 2)... | ALGO | 0.999499 | 4.19855 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-10-06T02:13: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": "92e615b6f63... |
7fb59b87-f36c-45f1-813b-77b90b1abb6f | BryanValeriano/marathon | lounge/INOI1201.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mk make_pair
#define fi first
#define se second
#define eb emplace_back
typedef long long ll;
typedef pair<int,int> ii;
typedef vector< pair<int,int> > vii;
const int INF = 0x3f3f3f3f;
const int T = 2e5 + 10;
int n;
ii v[T];
bool cmp(ii &a, i... | ALGO | 0.999899 | 4.102661 | {
"github_metadata": {
"branch": "master",
"commit_count": 188,
"repo_created_at": "2018-07-19T13:13:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5db27046... |
23b47073-c3d1-4aac-939f-1d4545fea767 | OpenMS/OpenMS | src/openms/include/OpenMS/ML/CLUSTERING/CompleteLinkage.h | // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
// SPDX-License-Identifier: BSD-3-Clause
//
// --------------------------------------------------------------------------
// $Maintainer: <NAME> $
// $Authors: $
// --------------------------------------------------------------------... | ALGO | 0.996622 | 7.167117 | {
"github_metadata": {
"branch": "develop",
"commit_count": 34896,
"repo_created_at": "2014-01-09T10:15:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 518,
"forks": 358,
"issues": 638,
"pull_requests": 64
},
"file_meta": {
"content_id": ... |
14a25c06-cb7a-4492-b4e5-21a1a2c75b1c | ishandutta2007/codeforces-j | joisino/normal/354/C.cpp | #include <bits/stdc++.h>
#define FOR(i,a,b) for( int i = (a); i < (int)(b); i++ )
#define REP(i,n) FOR(i,0,n)
#define YYS(x,arr) for(auto& x:arr)
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort( (x).begin(),(x).end() )
#define REVERSE(x) reverse( (x).begin(),(x).end() )
#define pb emplace_back
#define mp ma... | ALGO | 0.999952 | 3.737491 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42: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": "272768e70b7d... |
2f78b0ef-ac3d-4bd3-b091-47f03060f897 | Sahil-Sharma03/PEC_Data_Structures_Assignments | Assignment 3 (Search Size Unknown)(Sahil_Sharma_21104019).cpp | #include <iostream>
using namespace std;
int bSearch(int arr[], int low, int high, int x)
{
if(low > high)
return -1;
int mid = (low + high) / 2;
if(arr[mid] == x)
return mid;
else if(arr[mid] > x)
return bSearch(arr, low, mid - 1, x);
else
return bSearch(arr, mid + 1, high, x);
}
int search(int arr... | ALGO | 0.999913 | 4.72983 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-09-25T16:26: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": "d17c7c705e24... |
42b4bc24-ec18-4e9c-afa2-de6809c2f157 | abd0-omar/al_gore_rhythms | binary-search-tree/find-chain.cpp | #include <utility>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right)
: val(x), left(left), ... | ALGO | 0.999994 | 5.540351 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-09-20T08:18: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": "e0dfa44c5e19... |
a9d3d4cd-71db-4fdf-998c-41e256439bac | nellencr/COS3711 | Question1/count/main.cpp | #include <QCoreApplication>
#include <QFile>
#include <QTextStream>
#include <QRegularExpression>
#include <QStringList>
#include <QDebug>
bool isVowel(QChar ch) {
return QString("AEIOUaeiou").contains(ch);
}
QString cleanText(const QString &text) {
QString cleaned = text.trimmed();
cleaned.remove(QRegula... | TOOL | 0.942479 | 5.753229 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-05-15T12:08: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": "2038e1a21a... |
356d51d6-9835-4135-b966-b1f0b5ea4a3a | harrel56/GAv2 | GAv2/GAv2/Solution.cpp | #include <vector>
#include <iostream>
#include "Solution.h"
using namespace std;
Solution::Solution(const Solution& sol) : problem(sol.problem), size(sol.size)
{
data = new bool[size] {false};
for (int i = 0; i < size; i++)
data[i] = sol.data[i];
}
Solution::Solution(Solution&& sol) : problem(sol.problem), size... | ALGO | 0.999869 | 5.457603 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-03-17T10:42:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c133584edb... |
b0e37603-2ff0-4479-ba37-d6b7b0c9272a | ashhek/Leetcode_solution | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divapple-divdiv-classcompanytagscontainer-tagoccurence3-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10... | class Solution {
public:
bool isPalindrome(string& s) {
int i = 0;
int j = s.size() - 1;
while (i <= j) {
if (s[i++] != s[j--])
return false;
}
return true;
}
void partition(int i, string& s, vector<string> temp,
vector<... | ALGO | 0.999995 | 6.418015 | {
"github_metadata": {
"branch": "main",
"commit_count": 2699,
"repo_created_at": "2023-07-01T10:39: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": "e5eb605c0... |
96949a94-a72c-4b6b-9799-b40485ecd804 | adherent9870/data-structures-and-algorithm | linked list/interst_of_two_sworted_ll.cpp | #include <iostream>
using namespace std;
class node{
public:
int data;
node *next;
node(int data){
this -> data = data;
next=NULL;
}
};
node *takeinput(){
int data;
cin >> data;
node *head=NULL;
node *tail=NULL;
while(data != -1){
node *newnode=new no... | ALGO | 0.999911 | 4.1382 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-04-13T18: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": "70b68ec180... |
4c3d7ee5-4aa9-4c65-9463-e1c799fed94f | NerdPotatoo/XPSC-Problems | Week11/Day7/E_Klee_s_SUPER_DUPER_LARGE_Array.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define fastIO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int mod = 1e9+7;
void sol... | ALGO | 0.999949 | 4.691152 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2024-10-26T15:51:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51bb13eb47... |
7bb5ec74-ba04-4c02-a3e7-e8b49b21378e | shahincsejnu/competitive-programming-solutions | Codeforces Solutions/1435B.cpp | #include <bits/stdc++.h>
#define lli long long int
using namespace std;
void solve()
{
int n, m;
cin >> n >> m;
int arr[n+5][m+5], brr[n+5][m+5], crr[m+5][n+5], drr[n+5][m+5];
vector<int> v;
map<int, pair<int,int>> mp;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= m; j++){
... | ALGO | 0.999953 | 3.871199 | {
"github_metadata": {
"branch": "master",
"commit_count": 158,
"repo_created_at": "2020-07-21T07:33:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22e96b58... |
a8ae4bee-0ef0-460d-9b2b-28d18cc719a0 | Computer-engineering-FICT/Computer-engineering-FICT | II семестр/Дискретна математика/Лаби/Архів/Лабки по Дискретке/Lab_8.cpp | // Diskretka 8.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <fstream>
#include <iostream>
void Choose();
void Route();
void Distance();
int Search(int, int);
void Min(int);
int Rout(int, int, int, int);
void Perev();
int Searchh(int, int, int);
//int Check(int, int, int);... | ALGO | 0.996396 | 3.352717 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2019-06-22T07:41:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "617064143... |
06e8df56-cddf-4525-9c3d-e9e46d31057a | Xilinx/SDAccel_Examples | getting_started/kernel_opt/array_partition_ocl/src/host.cpp | /**********
Copyright (c) 2018, Xilinx, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the fol... | ALGO | 0.986668 | 5.780947 | {
"github_metadata": {
"branch": "master",
"commit_count": 1731,
"repo_created_at": "2016-08-05T17:34:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 358,
"forks": 210,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3d5d... |
b0629fb6-f1fd-4f16-bb54-2031d351093b | thirofoo/atcoder-archives | abc161/abc161_d_42280633_AC.cpp | /*
* Author: through
* Submission URL: https://atcoder.jp/contests/abc161/submissions/42280633
* Submitted at: 2023-06-15 23:55:20
* Problem URL: https://atcoder.jp/contests/abc161/tasks/abc161_d
* Result: AC
* Execution Time: 420 ms
*/
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/al... | ALGO | 0.999638 | 4.301682 | {
"github_metadata": {
"branch": "main",
"commit_count": 5513,
"repo_created_at": "2022-12-17T09:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "2ade1c111... |
710ee525-6030-4045-92e8-439d1199fdb9 | BlueBug12/Parallel_Prog_2021 | hw4/part1/pi_block_tree.cc | #include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/types.h>
#include <unistd.h>
#include <math.h>
int main(int argc, char **argv)
{
// --- DON'T TOUCH ---
MPI_Init(&argc, &argv);
double start_time = MPI_Wtime();
double pi_result;
long long int tosses = atoi(argv... | ALGO | 0.999876 | 4.418999 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2021-09-16T03:12: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": "7419221b51f... |
a9a9be0d-4636-4680-848c-88403e686323 | sjtly16/learning-ds-algo | stacks/Nearest Smaller to left.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
//for getting input from input.txt
freopen("input.txt", "r", stdin);
//for writting output to output.txt
freopen("output.txt", "w", stdout);
#endif
int arr[] = {4, 5, 2, 10, 8};
stack<int> stc;
vector<int> vec;... | ALGO | 0.999994 | 4.552926 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2020-07-15T13:30:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23e003a04... |
a2417247-dfe3-4b0e-8449-d3dec1699792 | Vector-013/Algorithms_Laboratory-23 | Data_structures/Trees_leetcode/trees_camera.cpp | #include <iostream>
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
};
class Solut... | ALGO | 0.999823 | 5.720473 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-10-05T15:17: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": "b81a6fddf030... |
10a312b2-64ca-4ab7-b6ae-e16a99ba05f0 | liuyubobobo/Play-Leetcode | 0501-1000/0664-Strange-Printer/cpp-0664/main.cpp | /// Source : https://leetcode.com/problems/strange-printer/
/// Author : liuyubobobo
/// Time : 2020-10-16
#include <iostream>
#include <vector>
using namespace std;
/// Interval DP
/// Time Complexity: O(n^3)
/// Space Complexity: O(n^2)
class Solution {
public:
int strangePrinter(string s) {
vector... | ALGO | 0.999984 | 5.199329 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "50... |
37c4297a-6d74-4fa2-b1e1-8413bc1b6487 | cybo-neutron/DS-and-Algo | Graph/mColoringProblem.cpp | //m-ColoringProblem
//https://practice.geeksforgeeks.org/problems/m-coloring-problem/0
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define eb emplace_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fo(i,n) for(i=0;i<n;i++)
#define fok(i,k,n) for(i=k;i<n;i++... | ALGO | 0.999964 | 4.736717 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-07-08T07:25: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": "3ab34bf9e5... |
00dc2d64-55e2-42f7-9709-db69d4b963d3 | cg37/Carl-Training-Camp | day8第四章 字符串/151_反转字符串里的单词.cpp | #include "head.h"
class Solution {
public:
void reverse(string &s, int start, int end){
for(int i = start, j = end; i < j; i++, j--) {
swap(s[i], s[j]);
}
}
void removeExtraSpaces(string &s) {
int slow = 0;
for(int fast = 0; fa... | ALGO | 0.999919 | 5.555032 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2023-02-01T08:50:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbde912bc... |
1cc2e844-1018-4684-958b-ae8c8c1b15de | ishandutta2007/codeforces-m | moransky/normal/1076/D.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <queue>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long LL;
typedef pair<LL, int> PLI;
const int N = 300010, M = 300010;
const LL INF = 0x3f3f3f3f3f3f3f3f;
int n, m, k, numE = 1, head[N], fa[N], faEdge[N];
bool vis[N];
vect... | ALGO | 0.999997 | 4.060098 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "983e0d4783b7... |
153db3e2-dd5b-4bf1-bc1e-21cb9963ca89 | rahul-goel/CompetitiveProgramming | CodeForces/B/1312 B.cpp | /*
Created by <NAME>.
*/
#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
const int INF = 1000000000;
#define pii pair < int, int >
#defi... | ALGO | 0.999788 | 4.38701 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2020-01-05T10:18: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": "61f41a23... |
db796d7b-cf8e-42f8-9f38-ae59a66404db | Diusrex/UVA-Solutions | 10810 Ultra-QuickSort.cpp | #include <iostream>
#include <vector>
using namespace std;
long long count;
int array1[500005];
int array2[500005];
void mergesort(int *array, int len, int offset)
{
if (len > 1)
{
int *first = array1 + offset;
if (first == array)
first = array2 + offset;
for (in... | ALGO | 0.999901 | 4.042964 | {
"github_metadata": {
"branch": "master",
"commit_count": 188,
"repo_created_at": "2013-12-15T19:00:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 96,
"forks": 66,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4af8eb... |
17db5a03-e1ea-4c57-9d52-ceb80c4804a9 | anshgoyal1/CPP | Company_questions/toast/1.cpp | // https://leetcode.com/discuss/interview-question/2400437/Toast-oror-SDE-intern-(OA)-oror-Minimum-Absolute-Sum
#include <bits/stdc++.h>
using namespace std;
#define int long long
int median(vector<int> &a)
{
int n = a.size();
if (n & 1)
{
return a[n / 2];
}
else
{
return (a[n... | ALGO | 0.999985 | 5.523091 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-06-19T05: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": "27558b5fe... |
4cbdabc2-4e52-4cbb-99be-d92f23c8198b | Sidharth70754/Data_Structure_Algorithm | Difficulty: Medium/Fractional Knapsack/fractional-knapsack.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// class implemented
/*
struct Item{
int value;
int weight;
};
*/
class Solution {
public:
// Function to get the maximum total value in the knapsack.
double fractionalKnapsack(vector<int>& val, vector<int>& ... | ALGO | 0.999532 | 5.442942 | {
"github_metadata": {
"branch": "main",
"commit_count": 1222,
"repo_created_at": "2024-10-02T17:22:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23de888db... |
d031c672-b31d-400d-8f91-be6202720d40 | Drakcap/Uva | Contest Volumes/Volume CIX/10929.cpp | #include <stdlib.h>
#include <string.h>
#include <stdio.h>
int main()
{
char num[1000];
while (gets(num) != 0) {
int tam = strlen(num);
if (tam == 1 && num[0] == '0') break;
int conta = 0;
int sinal = 1;
int i;
... | ALGO | 0.994358 | 3.344343 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2013-03-30T15:32: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": "d2ca596f5f... |
60761cd6-a16c-45b6-ba2d-503c226bc410 | cww97/OJcww97 | luogu/luogu2819图着色.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 111;
int n, k, m, col[N], cnt;
vector <int> G[N];
bool canColor(int u, int c){ // col
for (int i = 0; i < G[u].size(); i++){
if (c == col[G[u][i]]) return false;
}
return true;
}
void dfs(int dep){
//printf("dfs(%d)\n", dep);
if ... | ALGO | 0.99995 | 4.177134 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-04-29T09:40: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": "f5020d9dae... |
4539b39a-05bc-4964-87f0-a5323e764179 | duongnhn/CodeForFun | Cpp/StringToInteger.cpp | // https://leetcode.com/problems/string-to-integer-atoi/
// 8. String to Integer (atoi)
// Medium
#include <string>
using namespace std;
class StringToInteger {
public:
int myAtoi(string str) {
bool is_negative = false;
int start = 0;
int length = str.length();
while (start < lengt... | ALGO | 0.999117 | 5.27334 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-09-18T03:14: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": "836b50c3e... |
3981e99a-d2d6-4f4b-8b74-55dcd9eee909 | dharve3/MATH2190 | modular/powerFast.cpp | // Improved version of power.cpp
// Using square and multiply algorithm to reduce computations
#include <iostream>
using namespace std;
long int exponentiation(long int base, long int exp, long int n) {
if (exp == 0)
return 1;
if (exp == 1)
return base % n;
long int t = exponentiation... | ALGO | 0.999992 | 5.567503 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2024-02-16T15:55: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": "3ab754e27... |
e6279c08-3592-4f8d-b032-c4f18bde8e78 | mdahtotul/phitron_course | c++ programming/Module 05.5 Practice/problem2.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
/*
Time complexity O(n^2)
Space complexity O(1)
*/
for (int i = 0; i < n; i++) //O(n)
for (int j = i; j > 0; j--)
cout << i << j;
return 0;
}
/*
Complexity,
===> Time: logn
from line 14
when j... | ALGO | 0.999624 | 3.781131 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2022-10-29T18:59:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dbff08e514... |
4c6860c4-9e46-4665-8569-df7feb6d51d2 | wavescholar/numerical_libraries | itpp/itpp-4.3.1/itpp/base/matfunc.h | /*!
* \file
* \brief Various functions on vectors and matrices - header file
* \author <NAME>, <NAME>, <NAME>, <NAME>
* and <NAME>
*
* -------------------------------------------------------------------------
*
* Copyright (C) 1995-2010 (see AUTHORS file for a list of contributors)
*
* This file is p... | ALGO | 0.998706 | 6.725236 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2012-11-30T14:19:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "105733a4... |
222db7c0-22e6-4e73-ba27-531d0c3266e2 | rboyer503/maze-game | MazeServer/Maze.cpp | #include <boost/bind.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <limits>
#include "Maze.h"
#include "MazeSession.h"
#include "AIAgent.h"
Maze::Maze() :
maze_matrix_(nullptr), world_matrix_(nullptr), game_in_progress_(false)
{
}
Maze::~Maze()
{
delete maze_matrix_;
delete world_matrix_;
}
... | ALGO | 0.932004 | 5.519411 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-07-12T01:25: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": "c49a794146... |
f906198f-cd91-4e92-801a-9170bdb60b35 | ercaoeatting/leetcode-recode | graph/110字符串接龙.cpp | #include <iostream>
#include <queue>
#include <unordered_map>
#include <unordered_set>
using namespace std;
int main() {
string beginStr, endStr, str;
int n;
cin >> n;
unordered_set<string> strSet;
cin >> beginStr >> endStr;
for (int i = 0; i < n; i++) {
cin >> str;
strSet.inser... | ALGO | 0.999983 | 3.865298 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2024-02-29T08:53:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d7f1dc1ee... |
30f0ea5c-aab3-46d6-bc2b-5cee72a067e7 | rose-compiler/rose | src/midend/programAnalysis/OpenAnalysis/Utils/UnionFindUniverse.C | // $Id: UnionFindUniverse.C,v 1.1 2004/07/07 10:26:35 dquinlan Exp $
// -*-C++-*-
// * BeginRiceCopyright *****************************************************
//
// Copyright ((c)) 2002, Rice University
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification,... | ALGO | 0.989169 | 6.474079 | {
"github_metadata": {
"branch": "weekly",
"commit_count": 23355,
"repo_created_at": "2015-04-24T20:54:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 644,
"forks": 136,
"issues": 59,
"pull_requests": 0
},
"file_meta": {
"content_id": "72... |
c600fc09-e1b5-44b6-8e36-87a375f6eb25 | KrazyManJ/mendel-algorithmization | data_structures/hash_table.cpp | #include <iostream>
#include <list>
using namespace std;
const unsigned int BUCKET = 7;
typedef int Type;
/**
* Normally linked list but I am lazy fuck XDD
*/
typedef list<Type> HashTable[BUCKET];
/**
* Creates hash from value, it can be anything but it has two rules:
*
* <ol>
* <li>It always returns the sa... | ALGO | 0.996074 | 4.970827 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2023-10-24T21:22:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "615bb98e4... |
79ed77b8-6e60-45fb-a241-a275ca49e488 | 3ein39/LeetCode_Solutions | 0230-kth-smallest-element-in-a-bst/0230-kth-smallest-element-in-a-bst.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lp(n) for(ll i = 0; i < (n); ++i)
#define lp1(n) for(ll i = 1; i <= (n); ++i)
#define tc ll testcase; cin>>testcase; while(testcase--)
#define all(v) (v).begin(), (v).end()
#define allr(v) (v).rbegin()... | ALGO | 0.999902 | 5.161898 | {
"github_metadata": {
"branch": "main",
"commit_count": 892,
"repo_created_at": "2022-12-05T19:33: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": "38b46f5617... |
6a5ab680-4d57-4de8-94ff-457482ba90c5 | wangfanstar/dsa | src/vector/Vector_search_fibonaccian_A.h | /******************************************************************************************
* Data Structures in C++
* ISBN: 7-302-33064-6 & 7-302-33065-3 & 7-302-29652-2 & 7-302-26883-3
* <NAME>, <EMAIL>
* Computer Science & Technology, Tsinghua University
* Copyright (c) 2003-2019. All rights reserved.
********... | ALGO | 0.999919 | 4.79591 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-03-08T05:23:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5deea2468f... |
af2c5965-a939-4679-b1a0-e6eb7a5b49d3 | camsas/firmament | src/sim/google_runtime_distribution.cc | /*
* Firmament
* Copyright (c) The Firmament 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
*
* ... | ALGO | 0.988235 | 6.431902 | {
"github_metadata": {
"branch": "master",
"commit_count": 2226,
"repo_created_at": "2011-08-10T04:34:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 413,
"forks": 77,
"issues": 24,
"pull_requests": 2
},
"file_meta": {
"content_id": "7064... |
b0fc510c-0161-433d-8d33-c6d8c024b0f1 | JasonB1833/busyWork | C++busyWork/Pong.cpp | // Pong.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <time.h>
#include <conio.h>
using namespace std;
// enum for direction
enum eDir { STOP = 0, LEFT = 1, UPLEFT = 2, DOWNLEFT = 3, RIGHT = 4, UPRIGHT = 5, DOWNRIGHT = 6 };
// class for the ba... | TOOL | 0.937132 | 4.223841 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-02-17T22:24: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": "b6284ae7a56... |
7701e079-c40c-48c2-af42-3a6bd16dce34 | Mr-Magnificent/ippc | leetcode/ReorderList_143.cpp | #include <bits/stdc++.h>
using namespace std;
// 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:
... | ALGO | 0.999992 | 6.174347 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-05-07T01:49:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b38a1b43b... |
79eeceab-8dba-4b7e-ba5f-339158ec3220 | rodea0952/competitive-programming | AtCoder/Company/ddcc2020-qual/A.cpp | #pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include... | ALGO | 0.999961 | 3.834601 | {
"github_metadata": {
"branch": "master",
"commit_count": 408,
"repo_created_at": "2019-08-15T06:22: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": "0ff74b24... |
e3065ace-75a4-4139-a3a4-ee9c14ceb43e | guider/Snorlax | leetcode/math/013-Roman-to-Integer.cpp |
#include <string>
#include <vector>
#include <unordered_map>
using namespace std;
/*
* 罗马数字转换成阿拉伯数字
*/
class Solution {
public:
int romanToInt(string s) {
// vector<int> arabic = {1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000};
// vector<string> roman = {"I", "IV", "V", "IX", "X... | ALGO | 0.999856 | 5.292923 | {
"github_metadata": {
"branch": "master",
"commit_count": 606,
"repo_created_at": "2021-06-16T06:44:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8ae812... |
2f36fb9a-17c4-454f-b7cc-fa0dbd46cc44 | LAKSHMANANSASIDHARAN/lakshmanan | codingday9.cpp | /*Today problem is maximum score after spliting the array
They have given the binary string we need split the string one by one
and count the number zero in leftstring and number one in rightstring and add it up . Do thin until the last char in a string
Example :
Input: s = "011101"
Output: 5
Explanation:
All possib... | ALGO | 0.99992 | 4.536335 | {
"github_metadata": {
"branch": "main",
"commit_count": 279,
"repo_created_at": "2025-01-05T17:05: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": "603b1f181f... |
47e5d753-3f72-4e71-ba2d-eee199da2f85 | dev-th-kang/ps | graph-algo/dijkstra/dijkstra-undirected.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#define INF 2147483646
#define ans(x) (x==INF? -1 : x)
using namespace std;
vector<pair<int, int>> mat[100001];
int cost[100001];
void dijkstraSearch(int sv) {
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pai... | ALGO | 0.999877 | 3.838447 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-09-13T16:44: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": "18741a38682... |
f70f8daf-96ff-4a4b-af83-40f61f682377 | GyanaramDhaka/assignment | assingnment27/question1.cpp | #include <iostream>
using namespace std;
class complex
{
private:
int real;
int imag;
public:
void setvalue(int a, int b)
{
real = a;
imag = b;
}
void showdata()
{
cout << "real =" << real << endl
<< "imag= " << imag << endl;
}
complex operator+(... | ALGO | 0.979184 | 4.328758 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-05-22T12:27: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": "710ceb80d9... |
5a7b0531-bb69-409e-9fd7-04c01893a06a | liukun2634/leetcode | hot-problem/sort/merge-sort.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <limits.h>
using namespace std;
void merge(vector<int>& nums, int left, int mid, int right){
vector<int> temp1(nums.begin() + left, nums.begin() + mid + 1); //注意这里需要到mid + 1, 不放入mid + 1
vector<int> temp2(nums.begin() + mid + 1, nums.begin() +... | ALGO | 0.999994 | 5.306623 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2021-07-22T14:32: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": "d53b3e10... |
2e6dcaf3-c684-4d05-a9aa-b72ba6cd5b69 | Lydxn/Competitive-Programming | DMOJ/heist.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> plli;
typedef pair<int, ll> pill;
typedef pair<pa... | ALGO | 0.999948 | 4.294637 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2021-04-25T03:16:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3efa6c20514... |
76c98b3c-f85b-4bf8-a438-80f136156125 | ishandutta2007/codeforces-d | duality/normal/1110/E.cpp | #define DEBUG 0
#include <bits/stdc++.h>
using namespace std;
#if DEBUG
// basic debugging macros
int __i__,__j__;
#define printLine(l) for(__i__=0;__i__<l;__i__++){cout<<"-";}cout<<endl
#define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl
#define printVar(n) cout<<#n<<": "<<n<<endl
#define printA... | ALGO | 0.999992 | 3.182287 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "5c937d549cd7... |
17be293c-cd52-4c34-96e6-99b06b95d0e7 | arnabs542/interviews | leetcode/934_shortest-bridge.cpp | //In a given 2D binary array A, there are two islands. (An island is a 4-directionally connected group of 1s not
// connected to any other 1s.)
//Now, we may change 0s to 1s so as to connect the two islands together to form 1 island.
//Return the smallest number of 0s that must be flipped. (It is guaranteed that the ... | ALGO | 0.999858 | 5.928679 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2021-01-15T05: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": "958360771... |
79303408-29ab-4a8e-bc4f-086685eafa91 | GTLIDAR/safe-nav-locomotion | motion_planner/drake/multibody/plant/implicit_stribeck_solver_results.h | #pragma once
#include "drake/common/default_scalars.h"
#include "drake/common/eigen_types.h"
namespace drake {
namespace multibody {
namespace internal {
/// This struct stores the results from a computation performed with
/// ImplicitStribeckSolver. See the ImplicitStribeckSolver class's documentation
/// for furth... | TOOL | 0.929566 | 7.043983 | {
"github_metadata": {
"branch": "master",
"commit_count": 141,
"repo_created_at": "2020-09-10T17:55:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 28,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adefdf04... |
43584746-ee95-47ba-bb44-ee3a3787853d | cubing/f2lfast | cpp/triggers.cpp |
vector<Alg> AUFs;
// Triggers are grouped by slot.
// This makes it easy to avoid applying triggers for a slot that is already solved;
const size_t NUM_SLOTS = 4;
vector<Alg> triggers[NUM_SLOTS];
enum F2LSlot {
SLOT_H_FL = 0,
SLOT_I_BL = 1,
SLOT_J_BR = 2,
SLOT_K_FR = 3
};
void init_algs() {
AUFs.push_bac... | ALGO | 0.962939 | 4.324818 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2015-07-21T20:06:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "92a5c47f6b5b... |
c922aec3-1a23-407e-a254-075885094ebb | Faiyaz-2021331021/Segment-Tree | App_of_Max_Number_In_Range.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define endl '\n'
#define pp pair<int,pair<int,int>>
#define asort(a,n) sort(a,a+n)
#define vsort(v) sort(v.begin(),v.end())
#define vrsort(v) sort(v.rbegin(),v.rend());
#... | ALGO | 0.999984 | 4.971178 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-03-04T14:59:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8793933da8d2... |
d9d853b2-58da-45f4-b41f-31d45cb5ce68 | GoodFloor/Studia | inzynier/pwr_sem5/Języki Formalne i Techniki Translacji/lab1/KMP/kmp.cpp | #include <iostream>
#include <fstream>
#include "automate.hpp"
using namespace std;
int leadingOnes(unsigned char n)
{
int t = 128;
int leadingOnes = 0;
while (n >= t && t > 0)
{
leadingOnes++;
n -= t;
t /= 2;
}
return leadingOnes;
}
int main(int argc, char const *argv... | ALGO | 0.988603 | 4.070417 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2024-03-15T16:35: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": "adf2356ceb6... |
7ba4e687-c957-427e-850d-93f9afef49b9 | wholaraib/CPPS | maps-tut/main.cpp | #include <iostream>
#include <iomanip>
using namespace std;
class batsman
{
private:
int bcode;
string bname;
int innings;
int notout;
int runs;
void calcAvg()
{
average = (float)runs / (innings - notout);
}
public:
float average;
void getData()
{
cout << "Enter the batsman code : ";
cin >> bcode;
c... | TOOL | 0.98046 | 4.623439 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-21T12:06: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": "27aa44cf2118... |
ebfb0398-111d-43ad-824f-583382f5ea24 | Balpreet1003/Codeforces | S_Search_In_Matrix.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <numeric>
#include <limits>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <list>
#inc... | ALGO | 0.999324 | 4.036709 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-05-22T10:59:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "753133873122... |
84fb0837-dbc4-47eb-abcb-6fa8b99b14e7 | Akiira/Test1 | src/SafeCrackerProgram4.cpp | //============================================================================
// Name : SafeCrackerProgram4.cpp
// Author : <NAME>
// Version : 4
// Class : CMPSC 462, programming assignment 2
// Description : Finds the fastest way to a target value by building a tree of all
// possible moves in... | ALGO | 0.998346 | 4.179143 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2013-12-04T22:47: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": "f516617abb... |
870d3d1c-7f39-49be-a11a-6de3177ed8f5 | 30-Days-code/Aryan | Question29.cpp | #include <iostream>
using namespace std;
void Heapify(int arr[], int n, int i)
{
int largest = i;
int l = 2*i + 1;
int r = 2*i + 2;
if(l < n && arr[l] > arr[largest]) // if left child is larger than root
{
largest = l;
}
if(r < n && arr[r] > arr[largest]) // if right child is la... | ALGO | 0.999926 | 4.74211 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2020-04-26T14:05:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5a241e821... |
1d112dda-1371-48ee-957f-bd5e5455aa14 | UFOsonzz/Competitive-Programming | VNOJ/KANDP.CPP | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 2300;
const int MAXM = 3600;
const int add = MAXN >> 1;
const int dx[8] = {2, 1, -2, -1, 2, 1, -2, -1};
const int dy[8] = {1, 2, -1, -2, -1, -2, 1, 2};
int kx, ky, px, py, turn;
int d[MAXN + 5][MAXN + 5];
bool vis[MAXN + 5][MAXN + 5];
int main() {
... | ALGO | 0.999968 | 4.455552 | {
"github_metadata": {
"branch": "main",
"commit_count": 174,
"repo_created_at": "2024-03-20T16:32: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": "2238c8e614... |
5d100ee2-24b0-469c-9071-3e97cbb4d199 | mit-gfx/diff_stokes_flow | cpp/core/src/shape/sphere.cpp | #include "shape/sphere.h"
#include "common/common.h"
template<int dim>
const real Sphere<dim>::ComputeSignedDistanceAndGradients(const std::array<real, dim>& point,
std::vector<real>& grad) const {
Eigen::Matrix<real, dim, 1> p;
for (int i = 0; i < dim; ++i) p(i) = point[i];
// dist = r - |c - p|.
... | ALGO | 0.997267 | 6.42065 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2020-07-05T15:44:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 44,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f60773dae... |
16424378-0375-4ac3-9595-292237a27952 | PaddlePaddle/Paddle | paddle/phi/kernels/custom/limit_by_capacity_kernel.cc | // Copyright (c) 2024 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... | TOOL | 0.920254 | 6.892917 | {
"github_metadata": {
"branch": "develop",
"commit_count": 54743,
"repo_created_at": "2016-08-15T06:59:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 23037,
"forks": 5770,
"issues": 1009,
"pull_requests": 823
},
"file_meta": {
"content_... |
d5343455-d771-43ba-b6ce-1a6497f47af8 | cap-nascimento/competitive-programming-solutions | uri/solutions/2001 - 2500/2097.cpp | /*
<NAME>'s solution
Don't copy this, try for yourself
*/
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define vi vector<int>
#define ii pair<int, int>
#define ll pair<long long, long long>
#define st first
... | ALGO | 0.999511 | 3.9806 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2021-01-20T14:05: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": "3889c6d62bb... |
345c00e5-c074-4c96-94bc-657b0e5208e0 | KeithDonoghue/InterviewPrep | LeetCodeProblems/test/LeetCode85Test.cpp | #include <catch2/catch.hpp>
#include "leetCode85.h"
TEST_CASE("LeetCode 85 - Maximal Rectangle", "[leetcode85]") {
Solution85 solution;
SECTION("Example 1") {
std::vector<std::vector<char>> matrix = {
{'0', '0', '0', '1', '0'}, {'0', '0', '0', '1', '0'},
{'0', '0', '0', '1', '0'}, {'0', '0', ... | TEST | 0.981674 | 7.251114 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2025-01-30T15:58: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": "45af79a63... |
f2fc63aa-f087-47ac-a56f-b834289a3670 | cdriscoll817/ComputerGraphics7 | Courtney_Driscoll_15207755/quat.cpp | /*
* quat.cpp
* marchingCubes
*
* Created by <NAME> on 06/05/2010.
* Copyright 2010 School of Computer Science and Informatics. All rights reserved.
*
*/
#include "quat.h"
#include<iostream>
#include<cmath>
quat::quat():real(1.0f),imag(Vector(0,0,0)){
}
quat::~quat(){
}
quat::quat(float* matrix){
real = ... | ALGO | 0.982618 | 4.46915 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-06-16T00:46:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c60dfac612a9... |
b12df461-509b-4d70-9859-3911ae7b24e5 | ishandutta2007/codeforces-o | onionpringles/normal/666/B.cpp | #pragma warning(disable:4996)
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#include <complex>
#include <random>
#include <time.h>
#include <tup... | ALGO | 0.99995 | 3.227796 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:45: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": "7865a3d39703... |
2c82bcda-93ed-4781-a1b2-874c2416ce89 | isopropylcyanide/Competitive-Programming | code-cpp/fenwick_tree.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> A, B;
// Returns sum of A[0..index] (Range Sum)
int pointSum(int index){
int sum = 0;
index = index + 1;
while (index > 0){
sum += B[index];
index -= index & (-index);
}
return sum;
}
int rangeSum(int l, int r){
return ... | ALGO | 0.999853 | 5.250453 | {
"github_metadata": {
"branch": "master",
"commit_count": 179,
"repo_created_at": "2015-12-31T07:54:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d136b... |
27db65f0-d56a-4d28-8d74-c10a924f5294 | ethz-adrl/control-toolbox | ct_models/include/ct/models/HyA/generated/forward_dynamics.impl.h |
// Initialization of static-const data
template<typename TRAIT>
const typename iit::ct_HyA::dyn::tpl::ForwardDynamics<TRAIT>::ExtForces
iit::ct_HyA::dyn::tpl::ForwardDynamics<TRAIT>::zeroExtForces(Force::Zero());
template<typename TRAIT>
iit::ct_HyA::dyn::tpl::ForwardDynamics<TRAIT>::ForwardDynamics(iit::ct_HyA:... | ALGO | 0.997729 | 5.519217 | {
"github_metadata": {
"branch": "v3.0.2",
"commit_count": 1871,
"repo_created_at": "2019-04-25T21:55:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1596,
"forks": 332,
"issues": 59,
"pull_requests": 4
},
"file_meta": {
"content_id": "45... |
36480d91-a632-440a-8f7d-6cd76b29f793 | nishantydv97/competitive_coding | GeeksForGeeks/NutsAndBoltsProblem.cpp | /*
Given a set of N nuts of different sizes and N bolts of different sizes. There is a one-one mapping between nuts and bolts. Match nuts and bolts efficiently.
Comparison of a nut to another nut or a bolt to another bolt is not allowed. It means nut can only be compared with bolt and bolt can only be compared with n... | ALGO | 0.999955 | 5.297628 | {
"github_metadata": {
"branch": "master",
"commit_count": 348,
"repo_created_at": "2017-08-27T04:15:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a64900a... |
2be4c898-7d35-4a75-9088-e5110494e2a8 | PragmaticWays/cplusplus2 | rainfall-statistics-2/RainfallStatsMod.cpp | #include <iostream>
#include <string>
#include <iomanip>
using namespace std;
double getTotal(double[], int);
double getAverage(double[], int);
double getLowest(double[], int, int&);
double getHighest(double[], int, int&);
void sortList(double[], string[], int);
const int MONTHS = 12;
string months[MONTHS] = { "Janua... | TOOL | 0.998753 | 4.814989 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-01-25T05:13:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a39277cf90... |
921cc19a-18f4-49a1-8236-fa03c74d4f4d | k2font/atcoder | gks_rB_C.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<ll, ll>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, -1, 0, 1};
string char_to_string(char val) {
return string(1, val);
}
int ... | ALGO | 0.999649 | 4.180035 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-07-08T09:21: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": "098b55130... |
10a62853-1fcb-47b1-8b71-4bf525233265 | Ahmedsabib/Problem_Solving | CSES/Dynamic Programming/Projects.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {
ios_base::sync_with_stdio(0), cin.tie(0);
int n;
cin >> n;
vector<int> a(n), b(n), c(n);
map<int, int> mp;
for (int i = 0; i < n; ++i) {
cin >> a[i] >> b[i] >> c[i];
b[i]++;
mp[a[i]];
mp[b[i]];
}
int... | ALGO | 0.99986 | 4.256003 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2024-02-11T13:12: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": "4298c67462c... |
0171006d-87de-48d0-b8af-2c5b4bff2987 | demondragon07/dsa-gfg | Medium/Merge k Sorted Arrays/merge-k-sorted-arrays.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
#define N 105
using namespace std;
void printArray(vector<int> arr, int size)
{
for (int i=0; i < size; i++)
cout << arr[i] << " ";
}
// } Driver Code Ends
//User function Template for C++
class Solution
{
private:
void merge(vector... | ALGO | 0.999902 | 5.90389 | {
"github_metadata": {
"branch": "main",
"commit_count": 506,
"repo_created_at": "2023-03-14T13:45: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": "3dfd3ea725... |
ed0c6402-3bf2-4244-a5e2-9f823c9dca2a | dishant4163/A2Z-DSA-Striver | Step-16 Dynamic Programming (Patterns and Problems)/Lec-3 2D or 3D DP & DP on Grids/01_NinjasTraining.c++ | // 2D-DP | Ninja's Trainig
/*// Problem-Link-> https://www.naukri.com/code360/problems/ninja%E2%80%99s-training_3621003
int ninjaTraining(int n, vector<vector<int>> &points) {
// Write your code here.
vector<int> prev(4, 0);
prev[0] = max(points[0][1], points[0][2]);
prev[1] = max(points[0][0], po... | ALGO | 0.999864 | 5.679244 | {
"github_metadata": {
"branch": "main",
"commit_count": 732,
"repo_created_at": "2024-07-30T12:22:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce90d4acc8... |
4935acc1-990f-422a-8922-b7f677b521d9 | bluedawnstar/algorithm_study | library/succinct/waveletTreeBitVector.h | #pragma once
#include "bitVectorRank.h"
template <typename T>
struct WaveletTreeBitVector {
static const T NaN = numeric_limits<T>::min();
struct Node {
T valLow, valHigh; // value range (not index), inclusive
BitVectorRank rank;
Node* left;
Node* right;
// [fir... | ALGO | 0.999443 | 6.46959 | {
"github_metadata": {
"branch": "master",
"commit_count": 1274,
"repo_created_at": "2016-12-10T02:41:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 58,
"forks": 8,
"issues": 58,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ba69... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.