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 |
|---|---|---|---|---|---|---|---|
f3555448-e591-4337-9699-854ca23bd8c6 | Alok-meena/dsa_codes | STACK/max_rectangle_area.c++ | Max rectangle
Difficulty: HardAccuracy: 36.43%Submissions: 111K+Points: 8
Given a binary matrix mat[][] of size n * m. Find the maximum area of a rectangle formed only of 1s in the given matrix.
Examples:
Input: mat[][] = [[0, 1, 1, 0],
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1... | ALGO | 0.99998 | 6.453358 | {
"github_metadata": {
"branch": "main",
"commit_count": 1460,
"repo_created_at": "2024-03-15T13:17:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf64efc14... |
007e944f-770c-431b-8fcf-2bf2999b6b18 | mswetha1708/ComputerGraphics | Lab 5/Q1.cpp | #include<GL/glut.h>
#include<bits/stdc++.h>
using namespace std;
void init()
{
// Set display window color to as glClearColor(R,G,B,Alpha)
glClearColor(0, 0., 0., 0.1);
// Set projection parameters.
glMatrixMode(GL_PROJECTION);
// Set 2D Transformation as gluOrtho2D(Min Width, Max Width, Min Heig... | ALGO | 0.99878 | 3.866 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2020-10-31T16:56:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34ef5cb105f... |
71794dac-5462-48cb-8342-91f2e1d815c0 | jeffreyfox/LeetCode | Algorithms/126_word_ladder_ii.cc | /*
Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such that:
Only one letter can be changed at a time
Each intermediate word must exist in the word list
For example,
Given:
beginWord = "hit"
endWord = "cog"
wordLi... | ALGO | 0.99999 | 5.831172 | {
"github_metadata": {
"branch": "master",
"commit_count": 946,
"repo_created_at": "2015-01-25T05:18:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c75d6cb8... |
4a555a39-340f-474e-88aa-1b6eb06e0394 | Ishanis-CoderMan/1-1000-Leetcode-Solutions | 0210. Course Schedule II/0210.cpp | enum class State { kInit, kVisiting, kVisited };
class Solution {
public:
vector<int> findOrder(int numCourses, vector<vector<int>>& prerequisites) {
vector<int> ans;
vector<vector<int>> graph(numCourses);
vector<State> state(numCourses);
for (const vector<int>& prerequisite : prerequisites) {
... | ALGO | 0.999998 | 6.635098 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-06-03T06:03: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": "3e715abb65... |
19b5c9fd-8201-4093-b613-e827cc99a1bc | sunyz/Cam_leetcode_group | 496. Next Greater Element I-easy/qianyuan_star5.cpp | // 执行用时 : 16 ms, 在Next Greater Element I的C++提交中击败了97.15% 的用户
// 内存消耗 : 9.2 MB, 在Next Greater Element I的C++提交中击败了60.57% 的用户
// 思路简单,Nothing to say,标准答案使用栈,但表达太罗嗦了
class Solution {
public:
vector<int> nextGreaterElement(vector<int>& nums1, vector<int>& nums2) {
std::unordered_map<int, int> map;
for(in... | ALGO | 0.999909 | 5.031913 | {
"github_metadata": {
"branch": "master",
"commit_count": 174,
"repo_created_at": "2019-03-19T16:01:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6955bc78... |
7efb982f-fec0-4733-ac76-7309cc0c7ee8 | Connor-Sun/HetNet_model | UserEquipment.cpp | //
// Created by sunka on 2019/3/6.
//
#include "UserEquipment.h"
using namespace std;
UserEquipment::UserEquipment() {
setLocation( 0, 0 );
}
UserEquipment::UserEquipment(const int x, const int y ) {
setLocation( x, y );
}
void UserEquipment::setLocation(const int x, const int y) {
xCoordinate = x;
... | ALGO | 0.95599 | 4.098213 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-03-31T08:38: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": "17ec6138bc... |
4e04e918-7620-4018-8df3-e85bdeb6edef | jakubszpilowski/jipp2 | arrays_pointers/array/src/arr.cpp | //
// Created by Lenovo on 19.10.2021.
//
#include "arr.h"
/**Funkcja zwraca losową wartość z przedziału <a,b>
* @param a począte przedziału
* @param b koniec przedziału
* @return liczba losowa <a,b>
*/
int randomInt(int a, int b){
int x = rand() % (b - a) + a;
return x;
}
/**Funcja wyświetlająca tablice... | ALGO | 0.984094 | 4.286327 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2021-10-11T08:14: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": "1d8dd2b72... |
c87b2464-95ef-4ca2-a37a-96544c73bd90 | MaheenShahzad/Coin-Collector-Game | main.cpp | #include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <iostream>
#include <vector>
using namespace std;
using namespace sf;
const int n = 3;
const int m = 3;
const float cellSize = 50.0f;
int maxCoins(int board[][m], vector<vector<int>>& coin_tracker, int i, int j) {
if (i >... | ALGO | 0.998254 | 5.568389 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-31T17:39:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcf22e380046... |
f76fc3d2-0ed6-4591-bfa8-c9a22a748a05 | Archit669/data-structures-and-algorithms | dsa/2 arrays/assignment 2/9_minimum_platforms_problems-gfg.cpp | // { Driver Code Starts
// Program to find minimum number of platforms
// required on a railway station
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
//Function to find the minimum number of platforms required at the
//railway station such that no train waits... | ALGO | 0.999935 | 5.131085 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2022-04-24T10:26:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b08f8ff... |
0984229f-227c-4b73-9b3e-1b14aaca45f7 | UtkarshChharba/DSA-And-Solutions | DS ALGO/Coding Ninjas/Priority Queues/Assignment/check_max_heap.cpp | #include <bits/stdc++.h>
#include <vector>
using namespace std;
#define int long long
#define pi (3.141592653589)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define loopb(i,a,b) for(int i=b;i>=a;i--)
#define mod 1000000007
#define endl '\n'
#define pii pair<int, int>
#define w(t) int t;cin>>t;while(t--)
#define mii map<i... | ALGO | 0.999762 | 4.106451 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-11-12T09:44: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": "7607f873e... |
ba04dfd9-ca3b-49b2-9da8-157cd4927c1e | Antinust/LeetCodeProblemsAlgorithm | Demo/lc/DFS_BFS/DFS/MinPathSum.hpp | //
// MinPathSum.hpp
// Demo
//
// Created by Zhuo,Chuncai on 2022/3/11.
// Copyright © 2022 Zhuo,Chuncai. All rights reserved.
//
#ifndef MinPathSum_hpp
#define MinPathSum_hpp
#include <stdio.h>
#include "PublicCommon.h"
namespace MinPathSum {
/*
用dfs递归可以解决,看下别人是否有更 简便高效的方法
*/
class Solution {
public:
c... | ALGO | 0.999824 | 5.452496 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2022-04-04T08:45:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74241cb0d39... |
7b5f2ba8-e2a8-4370-9075-6123d40e5d25 | Sanchit-panday/Self-Paced-DSA | Sorting/insertion_sort.cpp | #include <stdio.h>
void insertion_sort(int arr[], int n);
int main() {
int n;
printf("Enter the size of array: ");
scanf("%d", &n);
int arr[n];
printf("Enter %d elements:\n", n);
for(int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
insertion_sort(arr, n);
printf("Sorted ... | ALGO | 0.999873 | 5.126048 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-04-07T22:32: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": "5bc9289c3db... |
fbb09168-e4a2-4055-9b55-ec752765de1a | veins/space_veins | lib/inet/src/inet/common/math/CompoundFunctions.h | //
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will... | TOOL | 0.989875 | 7.741635 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2021-11-03T14:45:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f60084509... |
6a1039ef-e739-4ae1-9177-63d6a8ca44e5 | joshualass/CP | Solutions/OJ/Kattis/allkill.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
ll MOD = 998244353;
ll exp(ll b, ll p) {
ll cnt = 1;
while (p) {
if (p % 2 == 1) {
cnt = (cnt * b) % MOD;
}
b = (b * b) % MOD;
p >>= 1;
}
return cnt;
}
ll ... | ALGO | 0.999986 | 5.323853 | {
"github_metadata": {
"branch": "main",
"commit_count": 426,
"repo_created_at": "2023-03-13T21:46:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1961b5f9b7... |
a7f3a1cc-9f79-4fb8-b0b6-e47faeb9581c | boatbod/op25 | op25/gr-op25_repeater/lib/op25_yank.h | #ifndef INCLUDED_SWAB_H
#define INCLUDED_SWAB_H
#include <stdint.h>
#include <algorithm>
/**
* Yank in[bits[0]..bits[bits_sz]) to out[where,where+bits_sz).
*
* \param in A const reference to the source.
* \param bits An array specifying the ordinals of the bits to copy.
* \param bits_sz The size of the bits arra... | ALGO | 0.925698 | 6.283983 | {
"github_metadata": {
"branch": "master",
"commit_count": 1854,
"repo_created_at": "2017-09-10T23:29:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 385,
"forks": 110,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "77... |
e177f654-1005-4202-bf9e-b90e7c77290f | kichico/Multilane_Revised_S-NFS_model | Multilane_Revised_S-NFS_model/Lane_Change.cpp | #include "Lane_Change.h"
void Lane_Change::TurnonLaneChangersSignal() {
//std::cout << "-----------------------------------" << std::endl;
Lanechanger = std::vector<LaneChangerInformation>(0);
CanditateLeadingCar = std::vector<CanditateAroundVehicle::Detected>(constants.Numberoflane);
MeasuredThisTime.NumberofLane... | ALGO | 0.968122 | 4.444664 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2021-06-04T06:48: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": "6519c602b... |
648925c0-45aa-4b68-83ae-2b9cc0809d01 | nxtsourav7/Competitive-Programming | CodeChef/START-138/Prefix_Suffix_Inequality.cpp | /**
* author : nxtsourav7
* created : 2024-06-12 21:07:06
**/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
int32_t main() {
cin.tie(0)->sync_with_stdio(0);
auto nxts... | ALGO | 0.999673 | 4.618526 | {
"github_metadata": {
"branch": "main",
"commit_count": 271,
"repo_created_at": "2023-06-20T13:35:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed438d946e... |
6d768111-d3a2-4893-9e2b-ba3b74c61fc8 | Wagenod/Yandex_C_plus_plus_development | white_belt/week 2/countries.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
using namespace std;
void print(const map<char, int>& m){
for (const auto& item: m)
cout << item.first << " " << item.second;
}
int main(){
int n;
cin >> n;
string operation_code;
map<string,string> countries; // б... | ALGO | 0.97321 | 4.088574 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-09-27T14:17: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": "9304c8311... |
1469db35-72c7-4936-8c8b-24585c85d2c4 | ayushman-25/Codechef-Submissions | LAZER.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
struct Point {
ll x;
ll y;
};
bool onSegment(Point p, Point q, Point r) {
if(q.x <= max(p.x, r.x) && q.x >= min(p.x, r.x) && q.y <= max(p.y, r.y) && q.y >= min(p.y, r.y))
return true;
return false;
}
int orientation(Point p, Point q, Point r) {
... | ALGO | 0.999966 | 4.078133 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-11-19T13:57:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "555e94271... |
ee2dac86-cb3e-41bf-9739-efa3a5254334 | Gabriel765324/Carpeta | CSES/Investigation.cpp | #include "bits/stdc++.h"
using namespace std;
long long m = 1000000007;
vector< vector< pair<long long, long long> > > Grafo;
vector<long long> d, c, Menor, Mayor;
vector<bool> v;
vector<long long> Dijkstra(){
set< pair<long long, long long> > Cola;
Cola.insert(make_pair(-1, 0));
d[0] = 0;
c[0] = 1;
... | ALGO | 0.999923 | 3.912364 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-06-22T21:22: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": "18251c6573e2... |
2edeba6a-ef2a-4638-aa5a-5b6f65dfc718 | Ajatshatru21/CP2_CIPHERSCHOOLS | BinaryTreeZigzagLevelOrderTraversal.cpp |
#include<iostream>
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.999998 | 5.986045 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-08-13T15:06: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": "b9d3ae0d6... |
ef2889db-2702-4269-9777-c223dd944800 | FNCRosse/PUCP-2024-1 | ALGORITMIA Y ED/EXAMENES/ALG EX1 2023_2 P2(PilasPrioridad)/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on 21 de agosto de 2023, 11:57 AM
*/
#include <iostream>
#include "Cola.h"
#include "Pila.h"
using namespace std;
#include "funcionesCola.h"
#include "funcionesPila.h"
#define N 13
void ImprimirFases(const Cola &cola,const Pila &pila1,const Pila pila2){
cout<<... | ALGO | 0.99908 | 4.481983 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-19T14:11:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78f8029bcc04... |
4b7c2596-ea76-40a5-9c2a-8e9294172153 | Qipu1220/BaiTapMang1Chieu | 23520493_23521082_23521462_23521604_23521672_BT03/Bai112/Bai112.cpp | #include <iostream>
#include <iomanip>
using namespace std;
void Nhap(int a[], int& n);
int TanSuat(int[], int, int);
int TimGiaTri(int[], int);
void LietKe(int[], int);
int main()
{
int a[500];
int k;
Nhap(a, k);
cout << "Cac gia tri thoa man la : ";
LietKe(a, k);
}
void Nhap(int a[], int& n)
{
cout << "Nhap n... | ALGO | 0.999663 | 3.393018 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-10-04T12:45: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": "c4b537f181e... |
fab3385b-3282-4f7c-a246-3f77841f8a19 | ru-ccmt/eDMFT | src/impurity/ctqmc/bathp.h | // @Copyright 2007 <NAME>
//
class BathProb{
public:
int N_ifl;
vector<double> BathP;
public:
BathProb(const vector<double>& BathProbability, const ClusterData& cluster): N_ifl(cluster.N_ifl), BathP(N_ifl){
for (int ifl=0; ifl<cluster.N_ifl; ifl++){
for (int i1=0; i1<cluster.ifl_dim[ifl]; i1++){
for ... | ALGO | 0.988954 | 4.086876 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2024-03-29T22:52:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29,
"forks": 3,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "943ac523e... |
36dca6ec-1c4f-4506-934b-0f7d4432bff3 | caryhooper/adventofcode | 2022/10/10.cpp | #include <bits/stdc++.h> //std::stoi, size_t
class CathodeRayTube{
private:
public:
size_t cycles;
ssize_t regX;
size_t signal_count;
std::vector<ssize_t> signals;
//Pass in a string by reference to parse by a ' ' character. Returns all characters up to the ' '
... | ALGO | 0.998365 | 5.791236 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2020-12-08T10:22: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": "905649b24... |
d4a05057-b5ba-4456-9107-8111f09264ea | Supriyo-455/KPIT-Nova-CPP-assignment | cpp-nova-assignment-2-main/bitmap.cpp | #include <iostream>
#include <cstring>
#include "bitmap.h"
using namespace std;
Student::Student()
{
// code here
}
Student::Student(int r, const char *n, int m1, int m2, int m3, int m4, int m5) // here m1,m2,m3,m4 and m5 are marks in each subject
{
// code here
rollno = r;
strcpy(name, n);
marks[0] = m1;
marks... | TOOL | 0.927798 | 3.931622 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-08-01T17:57: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": "2e287a6d0386... |
078a0d13-a70a-439e-aefc-452f31c35100 | Ahad-41/Competitive-Programming | Problem-Soving/LightOJ/1028.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> Pair;
#define all(a) (a).begin(), (a).end()
void answer();
const ll N = 1e6+7;
bool check[N];
vector<ll> prime;
void sieve() {
for (ll i = 3; i < N; i += 2)
if (!check[i])
for (ll j = i*i; j < N; j +=... | ALGO | 0.996568 | 4.792069 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2024-06-13T08:58: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": "0f2c5ef54f... |
0f41f84b-8687-4a92-b14c-6bacedd9511a | emon4075/CodeForces | D_Divisible_Pairs.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define PB push_back
#define All(V) V.begin(), V.end()
#define F first
#define S second
const int MOD = 1e9 + 7;
const int INF = INT_MAX;
void FASTIO()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
}
int main()
{
FASTIO(... | ALGO | 0.999725 | 4.533612 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2023-09-14T14:12: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": "636e188d... |
9fa0624d-2771-49dd-95c8-77c33d749dbd | pwqbot/functional-programming-in-cpp | chapter-02/average-score/main.cpp | #include <iostream>
#include <numeric>
#include <vector>
#if 0
// Imperative version
double average_score(const std::vector<int> &scores)
{
int sum = 0;
for (int score: scores) {
sum += score;
}
return sum / (double) scores.size();
}
#endif
// Calculating the average score with std::accumula... | ALGO | 0.999489 | 7.382143 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-11-03T13:27:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf7f5f3f1524... |
59a0b11b-bb8b-453e-958d-c89be9ce7e72 | figor0/cursera-yellow | Weak2/BusDecomp/main.cpp | #include <iostream>
//#include "buse_decomposition.h"
#include <string>
#include <iostream>
#include <cassert>
#include <vector>
#include <map>
using namespace std;
class BusManager;
enum class QueryType {
NewBus,
BusesForStop,
StopsForBus,
AllBuses
};
struct Query {
QueryType type;
string bus;
string stop;... | ALGO | 0.936408 | 5.119211 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-09-01T17:17: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": "0e79fa88a... |
1ba7aae1-1ecb-4f47-8441-c521f7ffd926 | Faysal-star/CF_AC | codeforces/1673/A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t ; cin >> t ;
while(t--){
string s ;
cin >> s ;
int arr[s.length()] ;
arr[0] = s[0] - 'a' + 1 ;
for(int i = 1 ; i < s.length() ; i++) arr[i] = arr[i-1] + s[i] - 'a' + 1 ;
if(s.length() & 1){
... | ALGO | 0.999812 | 3.412003 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2022-06-25T16:19: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": "5fc2b727... |
cd6e5aa9-8196-41a8-a741-90575c364cf0 | daid/librouge | ui/src/vertical.cpp | #include "r/ui/vertical.h"
#include "r/ui/element.h"
namespace r::ui {
void Vertical::update(std::vector<std::unique_ptr<Element>>& children, Recti r)
{
int min_height = 0;
int extra_height = 0;
int inf_count = 0;
for(auto& c : children) {
min_height += c->layout.min_size.y + c->layout.margin... | TOOL | 0.948584 | 5.785494 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2023-02-24T14:39:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b209c21c414... |
3a01b67f-3036-453e-99cd-1011d6a64750 | AnimeshSinha1309/algorithms-notebook | ques/adhoc/p2121.cpp | /**
* @Problem
* A hexadecimal representation of the walls around each cell of a maze are
* given. Print the visualization of this grid.
* @Reference
* https://icpcarchive.ecs.baylor.edu/index.php?option=onlinejudge&page=show_problem&problem=122
* implementation
*/
#include <iostream>
#include <stack>
using nam... | ALGO | 0.998696 | 4.720286 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2020-02-26T06:41:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 5,
"issues": 18,
"pull_requests": 3
},
"file_meta": {
"content_id": "e46202a... |
7183f026-a187-4f11-ade4-d27b1fa69bb9 | paulo/compprog | cses/1746/1746.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
const int MAXM = 105;
vector<int> v(MAXN);
int n, m;
vector<vector<int>> mem(MAXN, vector<int>(MAXM, -1));
int dp(int i, int prev) {
if (i == n) return 1;
if (mem[i][prev] != -1) return mem[i][prev];
if (v[i] != 0) {
if (pr... | ALGO | 0.999992 | 4.08421 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2019-11-23T12:35: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": "53ffd544e... |
422f7a88-cf63-4685-819e-890d4000baa2 | Artazik/algoritms239 | technocup2022e.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <iomanip>
#include <queue>
#include <set>
#include <map>
using namespace std;
#pragma GCC optimize("O3")
#define debug(x) cout << #x << " is " << x << '\n';
#define ld long double
const int mod = 998244353, N = 1e5 ... | ALGO | 0.999887 | 4.276195 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-03-21T14: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": "aed536a8f11... |
95224ee2-b33f-45f3-a45e-3d501c05457c | xinkuleee/cp-lib | Basic/simu.cpp | db rnd(db l, db r) {
static uniform_real_distribution<db> u(0, 1);
static default_random_engine e(rng());
return l + (r - l) * u(e); // u(rng);
}
db eval(pair<db, db> x) { ... }
void simulate_anneal() {
pair<db, db> cur(rnd(0, 10000), rnd(0, 10000));
for (double k = 10000; k > 1e-5; k *= 0.99) {
// [st... | ALGO | 0.99996 | 4.377788 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-03-23T10:48: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": "d1e1c80f24c... |
b885560f-a7dc-4387-bfe7-f562a1f59752 | UdaySharmaGitHub/DSA-CPP | GFG/Basic Problems/Union_of_two_array.cpp | /*
Given two arrays a[] and b[] of size n and m respectively. The task is to find the number of elements in the union between these two arrays.
Union of the two arrays can be defined as the set containing distinct elements from both the arrays. If there are repetitions, then only one occurrence of element should be pr... | ALGO | 0.999942 | 5.250105 | {
"github_metadata": {
"branch": "main",
"commit_count": 292,
"repo_created_at": "2023-11-19T16:25:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adfb15aebe... |
71bcb89c-86f9-4d62-9d23-6b570656da76 | AlekseyKhaleev/ASD_Lab3 | main.cpp |
#include "Utils.h"
#include "BTree.h"
int main(int argc, char* argv[])
{
NextRand(time(nullptr)); // инициализируем генератор случайных числел
BTree myTree(50,100); // создаем бинарное дерево с 50-ю вершинами и случайными значениями, не большими 100
std::cout<<"Generated ordered binary tree:\n\n";
m... | ALGO | 0.992603 | 3.779533 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-01-17T01:59: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": "3cfe28dfaba4... |
072e1826-8355-402b-badf-4866e5c3bf19 | Jimish18/DSA_Practise | matrix/shortestPathInGridWithObstaclesElimination.cpp | /*
Question - Shortest Path in a Grid with Obstacles Elimination
Link - https://leetcode.com/problems/shortest-path-in-a-grid-with-obstacles-elimination/
*/
#include <bits/stdc++.h>
using namespace std;
int shortestPath(vector<vector<int>>& grid, int k)
{
int n = grid.size();
int m = grid[0].size();
vec... | ALGO | 0.999974 | 5.371922 | {
"github_metadata": {
"branch": "main",
"commit_count": 654,
"repo_created_at": "2022-04-01T19:26: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": "f3d5df87b6... |
5a5a27b3-33c3-4748-b3d8-87d4a79a23ae | kiraclf/leetCodePractice | String/22_GenerateParen.cpp | #include <vector>
#include <string>
using namespace std;
class Solution {
public:
vector<string> generateParenthesis(int n) {
vector<string> ans;
string temp = "";
dfs(n, n, 0, temp, ans);
return ans;
}
void dfs(int leftCount, int rightCount, int currentLeftCount, string &c... | ALGO | 0.999964 | 5.674726 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2020-08-27T16:08: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": "81889598... |
908ed8fe-c9b6-48bc-8e9e-b8d13cb44eb9 | xymeng16/leetcode | code/128.longest-consecutive-sequence.cpp | #include <algorithm>
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
// start_marker
struct Comp {
bool operator()(const int &lhs, const int &rhs) const { return (lhs < rhs); }
};
class Solution {
public:
int longestConsecutive(vector<int> &nums) {
std::unordered_set<int> hashset(nums.be... | ALGO | 0.999932 | 5.503205 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-08-01T08:53: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": "a767785e6f3... |
c44bc6e4-af2f-42dc-9b7e-602f5e1c28d9 | ryotaro612/at_c | src/arc018/b.cc | #ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define as_int(a) static_cast<int>(a)
#ifdef ONLINE_JUDGE
int main() {
int n;
cin >> n;... | ALGO | 0.999869 | 4.771246 | {
"github_metadata": {
"branch": "master",
"commit_count": 2006,
"repo_created_at": "2019-07-01T03:51: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": "eee6112... |
2ac24f3e-a167-419d-b508-e9a401f75f60 | zimpha/competitive-programming | algorithmic-engagements/2009/dro.cc | #include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using int64 = long long;
const int N = 50000 + 10;
std::vector<std::pair<int, int>> edges[N];
int64 f[N], g[N];
int deg[N];
void update(int64 &x, int64 y) {
if (x < y) x = y;
}
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int ... | ALGO | 0.999711 | 3.546293 | {
"github_metadata": {
"branch": "master",
"commit_count": 352,
"repo_created_at": "2016-08-17T16:37:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3945cc... |
5e7072f1-a1ab-4b80-91ae-a128695beb7a | max-exner/TURBOdeb | c_implementation/src/enigma.cpp | /**
* @file enigma.cpp
* @author <NAME> (<EMAIL>)
* @brief
* @version 0.1
* @date 2019-04-19
*
* @copyright Copyright (c) 2019
*
*/
#include "checkingMachine.hpp"
#include "enigma.hpp"
using namespace std;
// Set
bool Enigma::b_rotateToNextPos()
{
char c_nextDrumPos[DRUMARRAY_YSIZE];
char c_curr... | ALGO | 0.998113 | 4.786499 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-06-28T19:11:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4333b7ed9... |
6ad002cc-1ef9-4ad4-a76d-5aa93ae161db | JQCRAK/Trabajos-Estructura-de-Datos | Estructura de Datos/Examen 2 parcial/Arbol/Ejercicio001.cpp | using namespace std;
#include <iostream>
#include "ArbolBinario.h"
void iterativeInOrder(ArbolBinario& arbol) {
NodoBinario* current = arbol.getRaiz();
NodoBinario* stack[100];
int top = -1;
while (current != NULL || top != -1) {
while (current != NULL) {
stack[++top] = current;
... | ALGO | 0.999695 | 5.702332 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2025-03-05T15:59: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": "46aa8ab11c... |
5a445d9e-6cae-482f-9ceb-ec26c4aceb9f | rongjx3/online_camera_stab | app/src/main/cpp/processor/Quaternion.cpp | //
// Created by ShiJJ on 2020/4/15.
//
#include "Quaternion.h"
Quaternion::Quaternion(const double w, const double x, const double y, const double z)
: w_(w), x_(x), y_(y), z_(z){
}
Quaternion Quaternion::Add(const Quaternion& other) const {
return Quaternion(w_+other.w_, x_+other.x_, y_+other.y_, z_+oth... | ALGO | 0.993161 | 5.03059 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-08-10T08:41:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ad055700d... |
aac32b38-fde4-4835-88f0-0fe1ee59b8b7 | algoribi/algorithm-study | Programmers/Kakao-coding-teat/2021/pg_광고삽입.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
long long time_stamp[360010] = {0};
string solution(string play_time, string adv_time, vector<string> logs) {
int plays = (play_time[0] - '0') * 36000 + (play_time[1] - '0') * 3600 + (play_time[3] - '0') * 600 + (play_time[4] - '0') * 6... | ALGO | 0.999131 | 4.968451 | {
"github_metadata": {
"branch": "master",
"commit_count": 439,
"repo_created_at": "2020-04-08T04:36: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": "f09473df... |
6eb0513e-955c-4af9-a8cd-31cd855e10d7 | MehediMim/2_1_DSA_2_CODES | WEE8_RedBlackTree/2105142_MAP.cpp | #include <bits/stdc++.h>
using namespace std;
#include "color.hpp"
struct node
{
int key;
string value;
node *left;
node *right;
node *parent;
char color;
node(int key, string value)
{
this->key = key;
this->value = value;
left = NULL;
right = NULL;
... | ALGO | 0.998435 | 5.341528 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-03-03T11:40: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": "7c9dfb2976c7... |
cd3a3ed7-a5dc-4800-ba55-64d0ef6f24db | Tanvir-831/computer_Grapics_Lab | Lab Codes/Liang_Barsky.cpp | #include <iostream>
#include <graphics.h>
using namespace std;
void drawColoredLine(int x1, int y1, int x2, int y2, int color)
{
setcolor(color);
line(x1, y1, x2, y2);
setcolor(WHITE);
}
void liangBarsky(int x1, int y1, int x2, int y2, int xmin, int ymin, int xmax, int ymax)
{
int p[4], q[4];
int dx... | ALGO | 0.979766 | 3.870268 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-06-01T18:43: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": "62e8770a1ec6... |
d99e1e67-c264-47c4-87cf-de865e2e09ed | travisdesell/tao | asynchronous_algorithms/asynchronous_newton_method.cxx | /*
* Copyright 2012, 2009 <NAME> and the University of North Dakota.
*
* This file is part of the Toolkit for Asynchronous Optimization (TAO).
*
* TAO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, eit... | ALGO | 0.997741 | 3.412881 | {
"github_metadata": {
"branch": "master",
"commit_count": 257,
"repo_created_at": "2012-05-15T02:46:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a93d84a... |
cbdf181a-030d-4fb8-b28e-c24d8c6c7ba6 | imtiaz1710/competitive-programming | codeforces/codeforces contest/codeforces ladder/c18.cpp | // #include <bits/stdc++.h>
// #define ll long long
// #define us unsigned short int
// #define fin freopen("/home/imtiaz/Desktop/in.txt", "r", stdin)
// #define fout freopen("/home/imtiaz/Desktop/out.txt","w", stdout)
// #define dbg(x) cerr << #x << ": " << x << endl
// #define fastio ios::sync_with_stdio (false); cin... | ALGO | 0.99997 | 4.066 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-11-01T15:12:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc3098427040... |
cd44c0e0-dc34-468f-b4a3-18ec24c32c7b | Akkkshattt-Sharrrmaaa/DSA | DSA before queue/linked_list_palindrome_check.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node * next;
node(int data){
this->data = data;
this->next = NULL;
}
};
node * reverseList(node * head){
node* prev = NULL;
node* current = head;
node* fwd = head->next;
while(curre... | ALGO | 0.999692 | 5.546679 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-07T11:15: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": "a351c0cfdfae... |
e33e1c7e-83b8-4e66-8d1a-669c8c0048e4 | Huloiarnata/OODP_Practical_SRM25 | week5/ques2.cpp | /*Create a class to print the area of a square and a rectangle. The class has two
functions with the same name but different number of parameters. The function for
printing the area of rectangle has two parameters which are its length and breadth
respectively while the other function for printing the area of square has... | TOOL | 0.916425 | 5.675873 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-31T04:44: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": "de24554a866f... |
cd451879-d863-4f46-87da-2c9c4d6d9086 | Trevorchenmsu/LeetCode-Solutions | 5_Longest_Palindromic_Substring.cpp | /*
solution 1: central line scan
time: O(n^2)
space: O(1)
*/
class Solution {
public:
string longestPalindrome(string s) {
string res = "";
if (s.empty()) return res;
for (int i = 0; i < s.length(); i++) {
string oddPalindrome = getPalindromeFrom(s, i, i);
if... | ALGO | 0.999989 | 6.24928 | {
"github_metadata": {
"branch": "master",
"commit_count": 230,
"repo_created_at": "2020-06-18T15:06:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65518f8e... |
fa998e0e-d9f5-4a5f-93bf-fed8cd9bcc41 | aanupam29/codeforces-problems | 222C - Reducing Fractions.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long int
#define ulli unsigned long long int
#define li long int
#define ff(i,a,b) for(int i=a;i<b;i++)
#define fb(i,b,a) for(int i=b;i>=a;i--)
#define w(t) while(--t >= 0)
#define l(s) s.len... | ALGO | 0.999988 | 3.47415 | {
"github_metadata": {
"branch": "master",
"commit_count": 912,
"repo_created_at": "2020-04-21T05:12:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01376ed... |
a2218a06-9454-475b-9807-f3fa9cd13493 | spaceandtimefdn/blitzar | sxt/multiexp/index/partition_marker_utility.cc | /** Proofs GPU - Space and Time's cryptographic proof algorithms on the CPU and GPU.
*
* Copyright 2023-present Space and Time Labs, Inc.
*
* 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... | ALGO | 0.939749 | 6.96628 | {
"github_metadata": {
"branch": "main",
"commit_count": 559,
"repo_created_at": "2023-06-12T18:27:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5010,
"forks": 153,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57ff42... |
9d0afbb9-f752-4a58-aad4-7fafb9eeba04 | Pajk/nagel-schreckenberg | src/track.cc | /*
* Datum: 20.5.2013
* Autor: <NAME>, <EMAIL>
* Projekt: DP - Kalibrace mikrosimulacniho modelu dopravy
*/
#include <cstdlib>
#include <iostream>
#include <ctime>
#include "track.h"
#include "car.h"
#include "car_factory/car_factory.h"
#include "cell.h"
#include "world.h"
#include "config.h"
Track::Track(Co... | ALGO | 0.98143 | 4.827415 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2013-03-03T23:40:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "363fb7d71... |
d8932c4e-1944-4d45-abc7-fffef432b4dc | mberakaya/Travelling-Salesman-Problem | main.cpp |
#include <iostream>
#include <sstream>
#include <algorithm>
#include <fstream>
#include <iterator>
#include "Path.h"
using namespace std;
# define INF 0x3f3f3f3f
template <class Container>
void split1(const string& str, Container& cont)
{
istringstream iss(str);
copy(istream_iterator<string>(iss),
is... | ALGO | 0.999665 | 3.553191 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-03-09T00:49:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42e45aef87... |
28a895b2-3eed-4b9d-b52a-52b20bd540bf | Ryadav0654/DSA | Linked List/Circular LinkedList/initialisationDoublyCircular.cpp | #include<iostream>
using namespace std;
class Node {
public:
Node* prev;
int data;
Node* next;
// constructor
Node(int val){
this-> data = val;
this-> prev = NULL;
this -> next = NULL;
}
};
void Print(Node* tail){
Node* temp = tail;
if(tail == NULL){
... | ALGO | 0.99344 | 4.771577 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-06-11T16:57: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": "0195f10183eb... |
5d3ed635-baa7-4d72-972f-a765991fad0d | subhasish/Algo | 05.Array/17.IsSudokuValid.cpp | /*
* 17.IsSudokuValid.cpp
*
* Problem: Given a partially filled Sudoku, determine whether it is a valid one or not
*
* Created on: Sep 9, 2017
* Author: subha
*/
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
bool HasDuplicate(VVI& sudoku, int start_row, in... | ALGO | 0.999225 | 5.714464 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-10-23T17:03: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": "1821987d0a... |
45dd0754-fc4b-46b6-bbb9-edf79b37f8f9 | jacklov3/Algorithm_implementation | DATASTRUCT/Binary_Tree.h | //
// Created by fish on 2019-07-01.
//
#ifndef ALGORITHM_BINARY_TREE_H
#define ALGORITHM_BINARY_TREE_H
#include <cstdio>
#include <cstdlib>
#include <math.h>
#include <iostream>
#include <stack>
using namespace std;
typedef int Status;//状态
#define ERROR 0
#define OK 1
typedef char TElemType;
typedef struct TNode{... | ALGO | 0.999795 | 3.936701 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-06-26T13:02: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": "678ed6dba... |
2caad1b9-5000-4bd7-a0be-92d04305b679 | Genomics-GPU/Genomics-GPU | CDP/CLUSTER/oneAPI/func.h | #ifndef FUNCH
#define FUNCH
#include <iostream>
#include <fstream>
#include <ctime>
#include <vector>
#include <cstring>
#include <algorithm>
#include <CL/sycl.hpp>
struct Option {
std::string inputFile;
std::string outputFile;
float threshold;
int wordLength;
};
struct Read {
std::string name;
... | DATA | 0.905022 | 3.83089 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-03-20T18:24:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b800e5f6783... |
a072d1b5-bcf9-4370-bb0d-6c6e3000b57f | RisshabSingla/LeetCode-C-Solutions | 1568-pseudo-palindromic-paths-in-a-binary-tree/pseudo-palindromic-paths-in-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999954 | 5.686224 | {
"github_metadata": {
"branch": "main",
"commit_count": 2390,
"repo_created_at": "2023-06-13T15: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": "900f9ba64... |
e2797440-37e3-464e-b0cc-6513e24f4145 | SiliconEngine/AdventOfCode2021-CPP | AdventOfCode2021-Day22/AdventOfCode2021-Day22.cpp | /**
* AdventOfCode2021-Day22.cpp : Advent of Code 2021, Day 22 (parts 1 and 2)
*
* NOTE: The solutions for 2021 aren't as cleaned up and well documented as other
* years I've done.
*
* @author <NAME>
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <reg... | ALGO | 0.994699 | 4.546552 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-03-14T00:03: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": "47112a7cbc... |
e302c337-9a2b-4240-a85a-dc313c22e12d | ankitdeb11/myDSAjourney100PlusDaysOfCode | CPP practice/BinarySearch/binarySearch.cpp | #include <iostream>
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int binarySearch(int arr[], int size, int key)
{
int start = 0, end = size - 1;
int mid = start + (end-start)/2;
while (start <= end)
{
if (arr[mid] == key)
{
return mid;
}
... | ALGO | 0.999704 | 5.07898 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2023-02-10T17: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": "e557ebed01... |
d198bd1b-8cb4-4ef7-b740-a19cd4f1fc88 | spin0za/mesh-segmentation | meshlib/algorithm/topology/Integration/LinearCombination.h | /*! \file LinearCombination.h
* \brief Algorithm for lineary combining holomorphic 1-forms on a mesh
* \author <NAME>
* \date Documented on 1/29/2011
*/
/********************************************************************************************************************************
*
* LinearCombination Clas... | TOOL | 0.907106 | 4.939277 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-05-06T14:27:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 11,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f325f81... |
a61fe65d-9a7a-4488-946f-2a75a67055db | MohamadAshrafSalama/User-Stories-generation | Code_Snippets/241-250/s302936762.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <numeric>
#define ll long long
#define mod 1000000007
#define mod1 998244353
using namespace std;
//vector<int>adj[200000+1];
int cnt=0;
vector<int>cand;
bool prime[100006];
void SieveOfEratosthenes(int n)
{
memset(prime, true, sizeof(prime));
... | ALGO | 0.999989 | 5.162404 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-06-04T17:01: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": "24e2059c8a46... |
30498d7b-7569-4983-b50a-d4f803ad39ab | ucb-bar/onnxruntime-riscv | onnxruntime/core/providers/nuphar/mti_x86/math/softmax_internal.cc | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "core/providers/nuphar/mti_x86/math/softmax_internal.h"
#include "core/codegen/mti/math/binary_ops.h"
#include "core/codegen/mti/math/reduce_ops.h"
#include "core/codegen/mti/math/unary_ops.h"
#include "core/prov... | ALGO | 0.99868 | 7.409388 | {
"github_metadata": {
"branch": "2021-12-23",
"commit_count": 5229,
"repo_created_at": "2019-11-16T10:07:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 88,
"forks": 35,
"issues": 26,
"pull_requests": 54
},
"file_meta": {
"content_id": "... |
d892aeff-f41d-43e4-b6e1-c3d710016db2 | GP101/2016 | CppUnderstanding/CppOcw/CppOcw_containerAndIterator3_algorithm.cpp | #include <stdio.h>
struct Sum
{
void operator()(int n) { sum += n; }
int sum{ 0 };
};
template<class InputIt, class UnaryFunction>
UnaryFunction for_each(InputIt first, InputIt last, UnaryFunction f)
{
for (; first != last; ++first) {
f(*first);
}
return f;
}
template<typename T>
class my... | ALGO | 0.99552 | 5.752099 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2016-05-03T12:54:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aac790a02... |
c1ddd28d-2284-4c66-916c-c8a45d8ff1e0 | ilee2914/schoolprojectsandmore | vision/IraLeeHomework2/unionfind.h | // <NAME>
#ifndef UNION_FIND
#define UNION_FIND
#include <cstdlib>
#include <string>
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
struct Node{
int value = -1;
Node* prev = nullptr;
vector<Node*> next;
};
class UnionFind {
public:
Node* find(int num) {
Node* node;
aut... | ALGO | 0.99944 | 4.669468 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-06-22T00:08: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": "0c4c9f0262... |
9041d22a-e13e-4f44-a8d2-52cae3fe8c54 | marcosvichialo/xanela03 | xanela03.ino | /*
Programa para simular a función dunha ventana de un automovil, da maneira
simplificada. O pulsador acciona o motor de subida o ser premido. unha
segunda pulsación para o motor e unha terceira fai que se accione o motor de baixada.
Añádense 2 finais de carreira (pin 5,pin 6), un para subida e outro para baixada.
E... | TOOL | 0.958376 | 5.809414 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-02-08T13:37: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": "8c37c9c66a79... |
022ad40a-2fe3-48e4-a432-9b788a86e34d | khalwsh/Competitive-Programming | data structure/k-d tree/manhattan distaince , min , max.cpp | const int N = 1e5 + 10;
ll n , x[N] ,y[N];
ll get_max() {
ll mn1 = LLONG_MAX, mx1 = LLONG_MIN;
ll mn2 = LLONG_MAX, mx2 = LLONG_MIN;
// transform: u = x + y, v = x - y;
for (int i = 0; i < n; i++) {
ll u = x[i] + y[i];
ll v = x[i] - y[i];
mn1 = min(mn1, u);
mx1 = max(m... | ALGO | 0.999924 | 3.978202 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2023-10-30T13:22:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a954696e... |
73d24592-ce81-4822-b135-bf2d1a93c020 | abhi1vaishnav/CPP | assignment_2/a2_q2.cpp | #include <iostream>
int main();
int main(){
double a{};
double b{};
double c{};
double d{};
double e{};
double f{};
double g{};
double h{};
std::cout << "Enter the first number in the matrix: ";
std::cin >> a;
std::cout << "Enter the second number in the matrix: ";
... | ALGO | 0.997755 | 3.834647 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2021-10-29T05:51:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aeb290a8c62... |
c4c2ad5b-9162-442f-9423-c6d9aaabe546 | mlarson98/ECE-173 | Assignment 9/Q 1 prime factor function.cpp | /*Q.1 Write a program that takes a positive integer from the user and calls a function to compute all
the prime factors of the entered integer. The called function should also displays those factors on the
screen. For example if the user enters 12 the program output should be: 1, 2, 3. */
#include <stdio.h>
//Retur... | ALGO | 0.999542 | 3.375408 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-05-01T01:02: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": "d856f9788... |
276d6705-3039-4c22-98e9-f08492796f57 | blakesullivan/Tafe-Work | SortClass/Trunk/sort-class/ManageSortCharacters.cpp | //<NAME> - Manage Sort Characters
#include "ManageSortCharacters.h"
#include "SortCharacters.h"
#include <iostream>
#include <windows.h>
using namespace std;
ManageSortCharacters::ManageSortCharacters()
{
do
{
Manage();
} while (true==Replay());
}
void ManageSortCharacters::Manage()
{
if (1==InputOption("What w... | TOOL | 0.991427 | 4.725492 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-11-04T00:27: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": "75eda7c1d5... |
74fd37c9-ef1f-4b00-b5b5-5227a3aa3c45 | SophieLabs/Information-Theory-Potts-Model | src/sim_dos_gte_et.cpp | #include "../include/model.hpp"
#include "../include/defs.hpp"
#include "../include/stats.hpp"
#include "../include/wanglandau.hpp"
#include "../include/version.hpp"
#include "../include/utils.hpp"
#include <clara.hpp>
#include <fmt/format.h>
#include <vector>
#include <algorithm>
#include <random>
#include <omp.h>
#i... | ALGO | 0.994205 | 6.286903 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-06-08T10:01: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": "5206de541d... |
2425bcff-cef2-4c19-aa9b-6bcdb0fead45 | Saifullah-Zakaib/CodSoft | To_do_list.cpp | #include <iostream>
#include <vector>
using namespace std;
class Task
{
public:
string name;
string status;
Task(string name, string status = "Pending")
{
this->name = name;
this->status = status;
}
};
class Task_option
{
public:
vector<Task> tasks;
void Task_add(Task tas... | TOOL | 0.901151 | 5.868483 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-10-19T16:52:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe53ebfc98b2... |
0e24b6ff-ba03-4cff-b558-aeb2d0a863db | JunhyunKang/studing_algorithm | boj/5.cpp | #include <iostream>
#include <queue>
#include <utility>
using namespace std;
int main(void){
int x, y;
cin>>x>>y;
if(x<2 || y <2){
cout<<-1<<'\n';
return 0;
}
int check[x][y];
int i,j;
for(i=1;i<=x;i++){
for(j=1;j<=y;j++){
check[i][j]=0;
}
} ... | ALGO | 0.999981 | 4.019235 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-05-02T02:52:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5fbfcfcbc3... |
a6c7da35-dec1-474d-8fba-5f62731f475f | SHY-Corp/LeetCode-Solutions | C++/682.BaseballGame.cpp | class Solution {
public:
int calPoints(vector<string>& ops) {
//stack for storing the record
stack<int> s;
int sum = 0;
for(int i=0; i<ops.size(); i++)
{
if((ops[i])=="+")
{
//storing the top element(to be pushed later) before popping... | ALGO | 0.999838 | 6.595127 | {
"github_metadata": {
"branch": "master",
"commit_count": 1745,
"repo_created_at": "2020-09-21T15:16:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 245,
"forks": 536,
"issues": 21,
"pull_requests": 2
},
"file_meta": {
"content_id": "d26... |
ef80c2fe-e757-4b78-bb30-a9c566b007fa | gwdina/CSCI261_Labs | Set 2/L2B/main.cpp | /* CSCI 261 Lab 2 B: RPS: Human vs. Computer part 2
*
* Author: <NAME>
* Skip Days Used: 0
* Skip Days Remaining: 5
* Resources used ():
* /
*
*
* rock, paper, scissors match against computer, the computer will choose at random (range: 0-2), will give the name of the output
*/
#include <iostream>
#include <cstdlib... | ALGO | 0.948748 | 3.524668 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-05T00:08: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": "c91fd3054999... |
1453090a-738a-46f7-bd3b-1311d45f9bca | KarlFreecss/LRBC | contest/2017-10-12-2016Dahka/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define siz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define foreach(it,a) for(__typeof((a).begin()) it=(a).begin();it!=(a).end();it++)
#define rep(i,a,b) for (int i=(a),_ed=(b);i<_ed;i++)
#define per(i,a,b) for (int i=(b)-1,_ed=(a);i>=_ed;i--)
#define pb... | ALGO | 0.999871 | 3.771043 | {
"github_metadata": {
"branch": "master",
"commit_count": 132,
"repo_created_at": "2017-03-06T05:30:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2df5637... |
b4d4af49-7f18-41c9-865c-0e8f58228964 | hypre-space/hypre | src/FEI_mv/femli/mli_solver_parasails.cxx | /******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
* HYPRE Project Developers. See the top-level COPYRIGHT file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
***************************************... | ALGO | 0.999766 | 6.068709 | {
"github_metadata": {
"branch": "master",
"commit_count": 12337,
"repo_created_at": "2018-11-19T20:42:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 763,
"forks": 210,
"issues": 132,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
febdc2b4-a67e-44bd-9dfa-8811fa8f1b46 | ebagli/ECHARM_CXX | process/bethe_bloch/src/ECHARM_process_bethe_bloch.cpp | //
// ECHARM_process_bethe_bloch.cpp
//
//
// Created by <NAME> on 31/07/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#ifdef _ECHARM_process_bethe_bloch_h
#include "ECHARM_process_bethe_bloch.hh"
#include "ECHARM_distribution_gauss.hh"
ECHARM_process_bethe_bloch::ECHARM_process_bethe_blo... | ALGO | 0.976248 | 5.086117 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2014-09-03T16:41:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "918ec2e94... |
9c52f1a9-fec0-46ef-a953-7192b0865602 | muratcancicek/Assignment-Projects | CS325/mc4233_hw1/SelectionAlgorithm.cpp | /* Coded by <NAME> S004233 Computer Science */
#include "SelectionAlgorithm.h"
SelectionAlgorithm::SelectionAlgorithm()
{
}
SelectionAlgorithm::SelectionAlgorithm(int k)
{
this->k = k;
}
void SelectionAlgorithm::sort(int* array, int n)
{
for (int i = 0; i < n - 1; i++)
{
for (int j = i + 1; j < n; j++)
{
i... | ALGO | 0.999913 | 4.481067 | {
"github_metadata": {
"branch": "master",
"commit_count": 978,
"repo_created_at": "2016-05-04T02:20:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f11137cf... |
986ad34a-29b7-4a43-a60d-5866ce75839c | robertozg/sort | insertionsort/insertionsort.cpp | #include <stdlib.h>
#include <ctime>
#include <iostream>
using namespace std;
#define N 50000
double tiempo_inicio;
double tiempo_termino;
void insertionSort (int numbers[], int array_size)
{
int i, j, index;
for (i=1; i < array_size; i++){
index = numbers[i];
j = i;
while ((j > 0) && (numbers[j-1] > index... | ALGO | 0.999631 | 4.510141 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-01-23T04:00:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3e4546b92... |
75536e42-7da1-486a-9560-595aa401eddf | JM-Mushraf/DSA-Problem-Solving | BT problems/checkForBalanceOfBT.cpp | #include <iostream>
using namespace std;
struct node
{
int data;
struct node *left;
struct node *right;
};
class tree
{
public:
struct node *createNode(int data)
{
struct node *root = new struct node();
root->data = data;
root->left = NULL;
root->right = NULL;
... | ALGO | 0.999972 | 4.799261 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2024-11-22T12:14: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": "514f1d673aa... |
e43c3557-b95f-4e10-b840-32676419e681 | ColorlessBoy/leetcode | 689.三个无重叠子数组的最大和.cpp | /*
* @lc app=leetcode.cn id=689 lang=cpp
*
* [689] 三个无重叠子数组的最大和
*/
/*
* Note:
* state: 还需要选 state 个不重叠子数组;
* index: 选 以nums[index]开头 的子数组 作为 第一个子数组。
* 0. sums[index] 表示以 nums[index] 开头长度为k的子数组 的和。
* 1. dp[state][index] = sums[index]
* + max_{next_index} dp[state-1][next_index]。
* 2. dp[0][index] 非常特别,... | ALGO | 0.999928 | 6.134579 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-07-29T11:22:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e269cc789... |
9b3ffd20-e37f-4b25-9b66-018baa4a50b5 | NayiniAkash/c-programming- | assignment day 2 que4 c program.cpp | #include <stdio.h>
int main() {
int arr[100], n, max_diff = 0, i, j;
// read the number of elements in the array
printf("Enter the number of elements: ");
scanf("%d", &n);
// read the elements of the array
printf("Enter the elements: ");
for (i = 0; i < n; i++) {
scanf("%d", &arr[... | ALGO | 0.999693 | 4.979944 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-04-04T15:17: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": "1459360e0abb... |
edbbddcc-b6f9-47b7-9721-d5e461f7406b | kaigian/LeetCodeCpp | LeetCodeCpp/LeetCodeCpp/leetcode-18.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
vector<vector<int>> fourSum(vector<int>& nums, int target) {
sort(nums.begin(), nums.end());
int len = nums.size(), sum = 0;
vector<vector<int>> result;
for (int i = 0; i < len - 3; i++) {
//如果nums[i]前面出现过... | ALGO | 0.999978 | 5.215143 | {
"github_metadata": {
"branch": "master",
"commit_count": 239,
"repo_created_at": "2019-10-12T16:12: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": "fdb4e70b... |
8193dc5d-cc4e-425c-a8a9-ed8b9d07eebc | kimh060612/KimALGO | Desktop/AlgorithmPS/1005.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main()
{
int T;
cin >> T;
for (int t = 0; t < T; t++)
{
int N, K, D;
int A[1001] = { 0, };
int Time[1001] = { 0, };
vector<int> E[1001];
queue<pair<int, int>> Q;
int input_edge[1001] = {0, };
cin >> N >> K;
for (int i ... | ALGO | 0.99994 | 3.974558 | {
"github_metadata": {
"branch": "main",
"commit_count": 750,
"repo_created_at": "2020-12-21T02:25: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": "14ef367b9d... |
483f589f-9291-49bf-a814-847f8b048cdc | RosettaCommons/rosetta | source/src/protocols/enzdes/EnzRepackMinimize.hh | // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// (c) Copyright Rosetta Commons Member Institutions.
// (c) This file is part of the Rosetta software suite and is made available under license.
// (c) The Rosetta software is developed by the co... | TOOL | 0.997354 | 6.706234 | {
"github_metadata": {
"branch": "main",
"commit_count": 11737,
"repo_created_at": "2023-11-17T16:42:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 296,
"forks": 100,
"issues": 27,
"pull_requests": 9
},
"file_meta": {
"content_id": "14df... |
8feb7410-1b43-49c0-8ec4-0a510bdd533a | WebKit/WebKit-http | Source/JavaScriptCore/dfg/DFGCFAPhase.cpp | /*
* Copyright (C) 2011-2018 Apple 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 conditi... | ALGO | 0.967785 | 7.466321 | {
"github_metadata": {
"branch": "master",
"commit_count": 231005,
"repo_created_at": "2011-01-11T13:50:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4992,
"forks": 1983,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
1157a713-e1be-4836-b006-16349df3c8dc | kth-competitive-programming/kactl | stress-tests/data-structures/Treap.cpp | #include "../utilities/template.h"
#include "../../content/data-structures/Treap.h"
pair<Node*, Node*> split2(Node* n, int v) {
if (!n) return {};
if (n->val >= v) {
auto pa = split2(n->l, v);
n->l = pa.second;
n->recalc();
return {pa.first, n};
} else {
auto pa = split2(n->r, v);
n->r = pa.first;
n-... | TEST | 0.980213 | 4.872114 | {
"github_metadata": {
"branch": "main",
"commit_count": 984,
"repo_created_at": "2017-05-28T21:22:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2974,
"forks": 819,
"issues": 51,
"pull_requests": 17
},
"file_meta": {
"content_id": "e673... |
c9fd1f45-0d52-461d-bfb8-5e347d5dc80b | qiaotian/CodeSprint | leetcode/cpp/399_evaluate_division.cpp | /*
Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the answer does not exist, return -1.0.
Example:
Given a / b = 2.0, b / c = 3.0.
queries are: a / c = ?, b / a = ?, a / e = ?, ... | ALGO | 0.999896 | 5.87565 | {
"github_metadata": {
"branch": "master",
"commit_count": 675,
"repo_created_at": "2016-02-12T17:26:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3bc3d70... |
db08f27b-369a-4d82-aa42-65e7425f2312 | shivankdixit111/Cosmic-Coders-75-days-challenge. | 0313-super-ugly-number/0313-super-ugly-number.cpp |
// lc
#define ll long long int
#define vi vector<ll>
#define vvii vector<vi>
#define vpii vector<pair<ll,ll>>
#define vs vector<string>
#define pii pair<ll,ll>
#define mii map<ll, ll>
#define umii unordered_map<ll, ll>
#define minpq(a) priority_queue<a,vector<a>,greater<a>>
#define maxpq(a) priority_queue<a>
#define... | ALGO | 0.99996 | 5.186022 | {
"github_metadata": {
"branch": "main",
"commit_count": 1164,
"repo_created_at": "2024-02-02T17:15:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19d5b9821... |
8317fb11-deff-4745-bee5-f2939c3663c7 | aroradev314/competitive_programming | practice_old/jumpingThroughSegments.cpp | #include <iostream>
#include <vector>
using namespace std;
void test_case() {
int n;
cin >> n;
vector<int> l(n), r(n);
for (int i = 0; i < n; i++) {
cin >> l[i] >> r[i];
}
int left = 0, right = 1e9;
while (left <= right) {
int k = left + (right - left) / 2;
pair<int, int> cur = {0, 0};
bool works =... | ALGO | 0.999989 | 4.865471 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-10-18T18:34: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": "a69a588adcda... |
1cff19dc-a2bb-440d-ba2b-bcf3af40fbe3 | deepsea-inria/pbbs-pctl | include/hull.hpp | // This code is part of the Problem Based Benchmark Suite (PBBS)
// Copyright (c) 2011 <NAME> and the PBBS team
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, incl... | ALGO | 0.999878 | 5.541156 | {
"github_metadata": {
"branch": "master",
"commit_count": 313,
"repo_created_at": "2015-12-29T12:56:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e897f025... |
758e48c1-6a4c-4b32-879f-5f79fcb884a7 | GaussGreen/old-code | arm/ARMProject/armgenpricer/gp_closedforms/gpclosedforms/VolBondMinMaxProxy.h |
#ifndef _GP_CF_VBPROXY_H
#define _GP_CF_VBPROXY_H
/// this header has to come first
/// as env.h defines pre-processor constants for checking and validation
/// namely for std::vector<double> and ARM_Matrix
#include "gpbase/env.h"
#include "gpbase/port.h"
#include "gpbase/rootobject.h"
#include "gpbase/gpvector.h"
#... | ALGO | 0.976431 | 5.140157 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-02-17T09:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c254120688b8... |
f943ca7a-a1e9-43d4-93c4-0877942b5556 | LanZBoY/LeetCodeWithCpp | 2463.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution
{
private:
long long minDistance(int robotIdx, int factoryIdx, vector<int> &robot, vector<int> &flattenFactory, vector<vector<long long>> &memo)
{
if (robotIdx == robot.size())
return 0;
i... | ALGO | 0.99995 | 5.474432 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2023-09-27T01:28: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": "13c593e8e19... |
94bf82e2-ef73-4715-9831-2c6cd1a8be43 | k1rep/algorithm-template-cpp | prim.cpp | //
// Created on 2024/2/18.
//
#include <iostream>
#include <vector>
using namespace std;
class Graph{
private:
int n;
vector<vector<int>> graph;
public:
explicit Graph(int n){
this->n = n;
graph.resize(n, vector<int>(n, -1));
}
void add_edge(int u, int v, int w){
graph[u][v]... | ALGO | 0.999988 | 5.297803 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2024-02-16T09:12: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": "63094fbc9f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.