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 |
|---|---|---|---|---|---|---|---|
44bf546c-9599-4ecd-b7a6-ab6f60f7b74b | zomb-zomb/VIW-SLAM | vins_estimator/include/estimator.h | #ifndef _ESTIMATOR_H_
#define _ESTIMATOR_H_
//#include "parameters.h"
#include "feature_manager.h"
//#include "utility/utility.h"
//#include "utility/tic_toc.h"
//#include "initial/solve_5pts.h"
//#include "initial/initial_sfm.h"
//#include "initial/initial_alignment.h"
//#include "initial/initial_ex_rotation.h"
#incl... | ALGO | 0.953995 | 5.915535 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-05-30T06:44:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa60b646544... |
86d41ccd-335b-4745-a57a-4773dcc406e4 | subarctic-blast/ya-cpp-developer-course | preliminary_course/theme_3/lesson_4/exercise_2.cpp | /* Урок 4: Ставим условия
*
* Задание 2
*
* Общее правило: если число заканчивается на 1, ставят суффикс “st”, если на 2 — “nd”, если на 3 — “rd”, а в остальных
* случаях — “th”. Исключение составляют числа, которые оканчиваются на 11, 12 и 13. Для них используют суффикс “th”.
* Напишите программу, которая запраш... | TOOL | 0.979445 | 4.13095 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-11-25T20:04: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": "4fce98ac421... |
166873eb-06d9-4790-b050-967e5a7d44d6 | arjitayadav/gdsc-1st-assignment | Arrays 2.cpp | #include <iostream>
#include <algorithm>
void sort012(int arr[], int size) {
int low = 0;
int high = size - 1;
int mid = 0;
while (mid <= high) {
switch (arr[mid]) {
case 0:
std::swap(arr[low], arr[mid]);
++low;
++mid;
... | ALGO | 0.999847 | 5.432602 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-11-14T15:46: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": "5f8ae6685682... |
18c52848-8646-440f-be62-7f16de2c7ad5 | aniketpathak028/LeetCode | 1302-deepest-leaves-sum/1302-deepest-leaves-sum.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.999981 | 6.369848 | {
"github_metadata": {
"branch": "main",
"commit_count": 1293,
"repo_created_at": "2021-08-12T15:44: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": "50a6ba4c9... |
ba85d04f-1284-4891-9379-c5aee586dfbb | Dicer-Zz/CodeingOnOJ | Codeforces/Codeforces Round #514 (Div. 2) B. Forgery.cpp | /*
* @Author: Dicer
* @Date: 2018-10-09 16:01:44
* @Last Modified by: Dicer
* @Last Modified time: 2018-10-09 16:28:41
*/
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define clr(s, x) memset(s, x, sizeof(s))
typedef long long ll;
typedef unsigned long long ull;
type... | ALGO | 0.999981 | 3.782409 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-10-12T05:16: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": "a8daf4746... |
a5670c5d-a677-48e6-b0b0-e874af41fdd5 | vishal1patidar/Practice-DSA | 287-find-the-duplicate-number/287-find-the-duplicate-number.cpp | // 1. Easy C++
// 2. Line by Line Explanation with Comments.
// 3. Detailed Explanation ✅
// 4. Initution is to use Binary Search for (logn) compexity ,
// other approaches are using map, bruteforce, cnt vector.
// 5. Please Upvote if it helps⬆️
// APPROACH 1 USING BINARY SEARCH
// ALGORITHM
// Perform Binary Searc... | ALGO | 0.999993 | 6.006067 | {
"github_metadata": {
"branch": "main",
"commit_count": 1865,
"repo_created_at": "2021-10-06T04:24:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03168b64f... |
e97a5845-fcbd-47c4-893f-7f9fdb5950c6 | Edlward/LifeBook | Chap_03-Tech/03.099-Desktop/_log/C++/Cpp Design-Class-Object-State-Signal-Event-Message.cpp | 花圓project <- 樹苗object <- 植物class.
05. State Machine. How many states? What States?
//! object ------->states. //isoSgl ->0, 1.------>state machine ------------>condition table.
//! ------->signals ------>events ------------>messages.
//! signals -> events. signalsArray[SGI... | ALGO | 0.997708 | 3.723911 | {
"github_metadata": {
"branch": "develop",
"commit_count": 23,
"repo_created_at": "2020-01-09T12:52:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e86ce16... |
e3be34a7-c364-4acb-b1ba-128ffcc33f0a | Top-Ranger/harbour-reversi | src/player/AssemblyAIPlayer/frontierdiscscore.cpp | /*
Copyright (C) 2014 <NAME>
All rights reserved.
You may use this file under the terms of BSD license as follows:
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 t... | ALGO | 0.991523 | 6.724738 | {
"github_metadata": {
"branch": "master",
"commit_count": 222,
"repo_created_at": "2014-03-16T14:46:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72179dd8... |
b50b49d3-97eb-44f1-803d-3df28e5ce420 | CHOULOKY/C2-Study | BAEKJOON/PPAGNIN/21. 재귀/24060.cpp | // Title: 알고리즘 수업 - 병합 정렬 1
// Solved by VICLOKY
#include <iostream>
#include <vector>
using namespace std;
int num; string str;
void merge_sort(vector<int>& vec, int p, int r, int k);
void merge(vector<int>& vec, int p, int q, int r, int k);
int main(void) {
int n, k; cin >> n >> k;
vector<int> vec;
for(int i=0... | ALGO | 0.999937 | 4.474636 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2024-07-06T13:14:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73eb9cb97... |
4eaed13c-9339-4f68-b78e-d12b56624770 | DmitryZagr/Alg_1sem | 2module/3_3/3_3/main.cpp | //
// main.cpp
// 3_3
//
//3_3. Закраска прямой 1.
//На числовой прямой окрасили N отрезков.
//Известны координаты левого и правого концов каждого отрезка (Li и Ri).
//Найти длину окрашенной части числовой прямой.
// Created by <NAME> 22.04.16.
// Copyright © 2016 <NAME>. All rights reserved.
//
#include <iostr... | ALGO | 0.999774 | 4.484241 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-06-04T14:56: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": "9819fa3b79... |
27ce879e-1c1e-4d2b-9e53-7499e141eae0 | TheSkyFucker/acm-icpc | template/geometry/Geo2D_circle.cpp | struct C {
P o; T r;
C() {}
C(P o, T r): o(o), r(r) {}
};
// point (inside / on / outside) circle
bool operator < (const P& p, const C& c) { return sgn((p - c.o).abs() - c.r) < 0; }
bool operator <=(const P& p, const C& c) { return sgn((p - c.o).abs() - c.r) <= 0; }
bool operator ==(const P& p, const C& c) { retur... | ALGO | 0.999861 | 5.126784 | {
"github_metadata": {
"branch": "master",
"commit_count": 177,
"repo_created_at": "2017-11-24T01:12:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3a6cba4... |
0f258560-55d4-4212-bfff-5dd00eb66418 | Divyanshmangla022/Divyanshmangla022 | longest leaf to root path.cpp | #include <iostream>
#include <vector>
#include <queue>
template <typename T>
class BinaryTreeNode {
public :
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data) {
this -> data = data;
left = NULL;
right = NULL;
}
};
using namespace std;
//... | ALGO | 0.999978 | 4.247996 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-04-18T10:47: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": "f1a9ed42bb67... |
6acd29ae-159e-4780-88de-176554695bd6 | 52North/IlwisCore | core/geos/src/algorithm/locate/SimplePointInAreaLocator.cpp | /**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2005-2006 Refractions Research Inc.
* Copyright (C) 2001-2002 Vivid Solutions Inc.
*
* This is free software; you can redistribute and/or modify it under
* th... | ALGO | 0.971801 | 6.968108 | {
"github_metadata": {
"branch": "master",
"commit_count": 6882,
"repo_created_at": "2013-05-15T13:19:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 36,
"forks": 13,
"issues": 26,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb4ad... |
8633760e-d02b-4415-996a-5a3c7176c59d | vishu9897/Leetcode | Word Break - GFG/word-break.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
// A : given string to search
// B : vector of available strings
class Solution
{
public:
int solve(string s,vector<string>&dict,unordered_map<string,int>&dp)
... | ALGO | 0.998749 | 5.011001 | {
"github_metadata": {
"branch": "main",
"commit_count": 1518,
"repo_created_at": "2022-08-22T03:55:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "533d4cde7... |
dd24bc22-bc41-4f80-a23b-a38d2760bd8a | Luerson/problems-resolutions | code forces/orphan/1452A.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define all(x) x.begin(), x.end()
#define debug(x) cout << #x << " = " << x << endl;
#define debug2(x, y) cout << #x << " = " << x << "; " << #y << " = " << y << endl;
#define pii pair<int, int>
#define pll pair<ll, ll>
typedef long long ll;
typedef lo... | ALGO | 0.999937 | 4.450697 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2021-10-09T14:53: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": "e246989c83... |
b4c03bb7-b1b1-49b8-8e66-26f177be8e9a | mammoths-chuvsu/string-searching | src/aho_corasick_substring_searcher.cpp | #include <queue>
#include <string-searching/aho_corasick_substring_searcher.hpp>
AhoCorasickSearcher::AhoCorasickSearcher() : BaseSubstringSearcher("Aho-Corasick") {}
bool AhoCorasickSearcher::Contains(const std::string& text, const std::string& substring) const {
AhoCorasick ahoCorasick;
ahoCorasick.AddPatte... | ALGO | 0.968009 | 6.049684 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-20T21:05:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "59c275260fe18... |
bc44d7af-89e2-4390-ad0d-110ce80a9f82 | itohdak/Codeforces | Div2/prev/597/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,... | ALGO | 0.999961 | 3.744739 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-05-21T14:37: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": "df7762827... |
3cef5472-3045-464c-be29-4d8e2234874d | Sanjana-Reddy28/DSA0159-c- | 51.cpp | #include <iostream>
#include <climits>
using namespace std;
int findMin(const int arr[], int size) {
int min = INT_MAX;
for (int i = 0; i < size; ++i) {
if (arr[i] < min) {
min = arr[i];
}
}
return min;
}
int findMax(const int arr[], int size) {
int max = INT_MIN;
for... | ALGO | 0.999791 | 5.169179 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-03T15:18: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": "8ed64719d129... |
1ab02f0b-4858-4d61-8840-91f6d50de56b | Prashant-flick/codeforces-contest | codeton round 8/C_2_Bessie_s_Birthday_Cake_Hard_Version.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
int t;
cin >> t;
while (t--)
{
int n,x,y;
cin >> n >> x >> y;
int ans=x-2;
int arr[x];
for(int i=0; i<x; i++){
cin >> arr[i];
}
if(x+y>=n){
... | ALGO | 0.999945 | 3.457139 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2024-07-19T19:14: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": "576b02adb... |
00a9093d-df19-46e1-92f0-d3718984cf56 | mmi366127/Online_Judge | zerojudge/e368 質數日/e368 質數日.cpp | #include <stdbool.h>
#include <stdio.h>
#include <string.h>
#define int long long
bool is_leap(int x) {
if(x % 400 == 0) return true;
if(x % 100 == 0) return false;
if(x % 4 == 0) return true;
return false;
}
bool is_prime(int x) {
if(x == 1) return false;
for(int i = 2; i * i <= x; i++) {
... | ALGO | 0.99958 | 3.602026 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2019-06-09T14:17: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": "06f8565f... |
4b76fdfe-89f5-4e30-bbfd-c242d3cc9dbb | adnanaziz/EPIJudge | epi_judge_cpp_solutions/power_set.cc | #include <algorithm>
#include <cmath>
#include <memory>
#include <numeric>
#include <vector>
#include "test_framework/generic_test.h"
using std::make_unique;
using std::vector;
void DirectedPowerSet(const vector<int>&, int, vector<int>*,
vector<vector<int>>*);
vector<vector<int>> GeneratePower... | ALGO | 0.99774 | 6.264757 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2017-12-21T06:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2874,
"forks": 1899,
"issues": 47,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
47bca296-4b12-4eca-a529-4901fe6083d8 | Better-Idea/Mix-C | math/ceil.hpp | #ifndef xpack_math_ceil
#define xpack_math_ceil
#pragma push_macro("xuser")
#undef xuser
#define xuser mixc::math_ceil::inc
#include"define/base_type.hpp"
#include"macro/xexport.hpp"
#include"math/abs.hpp"
#include"utils/mfxx.hpp"
#pragma pop_macro("xuser")
namespace mixc::math_ceil{
template<class type_t>
in... | ALGO | 0.971447 | 5.788222 | {
"github_metadata": {
"branch": "master",
"commit_count": 2404,
"repo_created_at": "2019-09-13T15:06:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 41,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "670c00c... |
2d355ed4-7ab6-41e6-a01a-a3b8cc492fac | vfdxvffd/DataStruct-Algorithm | Tree/HaffmanByCpp/struct.h | #pragma once
#include<iostream>
#include<cstring>
using namespace std;
//优先级队列
typedef struct QNode
{
struct TNode* val; //树的结点,其实也就是数据域
int priority; //优先级
struct QNode* next; //指针域
}*Node;
typedef struct Queue
{
int size; //队列大小
struct QNode* front; //队列头指针
}queue;
//树
typedef struct TNode
{
char ... | ALGO | 0.999688 | 3.66867 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-11-22T16:58:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9679ec56... |
8354a75f-6485-4831-91e4-2eee46e7eb78 | Altafyanto/Data-Structures-and-Algorithms-in-CPP | Dynamic Programming/Top 20 Interview Question/10_Maximize_The_Cut_Segments.cpp | // https://practice.geeksforgeeks.org/problems/cutted-segments/0
/*
First Refer Unbounded Knapsack Problem.(knapsack with Duplicate items)
Time Complexity - O(N), Space Complexity - O(N)
*/
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
... | ALGO | 0.999907 | 4.798242 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2021-07-14T01:22: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": "acc9bc04... |
6f710352-48f8-4f2d-9c69-95f2d66da60e | Segfault1602/sfFDN | src/array_math.cpp | #include "array_math.h"
#include <cassert>
#include <experimental/simd>
#include <arm_neon.h>
namespace sfFDN
{
void ArrayMath::Accumulate(std::span<float> a, std::span<const float> b)
{
assert(a.size() == b.size());
size_t block_count = a.size() / 4;
float* a_ptr = a.data();
const float* b_ptr = b... | ALGO | 0.960676 | 7.066714 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-04-22T18:25:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "553f2a9b99b5... |
5e5e2b71-a5dc-49cf-ae46-75bd0ddd27b5 | akashiitj/dsaprogram | gfgdivide_conmindiffbetweentwopoint.cpp | #include<iostream>
#include<math.h>
using namespace std;
int d;
class diffrence
{
public:
void merging(int a[],int p,int q,int r)
{
int i;
int l[q-p+2],m[r-q+1];
for( i=1; i<q-p+2; i++)
l[i-1]=a[i+p-2];
l[i-1]=1000000;
for( i=1; i<r-q+1; i++)
m[i... | ALGO | 0.999981 | 3.580818 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2017-05-08T18:29: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": "31d101ae5... |
a91ca269-7a0d-406f-a8c4-a9ccc09d23c5 | M-Awwab-Khan/Algorithmic-Amusement | Lab2/task2_efficient.cpp | #include <iostream>
#include <stdexcept>
using namespace std;
class Matrix {
private:
int **matrix;
int rows;
int cols;
void allocateMemory() {
matrix = new int*[rows];
for (int i = 0; i < rows; ++i) {
matrix[i] = new int[cols] {};
}
}
void deallocateMemory... | ALGO | 0.996807 | 6.229669 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-08-31T12:36: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": "10f3cd0d411... |
24a32b87-bc4b-4ba9-a86f-fb3ea2fe0ae9 | vividxz/CPP | binarySum_int.cpp | #include<iostream>
#include<cmath>
using namespace std;
long long int length(long long int num)
{
long long int length = 0;
while(num>0)
{
length++;
num/=10;
}
return length;
}
long long int reverse(long long int num)
{
long long int reverse = 0;
while(num>0)
{
reverse = (reverse*10) + (num%... | ALGO | 0.99997 | 4.354331 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-05-28T13:09: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": "4503f4f1fdb... |
6991921d-9b45-410f-94cd-b1a5738319e1 | nttcslab/diff-eq-comput-zdd | src/mylib/zdd.cpp | #include "common.hpp"
#include "graph.hpp"
#include "zdd.hpp"
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <unordered_map>
bool ZDD::readfromFile(const char *filename){
FILE *fp;
std::unordered_map<addr_t, addr_t> IDToPos;
if((fp = fopen(filename, "r")) == NULL){
return f... | ALGO | 0.99821 | 3.601796 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-10-19T04:23:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a287808e69f... |
c0793fd9-e9bc-489e-b92c-326115520b75 | RedBlazerFlame/noi-2023-training-solutions | w7/revenge/a/brute.cpp | /*
def bit(num, j, i):
return (num >> (j * 5 + i)) & 1
def print_grid(num):
for i in range(5):
for j in range(5):
print("#" if bit(num, i, j) else ".", end="")
print("")
for i in range(1 << 25):
count = 0
for j in range(3):
for k in range(3):
corner_dolo... | ALGO | 0.999281 | 4.211951 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-07-18T04:03:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4baf05c021d0... |
979b3834-d4ec-4cd2-a889-eb1954bafbdb | ngthanhvinh/competitive-programming | joi/final-round-2017/semiexpress.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<long long,long long> ii;
typedef pair<long long, ii> II;
const long long N = 3005;
long long n, m, k;
long long A, B, C, T;
long long s[N];
long long ans;
priority_queue <II> q;
void update(long long seg, long long posC) {
if (posC >= s[seg + 1]) retur... | ALGO | 0.999962 | 4.024362 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-03-17T15:19:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4fff70e0... |
14c6d8ed-6241-42b6-9c4e-1fd6a2d37e16 | MuhammadSawalhy/problem-solving | Virtual Judge/Fegla Senior Training 2023/qualification-contest/A - extraordinary Subarray/main.cpp | // ﷽
#include <algorithm>
#include <array>
#include <iostream>
#include <map>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
#ifdef SAWALHY
#include "debug.hpp"
#else
#define debug(...)
#define debug_itr(...)
#define debug_bits(...)
#endif
#define int long long
#define ll long long
#defin... | ALGO | 0.999974 | 4.14915 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2022-09-16T05:33:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85a038fbe5... |
5cbc0c47-6582-4689-81c4-1f362c1c4a63 | Nabeel-Rizwan/DSA | Stack_2B.cpp | #include <iostream>
using namespace std;
struct node{
int data;
struct node*next;
};
int Full(struct node*top){
struct node*ptr=(struct node*)malloc(sizeof(struct node));
if(ptr == NULL){
return 1;
}
else{
return 0;
}
}
int Empty(struct node*top){
if(top == NULL){
... | ALGO | 0.99843 | 4.185221 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-07-02T09:59:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d588b60a76f3... |
81edaf28-4f02-4036-b0b0-b4db8d635060 | 7kia/Theory-programming | MainGame/Entity/AgressiveBehaviour.cpp | #include "../World.h"
using namespace std;
void Entity::searchEnemy(Entity &enemy, world &world, const float deltaTime)
{
float radiuseView = type->view.radiuseView;
bool feelEnemy = type->view.feelEnemy;
bool onLevelEnemy = currentLevelFloor == enemy.currentLevelFloor;
bool onLevel = onLevelEnemy || feelEnemy;
... | ALGO | 0.985539 | 4.03971 | {
"github_metadata": {
"branch": "master",
"commit_count": 223,
"repo_created_at": "2015-09-25T18:00:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bda5116... |
53f91b1f-4da0-4ebb-ab14-073a1138f848 | wishihab/KelasAlgoritmaDasar | ProyekTugasUjian2014/MatriksTUGAS.cpp | #include<iostream>
using namespace std;
float m[10][10];
void menu()
{
cout<<"-=================================================-\n";
cout<<"-============ Matriks - Pilih Ordonya ============-\n";
cout<<"-=================================================-\n";
cout<<"1.Untuk ordo 2x2\n";
cout<<"2.Untuk ordo 3x... | ALGO | 0.996773 | 3.303986 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-03-22T06:34: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": "f26f1921f3... |
cbe24de8-fda8-4419-abdf-83e850531be7 | NagiMukuchi/DemoPreIT | DemoPreIT/LyThuyet/bai tap/Ly Thuyet buoi 7/7.1/7.5/7.5.cpp | // 7.5.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
using namespace std;
const int Gioi_Han = 20;
void NhapMang(int& Soluong, int Arr[]) {
cout << "Nhap vao so luong phan tu (toi da " << Gioi_Ha... | ALGO | 0.99968 | 4.049055 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2025-01-08T12:09: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": "36da5ca1868... |
30289246-1016-4c2d-812c-5c67ce08fff7 | icl-utk-edu/magma | sparse/src/ziterict.cpp | /*
-- MAGMA (version 2.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date
@author <NAME>
@precisions normal z -> s d c
*/
#include "magmasparse_internal.h"
#include "magmasparse_internal.h"
#ifdef _OPENMP
#include <omp.h>
#e... | ALGO | 0.958423 | 5.735459 | {
"github_metadata": {
"branch": "master",
"commit_count": 8870,
"repo_created_at": "2023-04-05T15:59:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 29,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "bed70... |
6729d434-5420-4284-bb7d-bd99f64a7f78 | trinhminhtriet/leetcode | solutions/3200-3299/3291.minimum-number-of-valid-strings-to-form-target-i/Solution.cpp | class Trie {
public:
Trie* children[26]{};
void insert(string& word) {
Trie* node = this;
for (char& c : word) {
int i = c - 'a';
if (!node->children[i]) {
node->children[i] = new Trie();
}
node = node->children[i];
}
}... | ALGO | 0.99999 | 5.902423 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2024-12-09T17:55:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96bd81... |
56203239-faa0-42a1-9123-686b2443a87e | walkccc/LeetCode | solutions/689. Maximum Sum of 3 Non-Overlapping Subarrays/689.cpp | class Solution {
public:
vector<int> maxSumOfThreeSubarrays(vector<int>& nums, int k) {
const int n = nums.size() - k + 1;
// sums[i] := sum(nums[i..i + k))
vector<int> sums(n);
// l[i] := the index in [0..i] that has the maximum sums[i]
vector<int> l(n);
// r[i] := the index in [i..n) that h... | ALGO | 0.999919 | 6.090634 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2019-02-23T15:46:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1254,
"forks": 437,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dfae912... |
8c656fba-484d-4334-9afd-8299d391570e | huyluongme/Algorithms-and-Programming | 2.Generation/Permute.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, x[30], id_i, id_k;
cin >> n;
// Xây dựng cấu hình đầu tiên
for (int i = 1; i <= n; i++) x[i - 1] = i;
do {
// In ra cấu hình hiện tại
for (int i = 0; i < n; i++) cout << x[i] << " ";
cout << endl;
// Tìm vị trí phần tử k... | ALGO | 0.999983 | 4.897397 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-09-27T09:50:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f320958e550... |
0ee9f7a0-b13e-4837-8d91-bbdd24b50b99 | ishandutta2007/codeforces-k | kostaskostil/normal/1662/F.cpp | // Problem: <NAME>
// Contest: Codeforces - SWERC 2021-2022 - Online Mirror (Unrated, ICPC Rules, Teams Preferred)
// URL: https://codeforces.com/contest/1662/problem/F
// Memory Limit: 256 MB
// Time Limit: 4000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#pragma GCC optimize("Ofast,unroll-loops")
#pragma G... | ALGO | 0.999747 | 4.230817 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5f5f971cd7c... |
92fcb82a-90ff-453d-a22c-a530c345c2e4 | pengfei9403/Lintcode | 链表/removeNthFromEnd.cpp | #include <iostream>
using namespace std ;
class ListNode {
public:
int val;
ListNode *next;
ListNode(int val) {
this->val = val;
this->next = NULL;
}
} ;
class Solution {
public:
/**
* @param head: The first node of linked list.
* @param n: An integer.
* @return: Th... | ALGO | 0.999959 | 5.256461 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2017-04-18T10:49: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": "a77b5e43d... |
6b56f209-ffcb-405f-af3d-b449783df3e8 | Haposola/LRUS-CoverTree-MIPS | KMaxIP.h | #pragma once
#pragma once
//Priority: small first
class KMaxIP_LRUS {
public:
KMaxIP_LRUS(arma::mat& data, double base = 2.0, int min_scale = INT_MIN) :
base(base), min_scale(min_scale) {
referenceTree = new LRUS_CoverTree(data, base, min_scale);
squared_dist_close_desc = std::pow(base, min_scale) * std::pow(b... | ALGO | 0.99979 | 5.168973 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-09-21T08:30: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": "ba150b9fae... |
d306d602-2bb7-4570-9520-3d14d316adee | shakilaust/leetcode | 994. Rotting Oranges.cpp | int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, -1, 1};
class Solution {
public:
int rows, columns;
queue < pair< int, int > > q;
queue < int > cost;
int bfs( vector<vector<int>>& grid ) {
int ans = 0;
while(!q.empty()) {
pair< int , int > now = q.front();
... | ALGO | 0.999991 | 5.419224 | {
"github_metadata": {
"branch": "master",
"commit_count": 664,
"repo_created_at": "2018-11-21T11:15:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39c23be5... |
edfcbdb7-a6a3-4b4e-a453-1fb81c1b11c4 | raincross7/code-similarity | codes/train_code/problem329/problem329_235.cpp | #include <stdio.h>
#include <algorithm>
#include <iostream>
#include <math.h>
using namespace std;
#define N 5001
int a[N];
bool dp[N][N];
bool suf[N];
int minValue[N][N];
void solve() {
int n, k; scanf("%d %d", &n, &k);
long long sum = 0;
for (int i = 1; i <= n; ++i) {
scanf("%d", &a[i]); sum += a[i];
if (a[i]... | ALGO | 0.999943 | 3.324542 | {
"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": "4f19d5445673... |
c3ab8708-f465-4e2b-9c80-3f587d120475 | shouzhong/Scanner | licenseplate/src/main/jni/src/FastDeskew.cpp | //
// Created by <NAME> on 02/10/2017.
//
#include <../include/FastDeskew.h>
namespace pr {
const int ANGLE_MIN = 30;
const int ANGLE_MAX = 150;
const int PLATE_H = 36;
const int PLATE_W = 136;
int angle(float x, float y) { return atan2(x, y) * 180 / 3.1415; }
std::vector<float> avgfilter(std::vector<float> angle_l... | ALGO | 0.979248 | 5.888759 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2019-09-30T03:09:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1419,
"forks": 362,
"issues": 56,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8c... |
d2067529-0416-485a-a998-575466ad32c7 | NuwanJ/robofest-2017 | Program1/other/old/arrowFollow.ino | /*
This code runs after lifting the box
*/
//int RED = 1, GREEN = 2, BLUE = 3;
#include <math.h> // (no semicolon)
static int reading[6];
void start_old(int boxColor) {
//This uses the colour reading as 1-RED,2-GREEN.3=BLUE
int directions = 5;
int gap = 15; //degrees
int steps = 5;
int stepSize = 40... | ALGO | 0.981585 | 3.168381 | {
"github_metadata": {
"branch": "master",
"commit_count": 283,
"repo_created_at": "2017-08-30T16:10:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40142170... |
ef64f017-d5e6-46d4-bcc6-be1ab1cf4907 | Aurametrix/Alg-C | SORT/Quicksort.c++ | // 10x faster Vectorized QuickSort: https://github.com/Aurametrix/Alg-C
/* Regular Quick sort */
#include <stdio.h>
void QuickSort(int arr[], int left, int right)
{
int i = left, j = right;
int tmp;
int pivot = arr[(left + right) / 2];
/* partition */
while (i <= j) {
w... | ALGO | 0.999974 | 5.408312 | {
"github_metadata": {
"branch": "master",
"commit_count": 415,
"repo_created_at": "2013-08-10T22:28:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82b3d91d... |
36545600-420c-4a93-ac2e-ba7e36430e72 | daidianlizi/AdvProgramProbSov_CS253 | hw_lab/6/3lab_GRAPH/main4.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <fstream>
#include <cmath>
using namespace std;
#define sqr(x) (x)*(x)
const int INF = 1000000000;
struct ListNode{
int v; //edge to v from the index u in the List
float weight; //weight from u to v
ListNode(int v, float weight): v(v), weig... | ALGO | 0.9998 | 3.175824 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-05-15T18:33: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": "2eef70cc85... |
df019f0e-45ea-485e-b926-6ce6b9b65b21 | qk12/Contest | CCPC/2019/Qinhuangdao/A-AngleBeats.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
struct point
{
ll x, y;
point(ll a = 0, ll b = 0) { x = a, y = b; }
point operator-(const point &b) const { return point(x - b.x, y - b.y); }
// 叉积(以原点为基准)
ll operator^(const point &b) const { return x * b.y - y * b.x; }
//利用叉积... | ALGO | 0.999975 | 3.997086 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-10-04T06:21: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": "134bbfecd4... |
b33a8a53-5598-4b2b-83dd-9e2e56f6044b | metrumresearchgroup/Torsten | cmdstan/stan/lib/stan_math/stan/math/fwd/fun/sum.hpp | #ifndef STAN_MATH_FWD_FUN_SUM_HPP
#define STAN_MATH_FWD_FUN_SUM_HPP
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/prim/fun/sum.hpp>
#include <stan/math/fwd/core.hpp>
#include <vector>
namespace stan {
namespace math {
/**
* Return the sum of the entries of the specif... | ALGO | 0.999337 | 6.491108 | {
"github_metadata": {
"branch": "master",
"commit_count": 655,
"repo_created_at": "2018-03-09T17:48:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 59,
"forks": 13,
"issues": 7,
"pull_requests": 1
},
"file_meta": {
"content_id": "096f082... |
6fef58e7-5bf0-4a7e-b20c-aeb8256c8366 | amanzi/amanzi | src/pks/PK_DomainFunctionVolumeFraction.hh | /*
Copyright 2010-202x held jointly by participating institutions.
Amanzi is released under the three-clause BSD License.
The terms of use and "as is" disclaimer for this license are
provided in the top-level COPYRIGHT file.
Authors: <NAME> (<EMAIL>)
*/
/*
Process Kernels
Scenario 1 (data distribution ... | ALGO | 0.981778 | 6.885141 | {
"github_metadata": {
"branch": "master",
"commit_count": 14660,
"repo_created_at": "2016-07-22T18:50:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 50,
"forks": 38,
"issues": 103,
"pull_requests": 5
},
"file_meta": {
"content_id": "a42... |
7ae554bb-9d56-4a50-b1a5-d56461e54695 | IRONAGE-Park/online-judge | C&C++ Project File/OnlineJudge/OnlineJudge/BAEKJOON/Normal Problem/NumberBaseball.cpp | #include<iostream>
#include<vector>
#include<string>
using namespace std;
vector<string> bucket;
void Init() {
for (char i = '1'; i <= '9'; i++) {
for (char j = '1'; j <= '9'; j++) {
if (i == j) continue;
for (char k = '1'; k <= '9'; k++) {
if (i == k || j == k) continue;
string s = "";
s += i;
... | ALGO | 0.998732 | 4.514995 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-01-16T02:37: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": "09add85056... |
4d11d14c-6a66-4c78-9276-3486d9b4f0a0 | nguyenvantu11052002/CTDL-GT | DSA11002 - CÂY BIỂU THỨC 2.cpp | #include<bits/stdc++.h>
using namespace std;
int solve (int a, int b, char c) {
if (c == '+') return a + b;
if (c == '-') return a - b;
if (c == '*') return a * b;
return a / b;
}
void TC(){
int n; cin >> n;
cin.ignore();
string s;
getline(cin, s);
n = s.size();
queue<int> q;
for (int i = n - 1; i >= 0... | ALGO | 0.999903 | 4.084858 | {
"github_metadata": {
"branch": "main",
"commit_count": 304,
"repo_created_at": "2022-02-06T15:10: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": "6c36ecb4d8... |
8b50ac6b-e86e-41e7-83cb-e1e7e4ae8acd | SabaAhmad04/DSA-Questions | MaximumSubArray.cpp |
//M1 solution using backtracking & devide and Conquer
#include<iostream>
#include<limits.h>
#include<vector>
using namespace std;
/*
int solve(vector<int>&num, int s, int e)
{
if(s==e) return num[s];
... | ALGO | 0.999983 | 4.342376 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-21T15:59: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": "b236713a39b8... |
97905ac0-f253-4836-a5d8-fc0f3d24a5ec | El-Medonho/Contests | Geral/AtCoder/contests/abc346/d.cpp | // ⢸⣿⣿⣿⣿⠃⠄⢀⣴⡾⠃⠄⠄⠄⠄⠄⠈⠺⠟⠛⠛⠛⠛⠻⢿⣿⣿⣿⣿⣶⣤⡀⠄
// ⢸⣿⣿⣿⡟⢀⣴⣿⡿⠁⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣸⣿⣿⣿⣿⣿⣿⣿⣷
// ⢸⣿⣿⠟⣴⣿⡿⡟⡼⢹⣷⢲⡶⣖⣾⣶⢄⠄⠄⠄⠄⠄⢀⣼⣿⢿⣿⣿⣿⣿⣿⣿⣿
// ⢸⣿⢫⣾⣿⡟⣾⡸⢠⡿⢳⡿⠍⣼⣿⢏⣿⣷⢄⡀⠄⢠⣾⢻⣿⣸⣿⣿⣿⣿⣿⣿⣿
// ⡿⣡⣿⣿⡟⡼⡁⠁⣰⠂⡾⠉⢨⣿⠃⣿⡿⠍⣾⣟⢤⣿⢇⣿⢇⣿⣿⢿⣿⣿⣿⣿⣿
// ⣱⣿⣿⡟⡐⣰⣧⡷⣿⣴⣧⣤⣼⣯⢸⡿⠁⣰⠟⢀⣼⠏⣲⠏⢸⣿⡟⣿⣿⣿⣿⣿⣿
// ⣿⣿⡟⠁⠄⠟⣁⠄⢡⣿⣿⣿⣿⣿⣿⣦⣼⢟⢀⡼⠃⡹⠃⡀⢸⡿⢸⣿⣿⣿⣿⣿⡟
// ⣿⣿⠃⠄⢀⣾⠋⠓⢰⣿⣿⣿⣿⣿⣿⠿⣿⣿⣾⣅⢔⣕⡇⡇⡼⢁⣿⣿⣿⣿⣿⣿⢣
// ⣿⡟⠄⠄⣾⣇⠷⣢⣿⣿⣿⣿⣿⣿⣿⣭⣀⡈⠙⢿⣿... | ALGO | 0.999926 | 4.216667 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-09-03T14:12:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e872c87660a... |
b3596932-5426-4a05-8a2d-2e6f74cfb725 | airwindows/airwindows | plugins/MacSignedVST/Tremolo/source/TremoloProc.cpp | /* ========================================
* Tremolo - Tremolo.h
* Copyright (c) 2016 airwindows, Airwindows uses the MIT license
* ======================================== */
#ifndef __Tremolo_H
#include "Tremolo.h"
#endif
void Tremolo::processReplacing(float **inputs, float **outputs, VstInt32 sampleFrames)
... | ALGO | 0.995645 | 5.34648 | {
"github_metadata": {
"branch": "master",
"commit_count": 458,
"repo_created_at": "2018-01-22T02:05:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 951,
"forks": 91,
"issues": 31,
"pull_requests": 4
},
"file_meta": {
"content_id": "70d5... |
3b914225-6a40-4dac-92ba-3545979e6057 | IkramBagban/Data-Structures-And-Algorithm | Supreme 2.0/26-binarySearchTree/Lecture-1/02-findMinNodeInBST.cpp | // Author: <NAME>
// Email: <EMAIL>
// GitHub: https://github.com/ikrambagban
#include <iostream>
using namespace std;
class Node
{
public:
Node *left;
Node *right;
int data;
Node(int data)
{
this->left = NULL;
this->right = NULL;
this->data = data;
}
};
Node *insertI... | ALGO | 0.999981 | 4.457522 | {
"github_metadata": {
"branch": "master",
"commit_count": 250,
"repo_created_at": "2023-07-30T09:32:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "026c1f8... |
416e9be8-7067-4103-9149-cc6d10679033 | VinVash/450-DSA | Striver/StackAndQueue/6. next-greater-element/main.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> nextGreaterElements(vector<int> &nums)
{
int n = nums.size();
vector<int> ans(n, -1);
for (int i = 0; i < n; i++)
{
int num = nums[i];
for (int j = 1; j <= n; j++)
{
if (nums[(i + j) % n] > num)
... | ALGO | 0.999992 | 4.506599 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2022-07-05T10:42:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa4a54c2bc... |
730a39d0-a67d-43a1-ac97-7a713ab5f888 | bokyungJ/algorithm | 중간정렬/2버블정렬.cpp | #include <iostream>
#include <time.h>
#include <stdlib.h>
#include "sort.h"
using namespace std;
const int N = 10000;
void BubbleSort(int a[], int N)
{
int i, j;
for (i = N; i >= 1; i--) {
for (j = 1; j < i; j++)
if (a[j] > a[j + 1]) swap(a, j, j + 1);
}
}
int main()
{
int i, a[N + 1];
double start_time;
/... | ALGO | 0.999512 | 4.530225 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-10-07T14:23: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": "58cedefff8... |
93306007-e13d-4a5b-88b4-c3c5ebd9c57b | liuyangzhuan/ButterflyPACK | EXAMPLE/InterfaceTest_simple.cpp | /* “ButterflyPACK” Copyright (c) 2018, The Regents of the University of California, through
Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the
U.S. Dept. of Energy). All rights reserved.
If you have questions about your rights to use or distribute this software, please c... | ALGO | 0.963824 | 5.140713 | {
"github_metadata": {
"branch": "master",
"commit_count": 1082,
"repo_created_at": "2018-09-11T23:07:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 51,
"forks": 16,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "51cb3... |
17c77c66-0d95-483c-be6a-8e0a98ce0df6 | nevzheng/leetcode | src/0000/600/600_non_negative_integers_without_consecutive_ones.cpp | // 600_non_negative_integers_without_consecutive_ones
// <NAME>
// 7/25/21
#include <catch2/catch.hpp>
#include <fmt/format.h>
using namespace std;
// This Solution is right, but TLE
// int find(int max, int sum, int pos, bool prev) {
// if (sum > max) return 0; // Exceeded max
// if (1 << pos > max) return ... | ALGO | 0.999938 | 6.070356 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2021-07-11T16:12:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a85189330... |
63d80527-8a85-40aa-ab28-7b9e2b11fad4 | simonnguyen175/cp-repo | daily/thayvong/extra/nang_cao/buoi_23/timso.cpp | #include<bits/stdc++.h>
#define simon "timso"
#define ll long long
using namespace std;
ll x, n;
map<ll, ll> d, a;
ll conv(ll x){
ll res = 1, tmp = x;
while ( tmp > 0 ){
if ( tmp % 10 != 0 ) res *= tmp % 10;
tmp /= 10;
}
while ( x > 0 ){
res += x % 10;
x /= 10;
}
... | ALGO | 0.99998 | 4.06741 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-16T14:21: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": "9c1b5af057... |
752f26ef-87f9-4f24-967f-c7c5c858ec64 | AkshatRauthan/Decode-DSA-2.0-With-Cpp | 28. Quick Sort/quickSort_Introduction.cpp | #include "iostream"
#include "vector"
using namespace std;
// _______ QUICK SORT _______
// Take The First Element As The Pivot Element.
// Search For Number Of Elements Smaller Than Pivot : n.
// Swap Pivot With The Element At The nth Index.
// Place All The Elements Smaller Than Piv... | ALGO | 0.999969 | 5.733894 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2024-01-04T16:33:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "009ec6fcb4d... |
1b0448b7-ad32-4416-bc6a-45fb769c8ae7 | kaiwen123/fall-2010 | TopCoder/Lottery.cpp | #include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <cctype>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queu... | ALGO | 0.998946 | 4.440074 | {
"github_metadata": {
"branch": "master",
"commit_count": 603,
"repo_created_at": "2016-04-25T06:28:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "13562a7e... |
4dd9c955-585e-41f7-a514-80a0fc74da7b | bruceSz/pnc_learn | hw_4/src/grid_path_searcher/src/test_matrix.cpp | #include <Eigen/Eigen>
#include <iostream>
#include <cassert>
Eigen::MatrixXd diag(Eigen::VectorXd vec, int total_step) {
Eigen::MatrixXd m = vec.asDiagonal();
//assert(step < vec.size() -1);
bool ul;
if (total_step > 0)
ul = true ;
else
ul = false;
Eigen::MatrixXd old = m;
... | ALGO | 0.998558 | 3.674612 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2020-06-15T02:29:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f9fcb421... |
3a08d5ce-8a8e-4b32-ac73-c7d3fbdd7ab9 | Arshlan-Raza/N_DSA | Patten/flipped_solid_diamond.cpp | #include<iostream>
using namespace std;
int main(){
int num ;
cin>>num ;
int n = num/2;
for(int i = 0 ; i < n ; i++){
//inverted pyramid 1
for(int j = 0 ; j < n-i ; j++){
cout<<"*";
}
//spaces
for(int j = 0 ; j < 2*i+1 ; j++){
... | ALGO | 0.999985 | 3.641314 | {
"github_metadata": {
"branch": "master",
"commit_count": 384,
"repo_created_at": "2023-07-07T04:15: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": "27c59ae4... |
52be3fef-97b9-4bb7-81a7-85b59221c829 | eshlykov/junk | school-31/coding/usaco-training/beads.cpp | /*
ID: ugnthes1
PROG: beads
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <map>
using namespace std;
int main() {
ifstream fin ("beads.in");
ofstream fout ("beads.out");
int n, m = 0, k = 0;
string necklace;
fin >> n >> necklace;
necklace += necklace;
// cout << necklac... | ALGO | 0.999957 | 3.399014 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2017-02-18T08:52: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": "f723c87d4... |
be200870-3964-4e72-9022-4cc406364f2d | owensgroup/RXMesh | include/rxmesh/diff/lbfgs_solver.h | #pragma once
#include "rxmesh/diff/diff_scalar_problem.h"
#include "rxmesh/diff/armijo_condition.h"
namespace rxmesh {
template <typename T, int VariableDim, typename ObjHandleT>
struct LBFGSSolver
{
using DiffProblemT = DiffScalarProblem<T, VariableDim, ObjHandleT, false>;
using DenseMatT = typename D... | ALGO | 0.99991 | 6.196298 | {
"github_metadata": {
"branch": "main",
"commit_count": 1834,
"repo_created_at": "2021-04-14T15:29:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 264,
"forks": 36,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "d66abe2... |
eac1d235-a83d-4bcf-a4be-a7434abaa163 | raincross7/code-similarity | codes/train_code/problem494/problem494_495.cpp | #include <bits/stdc++.h>
int main()
{
int n, a, b;
scanf("%d%d%d", &n, &a, &b);
if (a + b - n >= 2 || (long long)a * b < n)
{
puts("-1");
return 0;
}
int lds{};
if (b > 1) lds = (n - a) / (b - 1);
int rest{n - a - lds * (b - 1)};
std::vector<int> ans;
for (int i{}; i < lds; i++)
for (int j{(i + 1) * b}... | ALGO | 0.999814 | 3.333129 | {
"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": "d1f67c7e48e3... |
f8f3a2c4-e120-4326-87ff-daa081d30acc | humanoid-path-planner/hpp_benchmark | src/romeo-placard.cc | // Copyright (c) 2020, LAAS-CNRS
// Authors: <NAME> (<EMAIL>)
//
// This file is part of hpp-benchmark.
// hpp-benchmark is free software: you can redistribute it
// and/or modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation, either version
// 3 of the Lice... | ALGO | 0.98756 | 6.317914 | {
"github_metadata": {
"branch": "devel",
"commit_count": 190,
"repo_created_at": "2014-12-11T13:07:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 7,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4cf8c09bb3... |
306f3f4f-6932-48bc-bb15-f3e77c701c82 | HSley13/NDHU | second_year/DSA_HW/HW4/hw4_d.cpp | #include <climits>
#include <iostream>
#include <list>
#include <stack>
#include <vector>
class Graph {
public:
Graph();
void InsertVertex(int v);
void InsertEdge(int u, int v, int weight = 1);
bool IsEmpty();
std::list<std::vector<int>> Adjacent_List(int u);
void PrintAdjacentMatrix();
v... | ALGO | 0.999983 | 5.016019 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2023-11-25T12:20:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4fca4dc6018... |
00a65597-4043-4acd-b2ed-2c5c8622ebb1 | BULQI/IgSeq | DataPreprocessing_code/IsotypeClassification/TracebackTable.hpp | #ifndef TRACEBACKTABLE_HPP
#define TRACEBACKTABLE_HPP
#include "Accessory/SequenceString.hpp"
//this is struct to record the link back for tracing
//zero is for local align to indicate this is a zero node for terminating a path
enum LinkBack
{
UP, LEFT, UPLEFT, ZERO, UP_UPLEFT, LEFT_UPLEFT,
UP_LEFT //special... | ALGO | 0.939906 | 4.570738 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2021-08-02T01:59:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb451b113f... |
0c2a3c8d-a0e8-40c3-ab66-68838ee563af | shahanajshana/cryptography | cns exp 31.cpp | #include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <openssl/aes.h>
#define BLOCK_SIZE 16 // 128-bit AES block size
// XOR the last byte with Rb if MSB was 1
void generate_subkeys(uint8_t *key, uint8_t *K1, uint8_t *K2) {
uint8_t L[BLOCK_SIZE] = {0};
uint8_t Rb = 0x87;
AES_KEY aes_key;
... | ALGO | 0.998362 | 4.888532 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-27T10:47:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ce92fdd4da0... |
47705a6e-259d-4e0b-a30a-f06825158d4b | FerFrassia/metnum | src/cpp/main/Matrix.h | #include <list>
#include <string>
#include <vector>
#include <list>
#include <map>
using namespace std;
typedef map<int, map<int, double>> coordinateList;
typedef vector<double> diagonalMatrix;
typedef vector<vector<double>> vvMatrix;
struct CSR {
vector<double> A;
vector<int> JA;
vector<int> IA {0};
};
... | ALGO | 0.998949 | 3.732669 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2022-08-21T22:48: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": "bd94f720d59... |
698e84d3-9fe8-4a16-8b80-e54a5df257fb | Edith-3000/Algorithmic-Implementations | Interactive Problems/Sample Problem - 3.cpp | // Problem: E. XOR Guessing
// Contest: Codeforces - Educational Codeforces Round 71 (Rated for Div. 2)
// URL: https://codeforces.com/problemset/problem/1207/E
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// Parsed on: 16-11-2020 11:01:52 IST (UTC+05:30)
// Author: kapil_choudhary
#include<bits/stdc++.h>
using name... | ALGO | 0.999306 | 3.392893 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2020-07-24T04:49:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f482ca4... |
ce5cfa80-3027-4332-b38e-4a1b449405fb | fahriri/algoritma-basic-2 | nestedif.cpp | #include <iostream>
#include <string>
using namespace std;
main (){
string nama;
int jurusan;
double tugas, uts, absen, uas, total;
cout<<"Masukan Kode Program Studi :";
cin>>jurusan;
if (jurusan == 41){
cout<<"Program Studi SI"<<endl;
cin.ignore();
cout<<"Masukan Nama Mahasiswa :";
getline(cin, nama... | TOOL | 0.925662 | 3.252396 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-03-06T04:41: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": "0c6048e61d0... |
b44f40f7-ffaa-43ea-908a-d7758aacdad3 | noervaag/CSSI | querying/src/util/topkPriorityQueue.hpp | /**
* @file
* A basic Priority Queue (MAX) to keep the results
*/
#ifndef TOPK_PRIORITY_QUEUE
#define TOPK_PRIORITY_QUEUE
#include <queue>
#include "commons.hpp"
namespace sstss
{
struct myComp {
constexpr bool operator()(
DocScore const& a,
DocScore const& b)
const noexcept
{
return ... | ALGO | 0.985025 | 5.205713 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-11-23T15:00:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd8937bc4cd0... |
64d09f1e-f6ee-473e-b033-bcc8fa121dd0 | Burhanuddin3103/Coding-in-C-and-CPP | Computer Graphics/rotation of polygon.cpp | #include<iostream>
#include<conio.h>
#include<graphics.h>
#include<math.h>
using namespace std;
float x[20],y[20];
int n;
void dda(int n)
{
int j,a=0,i=0;
float X,Y,dx,dy,s,k;
for(i=0,j=1;i<n;i++,j++)
{
if(j == n)
{
j = j-1;
i = 0;
a = 1;
}
... | ALGO | 0.999719 | 3.881606 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-08-04T05:50:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "125310158... |
e839b458-c8ae-4186-8643-dfecfc936a3d | shockley6668/Algorithm-Design-and-Analysis | 算法分析设计/圆排列最小宽度/main.cpp | //
// main.cpp
// 圆排列最小宽度
//
// Created by Shockley on 6/6/24.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
// 计算当前排列的宽度
double computeWidth(const vector<double>& radii, const vector<int>& perm) {
int n = radii.size();
... | ALGO | 0.999976 | 5.148655 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-04-10T08:16:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "dec49c8f11bd... |
de80f086-b395-4264-9689-5ebce90dfcae | guricerin/procon-solutions | atcoder/abc/abc161/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (a); i >= (int)(b); i--)
#define all(x) (x).begin(), (x).end()
using i32 = int32_t;
using i64 = int64_t;
using f32 = float;
using f64 = double;
using P = pair<int, int>;
template ... | ALGO | 0.999846 | 4.382767 | {
"github_metadata": {
"branch": "master",
"commit_count": 290,
"repo_created_at": "2019-05-05T13:19: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": "03c15fd3... |
a6155d63-e819-4551-aec7-9472784a69ac | itos3d/GRAPHOS | libs/libOrsaAsift/libNumerics/computeH.cpp | // Authors: Unknown. Please, if you are the author of this file, or if you
// know who are the authors of this file, let us know, so we can give the
// adequate credits and/or get the adequate authorizations.
#include "homography.h"
#include "numerics.h"
#include <algorithm>
#include <math.h> /* For sqrt */
#includ... | ALGO | 0.998268 | 5.897197 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-12-19T10:40:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 90,
"forks": 26,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "55913f31... |
845aa5ff-a136-4102-8296-f73895e49bd1 | Krythz43/CP-Archieve | ICPC19/g3.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define lli long long int
#define rep(i,n,z) for(int i=z;i<n;i++)
#define rrep(i,z) for(int i=z;i>=0;i--)
#define nl cout<<endl
#define vi vector<int>
#define vlli vector<long long int>
#define umap u... | ALGO | 0.999684 | 3.038082 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-10-31T12:08: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": "8a9807bafa... |
942aab11-167e-4425-a6db-32cefe2f40c0 | Jinyuancheng/reactDemo | c_example/c_example4/main.cpp | /**************************************************************
* @file main.cpp
* @date 2019/08/14 17:30
* @author Jinzi
* @Contact: <EMAIL>
* @brief 输入某年某月某日,判断这一天是这一年的第几天?
***************************************************************/
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
... | ALGO | 0.999261 | 4.18917 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-09-30T03:42:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "526885ae21... |
3d93d2a5-66bb-43bd-b898-ff298ea76fd9 | echoCodeScript/Data-Structures-And-Algorithms | Graph Theory/Pepcoding/Graph_level2.cpp | #include<bits/stdC++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vil vector<ll>
#define vc vector<char>
#define vf vector<float>
#define vul vector<ull>
#define vb vector<bool>
#define vii vector<vector<int>>
#define vpii vector<pair<int,int>>
#define sti stack<int>
#define stc stack... | ALGO | 0.999755 | 4.125319 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-05-20T10:46: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": "d0013f1271f3... |
bb83f379-1535-479d-a442-2a8a2e0b7c82 | Areustle/heasoft-6.20 | Xspec/src/XSUtil/Numerics/LinearInterp.h | // C++
#ifndef LINEARINTERP_H
#define LINEARINTERP_H
#include "xsTypes.h"
namespace Numerics {
namespace Rebin {
// the engine of the subroutine previously coded in fortran as 'inibin'.
// has to include potential redshifts.
// computes the array of start,fi... | ALGO | 0.936671 | 5.823501 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-02-28T14:19:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d960a5704a... |
9d663370-4776-48e2-95ad-ea9447af16c7 | Nitishojha00/DSA_NOTES | Sorting/Insertion_Sort.cpp | // ✅ Stable algorithm
// ✅ O(n) if already sorted (Best Case)
// ❌ T.C. -> O(n^2) in Worst/Average Case
// ✅ Good for small or nearly sorted data
// ❌ Not suitable for large data
#include <bits/stdc++.h>
using namespace std;
void insertionSort(int arr[], int n)
{
for (int i = 1; i < n; ++i)
{
int key ... | ALGO | 0.999999 | 6.501981 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2025-06-04T05:43: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": "fc81c9301d0... |
c1563b97-3149-4a1d-996b-698edff77e53 | TigranAbrahamyan/tigran_abrahamyan | data_structure/day09/graph.hpp | #ifndef GRAPH_H
#define GRAPH_H
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Graph {
private:
vector<vector<int>> adjMatrix;
void outOfRangeException(int);
void dfs(bool*, int);
public:
Graph(int);
void printMatrix();
void addVertex();
void addEd... | ALGO | 0.927045 | 5.378481 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2022-02-28T16:06: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": "c672e1e9... |
33ae75a6-77ed-4073-a057-d80381ca13e4 | ankur-kayal/Competitive | Contests/Codeforces/731DIV3/G/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define nl '\n'
/*
Strategies:
1. Do a dfs or bfs to find all recheable nodes from 1, and discard all unreacheable nodes now
2. Do a topological sort on recheable nodes and find all cycles in the graph
3. Do a multisource bfs on the cycle nodes and find all nodes that are... | ALGO | 0.999913 | 4.912405 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2020-12-29T03:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "243ad6adb3b... |
1bcbd452-46c2-435d-a657-eca60d453f54 | PacificCommunity/seapodym-codebase | src/predicted_catch_without_effort.cpp | #include "calpop.h"
///Forward functions for:
///predicting catch by fishery without using the effort data.
///They compute local proportions of catch by fishery in the total catch over 'no effort' fisheries.
///Note, the catches being used need to have the same units.
void CCalpop::Ctot_proportion_fishery_comp(cons... | ALGO | 0.997417 | 5.474912 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2022-04-25T18:49:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "e76e80d6b... |
223b5c15-4be1-417b-93ee-d9a11b59de3e | ZiluZhang/LeetCode-Solutions | 029.cpp | // Divide Two Integers
// INT_MAX这种在头文件limits.h
// 注意负界比正界大,所以做任何运算都先转成long
// 重要!(0-(long)dividend)必须转long,否则如果是INT_MIN就会越界
// 每一次把除数翻倍,省时
#include <limits.h>
class Solution {
public:
int divide(int dividend, int divisor) {
if(dividend == 0) return 0;
if(divisor == 0) return INT_MAX;
if(div... | ALGO | 0.999691 | 5.082393 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2018-03-25T06:58: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": "cdeee34bc... |
f7eb32ec-9e06-4efe-96ab-8356a5a0917c | karanshah254/Learn-CPP-Programming | Problem-Statements/movie_watch2X_chef.cpp | /*
Chef started watching a movie that runs for a total of X minutes.
Chef has decided to watch the first Y minutes (Y is even) of the movie at twice the usual speed.
How long will Chef spend watching the movie in total?
Input : X = 100 , Y = 20
Output : Time Taken = 90
Explanation :
Y min has been watched in twi... | ALGO | 0.999803 | 4.697774 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-03-26T12:51: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": "2d0f2ae2300... |
f1b22660-c8ba-417a-8c72-20fc89fc7f7d | Pradumnk23/CF-PC-2 | IQ Test.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <math.h>
#include<algorithm>
#include <vector>
#include <string>
using namespace std;
#define mp make_pair
#define pb push_back
#define lli long long int
#define pl pair<lli,lli>
#define pi ... | TEST | 0.999705 | 3.775159 | {
"github_metadata": {
"branch": "main",
"commit_count": 141,
"repo_created_at": "2021-04-16T19:07:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e34ea564b... |
58b52945-ed18-4b74-a29e-f9638eef7355 | ComputerProgrammerStorager/DataStructureAlgorithm | CLRS/Greedy/RearrangeStringkDistanceApart.cpp | /*
Given a string s and an integer k, rearrange s such that the same characters are at least distance k from each other. If it is not possible to rearrange the string, return an empty string "".
Example 1:
Input: s = "aabbcc", k = 3
Output: "abcabc"
Explanation: The same letters are at least a distance of 3 from e... | ALGO | 0.999995 | 6.261503 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-08-16T03:57:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "efbcfe971ed... |
9fb7f5e8-be06-4863-ba10-8df4bf7f7be0 | ksaveljev/UVa-online-judge | 10576.cpp | #include <iostream>
#include <vector>
using namespace std;
#define pow2(i) (1<<i)
#define bit(i) (1<<i)
#define isOdd(i) (i&1)
#define isEven(i) (!(i&1))
#define sz(i) i.size()
#define REP(i, b, n) for (int i = b; i < n; i++)
#define REPI(i, b, n) for (int i = b; i <= n; i++)
#define rep(i, n) REP(i, 0, n)
#define rep... | ALGO | 0.999655 | 3.982676 | {
"github_metadata": {
"branch": "master",
"commit_count": 788,
"repo_created_at": "2011-04-04T11:43:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 106,
"forks": 69,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "4322c... |
31ec280a-9a7d-48bf-b1a1-48ef1a235b75 | folgerwang/UnrealEngine | Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/PBDBendingConstraintsBase.h | // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Chaos/Array.h"
#include "Chaos/Map.h"
#include "Chaos/PBDParticles.h"
#include "Chaos/ParticleRule.h"
#include "GenericPlatform/GenericPlatformMath.h"
namespace Chaos
{
template<class T>
class TPBDBendingConstraintsBase
{
public:
T... | ALGO | 0.977243 | 5.166014 | {
"github_metadata": {
"branch": "release",
"commit_count": 73960,
"repo_created_at": "2019-07-21T08:25:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 37,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "fda... |
285f8c80-45df-4678-9a78-a781468ffbe9 | sidharth-085/Striver-A-Z-Questions | DP Series/4. DP on Strings/LCS Pattern/9. ShortestCommonSupersequence.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
// In this question, we have to find Supersequence to which String 1 and String 2
// both are subsequences of this Supersequence.
// Approach 1: Using LCS Length function
// Time and Space Complexity same as LCS
/*
Algorithm:
- We ... | ALGO | 0.999901 | 5.931289 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-12-26T03:05:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a19d67700d... |
0ee95ae7-cb7c-4480-909f-1b5deb8b3b33 | TANGLIHUI/cpp-data-structure | AVL/AVL.hpp | #include <iostream>
#include <functional>
#include <stack>
#include <algorithm>
#include <cmath>
#include <set>
#define AVL_TEMPLATE \
template <typename Datatype,\
typename Less,\
typename Greater\
>
#define AVLDLG AVL<Datatype,Less,Greater>
template <typename Datatype,
typename... | ALGO | 0.999534 | 4.633582 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-10-26T08:11: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": "2d11289788... |
fb0c73f4-e7b7-44a3-aa37-faf5952fce75 | viveakrt/Competitive-programing | CodeChef/FILLGRID_The Grid Fill Problem.cpp | // https://www.codechef.com/START11B/problems/FILLGRID
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
ll gcd(ll a, ll b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
ll to_number(string s)
{
ll ans = 0;
int n = s.size(), i;
for (i = 0; i < n; ... | ALGO | 0.999673 | 4.581148 | {
"github_metadata": {
"branch": "main",
"commit_count": 482,
"repo_created_at": "2020-10-10T08:28:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 71,
"issues": 1,
"pull_requests": 3
},
"file_meta": {
"content_id": "fb4e46fe... |
4f4bc7b8-6377-4539-8866-1cd5db4f418a | bvrstich/peps-afqmc | include/btas/DENSE/detail/trash/blas/axpby_impl.h | #ifndef __BTAS_CXX_BLAS_AXPBY_IMPL_H
#define __BTAS_CXX_BLAS_AXPBY_IMPL_H 1
#include <btas/DENSE/detail/blas/blas_types.h>
namespace btas
{
namespace detail
{
/**** not really need for now
/// generic axpby function (to be overriden)
template<typename T>
void axpby (
const size_t& N,
const T& alpha,
const ... | TOOL | 0.992683 | 6.536975 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2014-06-11T19:28:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa47d8652... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.