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
19b8f673-758c-4879-a1a0-0338ddadd0fc
xfmeng17/leetcode
cpp/0740.cpp
class Solution { public: int deleteAndEarn(vector<int> &nums) { // return func1(nums); // return func2(nums); // return func3(nums); // return func4(nums); // return func5(nums); return func6(nums); } // ** top-down recursive, TLE int func1(vector<int> &nums) { sort(nums.begin(), nu...
ALGO
0.999967
4.795593
{ "github_metadata": { "branch": "master", "commit_count": 539, "repo_created_at": "2018-02-12T06:37: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": "f978793e...
f255cee4-f917-4949-a768-32a6485cbc60
felipecsl/cs-exercises
cpp/32-pick_random_element/pick_random_element.cpp
#include "../prep/random.h" #include <iostream> #include <vector> #include <iterator> #include <cstdlib> using namespace std; template <typename iterator> iterator pick_random_element(iterator begin, iterator end) { if(begin == end) return end; auto sample = begin; int weight = rand(); for(++begin; begin != e...
TOOL
0.907774
4.660006
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2012-06-20T06:22:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fecbde2b...
b62c51ac-06da-4545-a03f-85b0bef64f5e
Offliners/C_CPP_Review_for_Interview
writeup/Cpp/diameter_of_binary_tree/sol_1/main.cpp
#include<iostream> #include<vector> #include<queue> #include<algorithm> #define NULLTOKEN -101 using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} Tree...
ALGO
0.999859
4.089792
{ "github_metadata": { "branch": "main", "commit_count": 265, "repo_created_at": "2023-07-26T10:55:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cf7d557a65...
018f9a34-1300-43c0-b638-11e4506fd58c
alexandraback/datacollection
solutions_5731331665297408_1/C++/meshanya/task_c.cpp
#pragma comment(linker, "/STACK:100000000") #include <cassert> #include <cstdio> #include <cstdlib> #include <cstring> #include <cctype> #include <cmath> #include <ctime> #include <string> #include <map> #include <set> #include <vector> #include <queue> #include <algorithm> #include <iostream> using namespace std; #def...
ALGO
0.999987
3.975881
{ "github_metadata": { "branch": "master", "commit_count": 58, "repo_created_at": "2017-03-08T11:33:58.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f050b101e...
0ebb9a0a-45b2-411a-9b9c-b9306a48d935
moustapharamadan/LeetCode
LeetCodeCpp/LeetCodeCpp/header/0146_LRUCache.hpp
#pragma once #include <unordered_map> #include <list> //146. LRU Cache class LRUCache { public: LRUCache(int capacity) : m_capacity(capacity) { } int get(int key) { std::unordered_map<int, std::list<std::pair<int, int>>::iterator>::iterator hashTable_it = m_hashTable.find(key); ...
ALGO
0.980214
6.180674
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2020-05-08T21:02:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0421088d...
22075f06-e479-4164-ac64-e1da26882c0b
proprietary/sandbox
cpp/com_leetcode_problems_shortest_distance_after_road_addition_queries_i.cc
#include <gtest/gtest.h> #include <algorithm> #include <array> #include <limits> #include <queue> #include <vector> namespace { class Solution { static constexpr size_t kCities = 500; using Graph = std::array<std::vector<int>, kCities + 1>; public: std::vector<int> shortestDistanceAfterQueries( int n, ...
TEST
0.983922
6.45366
{ "github_metadata": { "branch": "master", "commit_count": 159, "repo_created_at": "2020-06-11T01:39: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": "4ff52a46...
2b1bb3b8-7887-41a0-b76f-3ce7c25e576e
Student-FastDev/Problems
Codeforces/Gorilla and the Exam.cpp
#include <bits/stdc++.h> typedef long long ll; using namespace std; const int MAX_N = 1e9+1; const int MOD = 1e9+7; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int T; cin >> T; while (T--) { int N, K; cin >> N >> K; vector<int> A(...
ALGO
0.999967
4.95955
{ "github_metadata": { "branch": "main", "commit_count": 320, "repo_created_at": "2024-06-18T14:19:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "379c315ee3...
f83ee4aa-ac72-4c99-9b56-d5b5c019bf57
Etawinsky/Altstu
Курс 2/Объектно-ориентированное программирование/Lab8/task14-2.cpp
#include <iostream> #include <cmath> using namespace std; template <class T> class Array { public: Array(int s); void Read(); T Display(); T Sum(); T Max(); private: T *data; int size; }; class Parabola{ public: Parabola(double _a, double _b, double _c); Parabola(); double Distance...
ALGO
0.993355
3.278957
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2015-11-14T04:52: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": "41178154e...
691cb736-e53f-439b-8d1b-9d0707953c9c
alexluscan/Cpp-algorithms
Algoritmica/Arbori de intervale/Lazy/24.02/Picture (IOI 1998)/pictures_stl_ok.cpp
/* OK * Pictures - perimetrul figurii baleiere + arbori de intervale Complexitate: O(N * lg MAXC) } */ #include <stdio.h> #include <vector> #include <algorithm> #include <string.h> using namespace std; struct Edge { int x, y1, y2, sgn; bool operator < (const Edge& e) const { return x < e.x || ( x...
ALGO
0.999318
3.644533
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2023-12-29T14:48: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": "e346629efc68...
44981813-f706-460c-89dd-499ae9b77913
aditya-vaish5/myLeetcode
213.house-robber-ii.cpp
/* * @lc app=leetcode id=213 lang=cpp * * [213] House Robber II */ // @lc code=start class Solution { public: int n; int dp[2][100000]; int f(vector<int> &nums, int index, bool hasZero) { if(dp[hasZero?1:0][index] != -1){ return dp[hasZero?1:0][index]; } int ans ...
ALGO
0.999988
5.428102
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2020-05-13T20:52:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c5b0cdffa...
b538bd03-d856-4560-9092-b605491299e8
FullteaR/CompetitiveProgramming
AOJ/Volume 0/Square Searching.cpp
#include <iostream> #include <vector> #include <algorithm> #include <cstdio> using namespace std; int squareSearching(int** table,int W,int H); struct rect{ int w; int h; bool operator<(const rect &another) const{ return w*10000+h<another.w*10000+another.h;//w,h<1000 }; bool operator==(const rect &anoth...
ALGO
0.999924
3.530222
{ "github_metadata": { "branch": "master", "commit_count": 351, "repo_created_at": "2019-04-24T06:41: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": "e5dbd5d6...
22e40ffc-78c3-4442-90c7-ad78a2855451
suman105/LeetCode-Top-100-Liked-Problems
Binary Tree/230 Kth Smallest Element in a BST.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.999996
6.343112
{ "github_metadata": { "branch": "main", "commit_count": 10, "repo_created_at": "2025-02-22T10:10:57.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "55abd1d742f...
32d90593-7c28-4160-9a06-f86c8c3ae159
fpGHwd/PAT
PAT/PATA1022.cpp
#include "stdafx.h" #include <cstdio> #include <map> #include <string> #include <set> #include <iostream> using namespace std; static map<string, set<int>> mpTitle, mpAuthor, mpKey, mpPub, mpYear; static void query(map<string, set<int>> &mp, string q_key) { // timeout here if (mp.find(q_key) == mp.end())printf("\nN...
ALGO
0.998428
3.564548
{ "github_metadata": { "branch": "master", "commit_count": 139, "repo_created_at": "2018-01-27T08:13: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": "b756a893...
418162ce-b4e5-4c4d-b1b1-c5c809cbb8a1
dimtass/DSP-Cpp-filters
lib/so_butterworth_hpf.h
/** * Second order Butterworth high-pass filter * <NAME> 2016-2020 * * fc, corner frequency * Butterworth low-pass and high-pass filters are specialized versions of the ordinary secondorder * low-pass filter. Their Q values are fixed at 0.707, which is the largest value it can * assume before peaking in the frequency r...
ALGO
0.916554
5.190984
{ "github_metadata": { "branch": "master", "commit_count": 19, "repo_created_at": "2016-09-26T09:55:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 174, "forks": 35, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "a78d10...
4c2f7272-5e2e-47f6-b05a-50375981cc24
limber18tc/limber18tc
arrays/ordenamiento/burbuja.cpp
#include <iostream> #include <stdlib.h> #include <time.h> using namespace std; void llenaVector(int v[], int n) { srand(time(NULL)); for(int i = 0; i < n; i++){ //v[i] = rand()%20 + 1; cin >> v[i]; } } int ordenaBurbujav1(int v[], int n) { int aux, contador = 0; for (int i = 0; i < ...
ALGO
0.999668
3.913442
{ "github_metadata": { "branch": "main", "commit_count": 5, "repo_created_at": "2025-01-15T14:59: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": "c524bfe7fea6...
6fbc22c2-7047-4599-a6f4-80c142b15043
piyushgoyall/Learning-C
More_on_C/65_27-10-2023_5.cpp
// Create a class Table to print the table of a number passed as a constructor parameter. // At the end display total number of objects created of that class. Write this code using static. #include <bits/stdc++.h> using namespace std; class Table { private: int number; static int objectCount; public: Tab...
TOOL
0.973077
6.047253
{ "github_metadata": { "branch": "main", "commit_count": 743, "repo_created_at": "2022-07-22T09:51:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fb1c60d8a3...
b12b6791-7bec-4048-967a-924bb8a0d98f
yjl9903/XCPC
HDu/4080.cpp
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <map> #define ms(a,b) memset(a,b,sizeof(a)) using namespace std; typedef long long ll; typedef unsigned long long ull; const int maxn = 100000 + 5; const int seed = 135; const int p1 = 1e9 + 7; char s[maxn]; int n, m, ans, ansp; ul...
ALGO
0.99994
3.696096
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-03-25T19:33:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "be1251682681...
708c1792-274b-41fe-a9a9-ac8d19754688
fdrmrc/Polydeal
source/agglomeration_handler.cc
// ----------------------------------------------------------------------------- // // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later // Copyright (C) XXXX - YYYY by the polyDEAL authors // // This file is part of the polyDEAL library. // // Detailed license information governing the sourc...
ALGO
0.996365
6.412594
{ "github_metadata": { "branch": "main", "commit_count": 467, "repo_created_at": "2022-10-12T13:30:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 4, "pull_requests": 6 }, "file_meta": { "content_id": "6a906d3290...
a0593879-cf93-4308-8a68-e7b6f53d4b24
dontwannacry/template
template/data struct/KDtree/P4169nearest.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; int N,M,cmpid,tot,root,px,py,ans,len,cnt,rub[600010]; struct point{ int x[2]; bool operator < (const point other)const{ return x[cmpid] < other.x[cmpid]; } }P[600010]; struct node{ int mx[2],mi[2],son[2],si;point p; node(){} node(point in){ p ...
ALGO
0.999972
4.737529
{ "github_metadata": { "branch": "main", "commit_count": 70, "repo_created_at": "2024-10-14T12:55:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2bf295fe444...
679d24d7-32d0-46e5-bcd8-92db69ec50dc
Dhr11/Bankers-Algo-Implementation
dbank.cpp
#include<iostream> #include<string.h> #include<stdlib.h> #include<string> #include<fstream> #include<algorithm> #include<vector> #include<cstdlib> #include<sstream> #include<ctype.h> #include<functional> #include<map> using namespace std; struct process{ int pid; int arrivaltime; vector<int> max; vector<int> ...
ALGO
0.999449
3.322296
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-11-13T07:57: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": "e639246131...
be61bb7c-6b25-4d7e-b116-c4773f1c3249
YJ243/python_codingTest
Samsung/strangeTrack_해설풀이.cpp
/* * 2024.03.06 * 이상한 원판 * 해설 풀이 * 회전하는 부분에 대한 처리 때문에 전체 원판을 각각 회전시키는 데 최대 O(N*M) 시간이 걸린다. * 인접한 수치를 확인하여 제거하는 부분에 O(N * M) 시간이 걸림, 정규화 처리에서도 마찬가지 * 이 모든 과정을 Q회 수행하므로, 전체 시간복잡도는 O(Q*N*M) */ #include <iostream> #define MAX_NUM 50 #define DIR_NUM 4 #define BLANK 0 #define CW 0 #define CCW 1 using namespace std; ...
ALGO
0.999958
5.367901
{ "github_metadata": { "branch": "main", "commit_count": 102, "repo_created_at": "2023-04-11T06: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": "8094d267d4...
f5f969ba-2e0f-44cf-90f0-f1b81bed5063
smufa/visokozmogljivo
naloga1/parallel.hpp
#ifndef PARALLEL_HPP #define PARALLEL_HPP #include "Image.hpp" #include <omp.h> #include <vector> inline Image calc_energy_par(Image in) { Image out(in.getWidth(), in.getHeight(), 1); const int width = in.getWidth(); const int height = in.getHeight(); #pragma omp parallel for collapse(2) schedule(dynamic) for...
ALGO
0.999586
6.117593
{ "github_metadata": { "branch": "master", "commit_count": 46, "repo_created_at": "2025-03-20T12:22:40.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4413447a0...
43f3d4a2-7ac8-44c1-a4c9-562e58ff565e
kalashkovpaul/vk-algorithms
homework1/task_02/task_02_03.cpp
// Даны два массива неповторяющихся целых чисел, упорядоченные по возрастанию. \ A[0..n-1] и B[0..m-1]. n » m. Найдите их пересечение.\ Требуемое время работы: O(m * log k), где k - позиция элемента B[m-1] в массиве A.. \ В процессе поиска очередного элемента B[i] в массиве A пользуйтесь результатом \ поиска элемента B...
ALGO
0.999993
4.417941
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2021-11-11T17:10:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "e3b5b578f62...
a895b5a2-65b0-438d-8eca-4d73fd797e7d
aweiand/SegmentaDente
Parte2/TrabalhoCG.cpp
// ********************************************************************** // PUCRS/FACIN // COMPUTAÇÃO GRÁFICA // // TrabalhoCG.cpp // Programa de segmentação de Imagens de Micro Tomografia // de dentes com algoritmos de segmentação por linear. // // <NAME> <<EMAIL>> // ***********************************************...
TOOL
0.973095
3.813679
{ "github_metadata": { "branch": "stable", "commit_count": 17, "repo_created_at": "2014-06-10T21:29: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": "59fa3abc8...
89adde81-19cb-4181-b628-8f8f4f1715f4
EstherJP/AEDA
p4/include/celda.hpp
#pragma once #include <iostream> template<class clave> class celda { private: int nbloques_; int nclaves_; clave* clv_; //vector de nceldas public: celda(void) {} celda(int nbloques); ~celda(void); bool buscar(clave& c) const; bool inserta...
TOOL
0.90066
3.366773
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2019-04-17T18:30: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": "0d2395aedd...
6ed1379e-e323-4d58-aad5-b696c46610a1
wyxmails/MyCode
crackCode_5/02.05.cpp
/* You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the 1's digit is at the head of the list. Write a function that adds the two numbers and returns the sum as a linked list. FOLLOW UP Suppose the digits are stored...
ALGO
0.999939
5.299536
{ "github_metadata": { "branch": "master", "commit_count": 618, "repo_created_at": "2014-04-18T02:36:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "82fbe420...
da3b1e6f-c38e-4e2a-ac66-3f7110734bb5
rishisankar/icpc
kattis/dp/safesecret.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int k; cin >> k; vector<ll> nums(k); vector<char> ops(k); vector<vector<ll>> mindp(k, vector<ll>(k, LLONG_MAX)); vector<vector<ll>> maxdp(k, vector<ll>(k, LLONG_MIN)); for (int i = 0; i < k; ++i) { ...
ALGO
0.999997
3.836667
{ "github_metadata": { "branch": "main", "commit_count": 324, "repo_created_at": "2021-01-08T15:36:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8280af8a18...
950b8434-05ca-40d7-b550-58b11dc10005
napat2224/Algorithm-Design
grader/ex05e1_shortest.cpp
#include <iostream> #include <vector> #include <queue> using namespace std; vector<vector<int>> m(100, vector<int>(100)); vector<vector<int>> dist(100,vector<int>(100,-1)); queue<pair<int,int>> q; int r,c; void bfs(){ q.push(make_pair(0,0)); dist[0][0] = 0; while(!q.empty()){ pair<int,int> u = q....
ALGO
0.999898
4.24919
{ "github_metadata": { "branch": "main", "commit_count": 18, "repo_created_at": "2025-04-15T08:54: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": "51d196da440...
cc664068-241f-45b2-8912-1fc13f8a21f1
martiwer/drake
drake/examples/kuka_iiwa_arm/pick_and_place/pick_and_place_state_machine.cc
#include "drake/examples/kuka_iiwa_arm/pick_and_place/pick_and_place_state_machine.h" #include "drake/common/drake_assert.h" #include "drake/common/text_logging.h" #include "drake/common/trajectories/piecewise_quaternion.h" #include "drake/math/rotation_matrix.h" namespace drake { namespace examples { namespace kuka_...
ALGO
0.966614
3.461922
{ "github_metadata": { "branch": "master", "commit_count": 19381, "repo_created_at": "2017-09-22T13:31:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d05a6f...
4baf25ec-219f-48ea-ac2e-90d2a2c158cf
m-reuter/arpackpp
examples/matrices/nonsym/bnmatrxa.h
/* ARPACK++ v1.2 2/20/2000 c++ interface to ARPACK code. MODULE BNMatrxA.h Function template for the matrix | T -I | |-I T -I | A = | -I T | | ... -I| ...
ALGO
0.998299
5.698997
{ "github_metadata": { "branch": "main", "commit_count": 191, "repo_created_at": "2015-05-07T13:44:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 67, "forks": 29, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "b4c28968...
d1c1f1f0-3c79-4bba-91ca-b9ffe1389619
swayfreeda/ImageBasedModellingEduV1.0
examples/task5/class5_scene2pset_single_view.cc
// // Created by caoqi on 2018/10/01. // #include <iostream> #include <stdexcept> #include <algorithm> #include <vector> #include <string> #include <cstring> #include <cerrno> #include <cstdlib> #include "core/depthmap.h" #include "core/mesh_info.h" #include "core/mesh_io.h" #include "core/mesh_io_ply.h" #include "co...
ALGO
0.918531
5.700973
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2018-08-13T16:42:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 152, "forks": 210, "issues": 9, "pull_requests": 4 }, "file_meta": { "content_id": "31bc7...
7dadf377-f93e-433c-9337-139c191cc26b
soulsheng/CudaAccMs3d
code/source/updateVectorByMatrix/updateVectorByMatrix.cpp
// updateVectorByMatrix.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include "Vertex.h" #include "Joint.h" #include "Vector.h" #include "../common/stopwatch_win.h" #include "updateVectorByMatrix.h" float PROBLEM_SCALE[] ={ 0.25f, 0.5f, 1, 2, 4, 8, 16, 32 }; // 问题规模档次,8档,250K至32M,2倍递增 int PROBLEM_SIZE = MEGA_S...
ALGO
0.998518
3.902107
{ "github_metadata": { "branch": "master", "commit_count": 111, "repo_created_at": "2012-09-28T11:42: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": "ffcdd2a4...
b0799e98-5d49-4299-bf6b-fc9ff9b3f3c6
KnoWingFly/OnlineJudgment
TestJawaban/test soal/test2.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> struct ListNode { int val; struct ListNode* next; }; struct ListNode* newNode(int val) { struct ListNode* node = (struct ListNode*)malloc(sizeof(struct ListNode)); node->val = val; node->next = NULL; return node; } void printList(stru...
ALGO
0.999488
4.414138
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2025-01-15T12:04: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": "ded172fff...
69bf861a-794a-4335-9249-b40fa97aff47
Linfanty/Code-in-Freshman
Codeforces/gym100610/k.cpp
#include <bits/stdc++.h> #define inf 0x3f3f3f3f #define maxn 205 //const int N = 2e5 + 5; using namespace std; typedef long long ll; int N, M; int w, h; int u, v; int s, n, t; double dis(int x1, int y1, int x2, int y2) { double mid[4]; mid[0] = sqrt((x1 + x2)*(x1 + x2) + (y1 - y2)*(y1 - y2)); mid[1] = sqr...
ALGO
0.999545
3.501788
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2018-02-27T14:54: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": "a1ee08f2e...
bf5eddb6-cb73-4c9f-829b-9fd53f185006
chaechae0322/Algorithm
BOJ/C++/9935_문자열폭발.cpp
#include <stdio.h> char input[1000001]; char bump[37]; char stack[1000001]; int match[1000001] = { 0, }; int top = -1; void explosion(int length) { for (int i = 0; i < length; i++) top--; } int getLength(char str[], int N) { int size = 0; for (int i = 0; i < N; i++) { if ((str[i] >= 48 && str[i] <= 57) || (st...
ALGO
0.999979
3.363587
{ "github_metadata": { "branch": "master", "commit_count": 112, "repo_created_at": "2020-01-09T10:31: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": "f702efc5...
1a22a3b6-9439-437b-a1bc-e187f085f7c2
Isurwars/Correlation
include/Templates.hpp
#ifndef INCLUDE_TEMPLATES_HPP_ #define INCLUDE_TEMPLATES_HPP_ // Correlation - Liquid and Amorphous Solid Analysis Tool // Copyright (c) 2013-2025 <NAME> (<EMAIL>) // SPDX-License-Identifier: MIT // Full license: https://github.com/Isurwars/Correlation/blob/main/LICENSE #include <algorithm> // For std::find #include <n...
TOOL
0.949735
6.832512
{ "github_metadata": { "branch": "main", "commit_count": 191, "repo_created_at": "2020-05-25T09:36:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 18, "forks": 8, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "4cf989d5e...
2be54f37-2cb3-4447-abd4-ebbd3a56e63e
hayaten0415/Competitive-programming
Codeforces/div3/624/A.cpp
#pragma region Macros // #pragma GCC target("avx2") #pragma GCC optimize("O3") #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) #define rrep(i, n) for (int i = (n - 1); i >= 0; i--) #define ALL(v) v.begin(), v.end() #define pb push_back #define eb emplace_back #define endl "\n" #define popcount(...
ALGO
0.999991
4.227348
{ "github_metadata": { "branch": "master", "commit_count": 1321, "repo_created_at": "2019-02-17T01:01:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "968e69f...
c453f5cf-6fa4-4a91-aa46-869026e7cc4e
AbsolutelySaurabh/Huffmann-Coding
improved/PriorityQueue.h
#ifndef PQ_NODE_H #define PQ_NODE_H #include<bits/stdc++.h> #include "Node.h" template <typename T> class PriorityQueue{ public: vector<Node<T>*> v; private: int getLeftChildIndex(int index){ return 2*index + 1; } private: int getRightChildIndex(int index){ return 2*index + ...
ALGO
0.999284
4.448591
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2017-01-18T18:52: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": "a799c48be6...
ec67e41f-ba4c-4db5-8b63-259701369121
kothariji/competitive-programming
GeeksforGeek - DSA Practice Problems/Floyd_Traingle.cpp
/* * कर्मणये वाधिकारस्ते मां फलेषु कदाचन । * मां कर्मफलहेतुर्भू: मांते संङगोस्त्वकर्मणि ॥ */ #include <bits/stdc++.h> using namespace std; #define bug(...) __f (#__VA_ARGS__, __VA_ARGS__) template <typename Arg1> void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; } template ...
ALGO
0.99987
4.88132
{ "github_metadata": { "branch": "master", "commit_count": 1881, "repo_created_at": "2020-08-27T07:08:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 680, "forks": 501, "issues": 2, "pull_requests": 2 }, "file_meta": { "content_id": "414...
5ac47f41-963d-4c74-b6f3-b4a2bafb25a7
Lrapava/pixel-art-vectorizer
main.cpp
#include <bits/stdc++.h> using namespace std; #define STB_IMAGE_IMPLEMENTATION #include "stb_image/stb_image.h" #define OTP_DEB false #define ifdeb if (OTP_DEB) #define debug if (OTP_DEB) cout #define vec vector #define str string #define fst first #define snd second int coincides(unsigned char* a, unsigned char* b,...
ALGO
0.997947
4.122659
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-07-21T12:34:31.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "09e992832168...
da9cc198-d8c3-4fc0-b44b-8e9f72036c02
jiyeon2781/algorithm-practice
Baekjoon/Gold/11404.cpp
#include <iostream> #include <algorithm> #include <vector> using namespace std; const int MaxSize = 101; const int INF = 10000001; int graph[MaxSize][MaxSize]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int N, M; cin >> N >> M; int a, b, cost; fill(graph[0], gr...
ALGO
0.999995
4.223662
{ "github_metadata": { "branch": "main", "commit_count": 209, "repo_created_at": "2023-11-15T01:33:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "525933e36f...
b7428312-39a2-4c6a-b948-9efa7726d44a
JuanGQCadavid/numerical_methods
investigation/etc/newton_polynomial.cpp
#include <iostream> using namespace std; #define MAXN 100 int n = MAXN; double xs[MAXN]; double ys[MAXN]; double div_diffs[MAXN][MAXN]; void build_div_diffs() { for(int i = 0; i < n; ++i) { div_diffs[i][0] = ys[i]; } for(int i = 1; i < n; ++i) { for(int j = 0; j < n - i; ++j) { double num = div_...
ALGO
0.999916
4.802626
{ "github_metadata": { "branch": "master", "commit_count": 106, "repo_created_at": "2019-03-08T02:53:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3d8321ed...
b4328907-3834-4100-9dc6-61259284496a
apache/doris
be/src/vec/functions/modulo.cpp
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
ALGO
0.906743
7.360854
{ "github_metadata": { "branch": "master", "commit_count": 26499, "repo_created_at": "2017-08-10T12:13:30.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 13962, "forks": 3497, "issues": 2697, "pull_requests": 616 }, "file_meta": { "content_i...
41689b4d-1440-4df5-a05b-26f4679ade92
jineshnagori/CodeQuotient
Stack and Queues/reverse.cpp
/* class CQStack{ public: CQStack(int s); // constructor void push(int j); // Add element on the top of the stack int pop(); // Remove element from the top of the stack bool isEmpty(); // Return true is stack is empty bool isFull(); // Return true if stack is full }; ...
ALGO
0.996357
4.6139
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-12-02T17:23:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a40e369c7...
5f271adf-6374-45e7-b581-79c912417bcc
PeindreLaColline/Algorithm-cpp
백준/Silver/1389. 케빈 베이컨의 6단계 법칙/케빈 베이컨의 6단계 법칙.cc
/*19:11*/ #include <iostream> #include <vector> #include <queue> using namespace std; int n, m; vector<vector<int> > map; vector<bool> visited; queue<int> q; void bfs(int s){ while(!q.empty()){ int cur = q.front(); q.pop(); for(int i =1; i<=n; i++){ if(i==s) continue; ...
ALGO
0.999972
3.409053
{ "github_metadata": { "branch": "main", "commit_count": 319, "repo_created_at": "2024-02-02T08:25:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f4946959ce...
7211d1de-4db5-4f8a-8f47-8299fd24663a
xwangfsu/CudaBubble
phasefield.h
// phasefield.h: interface for the phasefield class. // ////////////////////////////////////////////////////////////////////// #pragma once #include "tool.h" // Added by ClassView #include <cufft.h> #include "Calc.h" class phasefield { friend class phasefield; public: double *surface(); double *vol(); double* ...
TOOL
0.957947
4.498293
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2023-04-26T21:41:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8c2189dffe...
e13c7242-c146-467c-a7e7-417ec41bc9d8
Paxing939/Coursera-tasks
YellowBelt/1 week/Sqr.cpp
#include <iostream> #include <vector> #include <map> #include <utility> #include <string> using namespace std; template<typename First, typename Second> pair<First, Second> operator*(const pair<First, Second> &lhs, const pair<First, Second> &rhs); template<typename T> vector<T> operator*(const vector<T> &lhs, const ...
ALGO
0.994349
5.516374
{ "github_metadata": { "branch": "master", "commit_count": 116, "repo_created_at": "2020-06-12T18:06: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": "95098bfe...
b71852b1-e8d2-47cc-962e-b70368d34dc5
bgreer/sketchbook
musicbox/party.ino
// party mode float posoffset = 0.0; uint8_t amplitude[6]; float pre_amp[6], gauss[6]; static uint8_t gaussian[32] = { 255, 253, 249, 243, 235, 224, 212, 198, 183, 168, 153, 137, 122, 107, 93, 80, 69, 58, 48, 40, ...
ALGO
0.955347
3.795592
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2013-05-29T00:43:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "59e1a67f5...
2338d019-7dbc-430d-997f-8763b883594a
karlajen/presentation
Source.cpp
#include <iostream> using namespace std; class NodeType { public: NodeType(int = 0); // constructor with default value for // info field int info; // data NodeType * nextPtr; // pointer to next node in the list //All the functions void insert(NodeType * &head, int value); v...
ALGO
0.998757
4.489727
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2017-05-05T02:22: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": "e96e7be779...
02020573-fd9c-47b3-b5d9-71a3a444fdd7
ShigureJishin/NKUST_113-2_Data-Structure
HW01 Find Max Point Combination/HW01 Find Max Point Combination.cpp
/* 數字n來代表此圖總共有多少節點,並用n×n筆資料 來表示圖上各個節點之間是否存在一個共用邊(1代表有共用邊,0則代表無), 題目: 找出最大節點數,所有節點無共用邊 */ #include <iostream> #include <vector> using namespace std; bool CheckPoint(const int node, vector<int> PointList, const vector<vector<int>> SourceList) { for (int i = 0; i < PointList.size(); i++) { if (SourceList[node][...
ALGO
0.999968
4.799057
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-04-28T04:25: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": "6f2aceeb32a9...
c944aee0-c700-4242-a891-6370600bf17a
rijuyuezhu/XCPC-code
OI-time_Problems/数学/题目/P5656 【模板】二元一次不定方程/main.cpp
// https://www.luogu.com.cn/problem/P5656 #include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<vector> using namespace std; typedef long long ll; ll read() { ll x = 0, f = 1; char ch = getchar(); for(; ch < '0' || ch > '9'; ch = getchar()) if(ch == '-') f = -1; for(; ch >= '0' && ch ...
ALGO
0.999894
3.373718
{ "github_metadata": { "branch": "master", "commit_count": 37, "repo_created_at": "2023-03-05T03:20: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": "b99fbebb0...
a8013818-c997-4be2-9979-75964502ccf1
Abhi-Jeeet/Leetcode-cpp
1639_Number_of_Ways_to Form_a_Target_String_Given_a_Dictionary.c++
class Solution { public: int numWays(vector<string>& words, string target) { int wordLength = words[0].size(); int targetLength = target.size(); const int MOD = 1000000007; // Step 1: Calculate frequency of each character at every index in // "words". vector<vector<i...
ALGO
0.999969
6.785709
{ "github_metadata": { "branch": "main", "commit_count": 291, "repo_created_at": "2024-09-04T14:17:33.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "16eff05e62...
11ce0655-800c-4645-a1ca-c7b98d456065
nzhao/zgexpv
src/cpu/hamvec_func3.cpp
// |w> = |w> + H * |v>; // H = sum(H_i) + sum(H_ij); // H_i = h_i * S_(i,xyz) or h_ij * S_(i,xyz) * S_(j,xyz); // w_med = H_ij * w_med #include <iostream> #include <complex> #include <cmath> #include "omp.h" #define MKL_Complex16 std::complex<double> #include "mkl.h" //==============================================...
ALGO
0.999985
4.950701
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2015-11-04T23:28:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "470c3e043...
5abd6592-ee5b-41bb-af54-03fa4ae39ace
saarang123/Competitive-Programming
codeforces/675E.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; #define all(x) x.begin(), x.end() #define pb push_back #define mp make_pair template<class T> bool remin(T& a, const T& b) { return a > b ? a = b, 1 : 0; } template<class T> bool remax(T& a, const T& b) { return a < b ? a = b...
ALGO
0.999686
3.558024
{ "github_metadata": { "branch": "master", "commit_count": 15, "repo_created_at": "2021-05-13T07:29:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f385035e...
2b6b3fd7-7060-4d89-96bf-449427f8406c
dayoungee/Algorithm
백준/Silver/6580. 쿼드 트리/쿼드 트리.cc
#include <bits/stdc++.h> #define fastio cin.tie(0)->sync_with_stdio(0) using namespace std; int n = -3; bitset<512> check[512]; struct Converter { //0xdd -> int int conv[128]; Converter() { for (int i = 0; i < 16; i++) conv["0123456789abcdef"[i]] = i; } int operator() (const string& s) { return conv[s[2]] ...
ALGO
0.995883
3.630168
{ "github_metadata": { "branch": "main", "commit_count": 543, "repo_created_at": "2022-11-21T04:13: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": "62762cb101...
e1b5262e-3293-4061-80b6-50b3b6f27fb9
Ravibabuc/Google
Minimum_indexes.cpp
#include<bits/stdc++.h> using namespace std; int swap(int * A, int * B); int solve(vector<int> &A) { int n= A.size(); vector <int> B; B.resize(n); int minimum =0; int count =0; for (int i = 0; i < n-1; i++) { minimum=i; ...
ALGO
0.999981
3.734837
{ "github_metadata": { "branch": "main", "commit_count": 40, "repo_created_at": "2021-08-05T12:32: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": "81420ffef3f...
679a3d49-a815-448d-80ff-3face2247da5
hjfenghj/zuoshen_middlecalss
class04_problem05.cpp
#include<iostream> #include<vector> #include<stack> using namespace std; class PROBLEM05_1 { public: int get_res(vector<int> Arr) { int Len = Arr.size(); int maxR = Arr[0]; int maxL = Arr[Len - 1]; int L = 1; int R = Len - 1; int ans = 0; while (L != R) { //从左往右遍历 if (maxR > maxL) { if...
ALGO
0.999979
4.661819
{ "github_metadata": { "branch": "main", "commit_count": 19, "repo_created_at": "2022-06-15T03:25: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": "5c44009429f...
26474056-5ddd-4b1c-b432-c11d1169dc73
dieplinh0510/OOP_TrenLop_HIT
Tren lop/bai thuc hanh 8/8_2.cpp
#include <bits/stdc++.h> using namespace std; class SoPhuc { double a; double b; public: SoPhuc(); SoPhuc(double x, double y); SoPhuc operator+(SoPhuc y); SoPhuc operator-(SoPhuc y); friend ostream& operator<<(ostream& x, SoPhuc y); }; SoPhuc::SoPhuc() { a=0; b=0; } SoPhuc::SoPhuc...
ALGO
0.984185
4.950686
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-04-19T07:56: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": "1836e71cfbac...
ff47e891-aac8-409d-974e-2ef6f7a0768c
thcy/CSES-Solutions
Additional Problems/Network Breakdown (1677)/rainboy.cpp
/* https://cses.fi/problemset/task/1677 Network Breakdown practice with Dukkha */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/time.h> #define N 100000 #define M 200000 #define K 200000 void init_rand() { struct timeval tv; gettimeofday(&tv, NULL); srand(tv.tv...
ALGO
0.999993
3.484
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2019-08-15T05:56:42.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 115, "forks": 50, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "3d42bc...
e93d14bc-d6c5-4c8e-a2b5-c80011b9210e
phitronio/XPSC_Batch_06_Newbie_Problem_Solvers_Zone
Module_5_Bit_Manipulaion - 1/Basic Bitwise Operations.cpp
#include <bits/stdc++.h> using namespace std; bool check_kth_bit_on_or_off(int n, int k) { return ((n >> k) & 1); } void print_on_and_off_bits(int n) { for (int k = 7;k >= 0;k--) { if (check_kth_bit_on_or_off(n, k)) { cout << 1 << " "; } else { cout << 0 << " "; } } ...
ALGO
0.999513
4.339639
{ "github_metadata": { "branch": "main", "commit_count": 27, "repo_created_at": "2025-03-24T09:59:31.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 8, "forks": 4, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0c895503967e...
7538d8bf-9fe5-4a14-8294-64c156d21e7e
KeyviDev/keyvi
keyvi/include/keyvi/index/internal/index_auto_config.h
/* * keyvi - A key value store. * * Copyright 2018 <NAME><<EMAIL>> * * 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 requir...
CONFIG
0.916802
6.584729
{ "github_metadata": { "branch": "master", "commit_count": 1148, "repo_created_at": "2017-11-02T19:28:41.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 249, "forks": 46, "issues": 14, "pull_requests": 4 }, "file_meta": { "content_id": "8bcb...
f9070f32-cecd-4244-9ce6-8a15099edd03
abhinav-patel/dsa_c
6 searching/binSearch.cpp
int binarySearch(int arr[], int n, int x) { int low = 0, high = n - 1; while (low <= high) { int mid = (low + high) / 2; if (arr[mid] == x) return mid; else if (x < arr[mid]) high = mid - 1; else low = mid + 1; } return -1; } int Bi...
ALGO
0.999943
4.669677
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-11-10T18:05: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": "ae517d5573...
7029f165-631c-456e-9db5-56c295a6822e
storecodetn/TinK27_Thang0821
CROOTLESS_Phuoc.cpp
#include <bits/stdc++.h> using namespace std; const int maxNode = 1e5 + 100; int numNode, numQuery, num; int sta[maxNode], fin[maxNode], d[maxNode]; int pa[maxNode][19]; vector <int> g[maxNode]; void dfs(int u, int p) { sta[u] = ++num; pa[u][0] = p; d[u] = d[p] + 1; for (int v : g[u]) if (v !=...
ALGO
0.999994
5.528707
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2021-08-04T15:45: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": "c4c3bdca5f7e...
72e83645-d156-46b0-863b-59e8c301be41
Venkat10gitty/-Parallelization-of-Smith-Waterman-Algorithm-for-Genome-Sequencing-Using-Ricart-Agrawala-Algorithm
src/classes/ParallelFineOMPImplementation.cpp
/** * @file ParallelFineOMPImplementation.cpp */ #include "ParallelFineOMPImplementation.h" ParallelFineOMPImplementation::ParallelFineOMPImplementation(int argc, char* argv[]): Framework(argc, argv) { int i; if(argc<=1){ cin.clear(); cout << "Please enter the number of threads for parallel e...
ALGO
0.999229
5.245357
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-11-30T15:58:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6245a7bd3cd6...
6d6c5923-fa55-4fda-8634-89f3f3b76dc9
Guanhuachen1995/Leetcode_practice
algorithm/29. Divide Two Integers/29.cpp
class Solution { public: int divide(int dividend, int divisor) { int sign = 1; if(dividend<0) sign = -sign; if(divisor<0) sign = -sign; unsigned long c = 1; unsigned long long tmp = abs((long long)dividend); unsigned long long tmp2 = abs((long long)divisor);...
ALGO
0.999938
5.746627
{ "github_metadata": { "branch": "master", "commit_count": 749, "repo_created_at": "2017-01-02T07:35:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ef0880cc...
278e41ce-f705-413b-aedb-cb804d702f19
wenmingxing1/offer_code_for_github
08_MinNumberInRotatedArray.cpp
#include<iostream> using namespace std; //遍历数组,得到最小值 int MinInOrder(int *numbers, int index1, int index2) { int result = numbers[index1]; for (int i = index1 + 1; i <= index2; ++i) { if (numbers[i] < result) result = numbers[i]; } return result; } int Min(int *numbers, int le...
ALGO
0.99999
4.608015
{ "github_metadata": { "branch": "master", "commit_count": 49, "repo_created_at": "2017-09-04T07:06:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "34d03630e...
3f765a6f-a5be-4282-a0c0-c71fd42f4dca
ankitgarg503/Revision-Programs-DSA
stack_using_ll.cpp
#include<iostream> using namespace std; struct Node { int data; Node* next; }; Node* top = NULL; Node* createNode(int data) { Node* newNode = new Node; newNode->data = data; newNode->next = NULL; return newNode; } void linkedListTraversal(Node* head) { wh...
ALGO
0.998212
4.202608
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2023-10-01T16:39: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": "bdfb1370e...
6e8a4762-9632-4721-92b1-e2e39654ead2
NewRussianPirat/2-course
Algorithms/General Tasks/Dynamic Programming/Task 6/source.cpp
#include <iostream> #include <fstream> #include <vector> #include <string> #include <algorithm> void main() { std::ifstream in("input.txt"); std::ofstream out("output.txt"); std::string s1; std::getline(in, s1); int n = s1.length(); std::vector<std::vector<int>> matr(n, std::vector<int>(n, 1)); for (int j = 1; ...
ALGO
0.999985
3.427371
{ "github_metadata": { "branch": "main", "commit_count": 137, "repo_created_at": "2022-12-07T14:09:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "34461c1950...
9c352ff1-e41c-4bde-b864-3b33a3c968f4
meetprajapati19/eDLP
FirstFollow.cpp
#include <iostream> #include <map> #include <set> #include <vector> #include <string> #include <sstream> using namespace std; map<string, vector<vector<string>>> grammar; map<string, set<string>> firstSet; map<string, set<string>> followSet; set<string> nonTerminals, terminals; string startSymbol = "S"; // Utility to...
ALGO
0.999611
4.615623
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-04-30T18:38:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b3a1f7a04618...
91955553-923e-4253-82b7-149cba5ab821
chunmingchen/turbine
streamline.cpp
// Reference: VTK/Examples/VisualizationAlgorithms/Python/StreamlinesWithLineWidget.py #include <list> #include <iterator> #include <stdio.h> #include <stdlib.h> #include <omp.h> #include "vtkOSUFlow.h" #include "vtkDataSet.h" #include "vtkStructuredGrid.h" #include "vtkMultiBlockPLOT3DReader.h" #include "vtkMultiBl...
ALGO
0.939489
4.543605
{ "github_metadata": { "branch": "master", "commit_count": 35, "repo_created_at": "2014-04-21T20:52:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "cc79c11ff...
a2ff9991-313a-43e0-91aa-95a79b6c9d03
FazleRabbeBipul/LinkList-with-OOP-C-
Deletion & Insertion.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; const long long mod = 1e9 + 7; int dx[] = {0, 0, +1, -1}; int dy[] = {+1, -1, 0, 0}; const long long maxN = 2e5 + 5; #define ll long long #define pb push_back #define...
ALGO
0.999902
4.578065
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-02-11T16:31: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": "5a50c84ca8e2...
cbcc22f4-f91b-4ff5-ac0c-9e5a9eccc439
jetpotion/LeetCodeProblems
CountTopKFrequentWords/CountTopKFrequentWords.cpp
// CountTopKFrequentWords.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include <iostream> #include <unordered_map> #include <vector> #include <algorithm> #include <set> #include <queue> using namespace std; std::unordered_map<std::string, int>mp; struct Compare { bool ...
ALGO
0.999961
6.519704
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2021-05-22T17:22:07.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "69cf7bde63...
367ec7e5-fab5-4446-92f3-c06945afecba
LJFYC007/code
test/2020-02/2020-02-04/illustrious/illustrious.cpp
#include<bits/stdc++.h> using namespace std; #define REP(i, a, b) for ( int i = (a), _end_ = (b); i <= _end_; ++ i ) #define mem(a) memset((a), 0, sizeof(a)) #define str(a) strlen(a) #define pii pair<int, int> #define int long long typedef long long LL; const int maxn = 1e6 + 10; const int Mod = 998244353; const int...
ALGO
0.999785
3.999118
{ "github_metadata": { "branch": "master", "commit_count": 32, "repo_created_at": "2018-08-02T05:42:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6cff0ee00...
82be7f5d-dcc9-4de7-a9cc-f5e6102b9a9b
mellcr/ALGORITMIA
23.1_P1_LISTAS_FUERZABRUTA/funciones.cpp
/* * File: FuncionesAuxiliares.cpp * Author: <NAME> * Created on 21 de agosto de 2023, 12:11 PM */ #include <iostream> #include <iomanip> /*formato de números*/ #include <fstream> #include <random> #include "Lista.h" #include "funciones.h" using namespace std; /*Valores iniciales de la lista*/ void construir(...
TOOL
0.97766
5.023708
{ "github_metadata": { "branch": "main", "commit_count": 43, "repo_created_at": "2023-08-31T03:28:26.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1515b157671...
ef0af077-6063-4357-94a5-ef1eea0fa54d
huukhoa04/Toan-cntt
BUOI4/bai1.cpp
#include <bits/stdc++.h> using namespace std; #define MAX 100 void Identify(float a[][MAX] ,int n) { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (i == j) a[i][j] = 1; else a[i][j] = 0; } } } void Reset(float a[][MAX] ,int n) { for (int i...
ALGO
0.999956
4.485464
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2024-06-05T14:13: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": "be6f890862a9...
fc5d84d0-1765-437f-a8a4-6b1146325925
AcedbyB/machines_network_parallel_sorting
merge.cpp
#include <stdio.h> #include <iostream> #include <fstream> #include <filesystem> #include <vector> #include <algorithm> #include <assert.h> #include <unistd.h> #include <iterator> using namespace std; #define UNLIKELY(x) __builtin_expect((x), 0) void merge_files( vector<string> file_paths, string output_f...
TOOL
0.968501
5.348533
{ "github_metadata": { "branch": "main", "commit_count": 31, "repo_created_at": "2022-04-06T02:13: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": "b3ff5173a1e...
8e648389-6244-49fd-a8d0-3804132ab7ae
Frothor/LeetCode
Solutions/938_Range_Sum_of_BST/938_Range_Sum_of_BST.cpp
//Third fastest class Solution { int total = 0; void dfs( TreeNode* root, int L, int R) { if(!root) return; if( root->val >= L && root->val <= R ){ total += root->val; } auto leftmost = root->left; while( leftmost && leftmost->left ) { ...
ALGO
0.999997
6.801873
{ "github_metadata": { "branch": "master", "commit_count": 256, "repo_created_at": "2020-04-17T16:29:01.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fd7b5799...
17c3867f-3e64-4d78-9dbd-5bebabe6ae0f
AlgoStuff/CompetitiveProgramming
Codechef/SEPT14_ROTATION.cpp
/***********************************************************************/ // // INFINITUM // <NAME> // National Institute of Technology , Calicut // problem link : http://www.codechef.com/SEPT14/problems/ROTATION // Concept : AdHoc // Re...
ALGO
0.999961
3.52719
{ "github_metadata": { "branch": "master", "commit_count": 62, "repo_created_at": "2014-04-23T12:58:53.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "1e5812b9e6...
f1135597-69ef-45af-b934-5f625c5d4fc8
Cherish-you/leetcode_solve
review_gaopin/3_zixie.cpp
#include <iostream> #include <vector> #include <string> #include <unordered_set> #include <unordered_map> using namespace std; struct ListNode { int data; struct ListNode *next; ListNode() { } ListNode(int data) { this->data = data; next = nullptr; } }; struct ListNode ...
ALGO
0.99969
5.207348
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2024-11-02T03:58: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": "61ec31ce4e7...
41a35ad3-136f-4b1e-a293-9e5a3c905b05
ivangalbans/leetcode
src/1032.cpp
// https://leetcode.com/problems/stream-of-characters/description/ // O(QW) struct Trie { struct node { bool full; node *edge[26]; node() : full(false) { memset(edge, 0, sizeof(edge)); } } *root; Trie() { root = new node(); } void insert(string &w) { node *t ...
ALGO
0.996499
6.436965
{ "github_metadata": { "branch": "master", "commit_count": 103, "repo_created_at": "2022-02-19T17:50:50.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "8db82f79...
05faf447-b4fe-4441-ad8e-ef1c822898ae
xiaofeng-ustc/sdc_nano_degree
Term2_P1_Extended_Kalman_Filter/src/tools.h
#ifndef TOOLS_H_ #define TOOLS_H_ #include <cmath> #include "types.h" class Tools { public: /** * A helper method to calculate RMSE. */ static Vector CalculateRMSE(const Vectors &estimations, const Vectors &groundTruth); /** * A helper method to calculate Jacobians. */ static Matrix C...
TOOL
0.926431
6.823257
{ "github_metadata": { "branch": "master", "commit_count": 26, "repo_created_at": "2017-07-16T20:11: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": "31b959a3e...
f92391ed-9eb4-44b8-af23-bbf6fd2c3bfa
ysdshuaishuai/LeetCode-Cpp
src/8.字符串转换整数-atoi.cpp
/* * @lc app=leetcode.cn id=8 lang=cpp * * [8] 字符串转换整数 (atoi) */ #include <bits/stdc++.h> using namespace std; // @lc code=start class Solution { public: int isNum(char c) { return c >= '0' && c <= '9'; } int myAtoi(string str) { // 可以用stringstream很简单的实现,但是毕竟是练习算法,还是用一下普通方法。 bool isNeg =...
ALGO
0.99626
4.980668
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2020-05-02T08:43:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4020559e7...
3f177a7a-703e-4eeb-a64f-670ee55cd070
artem-barsov/CP
atcoder/abc174/D.cpp
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int n; std::string c; std::cin >> n >> c; std::vector<int> w(n), r(n); w[0] = (c[0] == 'W'); for (int i = 1; i < n; i++) w[i] = w[i-1] + (c[i] == 'W'); r[n-1] = (c[n-1] == 'R'); for (int i ...
ALGO
0.999912
4.312369
{ "github_metadata": { "branch": "master", "commit_count": 171, "repo_created_at": "2020-06-15T17:43:32.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4c8f1796...
ecfe8210-809f-4d96-aef1-9b215f866c69
AlbertLin0327/NTU-ADA
ADA Final Project/main.cpp
#include <bits/stdc++.h> using namespace std; class Operation{ public: // required computing Slices, the Duration required, and the number of Job per operations int slice, duration, number_of_job; int operation_index; int finish_time; vector <int> depends; }; class Job{ public: int m; // number of operations...
ALGO
0.999952
3.65771
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-06-28T16:41:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4975f4d94729...
25560ea8-d0f9-4b31-80c6-a76429b750e5
OliverVarnce/CPP
Sprint04/t00/utils/algorithmUtils.h
#pragma once #include <utility> #include <algorithm> namespace Utils { // [from, to] template<typename T> bool IsInRange(const T &val, const T &from, const T &to) { return (val >= from && val <= to); } template <typename T> bool IsInRange(const T& val, const std::pair<const T&, const T&>&...
TOOL
0.981181
6.167836
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-08-31T18:08: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": "14401d543d...
f3c3303b-7b78-426b-9bce-95261b894052
sarvex/leetcode-cpp-23
depth-first-search/0959.regions-cut-by-slashes.cpp
#include <string> #include <utility> #include <vector> class Solution { public: int regionsBySlashes(std::vector<std::string> &grid) { int N = grid.size(); auto Grid = std::vector<std::vector<int>>(N * 3, std::vector<int>(N * 3, 0)); for (int i = 0; i < N; i++) for (int j = 0; j < N; j++) { ...
ALGO
0.999466
5.074523
{ "github_metadata": { "branch": "main", "commit_count": 35, "repo_created_at": "2023-07-17T13:35:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 1 }, "file_meta": { "content_id": "eb0ef3db252...
da725e41-13a6-42fa-9615-dacd63510d3a
Zyloc/Algorithm-and-library
NITS HACKS FINAL/graph/generate.cpp
#include <stdio.h> #include <stdlib.h> #include <time.h> #define MIN_PER_RANK 1 /* Nodes/Rank: How 'fat' the DAG should be. */ #define MAX_PER_RANK 5 #define MIN_RANKS 3 /* Ranks: How 'tall' the DAG should be. */ #define MAX_RANKS 5 #define PERCENT 30 /* Chance of having an Edge. */ int main (void) { int ...
ALGO
0.997063
4.849191
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2016-06-01T18:17: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": "df331a891f...
69493f5e-2fcc-4ac7-8a86-330267fc01a2
Shahraaz/CP_P_S5
ICPC_Mirrors/Nitc_9.0/nwerc2019all/canvasline/submissions/accepted/tobi.cpp
#include <iostream> #include <set> using namespace std; int n, l[1005], r[1005], p, x, c[1005], candidate; set<int> pegs; int main() { cin >> n; for (int i = 0; i < n; i++) cin >> l[i] >> r[i]; cin >> p; for (int i = 0; i < p; i++) { cin >> x; pegs.insert(x); for (int i = 0; i < n; i++) if (l[i] <= x && x <...
ALGO
0.999992
3.78576
{ "github_metadata": { "branch": "master", "commit_count": 147, "repo_created_at": "2019-07-16T00:00:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "62e19713...
b023e12c-088d-4bc1-9d71-997333bd2d18
quasar0204/Problem-Solving
BOJ/1725.cpp
#ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif #include <algorithm> #include <cmath> #include <cstring> #include <iostream> #include <queue> #include <stack> #include <string> #include <map> #include <set> #include <deque> using namespace std; #define f(i,n) for(int i=0;i<n;i++) #define all(v)...
ALGO
0.999929
3.88393
{ "github_metadata": { "branch": "master", "commit_count": 52, "repo_created_at": "2020-08-26T10:56: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": "cab48360c...
54ea58dc-eece-4ed8-89e8-63407bd5e216
shwetaboora/DSACodes
Array and Vector/2DArray and Vector/MatrixTranspose.cpp
#include <iostream> using namespace std; int main() { // n = rows, m = columns / rows- up down , columns - left right // Given a square matrix A & its number of rows (or columns) N, return the transpose of A. // The transpose of a matrix is the matrix flipped over it's main diagonal, switching the row and...
ALGO
0.999936
5.377958
{ "github_metadata": { "branch": "main", "commit_count": 22, "repo_created_at": "2024-10-02T06:59:17.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "627ca0dc38a...
cf40f394-2b59-4d24-972f-4e92eab83cb2
ckckck1373/LeetCode_cpp
Problem/May_30_Day_Chanllenge/May05_First_Unique_Character_in_a_String.cpp
/* Date: 2020/5/5 Owner: <NAME> Note: 1. Use hashmap(unordermap) is not efficiency enough(version1) 2. int array[x]={0} // initailize all garbage with 0 */ // version 2 // Time complexity : O(n) // Faster than 96.56%(w/ cin opti) // 56% (w/o cin opti ) class Solution {...
ALGO
0.999966
5.063847
{ "github_metadata": { "branch": "master", "commit_count": 150, "repo_created_at": "2020-03-30T08:27: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": "4bbed48d...
e1499996-191e-42f9-892f-885a497d682c
muzammilkarimi/leetcode_problems
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii/3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii.cpp
// version optimized with 123 ms const int N=100000; uint64_t q[N]; int front, back; vector<int> adj1[N], adj2[N]; class Solution { public: static inline void build_adj(const vector<vector<int>>& edges, auto& adj){ for (const auto& e: edges){ const int u=e[0], v=e[1]; adj[u].push_ba...
ALGO
0.999972
4.826237
{ "github_metadata": { "branch": "master", "commit_count": 647, "repo_created_at": "2025-01-18T20:09:28.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d787a0b2...
2f3071e6-4aa9-4b72-b47e-24963e527be3
google/wiberg-minimization
utility/matrix/matrix_utility.h
// Copyright 2013 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
TOOL
0.969262
6.707635
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2013-09-10T01:33:08.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 17, "forks": 10, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "47ac49a50...
641b2ab4-bad1-43c1-887a-c8b4d9add53d
Havry21/CV_LAB
Лабораторная работа 3/lab3/lab3/main.cpp
#include <opencv2/core.hpp> #include <opencv2/imgproc.hpp> #include <opencv2/highgui.hpp> #include <opencv2/videoio.hpp> #include <iostream> using namespace cv; using namespace std; int thresh = 200; Scalar color = Scalar(120, 120, 120); Mat firstExc; #ifdef DEBUG void thresh_callback(int, void*) { threshold(firs...
ALGO
0.937114
4.168834
{ "github_metadata": { "branch": "master", "commit_count": 76, "repo_created_at": "2023-01-16T21:37: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": "efd3b6597...
7955a102-98cd-403e-ac18-d719bab87344
BlueSu007/Luogu-codes
P1036 选数.cpp
#include <iostream> #include <cstdio> #include <cmath> #include <algorithm> using namespace std; int n, m, cnt; int a[20 + 5], vis[20 + 5]; inline int readn(); bool isprime( int x ); void dfs( int sum, int step, int array ); int main() { ios::sync_with_stdio( false ); n = readn(), m = readn(); for ( int i = 1 ...
ALGO
0.999969
3.615484
{ "github_metadata": { "branch": "master", "commit_count": 572, "repo_created_at": "2020-04-08T07:44:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f267d53b...
ac09d935-81bb-4c81-8aa4-a61a4301975a
yihsuan1011/PathPlanning
include/ActualNode.h
#pragma once #include "RMP.h" #include "Kinematics.h" class CollisionAvoidance : public RMPLeaf { public: CollisionAvoidance(std::string name, std::shared_ptr<RMPNode> parent, const Eigen::MatrixXf& c, float R = 1.0, float epsilon = 0.2, float alpha = 1e-5,float eta =...
TOOL
0.925062
4.31554
{ "github_metadata": { "branch": "main", "commit_count": 12, "repo_created_at": "2024-04-17T07:39: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": "b3d275f5451...
735aaecf-b326-4726-99e1-57664a9ee3a2
lignumsystem/LignumForest
generate-tree-locations.cc
#include <TreeLocations.h> #include <LignumForestGlobals.h> using namespace LignumForest; ///\file generate-tree-locations.cc //extern int LignumForest::ran3_seed; //is a global variable namespace LignumForest{ ///\brief Tree locations Nonstationary Poisson process. void GenerateLocations(int& nTrees, double cor...
ALGO
0.998893
5.227925
{ "github_metadata": { "branch": "main", "commit_count": 378, "repo_created_at": "2021-09-17T09:43:11.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4a1d105e38b...
1b753935-2c2d-41e0-9e85-727d72d5540b
eoeodziad2137/zadania-cpp-zse
zadania /gra strategiczna /grastrtegiczna.cpp
#include <iostream> using namespace std; int main(int argc, char *argv[]) { system("chcp1250"); system("clear"); int metal, deuter, krysztal, krazowniki=0; string koniec; cout << "Ile masz metalu: "; cin >> metal; cout << "Ile masz krysztal: "; cin >> krysztal; cout << "Ile masz ...
TOOL
0.944701
3.500958
{ "github_metadata": { "branch": "main", "commit_count": 8, "repo_created_at": "2024-07-08T23:46:47.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "d7fbbfd22ec8...
e0b0fa14-567c-412e-8c50-038ffd4b9be4
ishandutta2007/codeforces-s
saost/normal/1621/B.cpp
#include <bits/stdc++.h> #define FOR(i,l,r) for(int i=l; i<=r; ++i) #define REP(i,l,r) for(int i=l; i<r; ++i) #define FORD(i,r,l) for(int i=r; i>=l; --i) #define REPD(i,r,l) for(int i=r-1; i>=l; --i) using namespace std; const int N = 100005; int t, n, m, k, res; int a[N], b[N], f[N]; void Enter() { cin >> n; } v...
ALGO
0.999672
3.869625
{ "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": "d0fac564290a...
4fb9c6ea-b30f-4ad6-bc7e-8ee2e326525a
Mann-Chandarana/Leetcode_Challenges
Linked_list/Questions/LTC8.cpp
/*--------Medium-----------*/ /*- Reverse Linked List II -*/ //////// Question number 92. /* When there is the possibility of change in head of the list at that time make dummy = -1 as your new head */ #include <bits/stdc++.h> using namespace std; struct ListNode { int val; ListNode *next; ListNode() ...
ALGO
0.999996
5.402481
{ "github_metadata": { "branch": "main", "commit_count": 43, "repo_created_at": "2023-10-14T18:31:34.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "a545ec88f8d...