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 |
|---|---|---|---|---|---|---|---|
2d0442cf-8cad-4003-8a63-526dfe411e18 | hummingg/LeetCode | 230.二叉搜索树中第k小的元素.cpp | /*
* @lc app=leetcode.cn id=230 lang=cpp
*
* [230] 二叉搜索树中第K小的元素
*/
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) : v... | ALGO | 0.999996 | 6.877646 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-02-27T10:50: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": "c6a5901962c... |
d9b92db4-c3e9-47db-a96f-96459c70d830 | SarthakRawat-1/dsa | Linked List/removeEveryKNode.cpp | // Problem Statement :- https://www.geeksforgeeks.org/problems/remove-every-kth-node/1
#include <iostream>
#include <vector>
using namespace std;
class NODE {
public :
int data;
NODE *next;
NODE(int value) {
data = value;
next = NULL;
}
};
NODE* CreateLinkedList(int arr[], int in... | ALGO | 0.999868 | 5.768391 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-16T07:11: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": "ff8fc5776167... |
0173f475-6984-45fc-bbde-f4ac7044ca5d | ShahjalalShohag/code-library | Graph Theory/BFS.cpp | #include<bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int N = 1e5 + 9;
vector<int> g[N];
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, m; cin >> n >> m;
for (int i = 1; i <= m; i++) {
int u, v; cin >> u >> v;
g[u].push_back(v);
g[v].push_back(u);
}
queue<in... | ALGO | 0.999992 | 4.317675 | {
"github_metadata": {
"branch": "main",
"commit_count": 952,
"repo_created_at": "2018-11-18T08:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3240,
"forks": 840,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "42108... |
b284c239-ced1-40b8-abd9-550971af5d78 | freesurfer/freesurfer | mri_fill/mri_fill.cpp | /**
* @brief fill interior holes of components representing white matter
*
* "Cortical Surface-Based Analysis I: Segmentation and Surface
* Reconstruction", <NAME>., <NAME>., <NAME>.
* (1999) NeuroImage 9(2):179-194
*/
/*
* Original Author: <NAME>
*
* Copyright © 2021 The General Hospital Corporation (Boston, ... | ALGO | 0.915892 | 3.240775 | {
"github_metadata": {
"branch": "dev",
"commit_count": 33611,
"repo_created_at": "2017-02-24T19:15:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 699,
"forks": 260,
"issues": 18,
"pull_requests": 11
},
"file_meta": {
"content_id": "9fb4... |
3caaa6b0-8e8d-4717-b574-98ffaba3a72a | mortarsanjaya/CoinWeight | CoinWeight/computereasy1.cpp | //
// computereasy1.cpp
// CoinWeight
//
// Created by <NAME> on 2020-04-29.
// Copyright © 2020 -. All rights reserved.
//
#include "computereasy1.hpp"
#include "coinselection.hpp"
#include "exception.hpp"
/*
Small documentation for the computer strategy:
The computer compares Coin 0 against all other single coi... | ALGO | 0.994905 | 5.793345 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2020-03-03T21:36:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "427f972e... |
2b7cf9de-7d31-499a-bf73-81a6a822af76 | XZegarra/AlgebraAbstracta | RSA/codigoEnigma.cpp |
#include "codigoEnigma.h"
codigoEnigma::codigoEnigma() {
key = keyGen();
srand(time(NULL));
string duplicateAlphabet = alphabet;
//Generating the random alphabets
for (int i = 0;i < alphabet.length();i++) {
int v1 = modulo(rand(), duplicateAlphabet.length());
while (duplicateAlphabet[v1] == 'T') {
v1 = m... | ALGO | 0.99769 | 4.088281 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-10-08T02:41:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03d9d7095f... |
82655c94-3c94-45cf-bb21-d06f2c542a32 | Sustainability4/Data-Structure-Algorithms | pririty_queues/k_largest_elements.cpp | #include<vector>
#include<queue>
#include <iostream>
using namespace std;
vector<int> kLargest(int input[], int n, int k){
/* Don't write main().
* Don't read input, it is passed as function argument.
* Return output and don't print it.
* Taking input and printing output is handled automatically.
... | ALGO | 0.999989 | 4.385391 | {
"github_metadata": {
"branch": "main",
"commit_count": 199,
"repo_created_at": "2021-04-10T11:31: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": "0310698e19... |
3df54a02-8a64-42bd-ac1f-d121544bffdf | mastojun/ProblemSolving | acmicpc.net/096/9627.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int N;
vector<string> words;
int wordCounter;
vector<string> one = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
vector<string> ten = {"ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "sev... | ALGO | 0.999094 | 4.513733 | {
"github_metadata": {
"branch": "master",
"commit_count": 214,
"repo_created_at": "2013-05-10T13:47:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f97a24ca... |
91b4859e-7d7a-4934-84bd-383b6b53ef25 | saken03/Competitive-Programming | [LoC] Summer Camp 2022/LoC SC 2022. Algorithms. Day 1/H.cpp | /***
AUTHOR: shabylkhan
CREATED: 18.07.2022 15:10:29
***/
#include<bits/stdc++.h>
using namespace std;
vector<int> g[55];
bool u[55];
int len, node;
void dfs(int v, int lvl, bool second = 0) {
u[v] = 1;
if (len < lvl) {
len = lvl;
if (!second) node = v;
}
for (int to : g[v]) {
if... | ALGO | 0.999729 | 3.687905 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2022-12-19T13:35: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": "768e4d268... |
9bee72fb-5a5c-4f43-8963-2dbc2b65bc0e | apurbo04/XPSC_Problem_Solve | 167/Delete_Not_Equal.cpp | #include <bits/stdc++.h>
#define ll long long
#define in cin >>
#define ot cout <<
#define nd << endl;
using namespace std;
const ll MOD = 1e9 + 7;
ll power(ll x, ll y)
{
ll ans = 1 % MOD;
while (y)
{
if (y & 1)
{
ans = (1LL * ans % MOD * x % MOD) % MOD;
}
x = 1LL * x * x % MOD... | ALGO | 0.999411 | 3.847111 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2024-10-27T13:43: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": "ff86cc860cf... |
159436e0-ede3-44e8-b6b1-e7ca1bd3b616 | joemonthana/EjerciciosCPP | UNIDAD I/Ejercicio25 - Tarea/Tarea4.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int pares = 0;
int impares = 0;
int totalParesImpares = 0;
for (int i = 1; i <= 10; i++)
{
if ( i % 2 == 0) {
pares = pares + i;
}
cout << i << " ";
}
cout << endl;
cout... | ALGO | 0.995248 | 4.395973 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2022-02-01T18:14: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": "88ed3b35ef9... |
a7a84cba-10dd-45d1-9d4a-1aa97e62c962 | maruf-ahammed-75/problem-solve-for-cp | Versity/CSE 406/First_In_First_Out.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
vector<int> a(n);
for(int i=0 ; i<n; i++){
cin>>a[i];//input vector elements
}
int frame = 3;
unordered_set<int> s;
queue<int> q;
int page_faults = 0;
for(int i=0 ; i< n; i++){
cout<<a[i]<<... | ALGO | 0.999583 | 4.185387 | {
"github_metadata": {
"branch": "main",
"commit_count": 351,
"repo_created_at": "2024-09-24T15: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": "f61d2b84aa... |
0af2a117-b8fd-48ce-a496-9a02a0fe2cab | henry20160826/CppWorkspace | 15. 3Sum/src/15. 3Sum.cpp | //============================================================================
// Name : .cpp
// Author : dh
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
//Given an arra... | ALGO | 0.997333 | 4.822295 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-09-07T13:07:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7725eeeaa7... |
dfb24ccd-51fd-4ca6-8ad8-372a1d56ed2a | pnthi160403/compettive_programming | codeforces/div2/round910/D/D.cpp | // CODE BY <NAME> NegativeZero TEAM
#include <bits/stdc++.h>
#define ll long long
#define hi cerr << "HIHIHI\n";
#define endl '\n'
#define int long long
// const int INF = (int)1e9;
const ll INF = (ll)1e18;
using namespace std;
void check(set<int> a) {
for(int x : a) {
cerr << x << ' ';
}
cerr ... | ALGO | 0.999973 | 4.601185 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-10-21T05:05: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": "8293d385aeb3... |
c4e55a1e-de56-4291-a9aa-fce67c201d2d | brkdnmz/algometu25 | i.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n = 500;
cin >> n;
int cnt[n * n] = {};
vector<array<short, 2>> locs[n * n];
int grid[n][n];
int id[n * n] = {};
int last_id = 0;
for (short i = 0; i < n; i+... | ALGO | 0.999892 | 4.18236 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-03-10T07:13: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": "f8943c600948... |
4d6e40aa-6a9f-4995-8ee8-fa353865df76 | justintimewatkins/ParallelProgammingLabs | Labs/FIR/Vitis_HLS/srcs/Archive/fir_2.1.cpp | #include "fir.h"
// Not optimzied code in Figure 2.1
void fir(d_stream& y, d_stream& x){
#pragma HLS INTERFACE mode=ap_ctrl_none port=return
#pragma HLS INTERFACE mode=axis register_mode=both port=y
#pragma HLS INTERFACE mode=axis register_mode=both port=x
coef_t c[N] = {
53, 0, -91, 0, 313, 500, 313, 0, ... | ALGO | 0.998924 | 5.43929 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2022-07-05T18:03:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08aed388a... |
e806a925-f15d-415c-a248-1e79c23fe38b | ohyeah521/cryptofbc | CryptoFBC/src/md5.h | #ifndef CryptoFBC_MD5_H
#define CryptoFBC_MD5_H
#include "cfbconfig.h"
#include "baseroutine.h"
NAMESPACE_BEGIN(CryptoFBC)
#define md5S11 7
#define md5S12 12
#define md5S13 17
#define md5S14 22
#define md5S21 5
#define md5S22 9
#define md5S23 14
#define md5S24 20
#define md5S31 4
#define md5S32 11
#define md5S33 16
... | ALGO | 0.956839 | 6.129219 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2016-03-22T14:10:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20814b475... |
7cdb7ccc-7871-409a-9664-44f9ac9f3d67 | haiyangwu/mediasoup-client-android | mediasoup-client/deps/webrtc/src/modules/audio_processing/agc2/agc2_common.h | /*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | TOOL | 0.912958 | 5.04162 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2019-09-19T03:38:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 200,
"forks": 118,
"issues": 37,
"pull_requests": 1
},
"file_meta": {
"content_id": "3f4... |
0b5acf7c-5159-4720-8ed1-6fa2b031ca77 | eobrie16/courses | cxx_271/examples/PolyLife/Life.h | enum CELL_TYPE { Boundary, Ant, Empty, APredator, PPredator};
class Organism
{
private:
CELL_TYPE ctype;
int isolation_count;
int crowding_count;
int birth_count;
public:
Organism();
virtual CELL_TYPE getType()=0;
// An Ant who has no neighbors for the following number of iterations, will die
virtual int get... | ALGO | 0.994704 | 3.378001 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-03-16T04:30:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 6
},
"file_meta": {
"content_id": "6a944f4b3... |
2676f733-c440-4a29-93f1-493f8d24abdb | charrann12/My-DSA-Journey | 06_StacknQueue/trappingRainWate.cpp | /* TRAPPING RAIN WATER
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
Example 1:
Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
Output: 6
Explanation: The above elevation map (black section) is represented by array [0,1,0,... | ALGO | 0.999994 | 6.517682 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2025-06-23T06:30:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "646eb791011... |
3e24c487-5be3-47e8-8ef2-3a3c7e8f8728 | uds-lsv/premise | code/embeddings.h | /*
Code to load embeddings and look-up nearest neighbouring embeddings.
*/
#ifndef EMBEDDINGS_H
#define EMBEDDINGS_H
#include <string>
#include <vector>
#include <memory>
#include "bitcollection.h"
typedef std::vector<double> Embedding;
class EmbeddingNeighborLookup
{
public:
// Args:
// e... | ALGO | 0.995357 | 5.975963 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-06-08T12:08:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b77f7b4b868... |
7a1f8833-9aa7-4c32-b170-445538adc69a | VanChef/simple_algorithms | reorder_odd_even.cpp |
/*
剑指offer上一道题
输入一个整数数组,实现一个函数来调整该数组中数字的顺序,使得所有的奇数位于数组的前半部分,所有的偶数位于位于数组的后半部分,并保证奇数和奇数,偶数和偶数之间的相对位置不变。
加一个限定条件:不允许使用额外的存储空间
解题技巧:这种题目一定要想清楚细节,找准一个方法,然后可以通过具体的实例确定写法
对于这道题,思路就是遇到一个奇数的时候,把他之前所有的偶数后移一位,在把这个奇数挪到偶数的头
这样就分成两种情况,遍历到该奇数时,之前有偶数/之前没有偶数
用event_start表示之前偶数的起始下标,
如果之前有偶数,那么则需要移动数组,由于最前面插入了一个奇数,event_start应该++,
如... | ALGO | 0.999985 | 4.604848 | {
"github_metadata": {
"branch": "master",
"commit_count": 95,
"repo_created_at": "2017-03-31T13:00:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b109a167e... |
f11ee9d5-dc84-4630-9b48-8a0cdf6be68d | DEShawResearch/fs123 | core123/include/core123/histogram.hpp | #pragma once
#include <vector>
#include <algorithm>
#include <cmath> // for INFINITY
#include <stdexcept>
#include <functional>
namespace core123{
/*
DOCUMENTATION_BEGIN
histogram is an abstract class with two derived classes (see below):
uniform_histogram
nonuniform_histogram
Except for the c... | TOOL | 0.96417 | 6.790317 | {
"github_metadata": {
"branch": "master",
"commit_count": 377,
"repo_created_at": "2019-04-02T21:58:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9cc8ea5... |
759ce133-354e-485a-8439-7329cee9b18f | zvolin/Draughts_AI | ai.cpp | #include "ai.hpp"
Node::Node( int depth, Board board_, bool side_, bool color_, Move move_ ) {
color = color_;
board = board_;
side = side_;
move = move_;
value = 0;
if ( depth == 0 || board.checkState( side ) != 0 )
value = board.evaluateBoard( side, color );
else {
for ( a... | ALGO | 0.992032 | 5.557765 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-06-02T23:06:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "07c8e47463... |
5199e961-bea6-4a7c-aa2d-ba674114e8b3 | DeanP-R/MediTech_Automation_Control | object_avoidance.cpp | #include "Arduino.h"
// Import the necessary libraries
#include "object_avoidance.h"
// Create an object for each laser sensor (left, center, right)
Adafruit_VL53L0X leftLaser = Adafruit_VL53L0X();
Adafruit_VL53L0X centerLaser = Adafruit_VL53L0X();
Adafruit_VL53L0X rightLaser = Adafruit_VL53L0X();
// Set the I2C addr... | TOOL | 0.995943 | 4.845892 | {
"github_metadata": {
"branch": "working",
"commit_count": 119,
"repo_created_at": "2023-01-24T16:03: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": "f743f4f... |
dab57213-73bb-4022-9487-c66faefe7f90 | Rachit-31/DSA_Ques | Codeforces/D_Black_and_White_Stripe.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define nl <<'\n'
#define fast_io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
void solve() {
int n, k;
cin >> n >> k;
string s;
cin >> s;
int min_recolor = k;
int current_whites = 0;
fo... | ALGO | 0.999879 | 4.653339 | {
"github_metadata": {
"branch": "main",
"commit_count": 275,
"repo_created_at": "2024-06-25T10:48: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": "3b34963292... |
5312f5f5-d3ee-47a6-bd7e-e003ee98802c | pachiko/HQRTR | hw4/lut-gen/Emu_IS.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <fstream>
#include <random>
#include "vec.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"
const int resolution = 128;
const bool invert = false;
// Quasi-Monte Carlo sampling
Vec2f Hammersl... | ALGO | 0.995164 | 4.75311 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2022-08-13T08:06:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d66df6af... |
05bb4b09-9be0-41e3-a6ca-b564a0699ff1 | spmallick/learnopencv | 3D-Gaussian-Splatting-Code/gsplat/gsplat/cuda/csrc/third_party/glm/glm/gtx/intersect.inl | /// @ref gtx_intersect
namespace glm
{
template<typename genType>
GLM_FUNC_QUALIFIER bool intersectRayPlane
(
genType const& orig, genType const& dir,
genType const& planeOrig, genType const& planeNormal,
typename genType::value_type & intersectionDistance
)
{
typename genType::value_type d = glm::dot(dir... | ALGO | 0.99248 | 6.773749 | {
"github_metadata": {
"branch": "master",
"commit_count": 2579,
"repo_created_at": "2015-02-17T08:00:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22057,
"forks": 11720,
"issues": 229,
"pull_requests": 48
},
"file_meta": {
"content_id... |
610b6395-e8a5-42c5-af60-7f0fd046bc0b | kapi97/C-Cpp | Programowanie obiektowe/II/Wektor intow 1.0.cpp | /*Stwórz wektor int'ów oraz pętle, która będzie go wypełniała
liczbami wpisywanymi z klawiatury ale tak aby po każdym wstawieniu
wektor był posortowany. (nie wolno używać funkcji sortującej).
Wprowadzenie 0 powoduje zakończenie działania pętli.
Po zakończeniu działania pętli proszę podać sumę i średnią
arytmetyczn... | ALGO | 0.999596 | 3.80034 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-12-10T17:55: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": "6ce5cba28... |
db1e96b8-a2d4-4d93-8895-ef6741e27cca | bqi343/cp-notebook | Contests/USACO Solutions/2016-17/Jan 2017/Silver/17 Jan S2.cpp | // #include<iostream>
#include<fstream>
#include<set>
#include<map>
#include<unordered_map>
#include<cmath>
#include<cstring>
#include<string>
#include<bitset>
#include<algorithm>
#include<vector>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gn... | ALGO | 0.999283 | 3.568074 | {
"github_metadata": {
"branch": "master",
"commit_count": 1350,
"repo_created_at": "2017-07-11T03:52:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2642,
"forks": 429,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6... |
c4d951ad-8c9f-458a-9456-9b23a42c2d6b | robertkarol/didactic | Standard Template Library/vector/vector - Constructors, (re)sizing and (re)allocating memory.cpp | #include <iostream>
#include <vector>
using namespace std;
void vector_with_default_constructor_and_pushback()
{
// We declare a vector.
// With this declaration, there is currently no memory allocated in it: it's empty!
// We called the allocated amount of memory capacity, and the actual number of elements - siz... | TOOL | 0.97312 | 4.556877 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-01-17T09:11:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23eb1152e... |
8a72430a-7be2-4190-8f79-6aef3c8ce138 | BekzhanKassenov/olymp | Nazarbayev University/Camp by Sergey Kopeliovich/Fall 2013/Team contest day 2/B/Main.cpp | /****************************************
** Solution by NU_02 **
****************************************/
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define MP make_pair
#define all(x) (x).begin(), (x).end()
#define fill(x, y) memset((x), y, sizeof(x))
#define ... | ALGO | 0.999118 | 3.896083 | {
"github_metadata": {
"branch": "master",
"commit_count": 426,
"repo_created_at": "2015-07-29T15:25:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10875b4e... |
c244ca62-cce4-4308-b5c5-46953c2fcf53 | Bhaikko/mdrrha | lib/Algorithm.cpp | #include "./../include/Algorithm.h"
Algorithm::Algorithm(std::vector<Process> processesToExecute)
{
this->avgTAT = 0.0f;
this->avgWT = 0.0f;
this->avgRT = 0.0f;
this->nCS = 0;
this->processesToExecute = processesToExecute;
}
void Algorithm::RunAlgo()
{
std::cout << name << " Started for " << t... | ALGO | 0.969826 | 4.675338 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2021-08-30T14:46:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2ccee16... |
a93024a0-9c4c-43aa-b896-f14f66cf20b3 | OpenModelica/OpenModelica | OMCompiler/SimulationRuntime/OMSICpp/runtime/src/Solver/RK12/RK12.cpp | /** @addtogroup solverRK12
*
* @{
*/
#include <Core/ModelicaDefine.h>
#include <Core/Modelica.h>
#include <SimCoreFactory/OMCFactory/OMCFactory.h>
#include <Solver/RK12/RK12.h>
#include <Solver/RK12/RK12Settings.h>
#include <Core/Math/ILapack.h>
RK12::RK12(IMixedSystem* system, ISolverSettings* settings)
: S... | ALGO | 0.999628 | 5.710988 | {
"github_metadata": {
"branch": "master",
"commit_count": 37531,
"repo_created_at": "2015-05-03T16:59:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1002,
"forks": 322,
"issues": 2061,
"pull_requests": 46
},
"file_meta": {
"content_id":... |
16c8c796-7ab7-452c-af4e-47965616837a | jeffreymorales978/B2 | calculaEdad.cpp | #include <iostream>
using namespace std;
int main()
{
int HEPV_aa, HEPV_ma, HEPV_da, HEPV_an, HEPV_mn, HEPV_dn, HEPV_a, HEPV_m, HEPV_d;
cout << "Ingrese la fecha actual Año-Mes-Dia :";
cin >> HEPV_aa >> HEPV_ma >> HEPV_da;
cout << "Ingrese la fecha de nacimiento Año-Mes-Dia : ";
cin >> HEPV_an >> HE... | ALGO | 0.986445 | 3.483907 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-10-06T14:18: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": "4886b74078d... |
e2f365a5-6dc4-4556-829d-cd6bfbf66df1 | annereinarz/ExaHyPE-Tsunami | ApplicationExamples/SWE/SWE_asagi_limited/MySWESolver_ADERDG.cpp | // This file was generated by the ExaHyPE toolkit.
// It will NOT be regenerated or overwritten.
// Please adapt it to your own needs.
//
// ========================
// www.exahype.eu
// ========================
#include "MySWESolver_ADERDG.h"
#include "MySWESolver_ADERDG_Variables.h"
#include "peano/utils/Loop.h"... | ALGO | 0.999823 | 3.382559 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2021-04-01T17:40:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c75d830760a... |
91ed3112-6f78-4385-ba6c-68c36b21a5fe | robertu94/cpsc3220-f18 | class/7_parallel/philosophers_lock_order.cc | #include <algorithm>
#include <array>
#include <chrono>
#include <iostream>
#include <mutex>
#include <random>
#include <thread>
// shared resources for the philosophers
const int num_philosophers = 5;
std::mutex io_mutex;
std::array<std::mutex, num_philosophers> dining_utensils;
// configure c++ random numbers
std::... | ALGO | 0.99808 | 5.676734 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2018-07-24T17:15:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3f4c3c57... |
4fc3b2cb-3d04-44d0-9c28-7e5a23a49d33 | zainryan/INSIDER-System | STAccel/inc/hls_csim/hls/hls_big_mult.h | /*****************************************************************************
*
* Author: Xilinx, Inc.
*
* This text contains proprietary, confidential information of
* Xilinx, Inc. , is distributed by under license from Xilinx,
* Inc., and may be used, copied and/or disclosed only pursuant to
*... | ALGO | 0.998548 | 4.324174 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-06-02T21:26:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 38,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dce8db3... |
45a965c5-d764-4eb9-bf88-5da9ae699928 | google/filament | third_party/draco/src/draco/compression/bit_coders/rans_bit_encoder.cc | // Copyright 2016 The Draco Authors.
//
// 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 law or agree... | ALGO | 0.984828 | 7.700166 | {
"github_metadata": {
"branch": "main",
"commit_count": 7301,
"repo_created_at": "2018-08-03T17:26:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 18658,
"forks": 1993,
"issues": 155,
"pull_requests": 23
},
"file_meta": {
"content_id": "... |
49bb873b-bcba-4ae4-bdbc-ea2644fe84bd | vdae2304/Contest-archive | IOI Preselectivos/IOI 2017/Etapa 4/Examen 1/Balanced Brackets.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAXN 700
int N, K, v[MAXN], B[MAXN];
int DP[MAXN][MAXN];
int Resolver(int a, int b) {
if (a >= b)
return 0;
if (DP[a][b] == -1) {
if (B[b] - B[a] == K)
DP[a][b] = v[a] + Resolver(a + 1, b - 1) + v[b];
for (int i = a; i <... | ALGO | 0.999976 | 3.454146 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2017-11-26T19:19:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab046d5a0... |
d0d8a51f-e383-41a6-82ea-fc14c8c7cd9b | zz9629/.leetcode | 680.valid-palindrome-ii.cpp | /*
* @lc app=leetcode id=680 lang=cpp
*
* [680] Valid Palindrome II
*/
#include "string"
using namespace std;
// @lc code=start
class Solution {
public:
bool isPalindrome(string s, int head, int tail)
{
if (s.empty()) return false;
while (head <= tail)
{
if (s[head] != s... | ALGO | 0.999927 | 6.702907 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-05-06T05:13: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": "5bc51a602e5... |
b7812325-4d66-415f-a330-4cecbe7cef35 | ShubhamAgrawal-13/Relational_DBMS | src/executors/linearHashing.h |
const int BUCKET_SIZE=5;
const double THRESHOLD_INSERT=0.75; //75%
const double THRESHOLD_DELETE=0.25;
class Record{
public:
int key;
int page_no;
int row_no;
// Record(){
// key=0;
// page_no=0;
// row_no=0;
// }
};
// INDEX ON a FROM A USING HASH BUCKETS 2
class BucketBlock{
public:
map<int, vector<... | ALGO | 0.988836 | 3.563701 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2020-11-25T16:12: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": "086d234fbc0f... |
c835ff95-3e55-43f8-970c-9bd8b6f22dce | darejester/CppStudies | palindrome/main.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string palindromeProblem(string s);
int main() {
string testString = "aaacodoc";
palindromeProblem(testString);
return 0;
}
string palindromeProblem(string s)
{
string prefix = "";
string palindrome = "";
while(s... | ALGO | 0.999852 | 4.357427 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-10-04T02:50: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": "948622d9abc... |
8ca2ddb1-85ff-466c-9978-c5d7fddccf7b | mtao/vempic | src/two/cell.cpp | #include <spdlog/spdlog.h>
#include <mtao/algebra/pascal_triangle.hpp>
#include "vem/two/cell.hpp"
#include "vem/utils/clang_hacks.hpp"
#include "vem/two/edge_lengths.hpp"
#include "vem/two/monomial_cell_integrals.hpp"
#include "vem/two/monomial_edge_integrals.hpp"
#include "vem/polynomials/gradient.hpp"
#include "ve... | ALGO | 0.940582 | 6.866587 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2022-07-01T14:50:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e11f4e50c22... |
4ed97d92-5781-4bb9-a42c-1836fbc6a8dc | Yevgeniy-Olexandrenko/tiny-handheld | software/games/tiny-joypad/hollowseeker-v0.1/game.cpp | #include "common.h"
#include "data.h"
/* Defines */
#define COLUMNS 18
#define COLUMN_W 8
#define CAVE_WIDTH (COLUMNS * COLUMN_W)
#define CAVE_BOTTOM_MIN 16
#define CAVE_BOTTOM_MAX 56
#define CAVE_BOTTOM_ADJ 34
#define CAVE_GAPMAX_MIN 32
#define CAVE_GAPMAX_MAX 255
#define CAVE_PHASE_MAX 256
#... | ALGO | 0.930283 | 4.667997 | {
"github_metadata": {
"branch": "master",
"commit_count": 167,
"repo_created_at": "2020-07-27T15:52:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6292d9b... |
75c98058-06fa-4827-8153-f1a0e3dd37ba | karimvafin/JitAotCourseMipt | src/DomTree.cpp | #include <stack>
#include <iostream>
#include "DomTree.hpp"
#include "assert.h"
namespace Compiler {
DomTree DomTree::createDomTree(const Graph& graph) {
DomTree domTree;
domTree.tree_.resize(graph.size());
std::vector<std::vector<size_t>> dominated = calcDominated(graph);
std::vector<std::vector<siz... | ALGO | 0.999819 | 6.81759 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-10-01T10:41: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": "9e4ed5f9dbf... |
3808bfb8-250a-4ce4-9fed-0d569bb41df9 | rishabhs/sygus-comp14 | solvers/enumerative/esolver-synth-lib/src/z3-4.3.1/src/parsers/smt/smtlib.h | /*++
Copyright (c) 2006 Microsoft Corporation
Module Name:
smtlib.h
Abstract:
SMT library utilities
Author:
<NAME> (nbjorner) 2006-09-29
Revision History:
--*/
#ifndef _SMTLIB_H_
#define _SMTLIB_H_
#include "ast.h"
#include "symbol_table.h"
#include "map.h"
#include "arith_decl_plugin.h"
namespace... | TOOL | 0.979674 | 6.344558 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2014-01-02T19:42:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 40,
"forks": 19,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "5becaa2... |
50e0e4fd-8b58-44cb-9ca7-184c53800773 | kisho1131/Data-Structure-and-Algorithm | Sorting/Quick-Sort.cpp | #include <bits/stdc++.h>
using namespace std;
int Partation(int arr[], int s, int r) {
int pivot = arr[r];
int k = s - 1;
for (int i = s; i <= r - 1; i++) {
if (arr[i] <= pivot) {
k = k + 1;
swap(arr[k], arr[i]);
}
}
swap(arr[k + 1], arr[r]);
return k + 1;
}
void QuickSort(int arr[], i... | ALGO | 0.999873 | 5.303042 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-06-01T18:11: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": "cf0c22e65f49... |
72c207f4-9e4f-439b-b71d-ac68a0eb9e9a | youmin1017/algo-demo-ii | src/demo/convex_hull.cpp | #include "convex_hull.h"
#include <algorithm>
#include <queue>
#include "demo_utils.h"
namespace Demo {
ConvexHull::ConvexHull() : points{} {
this->canvas = new Canvas;
// returns true if the three points make a counter-clockwise turn
this->cross = [](const ImVec2 &p0, const ImVec2 &p1,
... | ALGO | 0.999338 | 5.733645 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-05-05T07:13: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": "451353cdb3a... |
21aa4e9b-1fcb-48c3-bb64-a35558b24749 | abhijeetaman007/Code-Practice-Backup | InterviewBit/#Practice/Daily/Linkedlist_singly.cpp | #include<bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node* next;
};
node* head=NULL;
node *tail=NULL;
node* createnode(int val)
{
node *n=new node;
n->data=val;
n->next=NULL;
if(head==NULL)
head=n;
return n;
}
int countnodes()
{
node* t=head;
int c=0;
while(t!=NULL)
{
c++;
t=t... | ALGO | 0.999713 | 4.483263 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-11-23T16:15: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": "1c0b0a302... |
5d9da9ae-b755-4933-b00d-b5df7bbcb977 | JoseJaita/Procesamiento-de-Imagenes | projecto 1/avance 5/circle.cpp | #include "calibration.h"
#include "refinement.h"
int main(int argc, char *argv[]){
if (argc < 3 ){cout << "Faltan argumentos" <<endl;return -1;}
//---------------------- argv ------------------------------------
string arg = argv[1];
int n_f = atoi(argv[2]);
//------------------- variables for ca... | TOOL | 0.954914 | 4.060941 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2018-02-08T05:00: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": "ab94df717... |
f6893f01-5317-4c32-b2fa-72ba596a911c | Yuvrajchandra/Count-Vowels-Consonants-Digits-SpecialCharacters-in-String | count.cpp | // C++ program to count special characters, digits,
// vowels, and consonants in a given string
#include <iostream>
using namespace std;
// Function to count special characters, digits,
// vowels, and consonants in a given string
void countCharactersCategory(string s)
{
// Initializing variables to count the total nu... | ALGO | 0.996746 | 4.711582 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-06-02T07:35: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": "8a6370509b0b... |
84deadcb-7a9d-460b-a8ae-89a34d9e9e91 | NaRDo627/CheckersAI | CheckersAI/CheckerGameBase.h | #pragma once
#include "stdafx.h"
#include <string>
#include <map>
#include <iostream>
#include <limits>
#include <fstream>
const unsigned BOARD_SIZE = 8;
typedef unsigned BitBoard;
UINT inline RotateLeft(UINT a_nNum, UINT a_nCount)
{
return (a_nNum << a_nCount) | (a_nNum >> (32 - a_nCount));
}
UINT inline RotateRi... | ALGO | 0.97098 | 4.48351 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-03-19T17:33: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": "583e77310... |
46ed6e65-b601-425e-b75c-e4aec9cd779d | m10914/waxis_engine | SkinnedMesh/mmath.cpp |
#include "mmath.h"
int qu(int a){ return a*a;}
float qu(float a){ return a*a;}
double qu(double a){ return a*a; }
double module( D3DXVECTOR3 vec1, D3DXVECTOR3 vec2 )
{
return sqrt( qu(vec1.x-vec2.x) + qu(vec1.y-vec2.y) + qu(vec1.z-vec2.z) );
}
//--------------------------------------------
// Name:
// Desc:
... | ALGO | 0.999307 | 3.736799 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-01-10T08:28:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e8567493f... |
8235f7aa-bf24-44d1-b67f-8c12777b7956 | watashi/AlgoLib | DataStructure/RangeMinimumQuery/RMQ.cpp | #include <algorithm> // copy
#include <climits> // CHAR_BIT
#include <vector>
using namespace std;
template<typename T>
struct RMQ {
int n;
vector<T> e;
vector<vector<int> > rmq;
static const int INT_BIT = sizeof(4) * CHAR_BIT;
static inline int LG2(int i) { return INT_BIT - 1 - __builtin_clz(i); }
s... | ALGO | 0.999924 | 4.962122 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2011-10-06T10:02:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 111,
"forks": 40,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "252fe0... |
18b7ca89-2f12-41e6-9531-7d72f18d2327 | xbaotg/training | Codeforces/Contests/1512/c/main.cpp | #include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
#ifdef LOCAL
#define deb(x) cout<<"LINE("<<__LINE__<<"): "<<(#x)<<" = "<<(x)<<endl;
#else
#define deb(...)
#endif
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define FOD(i, a, b) for (int i = a; i > b; i--)
#define push_back ... | ALGO | 0.999949 | 3.803355 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-02-20T14:21: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": "f222a203c... |
2622d5c7-7013-4322-b8c3-24ad5289bfd7 | aflynt/aoc_cpp | day04.cpp | #include "aoc_lib.h"
#include "days.h"
#include "card.h"
#include <fstream>
#include <iostream>
#include <map>
void solve_p1(const std::string& fname){
auto lines = get_lines(fname);
long long ans = 0;
for (auto& line: lines)
ans += card(line).get_v();
std::cout << ans << "\n";
}
auto make_map(std::... | ALGO | 0.998779 | 4.973212 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2024-01-26T17:39: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": "219949d1e5... |
bcd864fa-4eaf-4326-9ad6-4856767015a0 | Katarzyna-W/DataAnalytics | Lab4/height_1_fit.hpp |
// Code generated by stanc v2.29.1
#include <stan/model/model_header.hpp>
namespace height_1_fit_model_namespace {
using stan::model::model_base_crtp;
using namespace stan::math;
stan::math::profile_map profiles__;
static constexpr std::array<const char*, 10> locations_array__ =
{" (found before start of program)"... | ALGO | 0.979106 | 5.411014 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2022-03-01T10:35:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d9bf5b11f9... |
21942e73-b89d-4fbe-bd02-0d3d108066ba | wuyadie/test | c++/template1.cc | #include <iostream>
template<typename T>
class Rational;
template<typename T>
const Rational<T> doMultiply(const Rational<T>& , const Rational<T>&);
template<typename T>
class Rational
{
public:
Rational<T>(T ca, T cb)
: a(ca), b(cb)
{}
void print()
{
std::cout << a << "," << b << std::endl;
}
f... | TOOL | 0.984764 | 6.179623 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2021-09-09T07:00: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": "f63a52f4... |
6089720a-eaf5-4fb9-97ee-0c4afeed2502 | tanvir-robin/CP-Solutions | 1705A-Mark the Photographer.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//Definition Section
//--------------------------------------------------------------
#define fl(i,x,y) for(int i=x; i<y; i++)
#define flc(i,x,y,z) for(int i=x; i<y; i+=z)
#define nl cout<<endl
#define vsort(v) sort(v.begin(), v.end());
#define vsor... | ALGO | 0.999967 | 3.774911 | {
"github_metadata": {
"branch": "main",
"commit_count": 505,
"repo_created_at": "2022-12-03T20:55:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12ff78c8c3... |
a6fe3d77-d96d-45b6-bdbb-6ae304a84029 | d2fong/SeaEssForeFiddyFore | helpers.cpp | //
// Created by <NAME> on 2015-07-06.
//
#include "helpers.h"
#include <sys/socket.h>
#include "constants.h"
#include <netinet/in.h>
#include <iostream>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <sstream>
#include <vector>
#include <string>
#include "DB.h"
using namespace std;
string appe... | TOOL | 0.920727 | 4.532494 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2015-07-06T23:37: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": "fac8afd27... |
01dc3c4e-c22c-4ea3-bca6-592308de1bda | nikolatechie/Competitive-programming | Codeforces/274B - Zero Tree.cpp | #include <bits/stdc++.h>
#include <ext/rope>
using namespace std;
using namespace __gnu_cxx;
using ci = const int;
using ld = long double;
using llint = long long;
using ullint = unsigned long long;
using pii = pair <int,int>;
using pcc = pair <char,char>;
using pss = pair <string,string>;
using vi = vector <int>;
usi... | ALGO | 0.999893 | 3.809044 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2019-03-07T18:18:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aae5872e... |
25d0a111-f990-4f24-a272-3fee300e90f0 | silenc3502/cpp_examples | ch2/max4.cpp | #include <iostream>
#include <cstring>
#include <string>
using namespace std;
template <typename T>
inline T const& max(T const& a, T const& b)
{
return a < b ? b : a;
}
template <typename T>
inline T * const& max(T * const& a, T * const& b)
{
return *a < *b ? b : a;
}
inline char const *max(char const * const& a... | ALGO | 0.996446 | 3.494412 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2020-11-19T03:34:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3189e7f3895... |
12894ae4-31f7-4948-9ac9-45573c2d3c64 | IvanRenison/ProgrammingProblems | CSES/Advertisement.cpp | // https://cses.fi/problemset/task/1142/
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef vector<ull> vu;
#define fore(i, a, b) for (ull i = a, gmat = b; i < gmat; i++)
/** Author: <NAME>, pajenegod
* Date: 2015-02-06
* License: CC0
* Source: Folklore
* Description: Range M... | ALGO | 0.999951 | 4.547585 | {
"github_metadata": {
"branch": "main",
"commit_count": 665,
"repo_created_at": "2022-11-24T13:05: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": "1cafd7fce5... |
a95d4097-922a-4495-a930-64ab293f96c8 | ishandutta2007/codeforces-nonalphabetic | 12tqian/normal/1483/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define f1r(i, a, b) for (int i = a; i < b; ++i)
#define f0r(i, a) f1r(i, 0, a)
#define each(t, a) for (auto& t : a)
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(x) begin(x), ... | ALGO | 0.999938 | 3.61026 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:49: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": "378bb3ce9874... |
41fad2fe-efb0-4ade-9bf6-0d9e4eaca0c3 | zjsxzy/Leetcode | Maximum Distance Between a Pair of Values/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define SZ(v) ((int)(v).size())
#define abs(x) ((x) > 0 ? (x) : -(x))
typedef long long LL;
class Solution {
public:
int maxDistance(vector<int>& nums1, vector<int>& nums2) {
int n = nums1.size(), m = nums2.size();
reverse(nums2.be... | ALGO | 0.999977 | 4.892195 | {
"github_metadata": {
"branch": "master",
"commit_count": 393,
"repo_created_at": "2013-09-27T03:59:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ae43a6c... |
02dfaf39-2320-4252-ae28-94748a561946 | XewiL/School-Projects | Basic Course on Programming/project-01/main.cpp | // TIE-02206, projekti 01, päivämääräluokka
//
// <NAME>, 160280
// Vertailupäivämääräksi valitaan 31.12.1799 ja katsotaan kalenterista,
// että se oli tiistai.
// Lasketaan sen jälkeen montako päivää on kulunut pyydettyyn päivämäärään.
// Ideoita otettu ohj1-prujusta.
#include <iostream>
#include <string>
#include... | ALGO | 0.969226 | 3.464428 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2018-01-18T16:59: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": "b05c3bba7... |
523eb027-acd1-4bc1-b377-daa29a0328cf | qasimyu/scssim | lib/matrix/Matrix.h | // ***************************************************************************
// Matrix.h (c) 2018 <NAME> <<EMAIL>>
// Health Informatics Lab, Ningxia University
// All rights reserved.
#ifndef _MATRIX_H
#define _MATRIX_H
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cassert... | TOOL | 0.978273 | 4.456643 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-03-09T07:46:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "335a3ce4... |
bacfdfab-fce2-4b3f-a783-cf973717a79a | CountryBird/CountryBird | Algorithm/show.cpp | #include<iostream>
#include<fstream>
#include<vector>
#include <algorithm>
using namespace std;
int k;
vector <vector<int>> twoSat;
vector <vector<int>> rTwoSat;
vector <bool> visited;
vector<int> topology;
vector<vector<int>> scc;
#define no(i) ((i)<(k)?(i+k):(i-k))
void first_dfs(int now) {
visited[now] = true;
... | ALGO | 0.999345 | 3.97184 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-03-02T04:57:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89f371f828a... |
700ade32-bff2-4df9-af85-7e5e04971e5a | hellodada/LeetCode | week1/304_eyan.cpp | // have more to think for this question....
// it has O1 solution in discuss
class NumMatrix {
private:
vector<vector<int>> selfmatrix;
vector<vector<int>> summatrix;
public:
NumMatrix(vector<vector<int>> &matrix) {
int row, col;
row = matrix.size();
if(row != 0) col ... | ALGO | 0.999789 | 6.361074 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-11-17T05:11:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "a5b72f96e... |
85a94b63-d6f5-454b-938c-73ba4e439d29 | Fineas/Algorithms-and-Data-Structures | Projects/Project4/source.cpp | #include <iostream>
#include <stdio.h>
#include <string>
#include <fstream>
using namespace std;
ifstream fin("software.txt");
class BST {
public:
string name;
string version;
int quantity;
int price;
string key;
int position;
BST *left, *right;
... | TOOL | 0.914678 | 3.537919 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-03-10T08:38:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08ee786de... |
b34ef6d4-2636-4da7-a914-f2aedce4ef44 | aminazBio/Train-station-timing | train_station.cpp | #include <iostream>
using namespace std;
int Partition(float arr[], int first, int last)
{
float Pivot = arr[first];
int count = 0;
for(int i = first + 1; i <= last; i++)
{
if(arr[i] <= Pivot)
count++;
}
int PivotIndex = first + count;
swap(arr[PivotIndex], arr[first]);
int i = first;
int j = l... | ALGO | 0.999977 | 4.535665 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-11-01T15:34:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7a9c1486ca2... |
e5a01abd-9013-4989-acf5-92d4b4e52be6 | detectivemark7/aprg | AprgAlgebra/AprgAlgebra/src/Algebra/Simplification/SimplificationOfExpression.hpp | #pragma once
#include <Algebra/Constructs/TermRaiseToTerms.hpp>
#include <Algebra/Constructs/TermsOverTerms.hpp>
#include <Algebra/Factorization/FactorizationConfiguration.hpp>
#include <Algebra/Term/TermTypes/Term.hpp>
#include <Common/Container/AlbaConfigurationHolder.hpp>
namespace alba {
namespace algebra {
nam... | TOOL | 0.90409 | 7.441504 | {
"github_metadata": {
"branch": "main",
"commit_count": 687,
"repo_created_at": "2021-08-07T08:34:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b85444d74f... |
a88ff8db-191b-48d1-a9a6-44e692c7fa13 | google-ai-edge/mediapipe | mediapipe/tasks/cc/vision/image_segmenter/calculators/segmentation_postprocessor_gl.cc | #include "mediapipe/tasks/cc/vision/image_segmenter/calculators/segmentation_postprocessor_gl.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "absl/log/absl_log.h"
#include "absl/status/status.h"
#include "absl/strings/str_format.h"
#include "mediapipe/framework/port/status_macros... | TOOL | 0.957595 | 5.153831 | {
"github_metadata": {
"branch": "master",
"commit_count": 4767,
"repo_created_at": "2019-06-13T19:16:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 30689,
"forks": 5453,
"issues": 443,
"pull_requests": 149
},
"file_meta": {
"content_id"... |
6d4d55e5-72e0-4ca7-a146-45477fb64ad4 | ishandutta2007/codeforces-s | se1ka2/normal/1247/D.cpp | #include <iostream>
#include <vector>
#include <map>
using namespace std;
typedef long long ll;
ll p[1002];
ll power(ll x, ll n){
ll res = 1;
for(int i = 0; i < n; i++){
res *= x;
if(res > 1000000) return 0;
}
return res;
}
int main()
{
ll n, k;
cin >> n >> k;
vector<ll> v... | ALGO | 0.999908 | 4.509579 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07: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": "a5aa76695ec9... |
5f7516e2-fa90-4b27-ae9d-d2f6df08b57c | andrei-coman/competitive-programming | biconnected-components-tarjan.cpp | int n, m, last;
std::vector <std::vector <int>> M;
std::vector <int> G[1 + MAXN], emptyVec;
std::pair <int, int> S[1 + MAXN];
int depth[1 + MAXN], lowlink[1 + MAXN];
void print_biconnected(){
printf("%d\n", M.size());
for(int i = 0; i < M.size(); i++){
for(auto y: M[i]) printf("%d ", y);
printf... | ALGO | 0.999658 | 4.350077 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-08-12T11:37: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": "8884b1fcd... |
284ca25e-ff6a-4094-8b2c-fd18d6da969f | bayashi-cl/procon-submission | atcoder/abc129/abc129_d/23286464.cpp | #pragma region include
#include <atcoder/dsu>
#include <atcoder/modint>
#include <boost/range/irange.hpp>
// #include <bits/stdc++.h>
// #include <cmath>
#include <iomanip>
#include <iostream>
// #include <iterator>
#include <limits>
// #include <map>
// #include <numeric>
// #include <queue>
// #include <set>
// #incl... | ALGO | 0.99993 | 4.530674 | {
"github_metadata": {
"branch": "main",
"commit_count": 3734,
"repo_created_at": "2022-01-03T06:42: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": "54d0ccf70... |
635f57bb-74b2-4189-95d4-9cb1c85af0a1 | bisnad/ofxDabFlock | src/dab_flock_evasion_behavior.cpp | /** \file dab_flock_evasion_behavior.cpp
*/
#include "dab_flock_evasion_behavior.h"
#include "dab_flock_agent.h"
using namespace dab;
using namespace dab::flock;
EvasionBehavior::EvasionBehavior(const std::string& pInputParameterString, const std::string& pOutputParameterString)
: Behavior(pInputParameterString, pO... | ALGO | 0.965616 | 5.598771 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-14T16:25: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": "a00c13f6fc47... |
7bedafbb-a67a-4150-8ee1-b1c531258dc0 | mooleetzi/ICPC | contest/CDUT2019-7/E.cpp | #include <bits/stdc++.h>
#define lson rt << 1, l, mid
#define rson rt << 1 | 1, mid + 1, r
#define debug
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pa = pair<int, int>;
using ld = long double;
int n, m, k, p;
const int maxn = 1e5 + 10;
template <class T>
inline T read(T &ret)
{
... | ALGO | 0.999934 | 4.671831 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-06-24T04:43:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78b54c93b... |
7d304417-ab3b-4191-a2fa-3661bb7772ef | SantiagoSalasucsp/ADA | lab1.cpp | //integrantes
//<NAME>
//<NAME>
#include <iostream>
#include <vector>
using namespace std;
int merge(vector<int>& arr, int left, int mid, int right) {
vector<int> temp(right - left + 1);
int i = left, j = mid + 1, k = 0;
int inversionCount = 0;
while (i <= mid && j <= right) {
if ... | ALGO | 0.999984 | 5.137473 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2025-03-13T02:05: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": "20ddcb494e9... |
751583a0-d231-4094-874e-63b54c010932 | laurimi/npgi | src/PolicyGraph.cpp | // PolicyGraph.cpp
// Copyright 2019 <NAME>
//
// 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 law or... | ALGO | 0.993553 | 6.986464 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-04-26T11:32:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "012feed6... |
1f6f187a-7e4f-425f-bd43-d68776c546d8 | ValveSoftware/source-sdk-2013 | src/mathlib/bumpvects.cpp | //========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $Workfile: $
// $Date: $
//
//-----------------------------------------------------------------------------
// $Log: $
//
// $NoKeywords: $
//===================================================================... | TOOL | 0.985445 | 6.238619 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2013-06-26T22:21:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9165,
"forks": 2667,
"issues": 352,
"pull_requests": 507
},
"file_meta": {
"content_id": ... |
85110961-dc66-40f3-90b1-5a236c0a97b3 | hhcoder/UsefulModules | ImageProcFramework/CoreLib/core_lib/include/proc/pyramid_proc.h | /*
#pragma once
#include <vector>
#include <utility>
#include <iostream>
#include <algorithm>
#include "../../data/pyramid_frame/pyramid_frame.h"
class PyramidProc
{
public:
static void BuildPyramid(
PdFrame* in_pd_frame,
ConfidenceFrame* in_conf_frame,
PyramidFrame* pyramid_frame,
const size_t decompose... | ALGO | 0.965944 | 5.727922 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-12-04T00:43: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": "8a33be7971... |
e81374b8-8834-4fc3-9872-aa3b0867fc7e | z-prize/2023-entries | prize-1-fpga-gpu-proof/prize-1b-e2e/gpu_snarkify_submission/merkle_accel/merkle_accel/common/ec_defs.h | /***
Copyright (c) 2024, Snarkify, Inc. All rights reserved.
Dual licensed under the MIT License or the Apache License, Version 2.0.
See LICENSE for details.
Author(s): <NAME>
***/
#pragma once
namespace ec {
class bls12381 {
public:
typedef ff::bls12381_fp fp;
typedef ff::bls12381_fr fr;
static constex... | CONFIG | 0.904326 | 7.103305 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-05-07T21:03:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 24,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e88bdd2266... |
143b6134-6e27-4463-b755-4c05c4fad8e0 | ajimenezh/Programing-Contests | Codeforces/ABBY3.0FinalProblemB.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <stdio.h>
using namespace std;
#define fo(i,n) for(int i=0;... | ALGO | 0.99995 | 4.168723 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2013-07-29T18:45:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c9721262... |
4459456b-611f-4277-934a-006a83822d07 | QiaoZhang0429/Cpp-Leetcode | BombEnemy.cpp | class Solution {
public:
//brute force, n^3
int maxKilledEnemies(vector<vector<char>>& grid) {
if(grid.size() == 0)
return 0;
int m = grid.size();
int n = grid[0].size();
vector<vector<int>> count(m, vector<int>(n, 0));
for(int i = 0; i < m; i++){
... | ALGO | 0.999983 | 5.219263 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-08-04T05:29: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": "8acfb4dbe... |
9008bbdb-7b57-4879-856c-27369a4ac1fa | tarotez/cppintro | inheritance.cpp | /* inheritance.cpp */
#include <iostream>
using namespace std;
class person{
public:
string name;
};
class ticket{
public:
int id;
person* user;
ticket(){user = new person;}
};
class transTicket : public ticket {
public:
string origin;
string destination;
transTicket(): ticket(){};
};
int main()
{
i... | TOOL | 0.953888 | 5.084028 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-11-26T10:44:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "260539690... |
eccdf1ff-ef98-4f05-b302-2d9f966606c5 | kouteisang/ParListCPU | Graph/Graph.h | #ifndef GRAPH_H
#define GRAPH_H
#include "../header.h"
struct edge{
uint s{0};
uint t{0};
edge() = default;
edge(uint _s, uint _t){
s = _s;
t = _t;
};
bool operator<(const edge &e) const {
return s < e.s || (s == e.s && t < e.t);
}
};
class Graph{
protected:
... | ALGO | 0.986064 | 4.195594 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2024-06-12T15:02: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": "692944b4458... |
6bdef440-297c-4e23-9bfc-92f3da9e3151 | mannsoneji/SE1 | module 4.2/max n um by friend fun.cpp | #include<iostream> //header file
using namespace std; //std library
class Test //class declared
{
private: //access speacifire
int x; //variable declaration
public: //access speacifire
int y; //variable declaration
void input() // function for input the data
{
cout << "Enter the number x:"; //print the... | ALGO | 0.998895 | 4.340996 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-03-31T11:17: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": "4c6abb1b0a46... |
af79133f-4d3d-4aed-b295-1cd6f4703795 | TosakaUCW/CompetitiveProgramming | Old/Luogu/[Luogu P5002] 专心OI - 找祖先.cpp | #include <stdio.h>
#include <algorithm>
const int N = 1e4 + 5;
const int M = 2e4 + 5;
const int LOG2N = 15;
int n, root, m;
int head[N], num_edge;
int size[N], sum[N], ans[N];
struct Node
{
int next, to;
} edge[M];
void add_edge(int u, int v)
{
edge[++num_edge].next = head[u];
edge[num_edge].to = v;
... | ALGO | 0.99977 | 4.092252 | {
"github_metadata": {
"branch": "master",
"commit_count": 506,
"repo_created_at": "2018-09-23T04:02:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "feed9069... |
f033bc25-e8c8-4a4f-8e65-0aadf6bef4bd | torres07/competitive-programming | algoritmos/kmp.cpp | #include <cstdio>
#include <cstring>
#include <time.h>
#include <bits/stdc++.h>
using namespace std;
#define MAX_N 100010
char T[MAX_N], P[MAX_N]; // T = text, P = pattern
int b[MAX_N], n, m; // b = back table, n = length of T, m = length of P
void kmpPreprocess(string P) { // call this before calling kmpSearch()
... | ALGO | 0.999941 | 4.536562 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2018-07-17T14:51:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b54702c... |
cf64bde6-e936-49e3-8edc-d4da9456be00 | kazdyrkeicam/Algorithms-Data_Structures | ADS/bst_tree/bst.cpp | #include <iostream>
#include <set>
using namespace std;
struct Node{
Node *parent, *l_child, *r_child;
int key;
Node(int k){
key = k;
parent = l_child = r_child = NULL;
}
Node(int k, Node *p){
key = k;
parent = p;
l_child = r_child = NULL;
}
};
struct BS... | ALGO | 0.999971 | 3.85219 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2021-07-19T12:43: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": "44c20af2fe5... |
9635ee43-b0d3-41f2-8b2e-181fccb68f5a | zhenfelix/OnlineJudgeCodings | 塔子哥学算法/P1224. 2023.04.15-春招-第三题-魔法之树 .cpp | // 题目内容
// 很久很久以前,有一个神秘的森林,这个森林里有一棵特殊的树,它被称为“魔法之树”。这棵树的每个节点都有一个权值,为 00 或 11,而且它们之间存在着连接,形成了一颗有 nn 个节点的二叉树。
// 人们相信,这棵树里蕴含着无穷的魔法力量,因为每一条路径都可以被看作是一串二进制数,而这些二进制数可以组成无数的数字,代表着神秘的力量和秘密。
// 为了探寻这个魔法之树的秘密,有许多勇敢的冒险家来到这个森林,试图通过对这棵树的研究来揭示其神秘力量的本质。然而,他们面临的问题是,有多少条路径代表的二进制数在 [l,r][l,r] 区间范围内?
// 塔子哥是一个来自遥远国度的数学家,他擅长解决这种数字问题。他在... | ALGO | 0.999981 | 5.082533 | {
"github_metadata": {
"branch": "master",
"commit_count": 152,
"repo_created_at": "2019-01-18T05:00: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": "5c91537e... |
214ad432-2955-46da-8268-4865b77a1ae6 | ThaiHaNguyen119/testgit | CB_072.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
// Hàm kiểm tra xem số có chứa chữ số 3, 5 hoặc 7 không
bool contains357(int n) {
while (n > 0) {
int digit = n % 10; // Lấy chữ số cuối
if (digit == 3 || digit == 5 || digit == 7) {
return true; // Ngay lập t... | ALGO | 0.999713 | 5.57972 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-03-12T13:12: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": "9610b5742e1e... |
a8391263-e8c7-4ca5-9d5c-a2709b36a2ea | Jianjinnanzhi-Nanzhi/Jianjinnanzhi | 电子信息类7班-李树权-嵌入式-第三次大组作业/Sort/Sources/task1.cpp | #include <time.h>
#include "sort.h"
#include <windows.h>
// 生成随机数组
void generateRandomArray(int arr[], int n)
{
for (int i = 0; i < n; i++)
{
arr[i] = rand() % 100000; // 生成0-99999之间的随机数
}
}
void testSortPerformance(int size,int sort)
{
// 设置随机种子,防止随机生成数重复
srand(time(0));
LARGE_INT... | ALGO | 0.98375 | 5.246767 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-16T15: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": "28bce8ed8012... |
36837bb8-a414-46c0-9a03-e3a2cae56126 | akhilkammila/leetcode-screenshotter | editorial_code/1-999/839. Similar String Groups/cpp-0.cpp | class Solution {
public:
void dfs(int node, vector<vector<int>>& adj, vector<bool>& visit) {
visit[node] = true;
for (int neighbor : adj[node]) {
if (!visit[neighbor]) {
dfs(neighbor, adj, visit);
}
}
}
bool isSimilar(string& a, string& b) {
... | ALGO | 0.999989 | 6.125751 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-06-02T16:24:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 912,
"forks": 294,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0fe55f... |
b0ccec6e-db06-4c04-8b09-2e9019dc0bb8 | PRKKILLER/Algorithm_Practice | DataStructure/Search&Sort/quick_sort.cpp | //
// Created by 薛智钧 on 2020/4/5.
//
#include <cstdio>
#include <cstdlib>
#include <algorithm>
int partition(int arr[], int lo, int hi){
std::swap(arr[lo], arr[lo + rand() % (hi - lo)]); // 随机交换
hi--;
int pivot = arr[lo];
while (lo < hi){
while (lo < hi && pivot <= arr[hi]) --hi; // 向左拓展G
... | ALGO | 0.999757 | 5.378083 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2021-08-10T03:39: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": "526d2dbcf... |
0d4016d4-e9ef-4863-9a01-939ca46e2798 | raincross7/code-similarity | codes/train_code/problem148/problem148_413.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;
using pll = pair<ll,ll>;
#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846
#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i... | ALGO | 0.99984 | 3.796079 | {
"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": "0c63b5a0249f... |
0b72129f-ce75-4417-92f3-41d6873c0f49 | manumena/pap-tp2 | src/ej3/ej3.h | #ifndef PAP_TP2_EJ3_H
#define PAP_TP2_EJ3_H
#include "../main.h"
#include <stack>
#include <algorithm>
using namespace std;
/*
** Exercise 3
*/
// --------------- Classes ----------------
class Graph {
public:
Graph() {}
~Graph() {}
int N; // #nodes
int M; // #edges
vector< list< pair<int, int> > > adjacenc... | ALGO | 0.998264 | 4.562572 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2016-09-26T22:48: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": "9cbc7d506... |
bbf42dd5-a9d7-4619-b651-687e614fcf44 | zimengyang/Graphics_MIS_PT | src/scene/materials/bxdfs/bxdf.cpp | #include <scene/materials/bxdfs/bxdf.h>
glm::vec3 BxDF::SampleAndEvaluateScatteredEnergy(const glm::vec3 &wo, glm::vec3 &wi_ret, float rand1, float rand2, float &pdf_ret) const
{
//TODO
wi_ret = glm::vec3(0);
pdf_ret = 0.0f;
return glm::vec3(0);
}
glm::vec3 BxDF::EvaluateHemisphereScatteredEnergy(cons... | ALGO | 0.975148 | 5.912298 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-04-02T13:52:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d13ece246... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.