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 |
|---|---|---|---|---|---|---|---|
9817f1c3-7263-48d8-9c4d-d9e961c5d539 | pavelsevecek/OpenSPH | core/gravity/BarnesHut.cpp | #include "gravity/BarnesHut.h"
#include "gravity/Moments.h"
#include "objects/geometry/Sphere.h"
#include "objects/utility/Algorithm.h"
#include "quantities/Attractor.h"
#include "quantities/Storage.h"
#include "system/Profiler.h"
#include "system/Statistics.h"
#include "thread/Scheduler.h"
NAMESPACE_SPH_BEGIN
static... | ALGO | 0.999869 | 5.44868 | {
"github_metadata": {
"branch": "master",
"commit_count": 1149,
"repo_created_at": "2020-06-15T13:11:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 220,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83ea... |
d910a5a8-8030-4c08-b769-0ce9cbab2644 | VastoLorde95/Competitive-Programming | Codeforces/142 Division 1/D/D2.cc | #include <bits/stdc++.h>
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define _ ios_base::sync_with_stdi... | ALGO | 0.999699 | 3.280517 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2017-07-25T11:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 171,
"forks": 41,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "765b3f... |
9e6ae9c1-738d-404a-8cee-c855c840d63a | rk98991439/Cpp | 32.cpp | #include<iostream>
using namespace std;
int main() {
int i, n,factorial=1;
bool is_prime = true;
cout<<" Enter Number To Find Its Factorial and CHECK Number is Prime or Not : ";
cin>>n;
for (int a=1;a<=n;a++) {
factorial=factorial*a;
}
cout<<" a) Factorial of Given Number is ="<<factorial<<endl;
// p... | ALGO | 0.99972 | 3.724864 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-23T19:50:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f531a51af650... |
bf43b95d-a47b-4977-8893-62b565d2493f | pluruel/Algorithm-Study | Programmers/test/test3.cpp | #include <string>
#include <vector>
#include <map>
using namespace std;
class trie {
public:
char c;
map<char, trie*> nexts;
trie(char _c) : c(_c){}
};
int sum = 0;
void finds(trie* t, int depth, string &str) {
if(depth == str.length()) {
if(t->nexts.find(0) != t->nexts.end()) {
... | ALGO | 0.999948 | 4.733372 | {
"github_metadata": {
"branch": "master",
"commit_count": 134,
"repo_created_at": "2019-06-28T05:40:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0516cd7f... |
99bcecdf-4ad2-452a-828d-c6b6d6292031 | muratsngl/raytracingBVH | raytracer/parser.cpp | #include "parser.h"
#include "tinyxml2.h"
#include <sstream>
#include <stdexcept>
#include <algorithm>
using namespace parser;
BVHNode* buildBVHRecursive(std::vector<int>& indices, int start, int end, const std::vector<Primitive>& primitives);
void computeBoundingBox(const std::vector<Primitive>& primitives, int sta... | TOOL | 0.968579 | 6.243707 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-19T09:21: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": "6d61bc2f9857... |
21b774c6-f6df-47ff-80a6-98dfa2c865d7 | Aks32216/Daily-Practice | Array/maximumRepeatingElement.cpp | #include <bits/stdc++.h>
using namespace std;
#define set_precision cout << fixed << setprecision(10)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repb(i, a, b) for (int i = a; i >= b; i--)
#define replb(i, a, b) for (ll i = a; i >= b; i--)
#define repl(i, a, b) for (ll i = a; i < b; i++)
#define repit(ar... | ALGO | 0.999955 | 4.385645 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2022-08-18T22:46:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72cb600d1ee... |
a6df98da-bdfb-471e-8fc0-e3154d030ae8 | avarpow/THUAC2020-Miracle | calculator.cpp | //calculator for hex-grids
#include<vector>
#include<tuple>
#include<map>
#include<algorithm>
#include"gameunit.h"
#include"calculator.h"
namespace calculator {
// left-up, right-up, left-down, right-down, left-right, up, down
std::vector<Point> MAPBORDER() {
std::vector<Point> border = {
Point(-7, -8, 15)... | ALGO | 0.996539 | 4.288345 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-05-02T20:53:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41efcaebb... |
4060037d-d515-4f48-8bad-c7c955ddbe36 | chitranshp/DSA | DP/NthTribonacciNumber.cpp | // https://leetcode.com/problems/n-th-tribonacci-number/submissions/888201157/
class Solution {
public:
int tribonacci(int n)
{
int first = 0, second = 1, third = 1, fourth = 1;
if(n <= 1)
return n;
for(int i = 3; i <= n; i++)
{
fourth = first + second... | ALGO | 0.999946 | 5.973096 | {
"github_metadata": {
"branch": "main",
"commit_count": 552,
"repo_created_at": "2022-08-06T14:20: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": "ef5e69d2fc... |
cc0cc030-ea14-49bd-a86d-44d08d02fd94 | bilgili/Voreen | include/voreen/core/datastructures/volume/operators/volumeoperatorsecondderivatives.h | /***********************************************************************************
* *
* Voreen - The Volume Rendering Engine *
* ... | ALGO | 0.970525 | 6.60746 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2013-12-13T11:13:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00415f8... |
0210a4d1-8704-48d3-a5c0-bdbc1eb44a34 | Bdegraaf1234/AdventOfCode-019 | AdventOfCodeCLI/AdventOfCode1-1/AdventOfCode1-1.cpp | // AdventOfCodeCLI.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include "AdventOfCode1-1.h"
#include "../../AdventOfCodeLib/Parsing.h"
#include "../../AdventOfCodeLib/Calculating.h"
#include <string>
using namespace::std;
int main(int argc, char* argv... | ALGO | 0.987028 | 4.793734 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-01-26T17:35: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": "4a9da22be... |
19086903-20f3-4f6e-a541-206b6c853f9e | jcouyang/upgma | upgma.cpp |
#include <iostream>
#include <iomanip>
#include "upgma.h"
#include "de_alloc.h"
using namespace std;
struct tree_info
{
int node_num ;
char leaf_flag;
int child_node_nums[2] ;
int node_size ;
int *node_list ;
float branch_lengths[2] ;
} ;
int main () {
cout << "main" ;
int NSTRUCTS=7;
float a... | ALGO | 0.999856 | 3.812402 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2012-11-13T16:42:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd5f3eea17... |
2aecc05d-208e-4f1b-a468-0fee5f9fcd9f | dotnet/machinelearning | src/Native/FastTreeNative/getsurplusderivatives.cpp | //------------------------------------------------------------------------------
// <copyright company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
#include "stdafx.h"
#include... | ALGO | 0.999043 | 6.156638 | {
"github_metadata": {
"branch": "main",
"commit_count": 2999,
"repo_created_at": "2018-05-03T16:20:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9223,
"forks": 1926,
"issues": 979,
"pull_requests": 9
},
"file_meta": {
"content_id": "e0... |
a9616f97-5986-41b6-ab45-61c14b73c62e | motxx/AOJ | repository/1161.cpp | #include <assert.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#incl... | ALGO | 0.999712 | 3.836539 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2016-06-15T19:01: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": "74a29ecb2... |
60ee1e1c-fb6f-4d32-9e6a-856253a994bf | raincross7/code-similarity | codes/train_code/problem268/problem268_35.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define pow(x,y) modpow(x,y)
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
... | ALGO | 0.999954 | 3.770033 | {
"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": "baf5df0687f2... |
cdcfa36f-6f3c-468f-aee2-3269e46125f1 | WallEye-Polymaze/.github | WALL-EYE.ino |
#include <arduino.h>
#include "Wire.h"
#include "Adafruit_TCS34725.h"
// OLED display library
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// Define OLED display parameters
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_ADDR 0x3C
#define OLED_SDA 21
#define OLED_SCL 22
// Create an instan... | TOOL | 0.91186 | 6.018859 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-06-27T15:25:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ff63585844e... |
4cb6dba0-50dc-4090-8d08-a7509c8d9e92 | Swayam-code/DSA-Supreme-3.0 | 12. Linked List/class codes/code1.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
//constructor
Node(int value){
this -> data = value;
this -> next = NULL;
}
};
Node* insertAtHead(int value, Node* &head, Node* &tail){
//LL is empty-> Head and Ta... | ALGO | 0.999934 | 5.238908 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-05-05T18:47:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45f7bf4ded2f... |
aea625e3-638d-4572-88a4-830cea644086 | sallop/Master | d20111221/kurata_main.cc | #include "FBM.hh"
// matrix is symmetrix, and w[i,i] is a mean values of x[i]
int main(int argc, char **argv)
{
size_t D=3, P=3;
size_t K=5, M=1000, N=1000, T=10000;
char prefix[32]="K", odir[32] = "dir-dat";
g_energy_idx = 10;
g_denergy_idx = 4;
g_prop_idx = -1;
g_annealing_schedule_idx = 1;
s... | ALGO | 0.999816 | 4.506577 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2012-12-24T02:09:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08d0f43995... |
4716c3ec-3f01-4f05-a665-570a91bbf4a4 | shuaishuaima/Leetcode | 17_Letter Combinations of a Phone Number.cp | //
// main.cpp
// leetcode
//
// Created by <NAME> on 3/9/16.
// Copyright © 2016 <NAME>. All rights reserved.
//
#include <iostream>
#include <vector>
#include <utility>
using namespace std;
/*
Discription:
Given a digit string, return all possible letter combinations that the number could represent.
... | ALGO | 0.9981 | 5.728607 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-07-23T00:03: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": "ac16edd49d... |
35b31246-5a6f-4ed7-bead-e9c630d61866 | DivithV25/DSA | More_Questions/1657_CloseStrings.cpp | class Solution {
public:
bool closeStrings(string word1, string word2) {
if (word1.length() != word2.length()) {
return false;
}
vector<int> mp1(26, 0);
vector<int> mp2(26, 0);
for (int i = 0; i < word1.length(); i++) {
mp1[word1[i] - 'a']++;
... | ALGO | 0.99999 | 5.923689 | {
"github_metadata": {
"branch": "main",
"commit_count": 436,
"repo_created_at": "2024-09-13T03:28:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6844c06ab5... |
94e6bc10-c6b7-4ed4-9f8b-39c0b7188159 | balagithubaccount/cpp-program-my-workout | array-programs/80-distinctpairsdiff.cpp | // Write a Cpp program to count all distinct pairs for a specific difference...
#include <iostream>
using namespace std;
int main()
{
int size, i, j, diff1, diff2, count;
cout << "Enter the size of the array: ";
cin >> size;
int arr[size];
cout << "Enter the " << size << " elements: ";
for (i = 0; i < siz... | ALGO | 0.999842 | 5.380666 | {
"github_metadata": {
"branch": "master",
"commit_count": 378,
"repo_created_at": "2023-01-31T00:55:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "03ce7a6f... |
84f1af62-8e4d-480f-bd20-6fac0019465c | Tinyshellzz/leetcode | Q1769_Minimum_Number_of_Operations_to_Move_All_Balls_to_Each_Box.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <iostream>
using namespace std;
#include <vector>
#include "utils/to_string.h"
class Solution {
public:
vector<int> minOperations(string boxes) {
vector<int> res = vector<int>(boxes.size(), 0);
int total = bo... | ALGO | 0.999955 | 4.497109 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-20T03:08: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": "ddba968aa712... |
c802fcaa-e4c6-42ea-bb57-dc04094c534f | mehemmedv/competitive_programming | IN2106 - Algorithms for Programming Contests/Week 4/E.cpp | #include <bits/stdc++.h>
#define MX 505
using namespace std;
struct edge{
int from;
int to;
int length;
edge() {}
edge(int from, int to, int length): from(from), to(to), length(length) {}
bool operator<(const edge other) const{
return length<other.length;
}
};
int par[MX], rk[MX]... | ALGO | 0.999918 | 3.855177 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2017-06-06T14:16: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": "071bc5fe4... |
d3a23255-630e-4e38-95b0-e043ada1003a | abelgideon/Banking-System | bankingSystem.cpp | #include <iostream>
#include <vector>
#include <fstream>
using namespace std;
void createAccount(vector<string> &usernames, vector<string> &passwords, vector<double> &balances);
bool login(vector<string> &usernames, vector<string> &passwords, int &userId);
void viewBalance(vector<double> &balances, int userId);
void ... | TOOL | 0.912727 | 4.457345 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-06-03T13:29: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": "3a91abfc165... |
df450aff-de58-4002-899f-b807bb5f9159 | peanutzhen/leetcode | solutions/__196_shopee2022A.cpp | /*
* Author: peanutzhen
* Created time: 2021/8/23 15:15:05
*/
#include <bits/stdc++.h>
using namespace std;
int search_start(vector<int> &a, int target) {
int n = (int) a.size();
int low = 0;
int high = n - 1;
while (low <= high) {
int mid = (low + high) >> 1;
if (a[mid] ... | ALGO | 0.999972 | 5.201149 | {
"github_metadata": {
"branch": "stable",
"commit_count": 241,
"repo_created_at": "2021-01-15T02:13:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf988eae... |
dafe3db8-f0fc-49f0-8cf6-ab03732842a5 | JMcunst/Baekjoon-Algo | baekjoon_algo/baekjoon_algo/10866.cpp | #include<iostream>
#include<deque>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int numberOfCommand;
deque<int> deque;
string str_command;
cin >> numberOfCommand;
for (int i = 0; i < numberOfCommand; i++) {
cin >> str_command;
if (str_comm... | ALGO | 0.999435 | 4.898462 | {
"github_metadata": {
"branch": "main",
"commit_count": 368,
"repo_created_at": "2021-01-24T12:22: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": "9b16c2d327... |
19d61435-b7ad-4364-9609-0e4a29595d3a | Tzadiko/JaneStreetPuzzles | December 2020/Matrix.h | #pragma once
#include "Direction.h"
#include "Offset.h"
#include <iostream>
#include <vector>
#include <memory>
#include <deque>
#include <unordered_map>
#include <string>
#include <sstream>
#include <algorithm>
#include <iterator>
struct Location
{
size_t row_;
size_t col_;
size_t val_;
Offset Subt... | ALGO | 0.98463 | 6.808716 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-11-28T02:56:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 286,
"forks": 46,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "574115... |
ac330f44-aa2d-4554-9920-4d7051ef3006 | roboterclubaachen/xpcc | src/xpcc/math/utils/bit_operation.hpp | // coding: utf-8
// ----------------------------------------------------------------------------
/* Copyright (c) 2009, Roboterclub Aachen e.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
... | TOOL | 0.959511 | 6.468797 | {
"github_metadata": {
"branch": "develop",
"commit_count": 4635,
"repo_created_at": "2012-03-05T10:49:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 172,
"forks": 39,
"issues": 11,
"pull_requests": 1
},
"file_meta": {
"content_id": "245... |
36382af0-7cd3-4e3c-8685-dc9f6d204778 | andrewqt/Competitive-Programming | IOI/_2013_P5_Robots/_2013_P5_Robots.cpp | #include "robots.h"
#include <bits/stdc++.h>
using namespace std;
int A, B, N;
pair<int, int> arr[1000005];
int w[50005], s[50005];
bool chk(int k){
int idx = 0;
priority_queue<int> pq;
for(int i = 1; i<=A; i++){
while(idx < N && arr[idx+1].first < w[i]){
pq.push(arr[++idx].second);
}
int c = k;
while(... | ALGO | 0.999955 | 3.645177 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-09-08T12:27:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb43336a4... |
784bb15c-47eb-4659-b728-bdfc25a238c1 | Meshcapade/difflocks | extensions/include/cuMat/src/ReductionOps.h | #ifndef __CUMAT_REDUCTION_OPS_H__
#define __CUMAT_REDUCTION_OPS_H__
#include "Macros.h"
#include "ForwardDeclarations.h"
#include "Constants.h"
#include "Iterator.h"
#include "ReductionAlgorithmSelection.h"
#include "Errors.h"
#if CUMAT_NVCC==1
#include "../../third-party/cub/cub.cuh"
#endif
#ifndef CUMAT_CUB_DEBUG
... | ALGO | 0.997325 | 3.16725 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-04-29T07:00:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 100,
"forks": 6,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "00dcfe6c16f... |
b4e7817f-d66a-4299-8538-435ee5e0efe4 | t-ashula/hironoproblem | main.cpp | #include <cstdint>
#include <iostream>
#include <cmath>
#include <limits>
#include <cmath>
#include "natural.h"
#include "prime.h"
#include "primefactor.h"
using namespace sencha;
// 対象にする桁モジュロマスク
static const natural digit = 100000ll;
//! nの階乗を素因数分解した時、素数pの指数は何になるか
//! 小さな数での実験は行なっているが
//! 未証明の推論が含まれているので正しさに注意を払う... | ALGO | 0.999842 | 4.785826 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2013-06-20T01:26: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": "f2974362f... |
7ee6e193-d27e-4ec2-b32e-eadb76761999 | xluos/ACM | HDU/最短路/一个人的旅行/main.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF=0x3f3f3f3f;
const int N=1008;
int n,m,s,t,d;
int Chara[N][N],dis[N],vis[N];
void Dijkstra(int src)
{
for(int i=0; i<m; i++)
{
dis[i] = Chara[src][i];
vis[i] = 0;
}
dis[src] = 0;
vis[src] = 1;
for(int i=0; i<m; i++)
... | ALGO | 0.999892 | 3.692276 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2017-06-13T11:04:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb015516e... |
5b80306f-c836-4795-8d6d-139be1ec3887 | morris821028/UVa | volume131/13184 - Counting Edges and Graphs.cpp | #include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1e9+7;
int main() {
int mask[8192] = {};
mask[1] = 1;
for (int i = 2; i < 8192; i++) {
if (mask[i] == 0) {
mask[i] = 2;
for (int j = i+i; j < 8192; j += i) {
if (mask[j] == 0) {
int n = j, cnt = 0;
while (n%i == 0)
n /= i... | ALGO | 0.999878 | 4.338499 | {
"github_metadata": {
"branch": "master",
"commit_count": 1197,
"repo_created_at": "2013-06-14T12:34:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 571,
"forks": 269,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "c92... |
a6909458-cc83-4d68-a5d4-ec77e063db6b | WayneWei228/Algorithm | AdventOfCode/2015/Solution/23.cpp | #include <cstdio>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long int64;
struct Computer; // 后面补充
struct Instruction { // 有四个方法,没有实现
// 有很多子类,但实现起来不一样
virtual ~Instruction() = default;
// 析构:销毁这个类的时候可以做事情,
// default:什么都不做
//... | ALGO | 0.999597 | 3.702278 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2022-08-08T06:28:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c719ef3f998... |
4680dee0-ab62-4a2b-902d-77e5a50d830f | Geant4/geant4 | source/processes/electromagnetic/lowenergy/src/G4PenelopeRayleighModelMI.cc | //
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration... | ALGO | 0.992417 | 4.621696 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2016-06-21T08:25:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 705,
"forks": 340,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "ac9523... |
e5dbb822-5347-4d4a-973c-c27e287c9697 | L-1ngg/AlgorithmCode | codeforces/contest/1029/2117F.cpp | #include <bits/stdc++.h>
#define ranges std::ranges
#define views std::views
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;
using pii = std::pair<int, int>;
using a3 = std::array<int, 3>;
using a4 = std::array<int, 4>;
const int dx[8] = { -1, 0, 1, 0, -1, -1, 1, 1 }, dy[8] = { 0, 1, 0,... | ALGO | 0.999578 | 4.90943 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2025-07-11T16:03:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11035aaf8... |
800f07e1-6e32-436a-8480-b15ed542f08e | siddharth20323/TOC-PRACT | TOC PRACTICALS/Q5.cpp | #include <iostream>
#include <string>
using namespace std;
// Function prototypes
void q0(string w, int i); //even even
void q1(string w, int i);
void q2(string w, int i);
void q3(string w, int i);
void q0(string w, int i) {
cout << "STATE q0 (Accepting)" << endl;
if (i == w.length()) {
cout << "Stri... | ALGO | 0.999355 | 4.381218 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-25T19:04:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9936a65ed7cc... |
76f04e41-366d-4096-aca0-f70055817e74 | wizleysw/backjoon | 1260/solve.cpp | // https://www.acmicpc.net/problem/1260
// DFS와 BFS
// Written in C++ langs
// 2020. 02. 03.
// Wizley
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
using namespace std;
int MATRIX[1001][1001]={0,};
int DFS_VISIT[1001]={0,};
int BFS_VISIT[1001]={0,};
void addEdge(int... | ALGO | 0.999993 | 4.79029 | {
"github_metadata": {
"branch": "master",
"commit_count": 506,
"repo_created_at": "2019-12-28T07:51:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0223b776... |
88bb7e76-faf5-400d-bab4-e69e5f1c15a3 | Mooophy/Cpp-Primer | ch11/ex11_27_28_29_30.cpp | //
// @<NAME>
//
// Exercise 11.27:
// What kinds of problems would you use count to solve?
// When might you use find instead?
// I would use count to deal with multimap or multi multiset.
// As for the associative container that have unique key, I would use find instead of count.
//
// Exercise 11.28:
// Define and... | ALGO | 0.991077 | 3.166843 | {
"github_metadata": {
"branch": "master",
"commit_count": 1813,
"repo_created_at": "2014-05-09T14:43:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8228,
"forks": 2982,
"issues": 109,
"pull_requests": 90
},
"file_meta": {
"content_id":... |
e6f8db2b-ca34-4889-82ab-f3e163ae44d3 | 22009939/COM2123 | main.cpp | #include <iostream>
#include <cmath>
using namespace std;
double calculateTreeHeight(double h, double d, double angle) {
double radians = angle * M_PI / 180.0;
return (h + (d + (d / 12.0)) * tan(radians)) / 12.0;
}
int main() {
double h, d_feet, d_inches, angle;
cout << "Enter the height of your eye ... | TOOL | 0.999609 | 6.144606 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-15T21:24: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": "6f3d39a2a925... |
53bea631-dcea-4c04-9a81-23e219bab397 | jhpc-quantum/RIKEN-braket | ket/include/ket/mpi/utility/apply_local_gate.hpp | #ifndef KET_MPI_UTILITY_APPLY_LOCAL_GATE_HPP
# define KET_MPI_UTILITY_APPLY_LOCAL_GATE_HPP
# include <cstddef>
# include <vector>
# include <utility>
# include <ket/utility/meta/ranges.hpp>
# include <ket/mpi/qubit_permutation.hpp>
# include <ket/mpi/utility/simple_mpi.hpp>
# include <yampi/datatype_base.hpp>
# incl... | ALGO | 0.993181 | 6.671083 | {
"github_metadata": {
"branch": "master",
"commit_count": 500,
"repo_created_at": "2017-11-13T08:21:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 17,
"forks": 1,
"issues": 24,
"pull_requests": 1
},
"file_meta": {
"content_id": "aa1c80a... |
08bc1b87-f3f4-41b4-bb8d-ecdf6ef0ddad | dhananjayjindal/LeetCode | Combination Sum - GFG/combination-sum.cpp | // { Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution {
public:
//Function to return a list of indexes denoting the required
//combinations whose sum is equal to given number.
void F... | ALGO | 0.999774 | 5.766008 | {
"github_metadata": {
"branch": "main",
"commit_count": 516,
"repo_created_at": "2022-02-20T15:06: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": "ed94983e4f... |
4b21eca5-b3f8-4b0d-affc-4f1657f532cc | khush-01/Competitive-Programming | Codeforces/427A - Police Recruits.cpp |
// Problem: A. Police Recruits
// Contest: Codeforces - Codeforces Round #244 (Div. 2)
// URL: https://codeforces.com/problemset/problem/427/A
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
using namespace std;
#define pi (3.14159... | ALGO | 0.999948 | 4.459888 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-03-12T04:37:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f215326e46e6... |
41432bd3-ea3b-4980-98da-8558d78eb1f6 | MiloGRambaldi/QFCL | qfcl_0_4/qfcl/random/distribution/normal_inversion.hpp | // Copyright (c) 2012 M.A. (Thijs) <NAME>, http://sitmo.com/
//
// Use, modification and distribution are subject to the BOOST Software License.
// (See accompanying file LICENSE.txt)
#ifndef QFCL_RANDOM_DISTRIBUTION_NORMAL_INVERSION_HPP
#define QFCL_RANDOM_DISTRIBUTION_NORMAL_INVERSION_HPP
#include <qfcl/random/d... | ALGO | 0.994796 | 5.82899 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2014-01-17T01:31: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": "a1daa24cf... |
4ff004e0-0b6f-419d-b8b4-9f88f9de5581 | Kritika30032002/kritika_leetcode | Frequency Game - GFG/frequency-game.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
int LargButMinFreq(int arr[], int n) {
// code here
map<int,int> mp;
for(int i=0;i<n;i++){
... | ALGO | 0.999871 | 5.133701 | {
"github_metadata": {
"branch": "main",
"commit_count": 2211,
"repo_created_at": "2022-06-18T08:33: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": "4271f7f8b... |
39d0284b-573e-491d-ab32-4dce6f224c4d | pumpkin1231/SE | Sudoku/src/sudoku.cpp | #include "board.h"
#include "sudoku.h"
#include <vector>
#include <fstream>
#include <algorithm>
#include <unordered_set>
#include <random>
#include <ctime>
using namespace std;
const string filepath_game = "game.txt";
const string filepath_final = "final.txt";
const string filepath_answer = "answer.txt";
// 随机数种子
d... | ALGO | 0.925805 | 4.061613 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-06-22T08:34: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": "0a15f056ab4... |
ce03c0bf-fc40-4468-ab6e-1d115c6109e8 | bcohen116/Data-Structures-Team-1 | Team1-Lab1-Code-master/Lab6-code/BinaryTree.cpp | //Written by <NAME> Edited by <NAME>
//Group 1: <NAME>, <NAME>, <NAME>. //10/20/2016
/* PusedoCode
class for the binary tree
A node of the tree
add function
create newNode
insert newNode
endf
search function
while
endf
endc
main
while reading file
read line... | ALGO | 0.998615 | 3.724754 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-08-25T20:40:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "887c4afb3a... |
aaebeb2f-566b-43ba-82b7-1c811a9130b8 | Sefayet-Alam/New-CP-submissions_vol_1 | C_Save_the_Magazines.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define scl(n) scanf("%lld", &n)
#define fr(i,n) for (ll i=0;i<n;i++)
#define fr1(i,n) for(ll i=1;i<=n;i++)
#define pfl(x) printf("%lld\n",x)
#define endl "\n"
#define pb ... | ALGO | 0.999969 | 3.615533 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2022-12-23T12:59: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": "2b379cc63... |
2971aedf-b018-4e11-a11e-dc30d108a115 | Um-ded/problem-solving | Codeforces Codes/508.Prob550C(Divisibility by Eight).cpp | ///*/////////////////////////////*///
/// IN THE NAME OF ALMIGHTY ALLAH ///
///*/////////////////////////////*///
///*///////////////*///
/// Author : Um_ded ///
///*///////////////*///
///*//////////////////////////////////////////*///
/// "When you want something, all the universe ///
/// conspires in helping you ... | ALGO | 0.999833 | 3.93509 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-02-20T21:25: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": "73927cf599d... |
964db30f-7260-4398-b134-c6d54966e73e | shivammaheshwari9837/Data-Structures-and-Algorithms-C-plus-plus | Linked List/Intersection Point in Y Shapped Linked Lists.cpp | /*
Ques :- Intersection Point in Y Shapped Linked Lists
Theory:-There are many methods to solve this problem.
Method Using difference of node counts:
1) Get count of the nodes in the first list, let be c1.
2) Get count of the nodes in the second list, let be c2.
3) Get the difference of counts d = abs(c1 – c2)
4) N... | ALGO | 0.99995 | 4.931972 | {
"github_metadata": {
"branch": "master",
"commit_count": 314,
"repo_created_at": "2020-08-06T04:49:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47ea1d... |
f65040da-ea22-4be4-8419-25139eb397ad | SeregaL2001/2.16_prog_7_sem | method.cpp | #include "method.hpp"
// добавление элемента в конец списка
void push_back(Point **last, double t_, double x1_, double x2_, double p1_, double p2_) {
Point *pt = (Point*)malloc(sizeof(Point));
pt->t = t_;
pt->x1 = x1_;
pt->x2 = x2_;
pt->p1 = p1_;
pt->p2 = p2_;
pt->next = NULL;
(*last... | ALGO | 0.999923 | 3.970181 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-12-17T14:42: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": "1392938b41f... |
50fd23cb-cbe7-44a8-a872-1538b1fe329a | ShuvaG/Vistas-of-Advanced-Computing | Rounding/Rounding/Rounding.cpp | // Assignment 2B - Round Function
#include <iostream>
using namespace std;
float roundoff(float number, int x, int type)
{
float newNumber, bigger_number, finalAnswer, roundofferror, multiplier;
string up, down, integer;
finalAnswer = 0;
multiplier = pow(10, x);
newNumber = number * multiplier;
switch (type)
{... | ALGO | 0.999705 | 4.2459 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-06-11T18:36: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": "eb7c711ac... |
b71ff8f2-5118-4631-8146-08dce6f14431 | rubabredwan/ioi-practice | Random/boi 2013/numbers.cpp | /* <NAME> */
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0;i<n;i++)
#define repn(i, n) for(int i=1;i<=n;i++)
#define set(i, n) memset(i, n, sizeof(i))
#define pb push_back
using namespace std;
long long dp[20][15][15][2][2][2];
vector<int>digits;
int isPal(int a, int b, int c){
if(b == c) return 1;
if(... | ALGO | 0.999576 | 3.904415 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2020-12-22T17:58: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": "affcce54a... |
904cc80b-9889-418f-b9d4-a8bb312fe438 | coffee-realist/cr_tinka | contest_8/B.cpp | #include <vector>
#include <climits>
#include <stdio.h>
#pragma GCC optimize("Ofast")
using namespace std;
class SegmentTree {
private:
vector<pair<int, int>> tree;
int n;
pair<int, int> merge(const pair<int, int>& left, const pair<int, int>& right) {
if (left.first == right.first) {
... | ALGO | 0.999975 | 5.360795 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2024-02-27T18:41: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": "f14cd5920... |
2ebb06d9-f33d-415b-a937-60b296f24b1e | kushal-sharma/logo_detection | vocab.h | #include "lib.cpp"
int getDesc(const string file, const Ptr<ORB>detector,
vector<KeyPoint>& kp, Mat& desc){
Mat img = imread (file);
cout << "Processing .." << file << endl;
detector->detect(img, kp);
detector->compute(img, kp, desc);
return 0;
}
int getDesc(const vector<string>& files, ... | ALGO | 0.982012 | 5.068875 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-08-19T18:54: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": "bf844e143f... |
0a5c1ae8-e604-48bb-9401-2bde25af41e9 | akansha-singh/dp | LCS/longest common substring.cpp | // Recursive
class Solution{
public:
int rec(string x,string y,int n,int m,int maxm){
if(n==0||m==0)return maxm;
if(x[n-1]==y[m-1]){ //explain choice diagram
maxm= rec(x,y,n-1,m-1,maxm+1);
}
maxm = max(maxm,max(rec(x,y,n,m-1,0),rec(x,y,n-1,m,0)));
ret... | ALGO | 0.999983 | 5.924893 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-03-09T11:18: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": "0aee9a7cd60a... |
e3e27882-b57b-4313-a1a0-e72eb06c2bfa | forbidden404/Coding-Challenges | Hackerrank/algorithms/longest-increasing-subsequent.cpp | #include <bits/stdc++.h>
using namespace std;
// Complete the longestIncreasingSubsequence function below.
long memo[100005];
int longestIncreasingSubsequence(vector<int> arr) {
memset(memo, 0, sizeof(memo));
int longest = 0;
for (int i = 0; i < arr.size(); i++) {
int pos = lower_bound(memo, mem... | ALGO | 0.999939 | 5.184351 | {
"github_metadata": {
"branch": "master",
"commit_count": 90,
"repo_created_at": "2019-05-09T19:29:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1f93220a... |
f38f95cb-ecb4-495e-83bd-0df14d6e1bf0 | riptideiv/USACO-Algorithms | Other Problems/problems/xor/xor.cpp | /*************************************
* Notes for XOR
* operator^ is bitwise xor
* you can use prefix sums for arrays
* because the opposite of xor is xor itself, instead of subtracting, just xor the previous part off
**************************************/
#include <bits/stdc++.h>
using namespace std;
int n, q;
... | ALGO | 0.999913 | 4.654154 | {
"github_metadata": {
"branch": "master",
"commit_count": 151,
"repo_created_at": "2022-08-22T06:43: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": "bdea0224... |
3286f614-9a76-4119-aa1a-7a3e6d7ad187 | namhn89/algorithm | codelearn/sasuke26/i/i.cpp | using namespace std;
#include<bits/stdc++.h>
#define Debug(...) fprintf(stderr, __VA_ARGS__)
#define st first
#define nd second
#define FORE(i,a,b) for(int i=(a),b_=(b);i<=b_;++i)
#define FORD(i,a,b) for(int i=(a),b_=(b);i>=b_;--i)
#define TR(c, it) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); it++)
#define... | ALGO | 0.999994 | 4.196693 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-04-22T01:54: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": "bfc0306f4... |
0d29e743-7f80-4451-86a6-63138bb68db2 | XiaoJiNu/data-structure-yr | 03-Sorting-Advance/Course Code (C++)/08-Quick-Sort-Three-Ways-yr/main.cpp | #include <iostream>
#include "SortTestHelper.h"
#include "InsertionSort.h"
#include "MergeSort.h"
#include "MergeSortOptimal.h"
#include "QickSort.h"
#include "QickSort2Ways.h"
#include "QickSort3Ways.h"
using namespace std;
int main() {
int n = 1000000;
// 测试1 一般性测试
cout<<"Test for random array, siz... | TEST | 0.933698 | 5.091054 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-01-03T09:12: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": "af0269a68b51... |
1156503a-81e7-4caa-81d5-7bdae5c4cb99 | KevinHaoranZhang/Leetcode | Sequence/q1-q99/q20-q29/q24/q24.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
#include <iostream>
class Solution {
public:
L... | ALGO | 0.99997 | 5.946472 | {
"github_metadata": {
"branch": "master",
"commit_count": 195,
"repo_created_at": "2020-07-17T03:49:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b7c2c7c... |
42058052-16af-46f1-b371-1b9c6aaafd58 | lin-dong-whale/vs- | TranslationBaseLiblouis/TranslationBaseLiblouis/TranslationBaseLiblouis/CompileFlashTable.cpp | #include "CompileFlashTable.h"
#include"utf-8tounicode.h"
#include"malloc.h"
#pragma warning(disable:4996)
#define SIGNSIZE 20902
char Dot01[64] = { "\0" };//点序翻译结果
typedef struct SIGNNN {
u16 unicode;
char Dot[64];
}chndanzi;
chndanzi signtable1111[SIGNSIZE]{};
typedef struct numtodot {
char num[7];
char do... | TOOL | 0.900469 | 3.306323 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-11-15T06:52: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": "010f925395... |
80507fd4-3e3e-45d5-881a-9bd7f5e9a114 | midas-journal/midas-journal-845 | source/itkMSKFCMClassifierInitializationImageFilter.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.929201 | 7.115809 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2011-12-10T10:54:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c961ff75e5... |
77a06f56-8b48-49cd-8412-b2ad7662dff7 | ivanpondal/mn-tp3 | entregable/src/spline.cpp | #include <spline.h>
Spline::Spline(){
}
Spline::Spline(int n){
generarSistema(n);
}
Spline::Spline(const vector<double> &y){
generarSistema(y.size());
generarSpline(y);
}
void Spline::generarSistema(int n){
vector<vector<double> > sistema(n, vector<double>(2, 0));
// Primera y última fila
sistema[0] = {1, 0}... | ALGO | 0.999229 | 4.449507 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2015-10-24T23:07:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c40b4db... |
6d458b6c-6282-484b-adfc-8efcf3989641 | jiadaizhao/LintCode | 0101-0200/0187-Gas Station/0187-Gas Station.cpp | class Solution {
public:
/**
* @param gas: a vector of integers
* @param cost: a vector of integers
* @return: an integer
*/
int canCompleteCircuit(vector<int> &gas, vector<int> &cost) {
// write your code here
int n = gas.size();
int total = 0;
for (int i = ... | ALGO | 0.999982 | 5.651799 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2017-10-02T03:48:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 72,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d2ba1d4... |
1473d092-b791-4f86-8551-9dd59ee8440f | superwonso/Durable-Subgraph-Matching | original/query_decomposition.cpp | #include "query_decomposition.h"
#include <algorithm>
#include <iostream>
// Query decomposition function implementation
QueryDecomposition decomposeQuery(const Graph& Q, const std::unordered_map<std::string, int>& label_counts) {
QueryDecomposition result;
// Copy vertex labels from the query graph
resul... | ALGO | 0.999884 | 6.165485 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-08-06T11:49:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88dd1c42dbb... |
19868e8c-d25a-4993-a952-faf88eb99e22 | floresjmjr/cplusplus | sudokuSolver/sudokuSolver.cpp | #include "inputSudoku.cpp"
// #include "cubeClass.cpp"
#include "solved.cpp"
#include "index.h"
#include <fstream>
//SudokuSolver class
class SudokuSolver
{
public:
int sudokuState[9][9];
int *cubePointers[9][9];
int *columnPointers[9][9];
int *rowPointers[9][9];
//int *cubePointers[9][3][3]; //Wouldn't i... | ALGO | 0.991504 | 3.301818 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-12-21T22:36: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": "643c2efd46e... |
d24e1a74-cce0-4fa8-847a-f3d34aae872a | Ryan-Sadeghi-Javid/competitveSoultions | bobs_word_conversion.cpp | //
// Created by <NAME> on 2021-06-23.
//
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
string a; string b;
cin >> a; cin >> b;
int cnt = 0;
if(a == b) {
cout << "Yes";
return 0;
}
if(b.size() != (a.size()-1)) {
... | ALGO | 0.99999 | 4.288624 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-01-23T00:20: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": "f64e7ce071... |
db31e610-b97c-475d-9bee-6842c5efcd26 | dpnguyen94/topcoder | ToastXRaspberry.cpp | #include <iostream>
#include <stdio.h>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <math.h>
#include <algorithm>
#include <map>
#include <set>
#include <limits.h>
#include <memory.h>
using namespace std;
#define REP(i,a,b) for (int i=(a);i<(b);i++)
#define FOR(i,a,b) for (int i=(a... | ALGO | 0.999541 | 4.745363 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-01-19T23:15: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": "e49ff0ea10... |
4c406f47-0f49-41f7-a8a1-9d5a5088a209 | huytran298/Code | C++/Cses/Range_Queries/2166.cpp | // time-limit: 3000
/*
**********************************
Author : Akkotsu / huyhuyne
**********************************
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define maxN (ll) 1e6 + 5
#define endl '\n'
#define fi first
#define se second
#define infi (int)(1e18)
#define bend(a... | ALGO | 0.999328 | 4.588854 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2024-08-08T12:37:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "900fb4fdcd7... |
7de142c5-dcc6-4ee7-bc18-3c090cc11024 | gowthu777/CSA0322-DATATSTRUCTURES | matrix multiplication.cpp | #include <stdio.h>
#define ROW1 3
#define COL1 3
#define ROW2 3
#define COL2 3
void matrixMultiply(int mat1[ROW1][COL1], int mat2[ROW2][COL2], int result[ROW1][COL2]) {
int i, j, k;
for (i = 0; i < ROW1; i++) {
for (j = 0; j < COL2; j++) {
result[i][j] = 0;
for (k = 0; k < COL1... | ALGO | 0.999956 | 4.574321 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-02T05:18: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": "1a3433db36ce... |
59cba9df-05cb-440a-99a3-31a43966914c | ImperishableMe/codeforces-submissions | codeforces/274/A.cpp | // HK HK HK HK HK HK JSN JRR
#include <bits/stdc++.h>
#define PII pair < int , int >
#define PIB pair < int , bool >
#define PI 2.0*acos(0.0)
#define ll long long int
#define FOR(i, a, n) for(int i = int (a); i < int (n); i++)
#define vi vector < int >
#define pb push_back
#define ceiling(a, b) (a %b == 0)?(a/b):(... | ALGO | 0.999849 | 3.334283 | {
"github_metadata": {
"branch": "master",
"commit_count": 1316,
"repo_created_at": "2021-02-22T10:48: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": "08c329a... |
d5e812c5-121e-4b02-8580-3e183ae8c96b | robertoBenavides/GestorDeDB | GestorDeDB/ArbolAVL.h | #include "Nodo.h"
#include <stack>
#include <vector>
#include <string>
#include <iostream>
#include <queue>
#include "Fecha.h"
#include "StringAdapter.h"
#include "Indice.h"
using namespace std;
#pragma once
template <class T>
struct ArbolAVL {
int maxline=0;
Indice indx;
StringAdapter SA;
bool changed=false;
Nod... | ALGO | 0.997053 | 4.05141 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2021-07-12T16:23: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": "8e8fd27ff... |
6ea712e9-5bbd-423a-a562-c6807b4d9526 | thecodingwizard/competitive-programming | IOI/IOI 13-Wombats/wombats.cpp | /*
* http://blog.brucemerry.org.za/2013/07
*
* For two rows { X, Y }, we will calculate the 2d array cost[i][j] = cost to
* go from the i'th column of the X'th row to the j'th column of the Y'th row.
*
* We can calculate cost for { X, X+1 } in O(c^2) time.
*
* Now, note that if we have cost[i][j] for { X, Y } a... | ALGO | 0.999646 | 3.688379 | {
"github_metadata": {
"branch": "master",
"commit_count": 946,
"repo_created_at": "2018-11-29T17:03:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 83,
"forks": 22,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b379b7... |
227d9f08-36ee-4136-acd5-525736010868 | raynacode/leetcode | 59.cpp | class Solution {
public:
vector<vector<int> > generateMatrix(int n) {
vector<vector<int> > res(n, vector<int>(n));
int depth = n / 2;
int count = 1;
for (int i = 0; i < depth; i++) {
int gap = n - 1 - 2 * i;
for (int j = i; j < n - i - 1; j++, count++) {
res[i][j] = count;
... | ALGO | 0.999956 | 5.241655 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2015-06-03T06:14: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": "19ac18cb... |
47c1cb3e-257a-4374-8043-f01c67f7089a | Justin-roy/DSA-COMPLETE-SERIES | Linked List/Find the Middle Node of the Linked list using two Pointers.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *link;
protected:
private:
}*head=NULL;
void Create(int A[],int n)
{
Node *t,*r;
head = new Node;
head->data = A[0];
head->link = NULL;
t = head;
for(int i=1;i<n;i++)
{
r = new Node;
r->da... | ALGO | 0.999962 | 4.721715 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-02-22T08:26: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": "354cc679ae... |
5b02e34f-a2e1-42f8-9778-dd3b17f15b78 | Kang-il/TIL | greedy/greedy_ex20.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string S,T;
string tmp;
void input(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin>>S>>T;
}
void solution(string s, string t){
if(s==t) {
cout<<"1\n";
exit(0);
}
... | ALGO | 0.999989 | 4.06584 | {
"github_metadata": {
"branch": "develop",
"commit_count": 185,
"repo_created_at": "2021-12-15T05:36: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": "0497679... |
c3f675ea-305f-4df2-9b31-b9ac4384cc32 | BoyManWamen/TrainingExercises | src/MergeList.cpp | class Node {
public:
int val;
Node* next;
Node(int initialVal) {
val = initialVal;
next = nullptr;
}
};
Node* mergeLists(Node* head1, Node* head2) {
Node* head = (head1->val < head2->val) ? head1 : head2;
Node* tail = head;
Node* current1 = (head1->val < head2->val) ? head1->nex... | ALGO | 0.999844 | 5.71775 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2023-11-28T01:35: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": "d6de1c51992... |
591672a9-64a3-4f3d-b4d6-3dcb1e5d5eea | esa/pagmo2 | include/pagmo/utils/hv_algos/hv_bf_fpras.hpp | /* Copyright 2017-2021 PaGMO development team
This file is part of the PaGMO library.
The PaGMO library is free software; you can redistribute it and/or modify
it under the terms of either:
* the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or... | ALGO | 0.998822 | 6.705189 | {
"github_metadata": {
"branch": "master",
"commit_count": 4643,
"repo_created_at": "2017-01-08T21:53:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 880,
"forks": 167,
"issues": 47,
"pull_requests": 8
},
"file_meta": {
"content_id": "9c7... |
d93a46ba-f50e-46c3-8606-02dacf21a5f0 | jccpp/dynamic-programming | src/memo/sum.h | #pragma once
#include <tuple>
#include <vector>
namespace memo {
/**
* @brief Returns true if the sum of the numbers in the vector is equal to the target sum.
*
* @param targetSum The target sum.
* @param numbers The numbers to sum.
* @return True if the sum of the numbers in the vector ... | ALGO | 0.999617 | 6.253218 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-06-17T02:48:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a230696d9081... |
112f4f1a-d008-4c10-a9bf-a3378eab92b8 | eklavyaK/CP-Algorithms | Graph/EulerianCircuit.cpp | #include<bits/stdc++.h>
typedef long double ld;
typedef long long ll;
using namespace std;
/*Eulerian Circuit is a path which starts at a node and goes through each and every edge 'exactly' once and terminates at the starting node.
Eulerian Circuit will exist only if degree of every node is even and all the vertices ar... | ALGO | 0.999997 | 4.603811 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2022-06-02T10: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": "f8f5d80bb... |
8848c505-3ad1-4927-98aa-8db730d9bab6 | krishnenduduttadc/DSA_Master_cpp | LinkedListL2/Array2LLBasic.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
vector<int> all;
int total = 0;
set<int> st;
struct Node
{
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = nullptr;
}
};
Node *createLinkedList(int arr[], int n)
{
if (n == 0)
retu... | ALGO | 0.999972 | 4.486038 | {
"github_metadata": {
"branch": "main",
"commit_count": 122,
"repo_created_at": "2024-07-06T11:48:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e709c5f6e4... |
983e5592-c3d4-4d87-869d-38d2542244a9 | nermeenwageh10/Leetcode-Solutions | Solutions/C++/1888-minimum-number-of-flips-to-make-the-binary-string-alternating/1888-minimum-number-of-flips-to-make-the-binary-string-alternating.cpp | class Solution {
public:
int minFlips(string s) {
s += s;
int n = s.size();
vector<vector<int>> need(n, vector<int>(2, 0));
for (int i = 0; i < n; i++){
int zero = (s[i] == '0');
if (i % 2 == 0){
need[0][0] += !zero;
ne... | ALGO | 0.999987 | 5.049393 | {
"github_metadata": {
"branch": "main",
"commit_count": 652,
"repo_created_at": "2023-02-16T12:25:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 315,
"forks": 83,
"issues": 3,
"pull_requests": 3
},
"file_meta": {
"content_id": "d115e6d... |
976b049a-8fe6-48b4-8f9a-5aa5f71606c2 | danilovict2/Competitive-Programming-Problems | USACO/Runaround Numbers/main.cpp | /*
ID: danilos4
LANG: C++
TASK: runround
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pair<int, int>>
#define mp make_pair
#define sz(a) a.size()
#define forn(i, n) for (int... | ALGO | 0.999983 | 3.395214 | {
"github_metadata": {
"branch": "master",
"commit_count": 665,
"repo_created_at": "2022-06-18T11:06: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": "cb8498f3... |
12c48275-aacc-4528-906f-afd35f8d707d | luisacaetano/Fundamentos-da-Programacao-de-Computadores-3-edicao | Cap04_Luisa_Caetano/Res03_Cap04.cpp | /*
Faça um programa que receba dois números e mostre o maior.
*/
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
float num1, num2;
cout << "Insira o primeiro número: "; cin >> num1;
cout << "Insira o segundo número: "; cin >> num2;
//verifi... | ALGO | 0.97318 | 4.075072 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-18T02:30: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": "8e308a509d8b... |
6df2a103-0023-4027-855f-43d0f35d9976 | SirRigby/cpTemplates | templates/bellmanford.cpp | #include<bits/stdc++.h>
#define TxtIO freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_updat... | ALGO | 0.999814 | 3.682435 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2024-07-10T11:09: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": "988af0b5b... |
8433a30e-2ccc-45ab-9bd3-bc5f2d531633 | leostd/Competitive-Programming | UVa/Problem Solving Paradigms/Complete Search/Iterative Complete Search/Three or More Nested Loops/11553_GridGame/115533_GridGame.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
int m[10][10], n;
bool check[10];
int getMin(int row) {
int a = 0x3f3f3f3f;
int idx = -1;
for (int col = 0; col < n; ++col) {
if (check[col]) continue;
if (a > m[row][col])
{
a = m[row][col];
... | ALGO | 0.99998 | 4.185556 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2017-04-09T05:24:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92a93071... |
cb82b497-48dc-4e70-aeda-640dfcb58dbc | utkucnay/Algorithms | AdventOfCode/2015/day4/cpp/main.cpp | #include <cstdint>
#include <iostream>
#include <iomanip>
#include <limits>
#include <ostream>
#include <sstream>
#include <openssl/md5.h>
#include <string>
std::string md5(const std::string &str){
unsigned char hash[MD5_DIGEST_LENGTH];
MD5_CTX md5;
MD5_Init(&md5);
MD5_Update(&md5, str.c_str(), str.size());
... | ALGO | 0.999588 | 4.982252 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2023-06-15T18:10:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fa24c59397... |
c7c54e60-f182-4d77-a96a-3ea0e646b61e | Row/advent-of-code-2015 | day13.cpp | //
// day13.cpp
// advent-of-code
//
/*
--- Day 13: Knights of the Dinner Table ---
In years past, the holiday feast with your family hasn't gone so well. Not everyone gets along! This year, you resolve, will be different. You're going to find the optimal seating arrangement and avoid all those awkward conversations... | ALGO | 0.99993 | 4.87824 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-09-04T21:44: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": "24e3c5504... |
a8d8593e-a1be-44cb-91b8-783632626819 | OldCopperPan/FourInARow | FourInARow.ino | // Arduino - Four in a Row (Connect Four) game for SunFounder LED Matrix (8x8) - V1.3
#include <rgbMatrix.h>
//**************************************** CONFIG ****************************************
// Game Select
byte game = 1; // 0 - Human 1 - Computer
byte gameSelect = 1; ... | TOOL | 0.91874 | 5.342052 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-02-01T20:35: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": "21453242b2e... |
f98bf855-e9bc-4f8b-8b3b-b9c57ef359cb | RapidsAtHKUST/AccTrussDecomposition | msp/src/yche/yche_helpers.cpp | //
// Created by yche on 5/20/19.
//
extern "C"
{
#include <GKlib.h>
#include "../struct.h"
#include "../defs.h"
}
//#define LOCKS // Problematic, do not know why yet.
#ifdef LOCKS
#include <omp.h>
#endif
#include <iostream>
#include <vector>
#include <chrono>
#include <algorithm>
#include "yche_serialization.h"
... | ALGO | 0.986752 | 5.346335 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2020-03-30T07:54:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 16,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb7ff536b... |
4d492695-366c-4acc-b32c-fdac93e738e0 | rtq9731/Algorithm_2ndGrade | 13rd/Tree_Algorithm/ThirdTry/main.cpp | //20402 권성빈
#include <string>
#include <vector>
#include "Node.h"
using namespace std;
vector<string> stringVector;
vector<Node> nodeVector;
vector<Node*> soloVector;
int nodeCount = 8; // 테스트용으로 8
string preorderStirng = "";
string postorderString = "";
string currentdata;
string leftdata;
int rootNodeData = 0;... | ALGO | 0.999969 | 4.850639 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-04-28T03:00:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b5d0076925... |
108fb4c6-bd4e-4b66-baa7-27002ee2468c | meenal2000/Graphs-Practice-ques- | Steps by Knight.cpp | time - O(n*m)
space - O(n*m)
int minStepToReachTarget(vector<int>&KnightPos,vector<int>&TargetPos,int N)
{
int i = KnightPos[0]-1;
int j = KnightPos[1]-1;
TargetPos[0]-=1;
TargetPos[1]-=1;
int dx[] = {-2, -1, 1, 2, 2, 1, -1, -2};
int dy[] = {1, 2, 2, 1, -1, -2, -2, -1};
vector<vecto... | ALGO | 0.999977 | 4.872582 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-07-04T16:57:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b59432072a4... |
099717f8-f33a-40c3-a6bf-605cfd6b5bcb | MaxySpark/HackerRank | DS/Array/CPP/A4.cpp | #include <bits/stdc++.h>
using namespace std;
vector <int> leftRotation(vector <int> a, int d) {
// Complete this function
vector<int> tempV;
for(int i=0;i<d;i++) {
tempV.push_back(a.at(i));
}
for(int i=0;i<a.size()-d;i++) {
a[i]=a.at(i+d);
}
int count = 0;
for(int... | ALGO | 0.999947 | 4.109941 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-09-13T18:42:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1fe02fd6... |
72042746-f355-4bbe-a87f-d53de1524966 | 1750252467/CppLearning | LeetCode/Day4/面试题 02.07.链表相交.cpp | /*
* @lc app=leetcode.cn id=面试题 02.07 lang=cpp
* @lcpr version=21801
*
* [面试题 02.07] 链表相交
*/
using namespace std;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#include <tuple>
... | ALGO | 0.99998 | 5.658474 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2023-03-13T09:10:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e304f78476e... |
2b71d0bc-78fe-4cea-815e-f5d2056d9332 | shreyanshg2010/Data-Structures | LinkedList/Rearrange LL seperating odd and even nodes.CPP | #include <stdio.h>
#include <stdlib.h>
struct Node
{
int data;
struct Node* next;
};
void printList(struct Node* head)
{
struct Node* ptr = head;
while (ptr)
{
printf("%d -> ", ptr->data);
ptr = ptr->next;
}
printf("NULL\n");
}
void push(struct Node** head, int data)
{
struct Node* newNode = (struct Node... | ALGO | 0.999959 | 4.646593 | {
"github_metadata": {
"branch": "master",
"commit_count": 306,
"repo_created_at": "2018-09-22T22:32:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3088dc95... |
6a9e199c-9e33-4d55-8ea6-1696b6da4ce1 | poke19962008/Competitive-Coding | MAR16/CHEFSPL.cpp | #include <iostream>
#include <stdio.h>
#include <math.h>
#include <string>
#define lli long long int
using namespace std;
int main(int argc, char const *argv[]){
#ifndef ONLINE_JUDGE
freopen("odd.txt", "r", stdin);
#endif
lli T;
scanf("%lld", &T);
while(T--){
string str;
cin>>str;
lli len = str.length... | ALGO | 0.999916 | 4.113804 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2015-12-06T14:47:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97e318186... |
72f4ba45-78c0-47b7-965e-406e6985e9e3 | mail-ru-im/im-desktop | gui/controls/DateTimeWidget.cpp | #include "stdafx.h"
#include "../utils/utils.h"
#include "../utils/InterConnector.h"
#include "../main_window/MainWindow.h"
#include "LineEditEx.h"
#include "controls/TooltipWidget.h"
#include "styles/ThemeParameters.h"
#include "fonts.h"
#include "DateTimeWidget.h"
#include "DateTimeWidget_p.h"
namespace
{
cons... | TOOL | 0.916257 | 6.868527 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-09-18T13:35:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 151,
"forks": 53,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e4e4b9... |
4620f863-7075-47ef-b2fd-35d8dba64987 | Zia-Ur-Rehman1/DataStructures | heap.cpp | #include<iostream>
using namespace std;
class Heap{
int array[10]={-1};
int i=0;
public:
void Add(int value)// I cant use parent of left right in private because the dont change with runnig time so direct numbers are more easy
//if I use direct num then no sapce will b cosumed for int data type
{
if(i>=0 ... | ALGO | 0.98694 | 3.379653 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-06-02T06:19:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca2317f8f995... |
26d4e842-6bf8-4456-86a6-9d0d986300c1 | TouwaErioH/Algorithm | WHUOJ/woj1006Language of Animals.cpp | //数据范围很大,不能用邻接矩阵
//没有边权,BFS就行,不用最短路
// 建图用链表或者vector
// BFS用QUEUE DFS用栈
#include <iostream>
#include<cstdio>
#include<vector>
#include<queue>
using namespace std;
const int maxn= 200005; //我傻了 写成20000+5,然后SEGMENTFAULT
vector<int> mapp[maxn];
bool visited[maxn];
struct Node {
int a, len; //s 到 a的距离 len
... | ALGO | 0.999941 | 3.922773 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2018-05-28T04:33:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92e6af781... |
200c4175-9be6-46a9-b538-4674ca86ab06 | ankursinghkuntal/DSA | TREE/Questions/Count Number of Nodes in a Binary Tree.cpp |
// 1. O(N)
// void NumNode(Node* root, int& cnt) {
// if (root == NULL) return;
// if (root->left) {
// cnt++;
// NumNode(root->left, cnt);
// }
// if (root->right) {
// cnt++;
// NumNode(root->right, cnt);
... | ALGO | 0.999893 | 5.392377 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2024-09-29T12:52: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": "5c4441298d0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.