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 |
|---|---|---|---|---|---|---|---|
0e545d38-9ee4-4ed2-b953-9030be30b7ca | MirrorYuChen/Mediapipe-MNN | 3rdLibs/MNN-2.3.0/source/backend/cpu/CPUPoolInt8.cpp | //
// CPUPoolInt8.cpp
// MNN
//
// Created by MNN on 2019/06/10.
// Copyright © 2018, Alibaba Group Holding Limited
//
#include "backend/cpu/CPUPoolInt8.hpp"
#include "core/Macro.h"
#ifdef MNN_USE_NEON
#include <arm_neon.h>
#endif
#include "core/Concurrency.h"
#define DST_TILE 16
#define CACHE_SIZE 128
namespac... | ALGO | 0.976104 | 6.920749 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2023-06-19T09:11:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "27c8ceb513... |
a34339a8-a7a2-4459-adce-12760f8cf57d | jonatas57/maratona | codechef/setembro2020/covid19b.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef map<int, int> mii;
typedef pair<int, int> ii;
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3f... | ALGO | 0.999972 | 3.431446 | {
"github_metadata": {
"branch": "master",
"commit_count": 225,
"repo_created_at": "2019-02-13T13:09: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": "5efa2c42... |
edd8e1a1-7526-47d7-a4fe-3a5ad6f73ee1 | PointCloudLibrary/pcl | features/include/pcl/features/ppf.h | /*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2011, <NAME>
* Copyright (c) 2012-, Open Perception, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provid... | ALGO | 0.938418 | 7.125256 | {
"github_metadata": {
"branch": "master",
"commit_count": 14566,
"repo_created_at": "2013-02-12T16:40:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10495,
"forks": 4656,
"issues": 432,
"pull_requests": 147
},
"file_meta": {
"content_id... |
7c578ae2-8329-4442-bb6b-d9f0ca333555 | apla77/Projeto_Fuzzy | TanqueTeste01/Arduino/Pid_Class/Pid.cpp | /**
Project: Controlador Fuzzy
File: Pid.h
Purpose: Implementation of the PID control class
@author <NAME>
@version 0.1 09/20/2019
*/
#include "Pid.h"
/**
PID class construtcor
@param Kp is the PID proportional gain.
@param Ki is the PID integrative gain.
@param Kd is the PID d... | TOOL | 0.93943 | 6.367126 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-06-05T12:43:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc91ec9e3... |
ad1be999-d915-4bc0-b794-25e97d13f021 | equadras/CompetitiveProgramming | codeforces/round855/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long ll;
//debug
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {... | ALGO | 0.999784 | 3.974506 | {
"github_metadata": {
"branch": "master",
"commit_count": 413,
"repo_created_at": "2023-09-05T15:37: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": "8d97fee9... |
a9718f7b-dec6-4cb9-bfc2-a844ed28cc7b | KeyaanKR/CSES | Introductory Problems/Grid_Paths.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
string g;
vector<vector<int>> grid(7, vector<int>(7, 0));
int paths = 0;
void getPaths(int index = 0, int x = 0, int y = 0) {
if (index == 48) {
if (x == 0 && y == 6) {
paths++;
}
return;
}
char move = g[index];
// Po... | ALGO | 0.999901 | 4.373054 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-03-02T04:17:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e48785bd08ee... |
d950ca2e-c239-423f-872b-263c2bd1aba7 | nosarabs/Parallel-and-Concurrent-Programming | PPC/Ejercicios Cortos OpenMP/E2_MonteCarlo.cpp | //#include <iostream>
//#include <omp.h>
//#include <math.h>
//#include <stdlib.h>
//#include <time.h>
//using namespace std;
//
//#define _CRT_SECURE_NO_WARNINGS 1 // para deshabilitar errores por uso de funciones deprecated sobre CRT o consola
//#pragma warning(disable : 4996)
//
//void hello(); /* Thread function *... | ALGO | 0.999465 | 3.601551 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2018-08-29T21:04: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": "ffd152599... |
97b4ccc9-16ef-490e-b59d-2127e55e3727 | keynoid/school.tests | Rubbish/ht6/ht6/7709.cpp | /* Дан целочисленный массив из 20 элементов. Элементы массива могут принимать целые значения от –10 000 до 10 000 включительно. Опишите на одном из языков программирования алгоритм, позволяющий найти и вывести количество пар элементов массива, в которых сумма элементов делится на 3, но не делится на 9. В данной задаче ... | ALGO | 0.999716 | 4.113345 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2019-09-13T15:03:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "60208e0c1... |
132b3d95-4711-44bb-87ae-22fb8457d0e2 | Manojit-Das-10/Coding | Searching/Unbound_Search.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Time Complexity: O(log n)
Space Complexity: O(1)
*/
int bs(int a[],int start, int end , int x)
{
while (start <= end)
{
int mid = start + (end-start)/2;
if(a[mid]==x)
{
return mid;
}
else if (x>a[mid])
... | ALGO | 0.999885 | 4.825265 | {
"github_metadata": {
"branch": "main",
"commit_count": 172,
"repo_created_at": "2023-12-28T15:55: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": "0af2a705d3... |
cd428550-3290-4403-b03d-574a3ee0855b | ioanev/bpmf-old | c++/mvnormal.cpp | /*
* Copyright (c) 2014-2016, imec
* All rights reserved.
*/
/*
* Sampling from WishHart and Normal distributions
*/
#include <numeric>
#include <functional>
#include <iostream>
#include <random>
#include "bpmf.h"
using namespace std;
using namespace Eigen;
/*
We need a functor that can pretend it's const,... | ALGO | 0.997795 | 5.817309 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-12-09T17:39:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d586c54488... |
fe328304-dc86-4a25-b488-74990f4870ad | thanhpt55/Computer-vision | fasthessian.cpp |
#include "integral.h"
#include "ipoint.h"
#include "utils.h"
#include <vector>
#include "responselayer.h"
#include "fasthessian.h"
using namespace std;
FastHessian::FastHessian(std::vector<Ipoint> &ipts,
const int octaves, const int intervals, const int init_sample,
... | ALGO | 0.962837 | 5.511184 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-12-21T02:21:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c84c1ec034... |
5d300b1b-9f50-4fe8-bdcd-f27af62d1909 | kashem-khondaker/Algorithm | assignment 2/Emperor_Alexander.cpp | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
const ll N = 1e5 + 5;
ll parent[N];
ll group_size[N];
class Edge
{
public:
ll u, v, w;
Edge(ll u, ll v, ll w)
{
this->u = u;
this->v = v;
this->w = w;
}
};
bool cmp(Edge a, Edge b)
{
return a.w <... | ALGO | 0.999891 | 4.364657 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-09-12T14:03:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec4d3ec22a7... |
2a0aea2a-3696-4ecf-9406-66a775cf2c8b | devyaniChoubey/My-Solutions-DS-Algo | Graphs/Interviewbit/Tree/Remove Half Nodes.cpp | https://www.interviewbit.com/problems/remove-half-nodes/
The idea is to use post-order traversal to solve this problem efficiently.
We first process the left children, then right children, and finally the node itself.
So we form the new tree bottom up, starting from the leaves towards the root.
By the time we process ... | ALGO | 0.99991 | 6.235363 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2023-07-01T03:49:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98269cdb9e... |
99e0ac5b-5f3d-4fa3-81ca-9f073a08859e | AlomeProg/gol | src/main.cpp | #include <raylib.h>
#include <array>
#include <iostream>
#include <random>
#include <chrono>
#include <thread>
#include <mutex>
const unsigned int size_map = 128;
const unsigned int size_cell = 8;
using Map = std::array<std::array<bool, size_map>, size_map>;
Map mapA;
Map mapB;
Map *current_map;
Map *next_map;
st... | ALGO | 0.998933 | 5.340434 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2024-02-22T15:05: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": "b4dd72573... |
fa56c5e4-dca1-4049-80a8-27b24cf13c29 | surya-prakash-susarla/My-Solutions | 2024/count_primes.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
typedef long long int llint;
typedef long long... | ALGO | 0.999962 | 5.078076 | {
"github_metadata": {
"branch": "main",
"commit_count": 1096,
"repo_created_at": "2018-11-28T13:59: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": "8037e4732... |
0fa863f4-cef2-45e2-b312-e3fdadb49343 | tommilostny/IMS_2021 | simlib/examples/model5.cc | ////////////////////////////////////////////////////////////////////////////
// Model MODEL5 SIMLIB/C++
//
// Example of 2 facilities with single queue (random)
//
#include "simlib.h"
// global objects
Facility Box[2];
Queue InQueue("Waiting customers");
Histogram Table("Time spent in system",0,5,2... | ALGO | 0.946812 | 5.658448 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2021-10-26T18:47: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": "b2f3cfbdf... |
1e12362c-43df-448e-a32e-b1c0b8b48d1a | Nek5000/nekRS | 3rd_party/AMGX/base/include/cusp/detail/device/transpose.h | /*
* Copyright 2008-2009 NVIDIA Corporation
*
* 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 applicable... | TOOL | 0.953742 | 6.648606 | {
"github_metadata": {
"branch": "master",
"commit_count": 405,
"repo_created_at": "2019-08-04T08:45:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 339,
"forks": 91,
"issues": 14,
"pull_requests": 2
},
"file_meta": {
"content_id": "4913f... |
84e24dad-3288-4406-8914-372c546d5c34 | Itsme-Parth/Data-Structures-and-Algorithms | SearchingAndSorting/Binary Search Questions/countOfAnElementInASortedArray.cpp | /*implemented with binary search */
#include <bits/stdc++.h>
using namespace std;
int firstBinSearch(int arr[], int n, int num)
{
int start = 0, end = n - 1, res = -1;
while (start <= end)
{
int mid = start + (end - start) / 2;
if (arr[mid] == num)
{
res = mid;
... | ALGO | 0.999922 | 5.589841 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2020-10-19T18:22: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": "f13e80f5... |
bc1aa158-c0d8-4047-b12a-b0e4fab94906 | alamgir65/NCPC | B_Balanced_Tunnel.cpp | #include <bits/stdc++.h>
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0);
typedef long long ll;
using namespace std;
int main()
{
fast
ll tt = 1;
while (tt--)
{
ll n, i, j;
cin >... | ALGO | 0.999967 | 3.642499 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2024-12-21T09:23: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": "3b523b72ede... |
47fc127e-4ab5-4caa-9606-022d1a1546f8 | shubham1910200/100-days-of-CPP | day66.cpp | /*
Day 66 coding Statement : Palindromic substrings
Anoop likes strings a lot but he likes palindromic strings more. Today, Anoop has two strings A and B, each consisting of lower case alphabets.
Anoop is eager to know whether it is possible to choose some non empty strings s1 and s2 where s1 is a substring of A, s2 ... | ALGO | 0.999949 | 6.334873 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2023-03-07T05: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": "0776b086e... |
3ccdd59f-87ab-4b07-88a5-99d0e385218a | ryleigh-stefanski/multithreaded_search_algo | parallel.cpp | // parallel.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <thread>
#include <queue>
const int size = 11;
struct point {
int front;
int back;
};
std::queue<point*> backLog;
bool threadOneRun = true;
bool threadTwoRun = true;
//this run... | ALGO | 0.999771 | 4.573054 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-05T14:56: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": "fcd39124a0b4... |
09e86a75-d6cc-4e83-a25a-0b773696f6d1 | jiaola/usaco.cpp | silver/2017_01/hps.cpp | #include <iostream>
#include <algorithm>
using namespace std;
void setIO(string name = "") {
ios_base::sync_with_stdio(0); cin.tie(0);
if (name.size()) {
freopen((name+".in").c_str(), "r", stdin);
freopen((name+".out").c_str(), "w", stdout);
}
}
int main() {
setIO("hps");
int N; c... | ALGO | 0.999359 | 3.761272 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2021-01-02T20:59: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": "747950fb6... |
7175fe42-e4a4-426e-9947-9530ce3281e2 | ishandutta2007/codeforces-p | purplecrayon/normal/1199/D.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
void fsc(int &x){
register int c;
x = 0; c=getchar()... | ALGO | 0.999872 | 3.863728 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48adab75812b... |
0499060b-25af-475e-8caf-56c0243ab92e | Andy2h/Leetcode | Permutation_Sequence.cpp | class Solution {
public:
string getPermutation(int n, int k) {
vector<int> elems;
for(int i = 1; i <= n; i++){
elems.push_back(i);
}
return perm_helper(elems, k);
}
private:
int fac(int i){
if(i == 1) return 1;
int result = 1;
whil... | ALGO | 0.999952 | 6.289178 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2014-06-01T18:08: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": "cb8a9877a... |
6e625150-2083-4f13-9269-57cba09c63e1 | PranjaliBhardwaj/Daily-DSA-Dose | June/Dayeight.cpp | class Solution {
public:
bool checkSubarraySum(vector<int>& nums, int k) {
int n = nums.size();
// Step 1: Iterate Through Starting Points
for (int start = 0; start < n - 1; start++) {
// Step 2: Expand the Subarray
for (int end = start + 1; end < n; end++) {... | ALGO | 0.999936 | 6.744828 | {
"github_metadata": {
"branch": "main",
"commit_count": 174,
"repo_created_at": "2024-01-01T07:20:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d571d63c8... |
f924e6d4-c4fb-49ae-a302-5cfc35910759 | JoeYao-bit/LayeredMAPF | algorithm/LA-MAPF/CBS/high_level_node.h | //
// Created by yaozhuo on 2024/5/31.
//
#ifndef LAYEREDMAPF_HIGH_LEVEL_NODE_H
#define LAYEREDMAPF_HIGH_LEVEL_NODE_H
#include "../common.h"
namespace freeNav::LayeredMAPF::LA_MAPF::CBS {
class HighLvNode // a virtual base class for high-level node
{
public:
Constraints constraints; // new constraints /... | ALGO | 0.995157 | 5.848897 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2024-02-27T08:45:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5f5bb2f3e... |
8fbe5d3e-daf2-40e0-8633-3b4163d36a73 | Andra-chan/Graph-Algorithms | Lab4AG/Lab4AG/Source.cpp | #include <iostream>
#include <fstream>
#include <vector>
int frunza_minima(const std::vector<int>& parinte, std::vector<int> &frecventa) // afla codificare Pufer
{
for (unsigned i = 0; i < size(parinte); i++)
if (frecventa[i] == 0) {
frecventa[parinte[i]]--;
frecventa[i]--;
return i;
}
return -1;
}
in... | ALGO | 0.999973 | 4.246932 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-04-07T22:01:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b67072e8f0b... |
3714cf90-7a30-4fc5-bb6f-38176eff6db5 | xizhonghua/polycube | src/mesh_func/surface_smooth.h | #ifndef SURFACE_SMOOTH_H
#define SURFACE_SMOOTH_H
#include <hjlib/math_func/math_func.h>
#include <zjucad/matrix/matrix.h>
#include <zjucad/matrix/itr_matrix.h>
#include <hjlib/math_func/operation.h>
#include "../numeric/csc_filler.h"
#include <jtflib/mesh/mesh.h>
#include <jtflib/mesh/util.h>
template <typename val_... | ALGO | 0.969686 | 5.574746 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-08-22T14:02:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c904413af... |
563a7fd2-792b-4f49-9008-88a0fbdf2c30 | AndrewBakalin/parallel-programming | lab1/lab1/sol.cpp | #include <cmath>
#include <iostream>
#include "point.h"
double Cos(double x1, double y1, double x2, double y2) {
double scalar_prod = x1 * x2 + y1 * y2;
double a1_len = sqrt(x1 * x1 + y1 * y1);
double a2_len = sqrt(x2 * x2 + y2 * y2);
double mult_of_len = a1_len * a2_len;
if (mult_of_len == 0)
return 0;
els... | ALGO | 0.999991 | 4.611245 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-02-10T07:49: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": "b9c0b86312... |
31476ec8-6ede-421e-a15a-04d6e6f5ace7 | ks0727/AtCoder-Archive | ABC/351-400/366/e_ans.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
using ll = long long;
const int M = 1e6;
vector<ll> f(vector<int> x){
int n = x.size();
rep(i,n) x[i] += M*2; //下駄を履かせる(負の数をなくす)
ll s = 0;
rep(i,n) s += x[i];
vector<ll> res(4*M+1);
res[0] = s;
int k = 0;
... | ALGO | 0.99996 | 3.491265 | {
"github_metadata": {
"branch": "main",
"commit_count": 324,
"repo_created_at": "2023-11-02T02: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": "58b0d0b19d... |
0f5a35ba-ba3c-4f42-90f2-1657c8ab9e06 | vyvanhungbg/K15-HIT-C- | K15-C++/Buoi2_C++/Bai4_Buoi2_LopC++.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n;
cin>>n;
// cach 1 2 for
for( int i=0; i<n;i++)
{
for(int j=0; j<n;j++)
if(i == 0 || i == n-1 || j == 0 || j == n-1) // khi diem A(i,j) o canh thi in * con khong in space
cout << "* ";
... | ALGO | 0.999858 | 3.042873 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2021-04-06T14:57: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": "5c8219c43... |
b29a2046-ec51-47ea-98cd-445a2347c38d | amaxseiner/RFNoCFrameSynchHWAccel | matchedRee/matchFilter.cpp | #include "matchFilter.h"
//NEW ATTEMPT
using namespace std;
void matchTop(hls::stream<rfnoc_axis> i_data, hls::stream<rfnoc_axis> o_data){
//void matchTop(rfnoc_axis *i_data, rfnoc_axis *o_data){
#pragma HLS INTERFACE ap_ctrl_none port=return
#pragma HLS INTERFACE axis port=o_data
#pragma HLS INTERFACE axis port=i_dat... | ALGO | 0.934085 | 3.041318 | {
"github_metadata": {
"branch": "master",
"commit_count": 143,
"repo_created_at": "2019-01-16T17:35:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db9f6829... |
dd58e0db-b396-4e81-9b05-e24497683537 | CompPhysics/ThesisProjects | doc/MSc/msc_students/former/ChristianF/ThesisCodes/Hartree-Fock/quantumdots.cpp | #include "quantumdots.h"
#include "Coulomb_Functions.hpp"
using namespace std;
bool energyComparison(const pair<int,double> &a,const pair<int,double> &b)
{
return a.second<b.second;
}
QuantumDots::QuantumDots(int numberOfShells, int numberOfParticles, int numberOfDimensions, double omega)
{
m_numberOfShel... | ALGO | 0.983413 | 3.982337 | {
"github_metadata": {
"branch": "master",
"commit_count": 213,
"repo_created_at": "2015-09-23T12:38:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f206447a... |
485e4965-2b09-400c-9c8e-614ed618fb44 | krist7599555/toi | toi6/toi6_gem/toi6_gem.cpp | // TOI6 GEM
// https://programming.in.th/tasks/toi6_gem
// ใช้ 2SAT(2-Satisfiability) และ Optimize ด้วย SCC(StronglyConnectedComponent)
// O(N+M)
#include <cstdio>
#include <cmath>
#include <iostream>
#include <cassert>
#include <stdexcept>
#include <stack>
#include <vector>
const int UNVISITED = -1;
struct TarjanStr... | ALGO | 0.999933 | 4.114562 | {
"github_metadata": {
"branch": "master",
"commit_count": 104,
"repo_created_at": "2023-05-21T01:48:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7840098... |
9e1290ec-489e-4c15-8615-5f90873f5657 | Kitware/VTK | ThirdParty/libproj/vtklibproj/src/projections/crast.cpp | #define PJ_LIB__
#include <math.h>
#include "proj.h"
#include "proj_internal.h"
PROJ_HEAD(crast, "Craster Parabolic (Putnins P4)") "\n\tPCyl, Sph";
#define XM 0.97720502380583984317
#define RXM 1.02332670794648848847
#define YM 3.06998012383946546542
#define RYM 0.32573500793527994772
#define THIRD 0.33333333333... | ALGO | 0.996046 | 5.872681 | {
"github_metadata": {
"branch": "master",
"commit_count": 94968,
"repo_created_at": "2010-04-27T15:12:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2910,
"forks": 1246,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7... |
ea1df065-755e-4e2e-ba0a-159942a46a10 | wzmw-zr/Code-Archive | 2020/12/15/4.LeetCode588.cpp | /*************************************************************************
> File Name: 4.LeetCode588.cpp
> Author:
> Mail:
> Created Time: 2020年12月15日 星期二 18时32分24秒
************************************************************************/
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#in... | TOOL | 0.994473 | 5.146673 | {
"github_metadata": {
"branch": "master",
"commit_count": 1859,
"repo_created_at": "2019-11-28T12: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": "5855946... |
f3bcab5d-811c-4b86-8f3c-242cedcfd04f | mkothule/LearningC-Udemy | lecture53_main.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
using namespace std;
int compare_with = 50;
bool check(int val) { // This function should return bool annd take integer as input
return val > compare_with;
}
class Test {
public:
bool operator()(int a) { // Overloading round brack... | ALGO | 0.998307 | 4.876366 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-12-22T08:54: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": "b4807fa8e... |
d986fb66-641a-4979-8cdf-5823749a8fd8 | wmFrank/intro-graphics-projects | lab6/Code/BVH.cpp | #include <algorithm>
#include <cassert>
#include "BVH.hpp"
#include <chrono>
BVHAccel::BVHAccel(std::vector<Object*> p, int maxPrimsInNode,
SplitMethod splitMethod)
: maxPrimsInNode(std::min(255, maxPrimsInNode)), splitMethod(splitMethod),
primitives(std::move(p))
{
// time_t start, s... | ALGO | 0.997584 | 4.173399 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-06-02T00:39: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": "6cc8f8eba98... |
d851ec68-0ea3-4991-9a0c-b123322122ab | Chiki1601/Hackerearth-Solutions | Data Structures/Advanced data structures/Fenwick (Binary Indexed) Trees/Operations on an array.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> os;
int pos(int p)
{
auto s = os.lower_bound(p);
if(s == os.end())
return os.size();
return os.order_of_... | ALGO | 0.999939 | 4.506654 | {
"github_metadata": {
"branch": "main",
"commit_count": 1808,
"repo_created_at": "2022-09-09T09:13:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "f8a46e2f... |
df699558-0975-42cc-848a-821a3336d7e1 | siemens/embb | algorithms_cpp/include/embb/algorithms/for_each.h | /*
* Copyright (c) 2014-2017, Siemens AG. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditio... | TOOL | 0.956966 | 7.234406 | {
"github_metadata": {
"branch": "master",
"commit_count": 1051,
"repo_created_at": "2014-09-29T19:45:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 189,
"forks": 41,
"issues": 9,
"pull_requests": 1
},
"file_meta": {
"content_id": "6fd57... |
ed8cbaf7-8716-4f50-9243-9dad2f0ed122 | mpc-msri/EzPC | Aramis/3party-aramis/party1/src/example_neural_nets/res_net_34.cpp | #include<vector>
#include<math.h>
#include<cstdlib>
#include<iostream>
#include "res_net_mem_opti.h"
//#include<fstream>
#include "EzPCFunctionalities.h"
// SGX instream
#include "../utils_sgx_port/utils_input_sgx.h"
#ifdef RESNET34
sgx_instream cin = sgx_instream();
using namespace std;
extern int partyNum;
vector... | TOOL | 0.973583 | 3.489557 | {
"github_metadata": {
"branch": "master",
"commit_count": 410,
"repo_created_at": "2019-02-16T11:23:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 429,
"forks": 129,
"issues": 52,
"pull_requests": 8
},
"file_meta": {
"content_id": "c518... |
de336ef1-5188-43a6-abdf-29927857bc39 | zero1248/lzbench-isal | nvcomp/CascadedSelector.cpp | /*
* Copyright (c) Copyright-2020, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this ... | ALGO | 0.96729 | 6.565094 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-10-23T15:29:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07a770befe... |
4821ddc4-8011-41de-bf4b-dd8ae0c29676 | yashxbenii/DSA | linkedlist.cpp | // even add
// odd value
// add a new node
// ListNode* head=new ListNode(-1);
#include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node*next;
Node(int data){
this->data=data;
next=nullptr;
}
};
void print(Node* head){
Node *temp=head;
while(temp!=nul... | ALGO | 0.999958 | 5.059976 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2025-04-15T16:39:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9912297e9... |
a0d2f2ff-7255-4a06-abfa-5ce357212d75 | Akib-Vijapura/Leetcode | 1474-longest-zigzag-path-in-a-binary-tree/1474-longest-zigzag-path-in-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999921 | 5.103102 | {
"github_metadata": {
"branch": "main",
"commit_count": 865,
"repo_created_at": "2024-08-22T11:44: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": "8e92a8075c... |
e38ab0c1-d1f2-4910-8692-9db973b76307 | arnab-api/ACM-Code | ACM LAB/Api Codes/Algorithm problems/SCC(strongly connected component)/0 kosaraju.cpp | /// kosaraju's algorithm for scc
#include<bits/stdc++.h>
using namespace std;
#define M 100100
int n,m,vis[M],taken[M];
vector<int>conn[M],topsort,va,vb;
void init()
{
for(int i=0;i<=n;i++) {
conn[i].clear();
//topsort.clear();
taken[i]=0;
}
}
void clr_vis()
{
for(int i=0;i<=n;i++) vi... | ALGO | 0.999965 | 4.851437 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-10-05T11:54:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c728fae53... |
19db57ea-d35e-47e4-a06c-cfe44f40c653 | dials/dials_scratch | jmp/from_dlstbx/profile_model/nave/profile_model_support.h | /*
* profile_model_support.h
*
* Copyright (C) 2013 Diamond Light Source
*
* Author: <NAME>
*
* This code is distributed under the BSD license, a copy of which is
* included in the root directory of this package.
*/
#ifndef DLSTBX_ALGORITHMS_PROFILE_MODEL_NAVE_PROFILE_MODEL_SUPPORT_H
#define DLSTBX_ALGORI... | TOOL | 0.905498 | 6.563947 | {
"github_metadata": {
"branch": "master",
"commit_count": 2512,
"repo_created_at": "2016-01-13T09:55:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "e93ba231... |
623a2fe0-21e1-4f81-818e-dc9b75af2e0a | tmoux/prog-contests | codeforces/1311/b/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int t; cin >> t;
while (t--) {
int n, m; cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector... | ALGO | 0.999982 | 4.277691 | {
"github_metadata": {
"branch": "master",
"commit_count": 288,
"repo_created_at": "2018-10-21T03:33:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc18799a... |
fe026b45-09a5-4b9f-8f87-6d7ff1c97757 | ManojKumar-18-24/PSCP | ASSIGNMENT 11-02-2023/Q311-02-2023.cpp | #include<iostream>
using namespace std;
class matrix
{ private:
int r,c;
int a[100][100];
public:
matrix(void);
void show()
{
cout<<r<<endl;
cout<<c<<endl;
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
cout<<a[i][j]<<" ";
} cout<<endl;
... | ALGO | 0.987697 | 3.363834 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-10-24T15:55: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": "76a783f73969... |
e83c45cb-038b-401c-aca1-b7f4e9881656 | OtricalaBlack/LOA | Lab3.3.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
struct node
{
char inf[256]; // Полезная информация
struct node* next; // Ссылка на следующий элемент
};
struct node* top = NULL; // Указатель на вершину стека
void push(void); // Добавление эле... | TOOL | 0.953669 | 4.14057 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-09-08T17:25:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "daf642a2269... |
a9f53fe5-ecf4-4d9c-ac05-11ed25e51228 | Xilinx/Vitis_Libraries | codec/L2/demos/pikEnc/host/pik/lossless_entropy.cc | // Copyright 2019 Google Inc. All Rights Reserved.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
#include "pik/lossless_entropy.h"
#include "pik/padded_bytes.h"
#define PIK_ENTROPY_CODER_FSE 1 // tANS; smallest... | TOOL | 0.906606 | 7.427591 | {
"github_metadata": {
"branch": "main",
"commit_count": 471,
"repo_created_at": "2019-09-23T19:13:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 988,
"forks": 381,
"issues": 0,
"pull_requests": 12
},
"file_meta": {
"content_id": "aa731c... |
7d1d140b-ed73-44f3-b2c1-aeac81c7d622 | QMCPACK/qmcpack | src/Particle/LongRange/LPQHIBasis.cpp | //////////////////////////////////////////////////////////////////////////////////////
// This file is distributed under the University of Illinois/NCSA Open Source License.
// See LICENSE file in top directory for details.
//
// Copyright (c) 2016 <NAME> and QMCPACK developers.
//
// File developed by: <NAME>, <EMAIL>... | ALGO | 0.985806 | 4.169589 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28915,
"repo_created_at": "2017-01-11T19:02:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 345,
"forks": 147,
"issues": 438,
"pull_requests": 16
},
"file_meta": {
"content_id": ... |
c3e07a96-07ee-4dc3-8db7-49183c896c28 | nadaamiin/board-games | NumericalTicTacToe.h | #ifndef BOARD_GAMES_NUMERICALTICTACTOE_H
#define BOARD_GAMES_NUMERICALTICTACTOE_H
#include "BoardGame_Classes.h"
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
using namespace std;
static bool isRandom5 = false;
template <typename T>
class Numerical_TicTacToe_Board: public Board<T> {
pr... | ALGO | 0.904618 | 5.646931 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2024-11-30T19: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": "aded308c3d7... |
27682d88-b215-4330-b099-77723a4cef98 | 1036-ce/note | cpp_primer/Chapter17/17.1/17.3.cpp | #include <cctype>
#include <fstream>
#include <iostream>
#include <map>
#include <ostream>
#include <set>
#include <sstream>
#include <string>
#include <string_view>
#include <tuple>
#include <vector>
#include <memory>
using namespace std;
using line_no = std::vector<std::string>::size_type;
using QueryResult = tuple<... | TOOL | 0.969481 | 4.026652 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2022-03-08T07:26: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": "5aa497a8a... |
6fe10d00-d35b-4c0d-9e80-9f6ed7ab8c04 | joannewolf/code_problems | leetcode/Trie/0720_Longest_Word_in_Dictionary.cpp | // use graph + BFS
class Solution {
public:
string longestWord(vector<string>& words) {
vector<vector<int>> graph(words.size());
queue<int> toBeChecked;
// construct the graph
for (int i = 0; i < words.size(); i++) {
if (words[i].length() == 1)
toBeChecked.emplace(i);
for (int j = i + 1; j < words.... | ALGO | 0.999762 | 5.531739 | {
"github_metadata": {
"branch": "master",
"commit_count": 239,
"repo_created_at": "2017-06-23T08:23: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": "e3f1a45b... |
ae1a134e-c7bb-4e8f-94d7-4e0bc0040cea | shahmeerkhan12/cpp-AtoZ | just c++/OOP C++/complex.cpp | #include <iostream>
#include <iomanip>
using namespace std;
const int N = 20;
//Function prototypes
void initialize(int& zeroCount, int& oddCount, int& evenCount);
void getNumber(int& num);
void classifyNumber(int num, int& zeroCount, int& oddCount,
int& evenCount);
void printResults(int zeroCount, int oddCount, int ev... | ALGO | 0.998102 | 4.590457 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-17T04:36: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": "570db9026d98... |
806c4829-7027-49f0-88a8-ea3790d94824 | Kilagen/ITMO-2sem-Cpp | CircBuffer/algo.h | //
// Created by kil4g on 28.04.2022.
//
#ifndef LAB3_ALGO_H
#define LAB3_ALGO_H
namespace algo {
template<typename Iterator, typename Predicate>
bool all_of(Iterator begin, Iterator end, Predicate f) {
while (begin != end) {
if (!f(*begin)) {
return false;
}
... | TEST | 0.961401 | 6.459142 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-06-06T12:02: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": "ab0e38fe9c4... |
4e515b7c-a488-48fe-93cc-1fa14b4731b3 | NLeSC-AAA2/host-template | src/fft_r2c/validation.hh | #pragma once
#include <fftw3.h>
#include <functional>
#include <gsl/span>
#include <map>
#include <string>
#include <vector>
#include <cassert>
template <typename T>
using complex_span = gsl::span<std::complex<T>>;
using shape_t = std::vector<int>;
namespace TripleA2 {
template <typename Config, typename InputNu... | ALGO | 0.926026 | 6.997005 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2019-01-15T14:58:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b08c513c5... |
5338941b-b074-407a-bf8d-a9044ad03d29 | mengxinzhao/EPIJudge | epi_judge_cpp/gray_code.cc | #include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <bitset>
#include "test_framework/test_failure_exception.h"
#include "test_framework/test_timer.h"
using std::vector;
using std::pow;
bool DiffersByOneBit(int x, int y) ;
bool Seen(vector<int>cur... | TEST | 0.997644 | 5.409172 | {
"github_metadata": {
"branch": "master",
"commit_count": 252,
"repo_created_at": "2018-02-07T02:39: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": "1c3746ad... |
8823afa6-0b29-4c3e-ae3c-5b30bad3fccb | su-hyunieee/vs_code_copy | codeup_100/백준_코테/15683_감시.cpp | #include <iostream>
#include <stdio.h>
#include<algorithm>
using namespace std;
/*
이 문제는 나랑..
안맞는듯. ..
*/
struct CCTV
{
int type, y, x;
};
int n, m, ret;
int map[8][8];
CCTV cctv[8];
int cctv_size;
//각자 도는 경우의 수
const int rot_size[] = {4, 2, 4, 4, 1};
void map_copy(int a[8][8], int b[8][8]... | ALGO | 0.999346 | 3.907615 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-06-02T04:44: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": "ce9b0abc4430... |
7696654d-d3ba-4d0e-b5bb-a81e2103fa15 | ksinb/atcoder | edpc/b.cpp | #include <iostream>
#include <climits>
#include <cstdlib>
using namespace std;
int n, k;
long INF = 100010;
int dp[100010];
int c[100010];
int main()
{
cin >> n >> k;
for (int i = 0; i < n; i++)
{
cin >> c[i];
}
for (int i = 0; i < 100010; i++)
{
dp[i] = INF;
}
dp[0] = 0;
dp[1] = dp[0] + ... | ALGO | 0.999974 | 3.851919 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-04-16T00:53: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": "e74c5fd96... |
89c8ebfe-9dfc-41e4-a0cc-1a43949ac1d6 | jefby/Algorithm_Test | source/main.cpp | #include <stdio.h>
#include <string.h>
#include <ctype.h>
#define MAX_N 5005
char ori[MAX_N];
char prc[MAX_N];
char ptr[MAX_N];
//implement Longest_palindrome_substring
//@printf the max length
void longest_palindrome_substring(const char*str)
{
if(str!=NULL)
{
int len = strlen(str);
int m=0... | ALGO | 0.999985 | 3.212871 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2013-06-17T07:20: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": "109ee714b... |
6717ce51-f2f9-43a0-bc4d-ce0810ab1039 | ranvijay-kumar4/Shooting_And_Upskilling_Range | C++/Practise/linkedList4.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node()
{
this->data = 0;
this->next = NULL;
}
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
void print(Node *&head)
{
Node *temp = head;
while (... | ALGO | 0.999965 | 5.173754 | {
"github_metadata": {
"branch": "main",
"commit_count": 176,
"repo_created_at": "2024-10-16T01:27: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": "731b1fa458... |
05bd1df7-9f1a-403f-98bb-0267f6ca4a5b | USTC-AIS-Lab/QuadrupedAntiSlip | doggy_control/src/gait/probe_gait.h | #ifndef _PROBE_GAIT_H_
#define _PROBE_GAIT_H_
#include "base_gait.h"
class ProbeGait : public BaseGait
{
public:
ProbeGait();
void compute_swing_legs_kinematics(DogState &state, double dt);
void gait_counter_reset();
double get_contact_plan(double dt, double window, int leg_index);
std::vector<Eig... | ALGO | 0.943787 | 4.758918 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-05-08T02:31:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d510804e4a791... |
cc06250d-b5da-4a37-b2de-37c794def7e5 | aliaagheisX/CMP-2025-Algorithms-Solutions-collections | Assignments/1/HousesFormAcycle.cpp | #include <bits/stdc++.h>
using namespace std;
int di[] = {0, 0, 1, -1};
int dj[] = {1, -1, 0, 0};
int n, m;
vector<vector<bool>> mat(10, vector<bool>(10));
class solution
{
bool flag = 0;
void recAns(set<int> vis, int i = 0)
{
if (vis.find(i) == vis.end())
{
vis.insert(i);
... | ALGO | 0.999977 | 3.616946 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-10-12T07:26:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f915675e172... |
452bc221-2e86-435e-8e95-bbd7f920f716 | TheAncientOwl/lunardb | src/Selenity/src/Managers/Collections/private/Common.inl | #pragma once
#include "../Common.hpp"
#include <nlohmann/json.hpp>
#include "LunarDB/Common/QueryData/QueryData.hpp"
#include "LunarDB/Moonlight/QueryExtractor.hpp"
#include "LunarDB/Selenity/Managers/Configurations.hpp"
#include <stack>
namespace LunarDB::Selenity::API::Managers::Collections {
namespace Calculus... | TOOL | 0.90521 | 7.785205 | {
"github_metadata": {
"branch": "main",
"commit_count": 392,
"repo_created_at": "2023-11-17T16:59:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "589d1c4357... |
aebf79bb-f40a-4b39-a0eb-30c79ff75cc3 | amang234/LeetCode-DSA | 2402-meeting-rooms-iii/2402-meeting-rooms-iii.cpp | class Solution {
public:
int mostBooked(int n, vector<vector<int>>& meetings) {
sort(meetings.begin(), meetings.end());
int m = meetings.size();
vector<int> room_meeting_count(n, 0);
priority_queue<int, vector<int>, greater<int>> available;
priority_queue<pair<long long, int>... | ALGO | 0.999991 | 5.909387 | {
"github_metadata": {
"branch": "main",
"commit_count": 1527,
"repo_created_at": "2024-01-09T18:00: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": "4db173b74... |
bcd2ecc1-ed5e-4170-a422-ad26b68029be | hamzashahid-blit/fast | sem-2/oop/as-1/q2.cpp | #include <iostream>
#include <string>
#include <tuple>
using namespace std;
// Ball class
class Ball {
private:
int x, y;
public:
Ball(int initialX = 0, int initialY = 0) : x(initialX), y(initialY) {}
int getX() const { return x; }
int getY() const { return y; }
void move(int dx, int dy) {
... | ALGO | 0.999723 | 5.600485 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2024-08-30T03:30:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ee198e496b... |
6064d3cf-5583-4125-ae85-5cffc40d8175 | wleuschner/PositionBasedFluids3D | development/PositionBasedFluids/Solver/SolverImpl/PBFSolverGPU.cpp | #include<GL/glew.h>
#include"PBFSolverGPU.h"
#include"../Constraint/ConstraintImpl/DensityConstraint.h"
#include"../../Graphics/AABB/AABB.h"
#include<list>
#include<iostream>
#include<GL/glew.h>
#include<glm/gtc/random.hpp>
PBFSolverGPU::PBFSolverGPU(std::vector<Particle>& particles,AbstractKernel* densityKernel,Abstr... | ALGO | 0.997412 | 3.968895 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2022-01-29T22:17:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6b91d19a... |
7991e2e2-d381-4147-aba0-81db9d46b7e7 | ishandutta2007/codeforces-c | cheetose/normal/1592/E.cpp | #include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define y0 y12
#define y1 y22
#define INF 987654321
#define PI 3.141592653589793238462643383279502884
#define fup(i,a,b,c) for(int (i)=(a);(i)<=(b);(i)+=(c))
#define fdn(i,a,b,c) for(int (i)=(a);(i)>=(b);(i)-=(c))
#defin... | ALGO | 0.999922 | 4.275816 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08084405654c... |
902c116c-c89d-4bd4-8696-7069fe66f325 | geekykri/striver-dp-series | 048FibonacciNumber.cpp | // Author: REET
// Problem: Fibonacci Number
// Link: https://leetcode.com/problems/fibonacci-number/
#include <bits/stdc++.h>
using namespace std;
// Approach: Recursive
// Time Complexity: O(2^n)
// Reason: Two different calls for every value of n
// Space Complexity: O(n)
// Reason: Auxiliary Stack Space O(n)
long... | ALGO | 0.99999 | 5.675194 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2022-10-16T07:47:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e81081d85f... |
b78f13ea-78a6-4190-be5b-981ed3bbcc41 | nareshenoy/base | src/script/project_euler/26.cpp | #include <iostream>
using namespace std;
int GetCycle(int d) {
int start = 1;
int remainder[10];
int count = 0;
int i, k;
for(i = 0;i < 10;i ++) remainder[i] = -1;
while(1) {
start *= 10;
if(start % d == 0) return 0;
else {
/* If the number has occured already check if
remainder was the same, i... | ALGO | 0.999151 | 3.586348 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2013-05-25T10:15:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "44387d3c9... |
0bb85d19-0339-4ccd-a0a7-e148f3434215 | Yak0Tak0/tString | main.cpp | #include <iostream>
#include "tstring.h"
using namespace std;
auto fun(const char* c) {
return TString(c);
}
auto main() -> int {
TString s1;
TString s2{"abrakadabra"};
TString s3 { s2 };
TString s4 = fun("nowy obiekt nr 1");
s1 = s2;
s1 = std::move( s2 );
s1.insert(0,"NA POCZATEK");
s1.insert(s1.si... | TOOL | 0.94135 | 4.047282 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-11-23T09:09:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af262e212f... |
db5935f5-496e-43e0-8fb3-01246e665ee3 | Kalit31/cp-playground | LeetCode/leetcode-july-challenge/week4/BinaryTreeZigZagLevelOrderTraversal-trees.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* Definition for a binary tree node.*/
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, ... | ALGO | 0.999998 | 6.002544 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2019-12-14T13:01: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": "96f996ec4... |
bb12f7e6-9367-49cd-8d93-ac2dba097f38 | Coach-Academy/Winter-2-2023 | Level 2/Class 3/Practice G1/Week 13/e.cpp | #include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typed... | ALGO | 0.999545 | 3.754416 | {
"github_metadata": {
"branch": "main",
"commit_count": 527,
"repo_created_at": "2023-11-22T17:57:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "7c67b748e82... |
da777a55-3a78-4a83-866b-603df8e6872c | delta4d/AlgoSolution | zoj/08/1769.cpp | #include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const double eps = 1e-2;
inline double dis(double x1, double y1, double x2, double y2) {
return sqrt((x1 - x2) * (x1 - x2) + (y1- y2) * (y1 - y2));
}
inline double angle(double a, double b, double c) {
return acos((a * ... | ALGO | 0.999411 | 3.992388 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2013-02-15T16:09:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da7c0f1b... |
fe764020-eff4-4b44-aa00-6c61c97b39a3 | MohamedMahmoudH/problemSolvingCodeForces | div3_D_GCD-sequence.cpp | #include <vector>
#include <iostream>
#define loop(i,a,b) for(int i = a ; i < b ; ++i)
#define all(x) (x).begin() , (x).end()
using namespace std;
int gcd(int a , int b)
{
if(!b)return a;
return gcd(b , a % b);
}
bool isGCDSeq(vector<int>& vec)
{
int sz = vec.size() , last = 0 , current = 0;
last = ... | ALGO | 0.999989 | 4.382995 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2024-05-18T21:32: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": "956a00bfdb7... |
32069f43-1859-4238-8d79-b1afdfe9036f | ryuyal/Algorithms | DMSXL/Binary_Tree/lc144.cpp | //
// Created by Liu on 2023/7/11.
// Description:
//
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr)
{
}
TreeNode(int x, TreeNode *l, TreeNode *... | ALGO | 0.999984 | 5.887796 | {
"github_metadata": {
"branch": "main",
"commit_count": 358,
"repo_created_at": "2023-04-19T02:46:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8816032941... |
09cfa4f6-f452-4c4b-8598-fe6afd8ff75a | Akash-Gupta-1999/graph_striver | Questions/47_most_stones_removed.cpp | #include<bits/stdc++.h>
using namespace std;
class dsu{
public :
vector<int> size,parent;
dsu(int v){
size.resize(v+1,1);
parent.resize(v+1);
for(int i=0;i<=v;i++)
parent[i] = i;
}
int findpar(int node){
if(node == parent[node])
return node;
... | ALGO | 0.999458 | 4.072829 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-04-17T21:12: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": "952a0bf9126... |
8cbe00a3-fe40-494c-99e5-3c025dff6e83 | Fanzijian1996/algorithme | PB14209127-project1/ex2/source/algorithm.cpp | #include"algorithm.h"
#define SCALAR 65535
//bubble sort
void bubbleSort(int array[],size_t n)
{
for(size_t j=n-1;j>0;j--)
{
for(size_t i=0;i<j;i++)
{
if(array[i]>array[i+1])
{
int temp=array[i];
array[i]=array[i+1];
array[i+1]=temp;
}
}
}
}
//count sort
void... | ALGO | 0.999867 | 4.483576 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2017-12-13T08:25:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b0ab7962... |
dc844cee-0df9-4c7f-bae4-1762c30802de | HuangDDU/hzy_algorithm | leetcode/top100/11.滑动窗口最大值(239)/ref.cpp | // 使用优先级队列,底层还是用堆
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Solution {
public:
vector<int> maxSlidingWindow(vector<int> &nums, int k) {
vector<int> res;
// 初始化窗口,建优先级队列
priority_queue<pair<int, int>> q;
// 窗口滑动往堆中删除、添加元素
for (int i = 0; i < nums.size() - k ... | ALGO | 0.999992 | 5.9453 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2023-09-10T14:53: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": "825bc9e0... |
d92c2175-f213-4497-834a-6969ad1cd081 | the0ss/DSA | 1457-pseudo-palindromic-paths-in-a-binary-tree/1457-pseudo-palindromic-paths-in-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999982 | 5.506392 | {
"github_metadata": {
"branch": "main",
"commit_count": 927,
"repo_created_at": "2023-11-29T14:08: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": "0e88b024b2... |
65338a20-4915-4d83-b7ab-246738bac7df | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/0_0_7811.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#define MOD 1000000007
using namespace std;
int main() {
int n, m, q;
cin >> n >> m >> q;
vector<vector<int>> graph(n, vector<int>(n, 0));
for (int i = 0; i < m; i++) {
int v, u, w;
cin >> v >> u >> w;
graph[v-1][u-1... | ALGO | 0.999992 | 4.509942 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "233cb5db48f... |
5d7c7b78-7852-4837-a695-50cbeb55c1a5 | samarth3101/DeepDiveCpp | LOOPS/for-loop/check_prime_number_or_not.cpp | #include<iostream>
using namespace std;
// int main(){
// int n;
// cout<<"Enter the number : ";
// cin>>n;
// bool flag = true; //number is prime
// for (int i = 2; i <= n/2; i++){
// if(n%i==0){
// flag = false; //number is composite
// break;
// }
// ... | ALGO | 0.999371 | 3.609298 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-10-26T10:11: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": "1f5b2f9e4f99... |
4ea0633e-7b71-4096-bf17-3daf234ccdcd | bilibiliChangKai/Distributed-Computer-Homework | HM1/胡子昂/v2/src/as1.cpp | // Author : huziang
// This is a parallel program calculate
// the all prime number in 2 -> n
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>
#include <math.h>
#include <memory.h>
#include "test.h"
int n, k;
int sqrt_n;
double blockinv;
int *pidsindex;
int *beginindex;
bool *isprime;
i... | ALGO | 0.99992 | 4.126252 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-03-19T15:24:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "238e6c1df... |
c2727811-b857-4e19-a824-a2bf9594bc20 | xymjhome/LeetCode | 94. Binary Tree Inorder Traversal/94. Binary Tree Inorder Traversal.cpp | //94. Binary Tree Inorder Traversal
//Given a binary tree, return the inorder traversal of its nodes' values.
//
//For example :
//Given binary tree[1, null, 2, 3],
//
// 1
// \
// 2
// /
// 3
//
//return[1, 3, 2]
#include <iostream>
#include <stack>
#include <vector>
using name... | ALGO | 0.999975 | 5.443708 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-05-11T09:23:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8436d67a06d... |
5469e278-8880-431a-be94-f66c546c0e3c | R-fzx/code | contest/20221015/source/qujunyi/dark/dark.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
struct node {
double x, y;
bool operator<(const node &p) const {
if (x == p.x) {
return y < p.y;
}
return x < p.x;
}
} a[200005];
bool cmp(int x, int y) {
return a[x].y < a[y].y;
}
double dist(int x, int y) {
return sqrt((a[x].x - a[y].x) ... | ALGO | 0.999842 | 4.709788 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2021-11-07T12:57: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": "ca05c38b... |
2c341ec0-8b6c-4daf-985e-4adb53409afe | llllllllll/advent-of-code | 2020/12/c++/part-2.cc | #include <array>
#include <deque>
#include <iostream>
#include <iterator>
#include <string_view>
#include <bit>
#include "aoc/aoc.hpp"
enum class instr {
n,
e,
s,
w,
f,
l,
r,
};
instr parse_instr(char c) {
switch (c) {
case 'N':
return instr::n;
case 'E':
retur... | ALGO | 0.999709 | 6.536525 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2019-12-04T00:09: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": "575d95b0c... |
af7bd386-ae9a-4ffc-8f28-d8ba29cf71c9 | KSorte/programming_vault | leetcode_solutions/1_DP/Leetcode322_CoinChange.cpp | #include <vector>
/*
Leetcode 322 Coin Change
You are given an integer array coins representing coins of different denominations and an integer amount representing a
total amount of money.
Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up
... | ALGO | 0.999864 | 5.858634 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2022-12-23T23:12:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b4231f23e... |
0652b93d-94d9-4e54-a099-74f43fdc54dc | loliTerrorist/compstuff | contest/e.cpp | #include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define float double
using namespace std;
/*
{
{a, b, c}
{d, e, f}
}
{
{a, b}
{c, d}
}
*/
vector<vector<float> > febmat = {{0.5, 0.5},{1, 0}};
vector<vector<float> > mult(vector<vector<float> > a, vector<vector<float> > b){
vector<vec... | ALGO | 0.999639 | 3.270874 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-11-10T02:22: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": "fe47ccd5aab... |
16f4257a-de5b-40f5-bc7b-a63ca7c15213 | kamyu104/LeetCode-Solutions | C++/minimum-edge-weight-equilibrium-queries-in-a-tree.cpp | // Time: O(r * (n + q)), r = max(w for _, _, w in edges)
// Space: O(r * n + q)
// Tarjan's Offline LCA Algorithm
class Solution {
private:
static const int MAX_W = 26;
public:
vector<int> minOperationsQueries(int n, vector<vector<int>>& edges, vector<vector<int>>& queries) {
vector<vector<pair<int, ... | ALGO | 0.999869 | 5.753444 | {
"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": ... |
9ecb3b42-baaf-4424-8f14-936227bcadd4 | Anatel-Phys/Autoencoder | NeuralNetwork.cpp | #include "NeuralNetwork.h"
#include "Functions.h"
#include <iostream>
Layer::Layer()
{
this->n_neurons = 1;
this->next_n_neurons = 1;
this->outputTag = false;
this->weights = new Eigen::MatrixXf(Eigen::MatrixXf::Random(1,1));
this->actiVal = new Eigen::MatrixXf(1, 1);
this->deltaBuffer = new Eigen::MatrixXf;
... | ALGO | 0.957818 | 4.843519 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-08-25T23:41: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": "4e1cb300f7f1... |
1b3afb04-d0cb-452b-8f6f-0280fd1db929 | bony2023/Competitive-Programming | Graph Algorithms/BFS/020 UVA - 571 Jugs.cpp | // Author : <NAME>
// 571 - Jugs
// BFS
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map>
#include<list>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<algorithm>
using namespace std;
#define pb push_back
#define sz size()
#define mp make_... | ALGO | 0.999753 | 3.539383 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2014-08-06T08:27:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "866556fe1... |
feaa7b62-a372-48fe-a4bb-c87b205c6634 | Shagun15/DSA-Practice | Assignment_25/Stack_linked_list.cpp | #include <iostream>
using namespace std;
struct Node{
int data;
Node *next;
Node *prev;
};
class Stack{
private:
public:
Node *top;
Node *end;
Node *new_node= new Node;
int len=0;
Stack(){
top =NULL;
end =top;
}
//push the value at t... | ALGO | 0.97375 | 3.914535 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2022-05-04T04:01:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24a0dd661d... |
1185c9c1-041c-4ec6-9a6c-8a68d51044b6 | wcy21/coding | 牛客竞赛/算法基础精选题单/BFS/NC15136_迷宫.cpp | #include <cstring>
#include <iostream>
#include <queue>
using namespace std;
struct node {
int x, y;
int step;
bool key;
node(int _x, int _y, int _step, bool _key)
: x(_x), y(_y), step(_step), key(_key) {}
};
char g[507][507];
bool vis[507][507][2];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1... | ALGO | 0.999934 | 3.956697 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-07-11T10:59: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": "675b914d1... |
a0d970a8-e0fc-4f9e-83ae-fecbb17f4b2e | shuleyu/CPP-Library | PolyFit.hpp | #ifndef ASU_POLYFIT
#define ASU_POLYFIT
// Need dev-libs/boost
#include<boost/numeric/ublas/matrix.hpp>
#include<boost/numeric/ublas/lu.hpp>
/***************************************************************
* This C++ template calculate the polynominal fitting for given
* input. This is a wrapper using the LU decomp... | ALGO | 0.998879 | 5.791216 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2017-12-19T16:32:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f089c83e... |
4d3762c2-91b9-486a-acd6-04e782bb023b | tedi21/algo-cpp | game/sudoku/sudoku_constraint.cpp | /*
* sudoku.cpp
*
*
* @date 01-04-2023
* @author <NAME>
* @version 1.00
* Réalisation d'un algorithme de résolution de sudoku
*/
// clang-tidy sudoku_constraint.cpp -checks=cppcoreguidelines-* -- -std=c++20
// clang++-11 -std=c++20 sudoku/sudoku_constraint.cpp -o sudokuBin -Icommon
#include <iostream>
#inclu... | ALGO | 0.999159 | 5.666819 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-17T19:23:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40d2cfca7143... |
4c59d378-5ba1-469c-9e92-74d11c06a373 | arpituppal/competitive-programming-codes | spoj/PLNDROME.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <algorithm>
#include <vector>
#include <cstring>
#include <stack>
#include <cctype>
#include <utility>
#include <map>
#include <string>
#include <climits>
#include <set>
#include <sstream>
#include <utility>
#include <ct... | ALGO | 0.999957 | 3.365109 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-09-24T13:53:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25b488a13... |
c4bf9f24-2234-400d-9560-b987be5d4cdb | Alisha0807/LP-2__practicals | pri.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
vector<pair<int, int>> graph[50]; // (adjacent node, weight),qadjacent list
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
int V;
vector<int> vis(V,0);
int prim(int s) {
pq.push({0, s});
int sum... | ALGO | 0.999973 | 5.717714 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-05T14:39: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": "c1cd1851e5f4... |
a01ba9db-20fa-40e9-9edc-4f8f411ea546 | krzyssota/Algorithms | parking.cpp | #include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
const int N_MAX = 500*1000;
int n, m;
int marked[N_MAX + 1]; // 1->car, 2->visited, 3->vis+car
vector<int> g[N_MAX+1];
void dfs(int u, int parent) {
if(marked[u] == 1) marked[u] = 3;
else marked[u] = 2; // marked[u] == 0
if(ma... | ALGO | 0.9999 | 4.015081 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-04-21T17:25:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "955313d6b5... |
9f99678d-4420-4314-be21-2dcee9b9c12f | raincross7/code-similarity | codes/train_code/problem090/problem090_181.cpp | #include<iostream>
#include<string>
#include<vector>
#include<map>
using namespace std;
int main()
{
vector<string> word;
string sent;
int ss = 0;
getline(cin, sent);
//input word
for(int i = 0; i < sent.size(); i++)
{
if(sent[i] == ' ' )
{
word.push_back(sent.substr(ss,i - ss));
int inc = 1,tmp... | ALGO | 0.999825 | 3.198406 | {
"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": "7c9c9cfcfe32... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.