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 |
|---|---|---|---|---|---|---|---|
2a39823d-af21-4984-8754-f4e88d515797 | MFRSiam/Vectorized-loops | main.cpp | #include <iostream>
#include <random>
#include <chrono>
#include <functional>
#include "src/vFor.hpp"
long long timeFunction(const std::function<void()>& func) {
auto start = std::chrono::high_resolution_clock::now();
func();
auto end = std::chrono::high_resolution_clock::now();
auto duration = std::... | TOOL | 0.982762 | 5.830964 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-10-24T17:29: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": "3abe5e5f7a... |
68363154-1eae-41e4-8078-9911c9568247 | mdaftab41/C---Code | Recursion/overlapRectangle.cpp | // not A recursion problem
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
// Function to check if two rectangles overlap
bool isRectangleOverlap(vector<int>& rect1, vector<int>& rect2) {
// Extracting coordinates of the first rectangle
int fx1 = rect1[0]; ... | ALGO | 0.999869 | 6.254964 | {
"github_metadata": {
"branch": "main",
"commit_count": 422,
"repo_created_at": "2023-10-14T00:05: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": "cc695edf40... |
ce0ae5f1-d991-4589-94e1-5c4a906a2701 | gzc/CLRS | C14-Augmenting-Data-Structures/exercise_code/m-Josephus.cpp | /*************************************************************************
> File Name: m-Josephus.cpp
> Author: Louis1992
> Mail: <EMAIL>
> Blog: http://gzc.github.io
> Created Time: Wed Jul 15 11:49:42 2015
************************************************************************/
#include<iostream>
using namesp... | ALGO | 0.999989 | 3.262894 | {
"github_metadata": {
"branch": "master",
"commit_count": 707,
"repo_created_at": "2013-12-03T08:07:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9559,
"forks": 2747,
"issues": 65,
"pull_requests": 20
},
"file_meta": {
"content_id": "... |
9e0521ef-d832-4c48-93f8-87aa046ee4b3 | rocket3989/hackerEarth2019 | september data structure/tree.cpp | #include <bits/stdc++.h>
using namespace std;
int R = 0;
// n -> it represent total number of nodes
// len -> it is the maximum length of array to hold
// ancestor of each node. In worst case,
// the highest value of ancestor a node can have is n-1.
// 2 ^ len <= n-1
// len = O(log2n)
int getLen(... | ALGO | 0.999928 | 3.390848 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-09-29T05:16: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": "73d092581... |
f841042b-dfe0-455c-b5cc-63d028f6375e | kamyu104/LeetCode-Solutions | C++/constructing-two-increasing-arrays.cpp | // Time: O(m * n)
// Space: O(min(m, n))
// dp
class Solution {
public:
int minLargest(vector<int>& nums1, vector<int>& nums2) {
static const int INF = numeric_limits<int>::max();
if (size(nums1) < size(nums2)) {
swap(nums1, nums2);
}
vector<int> dp(size(nums2) + 1, IN... | ALGO | 0.999989 | 5.741212 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
8e027207-25cf-470e-8766-4210bb7cf999 | Mandeep-017/DSA | Application of stack.cpp | #include <iostream>
using namespace std;
#define MAX_SIZE 100
class Stack {
private:
int arr[MAX_SIZE];
int top;
public:
Stack() {
top = -1;
}
bool isEmpty() {
return (top == -1);
}
bool isFull() {
return (top == MAX_SIZE - 1);
}
void push(int value) {
... | ALGO | 0.981908 | 4.757904 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-02-12T16:45: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": "5db81b2ec4b... |
d748f3ae-7944-48f3-bbb4-b6cbe181df1e | itkvideo/ITK | Modules/Segmentation/Blox/include/itkBinaryMedialNodeMetric.h | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... | ALGO | 0.972696 | 6.374891 | {
"github_metadata": {
"branch": "master",
"commit_count": 36261,
"repo_created_at": "2011-04-12T20:48:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "401783... |
e13bbb80-4e73-43c3-8eb6-b9f84cda06e4 | PrincetonUniversity/athena | src/chem_rad/integrators/six_ray.cpp | //========================================================================================
// Athena++ astrophysical MHD code
// Copyright(C) 2014 <NAME> <<EMAIL>> and other code contributors
// Licensed under the 3-clause BSD License, see LICENSE file for details
//=====================================================... | ALGO | 0.988568 | 4.874857 | {
"github_metadata": {
"branch": "main",
"commit_count": 5233,
"repo_created_at": "2014-05-02T16:11:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 270,
"forks": 152,
"issues": 24,
"pull_requests": 4
},
"file_meta": {
"content_id": "8b4ed... |
538dff68-6edc-4e53-ae97-2d14c8c948df | dufferzafar/interview | chak-fai/bfs-escape-from-grid.cpp | /**
* Came in Sprinklr's test?
*/
#include<bits/stdc++.h>
using namespace std;
struct coor {
int x,y;
bool operator < (const coor &a) const {
return a.x < x;
}
};
int n,m,a[105][105],v[105][105];
int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
/*
Given a n*m grid, 1 means obstacle, 2 means starting poi... | ALGO | 0.999946 | 3.443207 | {
"github_metadata": {
"branch": "master",
"commit_count": 226,
"repo_created_at": "2015-08-26T17:41:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47a7f8... |
f4c54714-b910-49c9-ba2f-35b126c12278 | FZhg/DPLL-SAT-Solver | tseitinTransformer.h | #ifndef TSEITIN_H
#define TSEITIN_H
#include <vector>
#include <map>
#include <string>
#include "treeNode.h"
class TseitinTransformer
{
private:
TreeNode *formulaRoot;
std::vector<std::vector<int>>* cnf; // represent CNF in vector of vector
std::map<std::string, int>* varIdTable; // stores the ID associ... | ALGO | 0.999229 | 4.617168 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-12T23:21: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": "2d178d95a778... |
1d1deeed-24e0-428f-9d84-1388e378e280 | SameOwner/gravity | MyGame/MyGame/src/Actor/Body/BoundingBox.cpp | #include "BoundingBox.h"
#include "OrientedBoundingBox.h"
#include "BoundingSphere.h"
#include "BoundingCapsule.h"
#include "BoundingSegment.h"
#include "Ray.h"
#include "CollisionModel.h"
#include <cmath>
#include <algorithm>
#include <limits>
#include "Base/HitInfo.h"
#include "../../Math/Collision/Collision.h"
//... | TOOL | 0.948971 | 4.67145 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-11-01T06:34:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6dc7fefa4e... |
17ce0c41-698e-42a6-b3cc-7defdd2c09ab | majanik/tpi_CALMweight | SphericalHarmonics/ylm.cc | #ifndef SCOTTUTILS_YLM_CC__
#define SCOTTUTILS_YLM_CC__
#include "sf.h"
using namespace std;
complex<double> ceiphi(double phi){
return complex<double>(cos(phi),sin(phi));
}
double SpherHarmonics::legendre(int ell,double ctheta){
return gsl_sf_legendre_Pl(ell,ctheta);
}
complex<double> SpherHarmonics::Ylm(int e... | TOOL | 0.995793 | 4.24241 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-07-14T09:59: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": "31716e4017... |
eaa94eb7-6f53-4748-8548-084c3a9a15fe | womo2014/SicilyOnlineJudge | Course——Software Design/模拟测验6 (期末模拟题D)/1009. numbers.cpp | #include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
using namespace std;
int k[8] = {0, 0, 1, 1, 1, 3, 3, 1};
int dp( int n)
{
if ( n < 0 )return 0;
if ( n == 0 )return 1;
int ret = 1;
for ( int i = 2; i <= 7; i++ )
ret += k[i]*dp(n... | ALGO | 0.999378 | 3.32201 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-08-02T07:51:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5161fba0f... |
27a41a74-99ee-4b38-ade9-c28ccd4f0bf5 | WwOwW4fun/Segment-Tree | Codeforces 1709D .cpp | /*
Author : <NAME>
Gmail : <EMAIL>
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define for0(i ,l ,r) for(int i = (l); i < (r); ++i)
#define for1(i, l, r) for(int i = (l); i >= (r); --i)
#define for2(v) for(auto it : v)
#define reset(a) memset(a,0,sizeof(a))
#define mem(a)... | ALGO | 0.999991 | 3.79349 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-06-01T03:35: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": "7d67f16deb2... |
6e66ebe2-8f51-4aba-9886-48eadc87513e | Awaludin14414/awaludin14414.gihub.id | TUGAS1.cpp | #include <iostream>
using namespace std;
/*
TUGASS 1
1. fungsi penjumlahan 2 bilangan
2. fungsi pengurangan 2 bilangan
3. fungsi menghitung jumlah nilai total dari sebuah array, contoh : [1,3,4,5] --> 13
4. Fungsi menghitung rata2 dari aray tsb. [1,3,4,5] -->13/4 <-- float, double / real
*/
// 1. Membuat Fungsi penj... | ALGO | 0.987671 | 4.461212 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-03-15T08:14: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": "c4178d0d2e0b... |
b3a98248-363b-4a6e-9975-ca747e5fa99a | HashanEranga/data_structures_and_algorithms | 05_2DArrays/04_sortedArraySearch.cpp | #include <iostream>
using namespace std;
std::pair<int,int> searchLinear(int arr[][100], int rows, int cols, int key){
for (int row = 0; row < rows; row++)
{
for (int col = 0; col < cols; col++)
{
if(arr[row][col]==key) return std::make_pair(row, col);
}
}
return s... | ALGO | 0.999506 | 4.699639 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2021-02-14T20:19:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6659ea6f6b8... |
ad54e4dd-0e87-4003-8234-a4ab731b15f8 | duny31030/My_road_of_ACM | VJ/sa/sa.cpp | /*
* =========================================================================
*
* Filename: sa.cpp
*
* Link:
*
* Version: 1.0
* Created: 2018/09/20 21时11分35秒
* Revision: none
* Compiler: g++
*
* Author: 杜宁元 (https://duny31030.top/), <EMAIL>
* Org... | ALGO | 0.999979 | 3.234491 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-04-12T04:50: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": "c492b2025... |
ff7f1b4b-dd44-4390-abe1-4338c3c7120e | AshHyun/BOJ | 1644.cpp | #include <algorithm>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <utility>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef tupl... | ALGO | 0.999906 | 3.817285 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2018-05-14T16:50:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b809e9186... |
ab3ae864-b753-4664-b987-d8944272cf39 | Mustehsan-Codes/CPP-DATA-STRUCTURES-AND-ALGORITHMS | Array with Template/array.h | #include<iostream>
using namespace std;
template <class tem>
class My_Array
{
private:
tem* my_Array;
int maxSize;
int currentSize;
public:
My_Array();
My_Array(int);
~My_Array();
bool empty();
bool full();
void addValue(tem);
tem removeValue();
void display();
};
template <class tem>
My_Array<tem>::My_Array... | TOOL | 0.991219 | 4.19937 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-05-26T10:36:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7512d6390d9... |
2dca2aaa-3055-41a7-b639-9e6787d8e1d1 | TheDwoon/AdventOfCode | AdventOfCode2024/Day02.cpp | #include <vector>
#include "parser.cpp"
#define TITLE "Day 02"
struct reactor {
std::vector<int> levels;
std::vector<int> boundaries;
};
typedef reactor day_t;
day_t parseInput(const char* const buffer, const int length) {
day_t reactor;
Parser p(buffer);
int globalIndex = 0;
reactor.bound... | ALGO | 0.999611 | 4.624966 | {
"github_metadata": {
"branch": "master",
"commit_count": 262,
"repo_created_at": "2020-11-29T20:06:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15d03086... |
8c1f0ee4-d6a7-4f59-b81b-46095a396628 | dkong/Words-Counter | words_counter.cpp | // words_counter
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <stdio.h>
void help(){
printf("\n"
"Example of using cvMatchTemplate(). The call is:\n"
"\n"
"words_counter template image_to_be_searched\n"
"\n"
" This routine will search using all methods:\n"
" CV_TM_SQDIFF 0\n"
" ... | ALGO | 0.978106 | 4.533532 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2010-05-02T18:55:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77f683b5db... |
1fa355c9-ebcd-46c8-a60a-e993ce09a2dd | shuding/leetcode-sol | algorithm/merge-k-sorted-lists/sol.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {
ListNode *head = NULL, *tail = NULL;
while (l1 || l2) {
... | ALGO | 0.999906 | 6.145841 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2014-10-14T08:42:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea05519a... |
a36894a8-9bb7-4190-99c2-b47c5504df16 | ArnabShikder24/problem-solving | Contest/vjudge PUC/B.cpp | #include <bits/stdc++.h>
using namespace std;
void solveEven(int n, int* arr, int* b)
{
int left = n - 1;
for (int i = 0; i < (n / 2); ++i) {
b[i] = arr[left];
left = left - 2;
if (left < 0)
break;
}
int right = 0;
for (int i = n / 2; i <= n - 1; ++i) {
b[i] = arr[right];
right = right + 2;
if (r... | ALGO | 0.999963 | 4.296326 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2023-04-20T06:47:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fffcf98afde... |
d1c7e340-5d9f-44dd-9c56-c21df974b68a | mvancompernolle/ai_project | data/npmos.cc | /*
* Copyright (c) 2005 <NAME> (<EMAIL>)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
* General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* ... | ALGO | 0.941268 | 6.293175 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-11-25T04:05:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e0c9bf99b... |
cf4b45ae-18ce-4b94-9694-849dfea5946d | SubratKumarSingh2001/GeeksForGeeks-Problems | DeleteDoublyLL.cpp | class Solution {
public:
// Function to delete a node at given position.
Node* deleteNode(Node* head, int x) {
// Your code here
//if want to delete the head node of DLL
if(x == 1) {
head = head->next;
head->prev = NULL;
return head;
}
... | ALGO | 0.999832 | 5.633945 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2025-01-15T15:34: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": "ed744ee420... |
0c40fb75-c32e-48e7-8c19-81a0eb65bf11 | yongjianmu/leetcode | second/max_sum_path_in_two_arrays/sol.cpp | #include "../include/header.h"
/*
Max sum path in two arrays
array Amazon
Given two arrays, the task is to complete the function max_path_sum that takes 4 argument The first two arguments represent the 2 arrays A[], B[] and the last two arguments l1, l2 denote the size of array A and B respectively. The function ... | ALGO | 0.999985 | 5.098639 | {
"github_metadata": {
"branch": "master",
"commit_count": 187,
"repo_created_at": "2016-06-06T19:10: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": "0d6ab3bc... |
4ab018c1-e840-4222-97fe-70c8432ad77e | Sho1007/Algorithm | 프로그래머스/3/43164. 여행경로/여행경로.cpp | #include <string>
#include <queue>
#include <iostream>
#include <unordered_map>
#include <algorithm>
using namespace std;
unordered_map<string, vector<string>> adjMap;
unordered_map<string, int> indexMap;
vector<pair<string,string>> stringVector;
queue<vector<string>> pathQueue;
int ticketSize;
vector<string> answe... | ALGO | 0.99993 | 5.541146 | {
"github_metadata": {
"branch": "main",
"commit_count": 300,
"repo_created_at": "2023-06-27T06:28: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": "a7b8cb4985... |
c8839927-02e8-48c0-95a0-91127cf3f8ad | CorReg-community/CorReg | src/BicTheta.cpp | #include "BicTheta.h"
#include <iostream>
using namespace Rcpp ;
using namespace Eigen;
using Eigen::Map;
using Eigen::MatrixXd;
using Rcpp::as;
SEXP BicTheta(SEXP X,SEXP Y,SEXP beta,SEXP intercept){
BEGIN_RCPP
const Map<MatrixXd> vecY(as<Map<MatrixXd> >(Y));//Y
Map<MatrixXd> matX(as<Map<MatrixXd> >(X));//X
c... | ALGO | 0.985298 | 5.368313 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-02-10T12:54:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "708e4bc8e1... |
eb30b24d-68fe-4798-b0c9-3431dde7034c | masudranam/dsa_problems | Codeforces/C_Ticks.cpp | #include<bits/stdc++.h>
using namespace std;
#define print(a) for(auto x:a)cout<<x<<' ';cout<<'\n';
#define debug(x) cout<<#x<<" "<<x<<'\n'
#define int long long int
const int M = 1e9 + 7;
const int N = 2e5 + 10;
void solve(){
int n, m, d;
cin >> n >> m >> d;
string s[n];
for(int i = 0; i < n; i++... | ALGO | 0.999887 | 4.121594 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2022-01-06T03:38: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": "9afb1445cf... |
efc73d60-40e7-4c41-8ea8-1736c903d0d4 | Collins-J-URI/eigenfaces | include/csc450Lib_linalg_base/Matrix.h | //
// Matrix.h
//
//
// Created by <NAME> on 3/28/15.
//
//
//=================================
// include guard
#ifndef ____Matrix_included__
#define ____Matrix_included__
//=================================
// forward declared dependencies
//=================================
// included dependencies
#include <io... | ALGO | 0.985105 | 4.803813 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2015-05-11T15:46: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": "32a61ecf0... |
a06941c0-8011-4c66-95bc-95d1f1331762 | SSAFY-9th-Algorithm/Algorithm_bbogaegi | february/week3/day3_swea_1767_connect_processor/손세이.cpp | #include <iostream>
#include <algorithm>
#include <queue>
#include <cstring>
using namespace std;
// 설계
// 그냥 DFS 돌면서
// 1. core를 하나씩 탐색하고,
// 2. 전원이 연결된 core, 그때 전선의 길이는 얼마인지 받아
// 3. 모든 코어를 탐색 했을 때, 현재까지 전원이 연결된 코어가 이전에 있던 답보다 많다면 최대수와 전선의 최소 길이 갱신
// 4. 만약 개수가 같으면 전선 길이 중 짧은 값으로 갱신
struct Node {
int y;
int x;
}... | ALGO | 0.999929 | 4.974382 | {
"github_metadata": {
"branch": "master",
"commit_count": 432,
"repo_created_at": "2023-02-07T02:00:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1748909d1... |
b0e9b62f-739a-4f12-9d6a-d36f39514a7b | gyeongpunch/Coding_Test | 백준/Gold/16947. 서울 지하철 2호선/서울 지하철 2호선.cc | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <map>
#include <queue>
#include <cstring>
using namespace std;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(nullptr);
const int MX=3001;
int N;
ve... | ALGO | 0.999995 | 4.618928 | {
"github_metadata": {
"branch": "main",
"commit_count": 580,
"repo_created_at": "2024-11-27T09:58: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": "678537390c... |
967a28e0-8ee5-4863-930f-d61a0d32689d | XyeHyin/vscode | newcoder/小红的区间修改_easy.cpp | // name: 小红的区间修改_easy.cpp
// date 2025-06-08
// author: XyeHyin
#include <bits/stdc++.h>
// #pragma GCC optimize("O3,Ofast,unroll-loops")
// #include "atcoder/convolution"
// #include "atcoder/dsu"
// #include "atcoder/fenwicktree"
// #include "atcoder/lazysegtree"
// #include "atcoder/math"
// #include "atcoder/maxf... | ALGO | 0.999944 | 4.769208 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-02T00:53:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6539dcbe26aa... |
12fe3c4d-3156-46a6-8246-110faf6ab6f5 | regismeyssonnier/CSES | CSES/DP/countingtower.cpp | // CSES.cpp : Ce fichier contient la fonction 'main'. L'exécution du programme commence et se termine à cet endroit.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>
#include <math.h>
using namespace std;
typedef long long int ll;
vector<ll>dp(1000000+5, 0);
//vector<vector<ll>>dp(10000... | ALGO | 0.999795 | 4.809389 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-10-25T12:29: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": "e180a4464310... |
e55be31d-c378-4664-b4a8-0850cdf3586e | CLDP/USACO-Contest | 2011-2012 Season/2012 US Open/Bronze/3lines.cpp | #include <iostream>
#include <cstdio>
#include <set>
#include <map>
#include <algorithm>
using namespace std;
const int MAXN = 50010;
int x[MAXN], y[MAXN];
int main() {
freopen("3lines.in", "r", stdin);
freopen("3lines.out", "w", stdout);
int n;
cin >> n;
map<int, int> cx, cy;
map<int, set<i... | ALGO | 0.999985 | 3.917945 | {
"github_metadata": {
"branch": "master",
"commit_count": 178,
"repo_created_at": "2013-05-12T16:29:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcfdea7d... |
4df2a3ee-8ea5-42ee-937b-c37a5548392c | auniquesun/Data-Structure-and-Algorithms | string/shortest_prefix.cpp | #include <iostream>
#include <vector>
using namespace std;
#define MAX 26
struct TrieNode{
// 有几个字符串公用这个字符
int count;
TrieNode *next[MAX];
TrieNode(){
count = 0;
for(int i = 0;i < MAX;++i){
next[i] = NULL;
}//for
}
};
// 插入
void Insert(TrieNode* &root,string str... | ALGO | 0.999981 | 3.958451 | {
"github_metadata": {
"branch": "master",
"commit_count": 299,
"repo_created_at": "2018-04-08T08:36:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c74863fb... |
7874f123-7799-4478-b445-06c76a64d44e | flare9x/leetcode | 1523. Count Odd Numbers in an Interval Range.cpp | /* 1523. Count Odd Numbers in an Interval Range
Given two non-negative integers low and high. Return the count of odd numbers between low and high (inclusive).
Constraints:
0 <= low <= high <= 10^9 */
/* 84 / 84 test cases passed.
Status: Accepted
Runtime: 0 ms
Memory Usage: 6 MB
Submitted: 6 hours, 6 minutes ago ... | ALGO | 0.999947 | 5.398068 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-03-27T22:52: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": "23c5453e955... |
9c47f09c-ae37-409e-8f16-c8afb4879310 | ishandutta2007/codeforces-k | kewth/normal/1284/E.cpp | #if 0
2020.01.05
5 5-set
1) 5-set
2) 5-set
3) l 5-set
5-set x5, x4, x3 x4 + 2 x3
x4, x3
X = x5 + x4 + x3 = C(n, 5) Y = 5 x5 + 4 x4 + 3 x3
ans = 5X - Y Y
Y 5-set
E 5-set E
3-set E E k
C(k, 3)
x x
O(n^2logn)
dnmd atan2 double long double
#endif
#include <cstdio>
#include <a... | ALGO | 0.999903 | 3.856846 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74112db798f8... |
33434380-300f-4a62-a12b-93567deda385 | Eperix/Toon-UE | Engine/Plugins/PCG/Source/PCG/Private/Elements/PCGSortTags.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "Elements/PCGSortTags.h"
#include "PCGContext.h"
#include "Helpers/PCGTagHelpers.h"
#include "Algo/StableSort.h"
#define LOCTEXT_NAMESPACE "PCGSortTagsElement"
#if WITH_EDITOR
// The label the node is known as internally.
FName UPCGSortTagsSettings::GetDe... | TOOL | 0.938632 | 7.354321 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2025-02-12T17:17:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "faaea667d79... |
3aa364f1-f8cc-4df8-8fbf-bd410222f8cd | ddotu2612/leetcode_tudv | T1_2025/B13_Merge_Intervals_Medium.cpp | // class Solution {
// public:
// vector<vector<int>> merge(vector<vector<int>>& intervals) {
// sort(intervals.begin(), intervals.end(), [](vector<int> a , vector<int> b) {
// return a[0] < b[0];
// });
// vector<vector<int>> res;
// int pre0 = intervals[0][0];
// ... | ALGO | 0.999999 | 5.891115 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2024-11-30T14:16:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69e470bbc... |
90367e79-d6e1-49ea-baed-3260f2103e9a | Nhartwig/algos_folder | project 1- all materials/Project1bishar/Project1bishar/mastermind.cpp |
// <NAME>, <NAME>
// Fundamentals of Algorithms
// Project 1 MASTER MIND 1b
// Implementation of the Mastermind Class
// Mastermind class performs the actions for playing the game and allowing IO
// Contains functionality to play game for ten turns, then tells the user if won or lost
// Also, the game will print the s... | ALGO | 0.98744 | 4.70222 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2017-01-16T23:35: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": "b670a8286... |
66bf3e9d-f960-4d6a-a1ef-034b71c299ed | cran/rforensicbatwing | src/indexvec.h | #ifndef INDEXVEC_H_
#define INDEXVEC_H_
#include "common.h"
#include "vec.h"
// this is a very simple class inherited from
// vec with the simple aim of forming an
// index vector for any class (that you can sort)
template <class T>
class indexvec: public vec<int> {
public:
indexvec(const vec<T> &x);
indexvec(... | ALGO | 0.9539 | 5.215021 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-03-13T06:05:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b1030cafaf... |
9f25d4b6-d77a-4b59-9816-76dd2fb3eb29 | bark-simulator/bark | bark/world/map/commons.hpp | // Copyright (c) 2020 fortiss GmbH
//
// Authors: <NAME>, <NAME>, <NAME> and
// <NAME>
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.
#ifndef BARK_WORLD_MAP_COMMONS_HPP_
#define BARK_WORLD_MAP_COMMONS_HPP_
#include <map>
#include <memory>
#incl... | ALGO | 0.997869 | 7.436076 | {
"github_metadata": {
"branch": "master",
"commit_count": 3507,
"repo_created_at": "2019-04-03T11:36:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 301,
"forks": 72,
"issues": 9,
"pull_requests": 6
},
"file_meta": {
"content_id": "91e34... |
e4a42c83-0c16-411f-ac12-a358dbe81e23 | alexandraback/datacollection | solutions_2755486_0/C++/FerroMrkva/c.cpp | #include<cstdio>
#include<cstring>
#include<set>
using namespace std;
#define MX 1001
#define INF MX*MX
int H[5*MX*MX];
void setH(int id,int zac,int kon,int h,int a,int b,int oldh){
if (oldh>H[id])
H[id]=oldh;
if (a<=zac&&b>=kon){
if (h>H[id])
H[id]=h;
//printf("setH: %d %d %d %d\n",id,zac,kon,h);
retur... | ALGO | 0.999624 | 3.659631 | {
"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": "e66f68caf... |
86df7eba-7670-4e53-9d30-b1ece19b9832 | NirbhaySirsikar/impact_training | Nirbhay/Array/012.cpp | // Given an array of 0s, 1s and 2s. Sort them
// Dutch National Flag Problem
#include <bits/stdc++.h>
using namespace std;
void DNFsort(int a[], int n)
{
int low = 0, mid = 0, high = n - 1;
while (mid <= high)
{
switch (a[mid])
{
case 0:
swap(a[mid], a[low]);
... | ALGO | 0.99997 | 4.380234 | {
"github_metadata": {
"branch": "nirbhay",
"commit_count": 7,
"repo_created_at": "2023-05-11T05:10: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": "0043bf59a... |
3257caef-d940-4650-8084-247d952d2926 | michalsvagerka/competitive | arch/rychlostne/trening-z-13-marca-2015/most.cpp | #include "../l/lib.h"
#include "../l/geo.h"
class most {
public:
double ans = 20000;
void check(const pii&a,const pii&b, const pii&c) {
ans = min(ans, pointSegmentDistance(a,b,c));
}
void read(istream& cin, vector<pii> &Z) {
int n; cin >> n;
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999893 | 4.028529 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2017-12-07T11:02:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1343bfd1... |
44a9ac68-ce2c-4fa3-917f-5562069cc43c | dcoveney/projamrex | Source/projection.cpp | #include <AMReX_BC_TYPES.H>
#include <projamrex.H>
#include <AMReX_MLMG.H>
#include <AMReX_MLNodeLaplacian.H>
#include <AMReX_NodalProjector.H>
#include <AMReX_MLABecLaplacian.H>
using namespace amrex;
Array<amrex::LinOpBCType,AMREX_SPACEDIM>
Projamrex::fetchBCsForProjection (Orientation::Side side) const noexcept
{
... | ALGO | 0.999845 | 5.873666 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-12-17T15:04: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": "050c51f3a6... |
4e127bdf-74a8-432f-8c0a-e939a93c7092 | Amanhacker/Aman-Barnwal-Leetcode-Solutions | 500-keyboard-row/500-keyboard-row.cpp | class Solution {
public:
vector<string> findWords(vector<string>& words) {
vector<string> res;
int n = words.size();
string first = "qwertyuiop";
string second = "asdfghjkl";
string third = "zxcvbnm";
unordered_map<char, int> u;
set... | ALGO | 0.999828 | 5.761819 | {
"github_metadata": {
"branch": "master",
"commit_count": 2521,
"repo_created_at": "2021-12-24T16:13:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 441,
"forks": 140,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "502... |
8a482fb6-c9db-4925-a6ef-419761378b6f | fupengfei058/algorithm | Leetcode/42. Trapping Rain Water.cpp | /*Trapping Rain Water:Given n non-negative integers representing an elevation map where the width of each bar is 1,
compute how much water it is able to trap after raining.*/
class Solution {
public:
int trap(vector<int>& height) {
if(height.size() < 3) return 0;
int left = 0;
int right = h... | ALGO | 0.999995 | 6.254454 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2017-11-16T02:54:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 70,
"forks": 30,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "330bfb... |
9992684c-523c-466b-8240-08aa3c01eeb9 | bandiaoz/Template | test/oj/Graph/connectivity/cut/acw_400.cpp | #include <bits/stdc++.h>
#include "src/Graph/connectivity/Tarjan_cut.h"
#include "src/Tree/VectorTree.h"
#include "src/Tree/HeavyLightDecomposition.h"
/*
[398. 交通实时查询系统](https://www.acwing.com/problem/content/400/)
[status](https://www.acwing.com/problem/content/submission/code_detail/39362359/)
*/
/**
* 给定一张无向图,多次询问... | ALGO | 0.999854 | 4.951534 | {
"github_metadata": {
"branch": "main",
"commit_count": 247,
"repo_created_at": "2022-04-28T12:29:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98c056ce04... |
ee274355-0838-4237-b359-e3a17ae9eaea | mengyiqwq/leetcodeprofile | myfirstC++/LeetCode/LeetCodeAST/combine.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
// 奇怪的暴力法
vector<vector<int>> combine(int n, int k)
{
vector<vector<int>> res;
if (k == 1)
{
for (int i = 0; i < n; i++)
res.push_back({{i + 1}});
return res;
}
vector<int> temp(k); // temp用来记录下标
for (... | ALGO | 0.999949 | 4.528006 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-12-17T08:20: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": "51c9c25cb3... |
a47c2c76-b121-416a-bb32-07dcdf2298cc | hieupham1103/TINHOC | SCHOOL/ANHKHOI/Dijkstra/dijkstra.cpp | #include <bits/stdc++.h>
using namespace std;
const int infinite = 1e9;
const int maxV = 100;
int Start, End;
int E, V;
vector<pair<int, int>> adj[maxV];
int visited[maxV];
int traced[maxV];
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> myHeap;
void inputReader()
{
cin >> V >> E;... | ALGO | 0.999987 | 4.270981 | {
"github_metadata": {
"branch": "main",
"commit_count": 406,
"repo_created_at": "2021-08-20T03:38:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d123c1ac1... |
902f81a2-8515-4e45-a2a3-92c5fe6effc9 | acm-clan/algorithm-stone | user/leetcode/113.路径总和-ii.cpp | /*
* @lc app=leetcode.cn id=113 lang=cpp
*
* [113] 路径总和 II
*/
// @lc code=start
/**
* 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), ... | ALGO | 0.999974 | 6.27926 | {
"github_metadata": {
"branch": "main",
"commit_count": 574,
"repo_created_at": "2021-02-18T15:25:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2066,
"forks": 620,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52d2e... |
b770ab93-f277-4674-8c30-055d8b25632c | pparys/qpt-parity | oink/src/rtl.hpp | /*
* Copyright 2017-2018 <NAME>, <NAME> University Linz
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | ALGO | 0.999792 | 4.551398 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-03-22T14:39:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c07068ae9... |
aaf3366b-4b7e-4c4a-943b-5a1b1f48e8be | DelcasK/chuan | bianchang.cpp | //变长顺序分配存储
#include<stdio.h>
#include<stdlib.h>
typedef struct
{
char *ch; //指向动态分配的存储区的首地址的字符指针
int length;
}Str;
//将一个串赋值给另一个串
int strassign(Str &str, char*ch) {
if (str.ch) //若str非空,则释放其空间
{
free(str.ch);
str.ch = NULL;
} //创建length存储ch长度,用c指向ch,用c处理操作而不应直接用ch
int length=0;
char*c ... | ALGO | 0.989703 | 3.326149 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-04-17T15:24:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d13e01fd7a... |
b0925f83-3827-4e49-b24c-91cd163d144b | wuxingyu1983/Algorithm | LeetCode/2172/main.cc | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <set>
#include <queue>
#include <stack>
using namespace std;
class Solution {
public:
int maximumANDSum(vector<int>& nums, int numSlo... | ALGO | 0.999851 | 4.744955 | {
"github_metadata": {
"branch": "master",
"commit_count": 737,
"repo_created_at": "2020-07-01T02:51:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "474d5640... |
3ad6020b-eddf-4900-b4fa-c1738ce235e7 | jahidhasanraju/code | code/minimum window of a string.cpp | #include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define minf INT_MIN;
#define mx 100
#define pb push_back
#define pf push_front
#define popf pop_front
#define popb pop_back
#define mem(a, v) memset(a, v, s... | ALGO | 0.999986 | 3.150516 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-11-19T18:53: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": "f7298cbf3e47... |
fd25bdb9-4783-42f9-868d-99409befd31e | devNicolasAmaral/PROVA_P1 | main.cpp | #include <iostream>
int main() {
int tam;
std::cout << ">>Inicio: Prova P1\n\n";
std::cout << "Defina o tamanho do vetor: ";
std::cin >> tam;
int valores[tam];
int max_valor = 0;
std::cout << "\nInforme os valores presentes no vetor: \n";
for (int i = 0; i < tam; i++) {
std::c... | ALGO | 0.998937 | 4.056085 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-15T23:35: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": "52ea540cb1e1... |
00240d23-6fb7-4eab-ae9c-775690d77cba | Adisanap3136/BEpractical | Prs/HPC/Parallel_bfs_dfs.cpp | #include <iostream> // For input/output operations
#include <vector> // For using vector container
#include <queue> // For BFS queue implementation
#include <omp.h> // OpenMP library for parallel programming
#include <stack> // For DFS stack implementation
using namespace std; ... | ALGO | 0.99999 | 7.378553 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-05-03T12:47: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": "e32620edab6f... |
e705239f-ab36-4329-a1bb-ea1306d053f4 | huguangAOA/datastructure | 第11章:树状数组与线段树/1、树状数组结构基础/1、HZOJ-329-弱化的整数问题.cpp |
/*************************************************************************
> File Name: 329.cpp
> Author: hug
> Mail: <EMAIL>
> Created Time: 四 8/22 20:39:12 2019
************************************************************************/
#include <iostream>
#include <cstdio>
#include <cstdlib>
#includ... | ALGO | 0.999793 | 3.868872 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-02-05T07:45:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 20,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac1db0d3b2... |
1a741ea3-b7cb-4e60-9c43-1388802f674f | Aphrodicez/POSN | POSN17/Camp3/Dynamic_Programming/Matrix_Chain_Multiplication/BottomUp/48_Bead-BottomUp.cpp | /*
Author : ~Aphrodicez
School : RYW
Lang : CPP
Algo : Matrix Chain Multiplication [Bottom Up]
Status : Accepted
*/
#include <bits/stdc++.h>
using namespace std;
#define i first
#define j second
#define pb push_back
#define eb emplace_back
#define all(a) (a).begin(), (a).end()
#define SZ(a) (int)(... | ALGO | 0.999551 | 3.881593 | {
"github_metadata": {
"branch": "master",
"commit_count": 270,
"repo_created_at": "2020-11-21T02:11: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": "f8343c39... |
e1487787-6ec7-4734-9913-dbbb0c320867 | Burhanuddin3103/Coding-in-C-and-CPP | Computer Graphics/boundaryfill algorithm (8 point).cpp | #include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<graphics.h>
void BoundaryF(int x,int y,int newcolour,int edgecolour)
{
int current;
current = getpixel(x,y);
//printf("%d",current);
if(current != edgecolour && current != newcolour)
{
putpixel(x,y,newcolour);
BoundaryF... | ALGO | 0.99939 | 3.574399 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-08-04T05:50: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": "2f5beb149... |
858590f2-c9f8-4146-8e2f-53fac4d71154 | ImtiazAhmedAkash/Problem-Solving | codeforces/1617/C.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// Paprika and Permutation
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define INF (1 << 30)
#define mod 998244353
#define N 300005
#define deb(x) cerr << #x << " = " << x << nl
void solve() {
int n;
ci... | ALGO | 0.999035 | 4.420957 | {
"github_metadata": {
"branch": "main",
"commit_count": 475,
"repo_created_at": "2022-11-19T14:05:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ecdef4a0e... |
93dda6f3-3e3c-4538-8463-8fa55f757453 | wh2per/SW-PRO-Algorithm | SW_PRO_Algorithm/기출A-0022(비상연락망).cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
#include <queue>
#include <string>
#include <string.h>
using namespace std;
bool check[1001];
bool info[1001][1001];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
freopen("./sample_input.txt", "r", stdin... | ALGO | 0.999588 | 3.855573 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2019-09-12T12:03:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1c31f0726... |
a640364d-8530-495c-94d3-fa59a1c94c04 | Aaryan2705/GFG | Medium/Partitions with Given Difference/partitions-with-given-difference.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int countPartitions(int n, int d, vector<int>& arr) {
int mod = 1e9+7;
// Calculating our search space
int range = 0;
for(int i=0;i<n;i++) range += arr[i]%mod;
... | ALGO | 0.999826 | 6.458123 | {
"github_metadata": {
"branch": "main",
"commit_count": 582,
"repo_created_at": "2024-03-09T10:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d116986dc6... |
01215044-ab6a-45f8-a2cd-4bc9cd7f3e0a | Ahmedfahmy8308/ACPC-Kafr-level2 | STL Solve/Registration_system.cpp | /*
_ _ _ __ _
/_\ | |__ _ __ ___ ___ __| | / _| __ _| |__ _ __ ___ _ _
/ _ \| '_ \| '_ ` _ \ / _ \/ _` | | |_ / _` | '_ \| '_ ` _ \| | | |
/ _ | | | | | | | | | __| (_| | | _| (_| | | | | | | | | | |_| |
\_/ \_|_| |_|_| |_| |_|\___|\__,_| |_| \__,_|_| |_|_| |_| ... | ALGO | 0.999702 | 4.368897 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-02-27T22:45:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "624726e36ea... |
52c4c346-2aa7-46c9-98c5-8e5fb532fbf7 | tingting0711/algorithm | 5_dynamic_programing/9.分组背包问题.cpp | /*
题目描述:
有 N 组物品和一个容量是 V 的背包。
每组物品有若干个,同一组内的物品最多只能选一个。
每件物品的体积是 vij,价值是 wij,其中 i 是组号,j 是组内编号。
求解将哪些物品装入背包,可使物品总体积不超过背包容量,且总价值最大。
输出最大价值。
输入格式
第一行有两个整数 N,V,用空格隔开,分别表示物品组数和背包容量。
接下来有 N 组数据:
每组数据第一行有一个整数 Si,表示第 i 个物品组的物品数量;
每组数据接下来有 Si 行,每行有两个整数 vij,wij,用空格隔开,分别表示第 i 个物品组的第 j 个物品的体积和价值;
输出格式
输出一个整数,表示最大价值。
数据范围
0... | ALGO | 0.999992 | 3.979189 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-06-26T15:23: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": "4faa4d001... |
169f4ab0-bf42-4d94-b740-9dcb76c4ab51 | MayankGupta-dev08/myCppWork | new/343_recurrsion_SortingStack.cpp | // Sort a stack using recurrsion.
/* stack {top,......, bottom}
stk {}
stk.push(1);
stk.push(5);
stk.push(0);
stk.push(2);
stk.push(4);
stk.push(3);
Before sorting -
stk {3 4 2 0 5 1} --> stk.top() = 3
After Sorting -
stk {5 4 3 2 1 0} --> stk.t... | ALGO | 0.999998 | 5.992849 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2021-06-07T21:23: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": "b198ea008... |
1cdb6b84-c0ad-4d29-a1f7-22a29f8bb0ae | keyradical/Euclid | Euclidean.cpp | //
// Euclidean.cpp
// Euclidean Algorithm
//
// Created by <NAME> on 09.10.2019.
// Copyright © 2019 <NAME>. All rights reserved.
//
#include "Euclidean.hpp"
Zfield::Zfield(int n) : n(n) {
makeSet();
}
void Zfield::makeSet() {
set = new int [n];
for (int i = 0; i < n; i++) {
set[i] = i;
... | ALGO | 0.995687 | 5.790122 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-11-25T21:35: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": "73a35ba5a9... |
28e47da2-2bfa-418e-afc7-8c1c477626ed | DevAggarwal03/DSA | Dp/rodCutting.cpp | #include "../stdc++.h"
using namespace std;
int rodCuttingBoUp(vector<int>& price){
int n = price.size();
vector<int> dp(n+1,0);
for(int i=1; i<n+1; i++){
dp[i] = price[0]*i;
}
for(int i=1; i<n; i++){
for(int j=1; j<n+1; j++){
int notCut = dp[j];
int cut = 0... | ALGO | 0.999895 | 4.106202 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-02T06:53: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": "f16542e3ff21... |
f1cf1084-bac5-4820-8925-b99cbe8a493a | gordonwoodhull/dynagraph | common/CoordTranslator.h | /**********************************************************
* This software is part of Dynagraph *
* http://www.dynagraph.org/ *
* *
* Copyright (c) 2006 <NAME> *
* Portions Copyright (... | TOOL | 0.919822 | 6.380346 | {
"github_metadata": {
"branch": "main",
"commit_count": 133,
"repo_created_at": "2014-01-21T16:33:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0157a9d1... |
c5ed4252-ef0e-4a92-84f1-204a6cac9654 | mmurray22/cs197-project | IndexStructures/include/Util/Zipf.h | //
// Created by <NAME> on 15.05.14.
// Copyright (c) 2014 <NAME>. All rights reserved.
//
#ifndef __Zipf_H_
#define __Zipf_H_
#include <math.h>
#include <random>
#include "Types.hpp"
#ifdef STEFAN_ZIPF
class Zipf {
private:
/**
* Generates a Zipf distribution according to the code from:
* <p>
* Gray, Sundaresa... | ALGO | 0.993622 | 4.692413 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2019-10-23T01:32:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62cc389f7... |
9b855579-d092-4d99-8314-d1d395a62d27 | krish-shahh/EC327 | HW2/twoparam.cpp | #include <iostream>
using namespace std;
bool makeTotalQ(int num1, int num2) {
if (num1 * num2 == 24) {
return true;
} else if (num1 + num2 == 24) {
return true;
} else if (num1 != 0 && num2 != 0 && (num1 % num2 == 0 || num2 % num1 == 0)) {
int div1 = num1 / num2;
int div2 ... | ALGO | 0.998876 | 5.573805 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2023-01-13T02:28: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": "40dee838ade... |
e622bee7-10bf-4128-8f8f-c2cbe1df75e6 | AutumnKite/Codes | Codeforces/1238F The Maximum Subtree/DP,树形DP/std.cpp | #include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
int read(){
register int x = 0;
register char f = 1, ch = getchar();
for (; !isdigit(ch); ch = getchar()) if (ch == '-') f ^= 1;
for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ '0');
return f ? x : -x;
}
#define N 30000... | ALGO | 0.999603 | 4.543706 | {
"github_metadata": {
"branch": "master",
"commit_count": 683,
"repo_created_at": "2019-08-18T00:53:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5eb2e64c... |
6242f2a4-2054-4b09-870a-3ee9cbf9af14 | mehdi-avara/minesweeper | main.cpp | #include "SBDL.h"
#include <stdlib.h>
#include <time.h>
#define maxMapSize 25
#define bomb 9
#define window_hi 545
#define window_wi 525
#define rect_sizea 20
using namespace std;
struct playerInfo
{
string playername;
int mapSizex;
int mapSizey;
int numberOfBomb;
int numberOfFlag;
int score;
... | TOOL | 0.954016 | 3.09067 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-05-27T16:52:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c33f9fba2e... |
c0dc5257-76dd-43ad-8f46-1272d96af0d4 | menglish626/ProjectEuler | include/BigNum.cpp | /*
<NAME>
Project Euler
BigNum Class
*/
#include "BigNum.h"
#include <math.h>
using namespace std;
short firstArgZ(short (*op)(short,short), short arg){return op(0,arg);}
short secArgZ(short (*op)(short,short), short arg){return op(arg,0);}
short sub(short a, short b){return a - b;}
short add(short a, short b)... | ALGO | 0.950484 | 3.813215 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-12-04T05:30:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd46b9411d... |
9ab4bdb3-6fa2-4ff4-b2fc-ac091030083d | simonpf/llrte | src/llrte/grids/regular.h | #ifndef _LLRTE_GRID_REGULAR_H_
#define _LLRTE_GRID_REGULAR_H_
#include <iostream>
#include <limits>
#include <memory>
#include <type_traits>
#include <utility>
#include "llrte/common.h"
#include "llrte/eigen.h"
#include "llrte/maths.h"
namespace llrte {
using eigen::Tensor;
using eigen::Vector;
///////////////////... | ALGO | 0.994313 | 6.04156 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2019-10-15T13:41: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": "548bbc4a... |
631071b4-2308-4692-ae44-a4bcb7b11fb6 | mwalczyk/Udemy-CPlusPlus-Course | Vectors/Vectors/main.cpp | #include <iostream>
#include <vector>
#include <string>
int main()
{
/*
A std::vector's capacity is the size of its internal array that contains "reserved" memory. In
contrast, its size is the actual number of elements that have been added to the std::vector.
When adding an element to a std::vector that is alread... | TOOL | 0.920426 | 6.173359 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-09-09T17:42: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": "afbb8c9d2... |
e902cf35-9f95-41e8-8236-0489b4ac6568 | yindaz/pbrs | mitsuba-af602c6fd98a/src/emitters/sun.cpp | /*
This file is part of Mitsuba, a physically based rendering system.
Copyright (c) 2007-2014 by <NAME> and others.
Mitsuba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
as published by the Free Software Foundation.
Mitsuba is distributed... | ALGO | 0.935407 | 7.021795 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-04-09T03:02:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 143,
"forks": 26,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bb987... |
3dcfd56c-ac88-4e83-87f8-cbc5bd1ccadf | rafaelcsva/CompetitiveProgramming | code/codechef/JUNE18A/TWOFL.cpp | //01, 06, 2018, 20:28:00 Rafaelcs cpp
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pii> pipii;
typedef pair<int, pipii> wtf;
typedef long double ld;
typedef long long ll;
map<pipii, int>dis;//cor e vertice
map<pipii, bool>vis;
priority_queue<wtf>pq;
int n, m;
const int N ... | ALGO | 0.999931 | 3.077966 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-08-30T23:18: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": "6fc1a05d0... |
13bacd0f-ab5f-47ac-b271-f4cc3702c3cc | yashkundu/cp | CodeForces/random/Edu121D.cpp | /**
* author: lazyhash(yashkundu)
* created: 18 Mar, 2024 | 07:07:48
**/
#include <iostream>
#include <vector>
#include <random>
#include <chrono>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef long double ld;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void ... | ALGO | 0.999786 | 4.794684 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2023-01-01T05:45: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": "34545e46b... |
193e533a-4f30-4c16-83bd-770f7f386dc4 | sahilgoyals1999/GFG-Algorithms | 12. Graph Algorithms/04. Connectivity/04. Biconnected Graph.cpp | // https://practice.geeksforgeeks.org/problems/biconnected-graph/0
// T.C => O(n + m)
// graph is connected and no. of APs is zero
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define in... | ALGO | 0.999832 | 5.059143 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2020-10-30T13:23: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": "64b4b9c8188... |
5988506e-c98d-43c5-80ce-969558c4f272 | rikvdk/codeforces | 370A.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <numeric>
#include <string>
using namespace std;
typedef long long ll;
int main()
{
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
int dx = abs(x1 - x2);
int dy = abs(y1 - y2);
// Rook
if (x1 == x2 || y1 ... | ALGO | 0.999956 | 3.92039 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2020-04-03T14:24: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": "b947a0dd... |
2adaf57f-9a97-4df2-9a15-156e786205cc | chongin12/Problem_Solving | acmicpc.net/old/13460.cpp | #include <bits/stdc++.h>
using namespace std;
int n,m;
int res=987654321;
void left(string arr[11], int cnt);
void right(string arr[11], int cnt);
void up(string arr[11], int cnt);
void down(string arr[11], int cnt);
int main(){
ios::sync_with_stdio(0); cin.tie(0);
cin>>n>>m;
string arr[11];
for(int i=0; i<n; ++i)... | ALGO | 0.999936 | 3.746151 | {
"github_metadata": {
"branch": "master",
"commit_count": 1482,
"repo_created_at": "2019-04-20T10:11:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02f33aa... |
befac0d7-7111-4d1b-8bbb-dbe51dad3b7f | AryanJaiswal763/DSA | StackImplementArray.cpp | #include<iostream>
#include<stack>
#include<bits/stdc++.h>
using namespace std;
class Stack
{
int *a;
int size;
int top;
public:
bool flag;
Stack(int s)
{
size=s;
a=new int[s];
top=-1;
flag=1;
}
void push(int val)
{
if(top==size-1)
{
... | ALGO | 0.999067 | 3.736366 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-13T05:18: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": "d6944466f4ad... |
dbb214fe-027a-47ae-b74b-776510f21084 | huangallen2008/cppcode | code/AAhomework/Level4/cf1019B.cpp | #include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#define int long long
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define RREP1(i,n) for(int i=(n);i>=1;i--)
#define f first
#define s second
#define pb push_back
#define... | ALGO | 0.999978 | 3.050468 | {
"github_metadata": {
"branch": "main",
"commit_count": 21357,
"repo_created_at": "2024-06-07T09:21: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": "c9d1abf0... |
495a863e-9944-466e-9c82-21b245c1409a | qze841/modcpp | competitive_prog/recursion/maxSumSubarray.cpp | //Divide and Conquer
//Time Complexity : O(nlogn)
#include <iostream>
#include <vector>
using vi = std::vector<int>;
// auto left_max(vi array, int left, int mid){
// int maxSum=array[mid];
// int sum = 0;
// for(int l = mid; l >=left; l--){
// sum +=array[l];
// maxSum = std::max(maxSum, sum);
// }
// re... | ALGO | 0.999969 | 5.302397 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-03-25T19:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14e5aa14ff4d... |
02b20830-0b95-4e61-8c84-5c51f94d6530 | girl-6/C- | 有理数的算术/有理数的算术/y.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
int GYS(int a, int b) //求最大公约数
{
int c = 0;
while (c=a%b)
{
a = b;
b = c;
}
return b;
}
string Itoa(int n) //实现int 到 string的类型转换
{
string s = "";
int c = 0;
while (c = n % 10)
{
char a = c + '0';
s.... | ALGO | 0.999073 | 3.876611 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2019-04-07T16:10:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "284e3a8d... |
aca9599d-5c49-4df2-af30-3fe373ae1a6b | prince-pastakiya/Weather-Stats | main.cpp | #include <iostream>
#include <iomanip>
#include <limits>
struct Data
{
float TotalRainfall;
int HighTemperature;
int LowTemperature;
float avgTemperature;
};
int main()
{
Data details[12];
float TotalRainfallYear = 0;
int HighestTemperature = std::numeric_limits<int>::min();
int LowestTemperature = st... | TOOL | 0.995686 | 6.296457 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-06-16T05:23: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": "974778c68997... |
88e2c40a-9684-4ae5-9a45-5c9203ee4db8 | heyfoz/cpp-baseball-bat-stats-simulator | BaseballBattingStatsSim.cpp | // Source(s) of logic assistance:
// <NAME>. (2018). Starting out with C++: From control structures through objects. Pearson.
//
// https://docs.microsoft.com/en-us/troubleshoot/developer/visualstudio/cpp/libraries/stl-sqrt-pow-functions
// https://docs.microsoft.com/en-us/cpp/standard-library/iomanip-functions?view... | ALGO | 0.985999 | 5.209615 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-10-15T20:58:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eebde930a9b... |
3398bbd8-af79-4707-be74-a604723ede5f | LeatherWang/calibcamodo | src/detect_aruco.cpp | #include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include "core/dataset.h"
#include "core/frame.h"
#include "core/measure.h"
#include "core/mapmark.h"
#include "core/maker_aruco.h"
#include "core/solver_initmk.h"
#include "core/solver_optmk.h"
#include "core/adapter.h"
#include "core/type.h"... | TOOL | 0.932314 | 4.332976 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-08-11T03:46: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": "999f999651... |
f5e20d0d-ec2b-4028-af1c-3b4e4ba63a9a | Ttdne/Applied-Algorithm | Discrete_Math/ONTHI/hamilton_cycle.cpp | #include <bits/stdc++.h>
using namespace std;
void printSolution(int path[]);
// Hàm kiểm tra nếu đỉnh v có thể được thêm vào vị trí 'pos'
bool isSafe(int v, bool graph[][100], int path[], int pos)
{
// Kiểm tra nếu đỉnh này là đỉnh kề của đỉnh vừa được thêm vào
if (graph[path[pos - 1]][v] == 0)
retur... | ALGO | 0.999995 | 5.991565 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-09-29T13:50: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": "b3494c40a748... |
e931d2a9-4dc3-46c5-acae-b68763bb96ab | juniorandrade1/Competitive-Programming | Codeforces/XIV All-Siberian Programming Contest named after I.V. Pottosin/07.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector< ii > vii;
#define INF 0x3F3F3F3F
#define LINF 0x3F3F3F3F3F3F3F3FLL
#define pb push_back
#define mp make_pair
#define pq priority_... | ALGO | 0.999981 | 3.652503 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-02-05T17:37:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53faef911... |
895df89d-2d21-48b3-a57f-d505f4d30aff | cappah/Alpha01 | Alpha01/mat4.h | #pragma once
#include "vec3.h"
#include "vec4.h"
#include "maths_func.h"
namespace gearengine { namespace maths {
struct mat4
{
union
{
float m[4 * 4];
vec4 columns[4];
};
mat4();
mat4(float diagonal);
vec4 getColumn(int index)
{
index *= 4;
return vec4(m[index], m[index + 1], m[index +... | TOOL | 0.958212 | 6.744885 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-05-04T03:33:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb3890c79a... |
5b22c08a-c570-4acd-94e5-8a9922d21b73 | CapTopGrade/SuperComp | MPI/4/4.1.cpp | #include <mpi.h>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
void print_matrix(const std::vector<int>& matrix, int rows, int cols) {
for (int i = 0; i < rows; ++i) {
for (int j = 0; j < cols; ++j) {
std::cout << matrix[i * cols + j] << " ";
}
std::c... | ALGO | 0.999961 | 5.335236 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-19T08:21: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": "ee194f0f5166... |
ba6c49ee-5fef-458d-81d9-df14b35ef819 | SparshJain2000/GFG_Solutions | Greedy/fractional-knapsack.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Item {
int value;
int weight;
};
// } Driver Code Ends
//class implemented
/*
struct Item{
int value;
int weight;
};
*/
// function to return fractionalweights
class Solution {
public:
double fractionalKnapsack(int W,... | ALGO | 0.99997 | 5.366589 | {
"github_metadata": {
"branch": "main",
"commit_count": 282,
"repo_created_at": "2020-12-10T18:09:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60bb72b58e... |
e239b302-9c28-4494-b589-b87d36631d13 | lofiprogram/data-structure | CHAP3 入门模拟/3.1 简单模拟/3.1 I.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
int n;
while (scanf("%d", &n) != EOF) {
int w1 = 0, draw1 = 0, lose1 = 0;
int w2 = 0, draw2 = 0, lose2 = 0;
int c1 = 0, j1 = 0, b1 = 0;
int c2 = 0, j2 = 0, b2 = 0;
for (int i = 0; i < ... | ALGO | 0.999448 | 3.121528 | {
"github_metadata": {
"branch": "main",
"commit_count": 236,
"repo_created_at": "2020-12-22T17:18: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": "0c79e7d289... |
10c6cd58-1d34-4500-a480-0fae2f17519b | gamesburner/AIDS-FDS-SEM3 | pr7_linkedlist_pinnacle_club.cpp |
#include<iostream>
using namespace std;
struct node
{
int prn;
string name;
struct node *next;
};
class linklist
{
node *president,*secretory;
public:
linklist()
{
president = NULL;
secretory =NULL;
}
void addMembers();
void countMember();
void deleteMembe... | ALGO | 0.99765 | 3.601589 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-13T14:49: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": "32d274901282... |
c81e3b56-513b-405a-abad-ad4f715561bf | raincross7/code-similarity | codes/train_code/problem383/problem383_182.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int N, M;
cin >> N;
vector <string> b_str(N);
for (int i = 0; i < N; ++i){
cin >> b_str.at(i);
}
cin >> M;
vector <string> r_str(M);
vector <string> merge_str_vec(N + M);
for (int i = 0; i < M; ++i){
cin >> r_str.at(i);
}
for(int i... | ALGO | 0.999831 | 3.640185 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "402a1bcc569f... |
f7e2cac4-9ed6-470d-841f-f879c5c7ee47 | manoflearning/cp-codes | Baekjoon OJ/02000-02999/2014.cpp | #include <iostream>
#include <queue>
#include <climits>
#define ll long long
using namespace std;
struct bb {
int x;
int fg;
};
struct cmp {
bool operator() (bb a, bb b) {
return a.x > b.x;
}
};
int k, n;
int arr[100];
priority_queue<bb, vector<bb>, cmp> pq;
int main() {
cin >> k >> n;
for (int i = 0; i < ... | ALGO | 0.999943 | 3.37658 | {
"github_metadata": {
"branch": "main",
"commit_count": 1899,
"repo_created_at": "2020-08-06T14:38: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": "66653461f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.