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
af83489c-e306-461d-9683-a1cbfa5d6ac8
Renegade-3863/Hotaru_at_Leetcode
CollectionOfSolutionsCC/_127ladderLength.cc
#include "Solution.h" int Leetcode101_200;:Solution::ladderLength(string beginWord, string endWord, vector<string>& wordList) { // 经历了 126 题的洗礼,相信大家对这道原题都已经觉得小儿科了,可以直接套用上一题的 BFS + DFS 策略解决 // 这里考虑一下,如果我们事先没有做过 126 题那种优化 // 本题第一眼,其实还是会想到单纯的 BFS(毕竟要求计算的是最短距离,很难不第一时间想到 BFS) // 考虑直接对这些单词进行建图 // 在建图的过程中...
ALGO
0.999872
5.23673
{ "github_metadata": { "branch": "main", "commit_count": 111, "repo_created_at": "2024-04-25T06:57: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": "802a914b0d...
c65abc59-9149-4c22-b77b-e30fdafd30c3
Rainboylvx/pcs
loj/10067/1.cpp
/*----------------- * author: Rainboy * email: <EMAIL> * time: 2020年 05月 13日 星期三 15:10:56 CST * problem: loj-10067 *----------------*/ #include <bits/stdc++.h> #define For(i,start,end) for(i = start ;i <= end; ++i) #define Rof(i,start,end) for(i = start ;i >= end; --i) typedef long long ll; using namespace std; /* ==...
ALGO
0.999989
4.122249
{ "github_metadata": { "branch": "master", "commit_count": 89, "repo_created_at": "2019-11-03T09:56:59.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 2 }, "file_meta": { "content_id": "21a275d9b...
b0cb632b-844b-4361-88f1-4803ea15fbd9
ishandutta2007/codeforces-a
a_g/normal/1569/C.cpp
#include <bits/stdc++.h> #define ll long long using namespace std; int MOD = 998244353; ll expmod(long long a, long long b, int m) { int res = 1; a = a % m; if (a == 0) return 0; while (b > 0) { if (b & 1) { res = (res*a) % m; } b = b>>1; a = (a*a) % m; } return res; } int main...
ALGO
0.999894
5.269508
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2024-04-11T00:51:41.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fab074589462...
9250907a-4b8b-4b29-ac62-2deb845b5c6d
medapatisaiswetha/MissionRnD-C-Arrays-Worksheet
src/sortedArrayInsertNumber.cpp
/* OVERVIEW: Given a sorted array, insert a given number into the array at appropriate position. E.g.: Arr = [2, 4, 6], num = 5 final Arr = [2, 4, 5, 6]. 5 is inserted at 2nd index. INPUTS: Integer Array pointer, length of the array, number to be inserted. OUTPUT: Array pointer after inserting number. ERROR CASES: R...
ALGO
0.999942
4.688759
{ "github_metadata": { "branch": "master", "commit_count": 14, "repo_created_at": "2016-03-07T07:10: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": "b418514b1...
7aa5fa22-1a08-4c02-88b0-9acd6c1fa870
RiceReallyGood/Leetcode
300+/968_Binary_Tree_Cameras.h
#include <vector> #include <climits> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; class Solution { public: int minCameraCover(TreeNode* root) { vector<int> withcamera(1001); vector<int...
ALGO
0.999973
5.861486
{ "github_metadata": { "branch": "master", "commit_count": 7, "repo_created_at": "2020-02-26T09:01: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": "51e89444e9...
2ba98760-b9e6-4403-bc8c-39276561304e
jssosa10/maratones
solutions/valentin.cpp
/* * I won't be broken * I won't be tortured * I won't be beaten down * I have the answer * I can take the pressure * I will turn it all around * Lift me up above this * The flames and the ashes * Lift me up and help me to fly away */ #include <bits/stdc++.h> using namespace std; int n; set<char> is, nots; int...
ALGO
0.999641
3.302161
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2017-08-24T20:23:13.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "81be3ea98...
9c193ca3-0e4e-4522-a3e8-b8c7838b8134
danielthoren/algorithms
physics/shape.h
#ifndef DALG_SHAPE #define DALG_SHAPE #include <vector> #include <optional> #include "../dalg/geometry/vec2d.h" #ifndef DEBUG #define DEBUG 0 #endif namespace phys { /** * Author: <NAME> * * Contains information about a contact point in a collision * between two shapes */ template...
ALGO
0.916539
6.124635
{ "github_metadata": { "branch": "master", "commit_count": 204, "repo_created_at": "2020-04-24T08:15: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": "e631c3c8...
fd8f0202-85e5-4192-9460-ff27f605d1f9
Sayantan-dev1003/LeetCode150
Day60_CopyListWithRandomPointer.cpp
/* // Definition for a Node. class Node { public: int val; Node* next; Node* random; Node(int _val) { val = _val; next = NULL; random = NULL; } }; */ class Solution { public: Node* copyRandomList(Node* head) { if (!head) return nullptr; Node...
ALGO
0.997807
5.514002
{ "github_metadata": { "branch": "main", "commit_count": 172, "repo_created_at": "2025-02-09T18:09:12.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66dbbdab47...
064a3cde-e021-4b81-af30-1eafded22a66
tsumehashi/blogpost
20210926/main.cpp
#include <iostream> #if __has_include(<coroutine>) #include <coroutine> #else #include <experimental/coroutine> #define USE_EXPERIMENTAL_COROUTINE #endif #include <memory> #include <chrono> #include <thread> #include <algorithm> #include <vector> #include <deque> #include <Eigen/Core> // Eigen 3.4> #include <Eigen/Ge...
ALGO
0.994998
4.90576
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2021-08-28T09:21:36.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "98c7bb3568...
47f9376c-511e-470c-9af3-b9c82c39de04
rrahulgupta098/C-
palindromeLLMArch30.cpp
#include<iostream> using namespace std; class node{ public : int data; node* next; node(int d){ data=d; next=NULL; } }; void insertatTail(node* &head,int data){ node *newnode = new node(data); if(head==NULL){ head=newnode; return; } node * temp=head; while(temp->next!=NULL){ temp=temp->next; } temp->next=newno...
ALGO
0.999887
4.234509
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2023-03-16T08:54: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": "e97bcc92b3...
7624728d-62be-46e5-a1e6-1f271ef8f3a5
feukiceldin/programiranje
III/Matrice/M4/DZ/Zadatak 2/main.cpp
#include <iostream> using namespace std; int main(int argc, char** argv) { double a, b, c, d, e, f; cout << "Program za rjesavanje sistema jednacina u formi:\nax + by = e\ncx + dy = f\n"; cout << "Unesite a, b, c, d, e, f: "; cin >> a >> b >> c >> d >> e >> f; double dd = a*d - b*c; if (dd == 0){ cout...
ALGO
0.99935
3.524313
{ "github_metadata": { "branch": "main", "commit_count": 48, "repo_created_at": "2022-10-27T16:20:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "39947ef8bb5...
2212dc10-8697-49e6-bb29-14a5e1cbbce1
SamPusegaonkar/ComputationalGeometry
convexHull/grahamAlgo/src/main.cpp
#include <iostream> #include <cmath> #include "../include/Polygon.h" #include "../include/matplotlibcpp.h" namespace plt = matplotlibcpp; int main( ) { //Read the input file std::string file; std::cout << "Type the filename & press enter! (Example: test_case.txt) "; std::cin >> file; std::str...
ALGO
0.993717
4.792189
{ "github_metadata": { "branch": "main", "commit_count": 102, "repo_created_at": "2021-11-19T15:26:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b075dd4665...
0c87ef66-7e69-4c11-bbda-2c84382bcbfc
happyheroboy/Contact-based-Registration
C++/solver_pose.h
#pragma once #include "config.h" #include "Data.h" #include "track_points_KF.h" class solver_pose { public: struct modelPts { vector<Vec4d> fPts; // 模型的特征点 vector<Vec4d> keyPts; // 模型的关键点 }; // 特征观测情况【模型角度】 struct model_info { int ob_num; // 有效观测的数目,即cam_fList中有效特征点的总数 vector<vector<Vec3...
ALGO
0.994882
5.239941
{ "github_metadata": { "branch": "master", "commit_count": 10, "repo_created_at": "2024-09-30T03: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": "6f5892ffe...
6368b455-04d5-43f3-ac94-dd5b765e750b
andrewtrotman/ATIRE
source/ranking_function_lmds.h
/* RANKING_FUNCTION_LMDS.H ---------------------- */ #ifndef RANKING_FUNCTION_LMDS_H_ #define RANKING_FUNCTION_LMDS_H_ #include "ranking_function.h" /* u=2500 is in the Petri et al (ADCS 2013) paper, I have no idea where they got it from. */ #define ANT_RANKING_FUNCTION_LMDS_DEFAULT_U 2500.0 /* class ANT_RANKING...
ALGO
0.996218
5.270942
{ "github_metadata": { "branch": "master", "commit_count": 2141, "repo_created_at": "2020-08-02T23:51:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3115c2d...
95d3a263-f2f0-454d-a097-b0868ffc6d60
BIGBALLON/NCTU_TCG
FIb2584_EVAL_AI/Fib2584/GameBoard.cpp
#include "GameBoard.h" const int GameBoard::fibonacci_[32] = {0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309}; Random GameBoard::random_; GameBoard::GameBoard(): board_(0) { } void Game...
ALGO
0.986828
4.453976
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2017-04-30T09:36:00.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0d8ab735d...
1ff92086-6561-40ed-92b0-a4818e85deee
mwong4/ICS4U
Rand/MergeSort/main.cpp
/* Author: <NAME> Date Created:Feb 12, 2020 Date Updated:Feb 12, 2020 Purpose: Doing merge sort Source From ICS3U projects by <NAME> Srand based on time from Cplusplus.com: http://www.cplusplus.com/reference/cstdlib/srand/\ Stack Overflow page for inspiration on how to find nearest power of 2: https://stackoverflow.co...
ALGO
0.999864
5.262276
{ "github_metadata": { "branch": "master", "commit_count": 199, "repo_created_at": "2020-09-14T19:42:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2234073a...
da8c7ec5-3675-44c3-9259-2a3bf582ab98
Yuulis/AtCoderSolution_old
AtCoder/ABC/041~060/045/B.cpp
#include <bits/stdc++.h> #include <atcoder/all> #define all(x) (x).begin(), (x).end() #define fix(x) fixed << setprecision(x) constexpr auto PI = 3.14159265358979; constexpr auto INF = 1e+9; constexpr auto INFL = 1LL << 60; using namespace std; using namespace atcoder; using ll = long long; using lld = long double; ...
ALGO
0.999942
4.343068
{ "github_metadata": { "branch": "main", "commit_count": 445, "repo_created_at": "2021-08-19T01:43:21.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "e226bed2de...
7a8019b9-7838-4e88-9f3e-cb2448b8aa46
alwzbright97/Cpp-practice
baekjoon/binary_search/lower_and_upper_bound.cc
#include <algorithm> #include <iostream> constexpr int MAX = 200000; int N, C; unsigned int arr[MAX]; int lower_bound(int value) { int low = 0, high = N; int mid; while (low < high) { mid = (low + high) / 2; if (arr[mid] >= value) { high = mid; } else { low = mid + 1; } } retur...
ALGO
0.999989
4.517481
{ "github_metadata": { "branch": "master", "commit_count": 82, "repo_created_at": "2022-04-06T02:09: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": "43a79f1b1...
b424e2e1-beec-4ccd-8030-f2a6441ad1c7
vsallaberry/privgold-pandora
vegastrike/boost/1_28/boost/preprocessor/arithmetic/add.hpp
#ifndef BOOST_PREPROCESSOR_ARITHMETIC_ADD_HPP #define BOOST_PREPROCESSOR_ARITHMETIC_ADD_HPP /* Copyright (C) 2001 * <NAME> * http://www.housemarque.com * * Permission to copy, use, modify, sell and distribute this software is * granted provided this copyright notice appears in all copies. This * software is prov...
ALGO
0.982622
6.043048
{ "github_metadata": { "branch": "master", "commit_count": 159, "repo_created_at": "2021-12-23T23:43:46.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4318e6e9...
a8dfb1af-2c73-4b0d-9ba0-3f1cfa5ddb24
oxygen-hunter/Flashboom
data/big-vul-100/add_attention_code/Phi/top0-100/minimum-cost-to-buy-apples-Solution.minCost/177767_DoS.cpp
static bool decode_openldap_dereference(void *mem_ctx, DATA_BLOB in, void *_out) { void **out = (void **)_out; struct asn1_data *data = asn1_init(mem_ctx); struct dsdb_openldap_dereference_result_control *control; struct dsdb_openldap_dereference_result **r = NULL; int i = 0; if (!data) return false; control = ...
ALGO
0.978709
3.38462
{ "github_metadata": { "branch": "main", "commit_count": 4, "repo_created_at": "2025-03-22T14:39:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "178838ee1d63...
65200081-4584-4c15-bcf1-7b5b620f87ea
okuchap/cppAlgo
15C.cpp
#include<cstdio> #include<iostream> #include<cmath> using namespace std; struct Point{double x, y;}; void koch(int n, Point a, Point b){ if(n==0) return; Point s,t,u; double th = M_PI * 60.0 / 180.0; s.x = (2.0*a.x + 1.0*b.x) / 3.0; s.y = (2.0*a.y + 1.0*b.y) / 3.0; t.x = (2.0*b.x + 1.0*a.x)...
ALGO
0.99989
3.694378
{ "github_metadata": { "branch": "master", "commit_count": 6, "repo_created_at": "2016-10-19T06:12: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": "b040c6430e...
848aa366-14a2-4518-b152-db2ea598349e
R-fzx/code
contest/20221013/source/fzx/simple/simple.cpp
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <vector> #ifndef ONLINE_JUDGE #define debug(...) fprintf(s...
ALGO
0.999888
3.973056
{ "github_metadata": { "branch": "master", "commit_count": 122, "repo_created_at": "2021-11-07T12:57:29.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b259026a...
fdf03200-7db8-4b4c-995d-5c86a8b13965
SanctusAnimus/aoc_2023
aoc_2023/day_9.hpp
#ifndef AOC_DAY_9 #define AOC_DAY_9 #include "solution.hpp" #include <array> #include <cstdint> #include <algorithm> #include <execution> #include <numeric> class Day9 : public Solution<Day9> { public: Day9() { day_num = 9; // 1757008019 - 995 p1_expected = 1757008019; p2_expected = 995; resolve_bench...
ALGO
0.99966
6.186974
{ "github_metadata": { "branch": "master", "commit_count": 25, "repo_created_at": "2023-11-29T15:39:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "14d29444d...
7ba40cd7-1c53-4a63-8b0a-1fd56f1099f4
AlgebroHeavyGuns/Programming
Basics/17_CoeficientesParabola.cpp
/* (C)Algebro. Haciendo uso de un vector para almacenar los coeficientes a,b,c; calcular el valor de f(x) = a*x^2 + b*x + c para diferentes valores prefijados de X. Haciendo uso de una funcion CalcularF(coeficientes[3], X). */ #include <iostream> using namespace std; double Calcular_F(double coeficientes[3]...
ALGO
0.999336
4.596382
{ "github_metadata": { "branch": "master", "commit_count": 74, "repo_created_at": "2018-07-09T08:22:44.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "32628bc2d...
0d0c11a7-5e89-48f0-b1fe-d0a95bc416cf
Jhonathan-Pizarra/Cpp
Programas/11_operaciones_punteros.cpp
#include <iostream> using namespace std; /* * Operador de dirección (&): devuelve la dirección de memoria de su operando. * Operador de contenido de (o desreferencia) (*): devuelve el valor de la variable ubicada en la dirección especificada por su operando. */ /* * El asterisco (*) se usa para declarar un puntero...
ALGO
0.980625
4.141367
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2020-12-02T00:22: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": "7a156003762d...
e94217dc-832a-4ea9-8e0a-d52623c12419
yeye921/Algorithm-cpp
Baekjoon/Review/week2/2852_1.cpp
// 문자열을 숫자로 바꾸는 법: stoi(문자열) // 삼항연산자: num2 == num1 ? a++ : b++ #include <bits/stdc++.h> using namespace std; #define prev aaa #define time bbb int n, A, B, asum, bsum; string team, time, prev; void print(int sum){ int min = sum / 60; int sec = sum % 60; // 10보다 작을때만 처리해주면 됨 string m = ""; string s ...
ALGO
0.999594
4.06879
{ "github_metadata": { "branch": "main", "commit_count": 433, "repo_created_at": "2022-09-27T06:40:09.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "acfed229f0...
a80d503a-c0c1-487b-98af-faa45b591e55
SakshamJr/Numerical-Methods-Lab
lab_07_integration.cpp
#include <iostream> #include <cmath> using namespace std; double f(double x) { return x * exp(x); } void trapezoidal(double x0, int n, double h) { cout << endl << "Trapezoidal: "; double sum = 0; double x; for (int i = 1; i < n; i++) { x = x0 + i * h; sum += f(x); ...
ALGO
0.999878
5.159323
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2024-03-16T08:40:20.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f67ac9ebb0eb...
9e640f6f-6407-49ac-a83e-881251667f73
dengyufan2008/code
History/LuoGu/P2466.cpp
#include <algorithm> #include <ctime> #include <iomanip> #include <iostream> #define LL long long using namespace std; struct V { LL x, y, v; } v[1001]; LL n, s, tot, f[1001][1001][2]; int main() { cin >> n >> s; for (LL i = 1; i <= n; i++) { cin >> v[i].x; } for (LL i = 1; i <= n; i++) { cin >> v[...
ALGO
0.999817
4.386016
{ "github_metadata": { "branch": "master", "commit_count": 1775, "repo_created_at": "2021-09-21T09:26:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "027ec05...
9812d247-7d8a-4751-a71f-ed9e84cb6bc0
AdemHodzic/Pripreme-za-takmicenje
Joker/main.cpp
#include <iostream> #include <cstdlib> #include <string> using namespace std; void solve(int dobitniBroj[], int igrac); int main() { //1. Unijeti kuglice i izracunati dobitni joker broj //2. Unijeti listice i njihove joker brojeve //3. pozvati funkciju da isprinta dobitke int kuglice[6]; for(int ...
ALGO
0.999832
4.13495
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2018-04-09T07:10: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": "e89f8c0d3...
e520eb29-2f4a-4502-817f-1f0e8a105c02
ketsueki33/LeetCode
169MajorityElement.cpp
#include <bits/stdc++.h> using namespace std; #define turbo \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); // https://leetcode.com/problems/majority-element/ // https://www.youtube.com/watch?v=nP_ns3uSh80 class Solution { public: int majorityElement(vector<int>& nums) { ...
ALGO
0.999955
5.015505
{ "github_metadata": { "branch": "master", "commit_count": 31, "repo_created_at": "2023-09-07T21:32:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "6b00ee39a...
6255ff22-3dbd-4f84-845b-044be3301339
tensorflow/tensorflow
third_party/xla/xla/tsl/platform/cloud/expiring_lru_cache.h
/* Copyright 2017 The TensorFlow Authors. 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 law or a...
TOOL
0.942507
7.876016
{ "github_metadata": { "branch": "master", "commit_count": 182413, "repo_created_at": "2015-11-07T01:19:20.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 190773, "forks": 74758, "issues": 873, "pull_requests": 553 }, "file_meta": { "content...
929231d4-e9b4-4303-b764-07e2caaa800c
manakupadhyay/LeetCode
Array/Find Unique.cpp
/* You have been given an integer array/list(ARR) of size N. Where N is equal to [2M + 1]. Now, in the given array/list, 'M' numbers are present twice and one number is present only once. You need to find and return that number which is unique in the array/list. Sample Input 1: 1 7 2 3 1 6 3 6 2 ANS: 1 */ int fin...
ALGO
0.999792
4.414007
{ "github_metadata": { "branch": "master", "commit_count": 28, "repo_created_at": "2020-06-13T11:46:48.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5b3e7d132...
883d0619-d0ae-482f-b575-e3fd02228ce6
we8809/Project-CPP
0. 과제/C++ Other Codes/C++ Other Codes/ass4/BinarySearchTree.h
#pragma once #include <memory> #include <vector> namespace assignment4 { template <typename T> class TreeNode; template <typename T> class BinarySearchTree final { public: void Insert(std::unique_ptr<T> data); bool Search(const T& data); bool Delete(const T& data); const std::weak_ptr<TreeNode<T>> GetR...
ALGO
0.999498
5.905043
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2021-05-28T11:27: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": "b43892ee664e...
8526f38c-263c-4cc4-b91d-e68ef265c47d
Rajesh0901-sudo/CPP
hybride inhr/main.cpp
#include <iostream> #include<math.h> using namespace std; class first { protected: int p[3]; public: void getp() { cout<<"enter three point a-"; for(int i=0;i<3;i++) { cin>>p[i]; } } }; class second : public first { protected: int q[3]; public: void ...
ALGO
0.999745
5.130508
{ "github_metadata": { "branch": "master", "commit_count": 1, "repo_created_at": "2021-09-30T18:49: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": "9b8aeeb59d...
14ab4c0b-3651-492d-9889-ac3af78738bf
loisaidasam/adventofcode
2021/day21/solution.cpp
#include <iostream> using namespace std; int solution1() { // Example: // int positionA = 4; // int positionB = 8; // Real int positionA = 3; int positionB = 7; int scoreA = 0; int scoreB = 0; int diceCount = 0; int roll; while (true) { // Player A roll = ...
ALGO
0.999826
3.680057
{ "github_metadata": { "branch": "master", "commit_count": 200, "repo_created_at": "2015-12-03T21:18: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": "40319fab...
6f90e872-b8d5-42a7-bd0f-855589408f86
Srushtii10/dsacode
practical5 expression tree.cpp
#include<iostream> #include<stack> using namespace std; struct node { char data; node* l = NULL; node* r = NULL; }; class tree { public: int i; int n; char* arr; node* root; tree() { root = NULL; } void create() { cout << "Enter the number of ex...
ALGO
0.999776
5.085671
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2025-05-03T14:35: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": "7fbe2ee57695...
c310e448-8cbf-4998-9a50-9f6d8e3049bc
Delpro-Club/Programming-Code
Hackerrank/Seperate the numbers.cpp
#include<bits/stdc++.h> using namespace std; int main() { int num; cin >> num; std::vector<string> vec(num); for(int i = 0; i < num; ++i) { cin >> vec[i]; } for(int i = 0; i < num; ++i) { string str = vec[i]; // one input at a time string temp = ""; ...
ALGO
0.999995
3.520015
{ "github_metadata": { "branch": "master", "commit_count": 9, "repo_created_at": "2015-10-19T13:41:47.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 0, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "36505a31c4d...
ae53b2f8-7aa0-45d4-b066-db8880cb47e6
Yawn-Sean/Daily_CF_Problems
daily_problems/2024/07/0726/personal_submission/cf1660e_retyrn.cpp
int n; void solve() { cin >> n; vector<string> g(n); cin >> g; // 只需要记录对角线上的1的个数 int sum = 0; for (auto& s : g) { for (auto& c : s) { sum += (c == '1'); } } vector<int> cnt(n * 2); auto cal = [&]() { int mn = (n + sum - cnt[n] * 2); ...
ALGO
0.999925
4.055363
{ "github_metadata": { "branch": "main", "commit_count": 20410, "repo_created_at": "2024-02-26T01:04:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 478, "forks": 302, "issues": 0, "pull_requests": 7 }, "file_meta": { "content_id": "77e3...
2e9953a4-16e3-4a67-ba88-bb8edb693599
afentev/Algorithms-and-Data-structures
Algorithms on graphs/LCA and LA/Macro-Micro-Tree Algorithm.cpp
#include <iostream> #include <vector> #include <cmath> #include <stack> using namespace std; // solution for https://leetcode.com/problems/kth-ancestor-of-a-tree-node/ // this problem has weak tests. the solution for the problem with more solid tests provided below class TreeAncestor { public: TreeAncestor(int n,...
ALGO
0.999992
5.452097
{ "github_metadata": { "branch": "main", "commit_count": 122, "repo_created_at": "2021-10-19T18:08:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 2, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "14280d495a...
aeb0062d-a5bb-4782-b5a7-ce370528e328
ArtSynen/Practice_Work
Pract5 Vpr 9/Pract5 Vpr 9.cpp
#include <iostream> using namespace std; int main() { int row, col, ret, l, ch = 0; cout << "Enter row = "; cin >> row; cout << "Enter column = "; cin >> col; int** Numb = new int*[col]; int* sum = new int[col]; for (int i = 0; i < col; i++) { Numb[i] = new int [row]; } ...
ALGO
0.999429
3.679155
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2023-05-23T16:56:16.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f61284b2b4bb...
f262dbae-d03c-42e3-9ace-200b5f7b4f5c
OpenSourceRisk/Engine
QuantExt/qle/cashflows/averageonindexedcoupon.cpp
/* Copyright (C) 2016 Quaternion Risk Management Ltd All rights reserved. This file is part of ORE, a free-software/open-source library for transparent pricing and risk analysis - http://opensourcerisk.org ORE is free software: you can redistribute it and/or modify it under the terms of the Modified BSD License...
TOOL
0.941414
7.121421
{ "github_metadata": { "branch": "master", "commit_count": 24865, "repo_created_at": "2016-10-07T09:15:00.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 567, "forks": 245, "issues": 58, "pull_requests": 7 }, "file_meta": { "content_id": "74...
1500b7ef-c06a-4cb0-81e7-b3ea663581ee
Denver17/Algorithms_Exercise
挑战程序设计竞赛/2.2_贪心算法/练习1_区间贪心/297_隔间预定.cpp
#include<iostream> #include<cstdio> #include<vector> #include<queue> #include<stack> #include<map> #include<set> #include<cmath> #include<stdlib.h> #include<algorithm> using namespace std; const int INF = 1e7 + 10; struct cow{ int ID, room; int s, t; }; struct node{ int id, _time; }; vector<cow> vec; b...
ALGO
0.999997
3.777317
{ "github_metadata": { "branch": "main", "commit_count": 2, "repo_created_at": "2022-06-12T14:30:15.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5059583748d3...
503d841b-447d-40d5-b680-8e5cf24ed967
micmacIGN/micmac
src/neighboor/neigh_general.cpp
/*Header-MicMac-eLiSe-25/06/2007 MicMac : Multi Image Correspondances par Methodes Automatiques de Correlation eLiSe : ELements of an Image Software Environnement www.micmac.ign.fr Copyright : Institut Geographique National Author : <NAME> Contributors : <NAME>, <NAME>. [1] <NAME>, <NAM...
TOOL
0.939762
5.857371
{ "github_metadata": { "branch": "master", "commit_count": 10879, "repo_created_at": "2016-11-24T22:09:54.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 785, "forks": 163, "issues": 83, "pull_requests": 30 }, "file_meta": { "content_id": "f...
a1e2e01d-98f2-4667-9394-959915e405ed
ishaan0/Competitive-Programming
Online Judge Submission/Uva/11565.cpp
#include<bits/stdc++.h> using namespace std; /* #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds ; template <typename PB> using ordered_set = tree<PB,null_type,less<PB>,rb_tree_tag,tree_order_statistics_node_update> ; */ #define Boost ios::sync...
ALGO
0.999968
4.251884
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2022-09-08T16:21:23.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 2, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bb3af0fab51b...
06b87576-43d1-4f3e-a25c-4ddc53326d94
CoronaEngine/Vision
src/render_core/denoiser/SVGF/filter_moments.cpp
// // Created by Zero on 2024/2/15. // #include "filter_moments.h" #include "svgf.h" namespace vision::svgf { void FilterMoments::prepare() noexcept { } void FilterMoments::compile() noexcept { Kernel kernel = [&](Var<FilterMomentsParam> param) { Float history = param.history_buffer.read(dispatch_id());...
ALGO
0.956281
6.048113
{ "github_metadata": { "branch": "master", "commit_count": 5650, "repo_created_at": "2022-08-26T08:15:05.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 41, "forks": 7, "issues": 1, "pull_requests": 0 }, "file_meta": { "content_id": "47df4e2...
7ef780cb-4662-44d6-a28e-90b236d24ca9
yuforest/contests
hhkb_programming_contest_2020/c/main.cpp
// ここは競プロではサボりがちです #include <bits/stdc++.h> using namespace std; // デバッグ用マクロです。詳しくは https://naskya.net/post/0002/ #ifdef LOCAL #include <debug_print.hpp> #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast<void>(0)) #endif // 節操ないですが、競プロでは便利です。 using ll = long ...
ALGO
0.999939
4.66187
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2022-06-03T05:09:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "0a141abd8...
c03a0c12-312e-41b9-83eb-3c5ee99d6bfc
RachithP/planning-in-robotics
dp-with-mms/cpp_code/src/DFSAlgorithm/dfsalgorithm.cpp
#include "dfsalgorithm.h" #include "../API/api.h" #include "../Direction/direction.h" #include <algorithm> /** @brief Constructor of the class DFSAlgorithm * @details Calls base class constructor * @param maze_ptr pointer to the array of maze representing each cell in the maze * @return void */ fp::DFSAlgorithm::DF...
ALGO
0.999924
4.959557
{ "github_metadata": { "branch": "master", "commit_count": 54, "repo_created_at": "2019-04-03T04:26:43.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "361f52ca9...
bb481070-898f-41d7-82d1-d303ba28b208
mikemask/SimpleViscoSolver
forces_bond_kelvin.h
void forces_bond_kelvin(Bond *bond, Part parti, Part partj, double kn, double ks, double mun, double mus, double dt, int i) { double *omi, *omj; double *posi, *posj, *veli, *velj; double *posi_in, *posj_in; double radius, *inertia, area; double *fn, *fs, *tn, *ts; /*Getting bond values*/ f...
ALGO
0.993442
5.00816
{ "github_metadata": { "branch": "main", "commit_count": 3, "repo_created_at": "2021-01-11T16:07: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": "dd0edc172b8a...
05700951-7c23-4b56-96dd-d77b1bb546a9
HNSharma-07/DSA-in-Cpp
Recursion/031-1_Recursion.cpp
// Recursion : when a functions calls itself is called recursion (badi problem ko chhoti problem me tod sake to recursion use kar sakte hai) // recusive relation : make formula // base case : when we have to stop. base case (return value) is mendetory because without it function will be called infinite time due to thi...
ALGO
0.999911
5.091999
{ "github_metadata": { "branch": "main", "commit_count": 14, "repo_created_at": "2023-02-28T12:50:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 8, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2d942e28ecb...
edc75ace-e06a-48dc-89f3-b0ce7e324ecc
shyu61/program-competition
code/contest/abc410/e.cpp
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) void chmax(int& a, int b) { a = max(a, b); } // 🔷初見でどうやったら解けるか // 組合せ最適化問題。過去の選択に累積的に依存するのでdpを考える // まずは素直に立式してみる。「dp[i番目まで見た時][体力残りがj][魔力の残りがk]:=true/false」 // これだとO(nhm)でTLE。値がbool値の場合は勿体無いので他の情報に置き換えられないか考える。 // true/fal...
ALGO
0.99997
3.720242
{ "github_metadata": { "branch": "main", "commit_count": 719, "repo_created_at": "2024-08-14T11:39:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f5f8174241...
d456bea5-855e-4774-a1b6-5bb44ac94290
wang12d/Project-Euler
pe320.cpp
#include <iostream> #include "pe_algs.h" #include <string.h> #define max(x, y) ((x) > (y)) ? (x) : (y) const long neg = 1L << 63; const long m = (~0 ^ neg); const int n = 1000000; const long mod = 1000000000000000000L; long res [1+n]; std::vector<int> primes; long cons = 1234567890L; long pot(long n, int p) { lon...
ALGO
0.999719
3.411911
{ "github_metadata": { "branch": "master", "commit_count": 5, "repo_created_at": "2019-12-16T13:07: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": "4bce459d87...
8907e4d2-64b3-4b40-aca9-d29589a13521
paradise-fi/RoFI
softwareComponents/torqueComputation/src/traverseRofiWorld.cpp
#include "traverseRofiWorld.hpp" #include <torqueComputation/compute.hpp> #include <configuration/joints.hpp> using namespace rofi::torqueComputation; using namespace arma; vec3 getRoficomPosition(const rofi::configuration::Component& roficom) { vec translateOrigin{-0.5, 0, 0, 1}; auto position = roficom.getP...
ALGO
0.981053
7.458517
{ "github_metadata": { "branch": "master", "commit_count": 1191, "repo_created_at": "2018-12-04T12:26:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 42, "forks": 10, "issues": 52, "pull_requests": 11 }, "file_meta": { "content_id": "0b5e...
3728f8d1-b029-44ab-9dfa-908b3cfdf45e
Thalisson-Alves/Competitive-Programming
code/math/fft.cpp
template <bool invert=false> void fft(vector<complex<double>> &a, const vector<int> &rev) { const static double pi = acos(-1); const int n = (int)a.size(); for (int i = 0; i < n; i++) if (i < rev[i]) swap(a[i], a[rev[i]]); for (int len = 2; len <= n; len <<= 1) { double angle = 2 * pi / len * (invert ? -1 :...
ALGO
0.999928
6.006258
{ "github_metadata": { "branch": "main", "commit_count": 1114, "repo_created_at": "2023-05-15T00:16:37.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 7, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "abe4c2885...
770f921e-4e38-4804-941a-7ca13287c8d0
PatelManav/Codeforces_Backup
433B.cpp
/*May The Force Be With Me*/ #include <bits/stdc++.h> #include <stdio.h> #include <ctype.h> #define ll long long #define MOD 1000000007 #define endl "\n" #define vll vector<long long> #define pll pair<long long, long long> #define all(c) c.begin(),c.end() #define f first #define s second #define inf INT_MAX #define siz...
ALGO
0.999665
5.002926
{ "github_metadata": { "branch": "master", "commit_count": 98, "repo_created_at": "2020-10-01T14:54: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": "43d67d6de...
bd37974e-6479-43bd-98b5-8efd4e29cf95
MasterMind90/cppractice
atcoder/abc159/D.cpp
#ifndef LOCAL #pragma GCC optimize("O3") #endif #include "bits/stdc++.h" using namespace std; #define sim template < class c #define ris return * this #define int long long #define dor > debug & operator << #define eni(x) sim > typename \ enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) { sim > struct rg...
ALGO
0.999953
3.671355
{ "github_metadata": { "branch": "master", "commit_count": 1713, "repo_created_at": "2021-01-12T19:00: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": "3eab5bb...
bb5fde79-0ff4-4b93-9be0-0fc12d75b1e5
li4097/objtest
src/binarytree/binarytree.h
/* * binarytree.h * Copyright (C) 2019 LQ <<EMAIL>> * * Distributed under terms of the MIT license. */ #ifndef BINARYTREE_H #define BINARYTREE_H #include "utility.h" template<class T> struct Node { Node(const T& data,uint8_t height) :data(data), height(height+1), left(nullptr), right(nullptr) {} Node...
ALGO
0.999719
5.042985
{ "github_metadata": { "branch": "master", "commit_count": 12, "repo_created_at": "2019-04-24T13:53: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": "79f3c246d...
0e49eba7-337f-45f0-8404-a857c2aabcd0
WLSTLA/DataStructureLearning
5.Graph/MinPath_BFS.h
#pragma once #include<iostream> #include<queue> /* 使用BFS求最短路径。但这种方法只能求无权图的单源最短路径 */ class MinPathBFS { public: void CreateMinPathBFS(int(*inEdges)[5]) { _edges = inEdges; memset(_visited, 0, 5); for (size_t i = 0; i < 5; ++i) { _minDis[i] = 0; } for (size_t i = 0; i < 5; ++i) { _path[i] = 0; } }...
ALGO
0.99975
4.178839
{ "github_metadata": { "branch": "master", "commit_count": 17, "repo_created_at": "2021-12-12T02:28:22.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "c42331328...
a4753222-0278-45d8-9f10-c0ff818a5e9d
earthboom/CodingTest_Study
CodingTest/Solutions/diskcontroler.h
#pragma once #include "stdafx.h" // 프로그래머스 - Lv 3 // 힙 ( Heap ) // 디스크 컨트롤 //====================================================================================== //====================================================================================== class disk_cmp { public: bool operator()(vector<int>& a, ve...
ALGO
0.999922
4.690947
{ "github_metadata": { "branch": "master", "commit_count": 11, "repo_created_at": "2020-08-29T08:10: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": "5e2ad2eb3...
8d604340-f08a-414f-875c-cd9602df382b
Deeplearning-JorD/DAIMA
2023杭电多校/第四场/1012.cpp
#include <bits/stdc++.h> using namespace std; using ll = long long; using db = double; #define endl '\n' #define PII pair<ll, ll> #define siz(s) (ll)(s.size()) #define all(a) a.begin(), a.end() #define all1(a) a.begin() + 1, a.end() #define priq priority_queue #define SPO(n) fixed << setprecision(n) #define rep(i, l, r...
ALGO
0.999936
3.955678
{ "github_metadata": { "branch": "main", "commit_count": 6, "repo_created_at": "2023-12-26T13:33: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": "6a7ed974482f...
675b0cc7-478e-4e45-819b-71e1088e7ba3
ilaunchmoon/DesignMode
DataStructure/ThreadedBTree.cpp
// // Created by iCuriosity on 2024/8/1. // #include "ThreadedBTree.h" namespace DataStructure { template<typename T> typename ThreadedBTree<T>::ThreadedBNodePtr ThreadedBTree<T>::CreateCompleteTree(int start, int end, const std::vector<T> &values) { if(start > end) return nullptr; ...
ALGO
0.989379
6.004443
{ "github_metadata": { "branch": "main", "commit_count": 155, "repo_created_at": "2024-03-17T05:15:53.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "b741159976...
fb02f593-61b2-4c51-8991-02a05f873e73
Lihit/LeetCode
Medium/18.4sum.cpp
/*Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: The solution set must not contain duplicate quadruplets. For example, given array S = [1, 0, -1, 0, -2, 2], and target = 0. A soluti...
ALGO
0.999831
5.582617
{ "github_metadata": { "branch": "master", "commit_count": 21, "repo_created_at": "2017-09-30T06:36: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": "43788d3f7...
ec756991-7087-4ec7-b57d-d0233cbf8437
ishandutta2007/codeforces-p
pranjal.ssh/normal/685/B.cpp
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> // #include <sys/resource.h> using namespace std; using namespace __gnu_pbds; #define INF 1000000007 typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> ordered_set; typedef long...
ALGO
0.999816
3.956446
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:49:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "993026a90e01...
b0d19296-b5c8-436d-999c-e2320d5d409a
salim002/Cpp-Codes
52_Codeforces/17_Codeforces 3/90_pursuit.cpp
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<ld> vd; #define fi first #define se second #define mp make_pair #define pb push_back const int mod = 1000000007; #define all(x) x.be...
ALGO
0.999969
3.435439
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2023-12-11T13:47: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": "54a528e9fd...
b53eb305-d744-4acd-8801-21e7fdeb8ea7
ernestognw/Teampp
examples/functions/sort.tpp
program find_test; vars i, max, qty : int; vars array[100] : int; void function readArray(length : int); vars i : int; { for(i = 0; i < length; i = i + 1) { read(array[i]); } } void function printArray(length : int); vars i : int; { for(i = 0; i < length; i = i + 1) { write(array[i]); } } void func...
ALGO
0.988917
4.011688
{ "github_metadata": { "branch": "main", "commit_count": 120, "repo_created_at": "2021-04-10T04:11: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": "73f908891e...
66f3f0f1-0997-4507-825b-bbeab8926eeb
Kang-il/TIL
brute_force/bf_ex24.cpp
#include <iostream> #include <vector> #include <algorithm> #define INT_MAX 2147483647 int W[10][10]; int main(){ std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); //(10971) //외판원 순회2 // TSP(Traveling Salesman Problem) -- CS분야에서 가장 중요하게 취급되는 문제 중 하나이다. // ...
ALGO
0.999961
4.192601
{ "github_metadata": { "branch": "develop", "commit_count": 185, "repo_created_at": "2021-12-15T05:36:55.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "3e48eee...
a86aa5fd-d04b-4e87-8d43-d81c27561f1f
alecland/CG
Training/MarsLanderEp2.cpp
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; #define YMAX_SPEED 40.0 #define XMAX_SPEED 20.0 #define GRAVITY -3.711 /** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. **/ int main() { int surfa...
ALGO
0.999533
4.247053
{ "github_metadata": { "branch": "master", "commit_count": 80, "repo_created_at": "2016-12-08T10:59:39.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "05e62ef7c...
1a9e75a7-5f90-444c-846e-8aeac3c5dd3f
kotturtech/OpenCLRayTracer
OpenCLRayTracer/BuildUtils/FileToStringUtility/FileToStringUtility/sk.cpp
const char* stringkrnl = "\// Sort kernels \// EB Jun 2011 \ \#if CONFIG_USE_VALUE \typedef uint2 data_t; \#define getKey(a) ((a).x) \#define getValue(a) ((a).y) \#define makeData(k,v) ((uint2)((k),(v))) \#else \typedef uint data_t; \#define getKey(a) (a) \#define getValue(a) (0) \#define makeData(k,v) (k) \#endif \ \/...
ALGO
0.999985
4.00481
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2016-06-27T08:32:45.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 2, "issues": 2, "pull_requests": 0 }, "file_meta": { "content_id": "09e69e6828...
6e51d9dc-50fc-480e-8883-4fd04b787d80
pangtao22/quasistatic_simulator
quasistatic_simulator_cpp/diffcp/qp_derivatives.cc
#include "diffcp/qp_derivatives.h" #include <cmath> #include <iostream> #include <unsupported/Eigen/KroneckerProduct> // NOLINT #include "drake/common/drake_assert.h" using Eigen::MatrixXd; using Eigen::VectorXd; void QpDerivativesBase::CheckSolutionError(const double error, const double tol, ...
ALGO
0.995861
7.760243
{ "github_metadata": { "branch": "main", "commit_count": 198, "repo_created_at": "2020-08-14T05:25:08.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 41, "forks": 7, "issues": 8, "pull_requests": 2 }, "file_meta": { "content_id": "30824b155...
d1ae1083-d518-41e2-ae9c-374fd1bd36f1
ompl/ompl
src/ompl/multilevel/datastructures/pathrestriction/FindSectionSideStep.h
/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2020, * Max Planck Institute for Intelligent Systems (MPI-IS). * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, ar...
ALGO
0.999626
6.494878
{ "github_metadata": { "branch": "main", "commit_count": 4948, "repo_created_at": "2014-05-20T14:22:59.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1776, "forks": 636, "issues": 80, "pull_requests": 28 }, "file_meta": { "content_id": "21a...
abb6d93f-6c05-411e-8b9e-0210deba0560
E-M-Bailey/competitive_programming
codeforces/unsolved/1980/D.cpp
#include <bits/stdc++.h> using namespace std; #define sz(C) (int(size(C))) #define all(C) begin(C), end(C) void go(); int main(int argc, char const *argv[]) { if (argc > 1) { ignore = freopen(argv[1], "r", stdin); ignore = freopen(argv[2], "w", stdout); } cin.tie(0)->sync_with_stdio(0); int tc = 1; cin ...
ALGO
0.999968
4.253152
{ "github_metadata": { "branch": "main", "commit_count": 548, "repo_created_at": "2022-12-09T02:31:14.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "5704fcd6fd...
b1d543ed-22d5-4868-a031-db38399b27a9
gsscsd/Code_Training
niuke/字符串/把字符串转换成整数.cpp
/** 题目描述 将一个字符串转换成一个整数(实现Integer.valueOf(string)的功能,但是string不符合数字要求时返回0), 要求不能使用字符串转换整数的库函数。 数值为0或者字符串不是一个合法的数值则返回0。 输入描述: 输入一个字符串,包括数字字母符号,可以为空 输出描述: 如果是合法的数值表达则返回该数字,否则返回0 */ /** 解题思路 */ #include <iostream> #include <string> #include <cstring> using namespace std; class Solution { public: int StrToInt(strin...
ALGO
0.9998
4.754447
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2018-09-22T02:12: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": "1508af749a...
b7a760e3-65ed-43cd-a8bc-9b6b9d2e04d0
FabianDz/proyectosC-C-
SegundoProyecto/matriz.h
// Bibliotecas #include <string> using namespace std; // indef #ifndef MATRIZ_H_ #define MATRIZ_H_ // Clase Matriz class Matriz{ public: // Atributos int ordMat; // Orden de las matrices float **contMat; // Matriz // Constructor Matriz(){ ...
TOOL
0.92299
3.898005
{ "github_metadata": { "branch": "main", "commit_count": 13, "repo_created_at": "2022-09-18T18:40:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "ff5da9ca28a...
3e05d58d-1273-438f-bd23-3107c404483a
1337rave/labLIbaa
main.cpp
#include "library.h" #include <iostream> int main() { const char* str1 = "Hello, "; const char* str2 = "world!"; char buffer[50]; std::cout << "Length of str1: " << mystrlen(str1) << std::endl; mystrcpy(buffer, str1); std::cout << "Copied string: " << buffer << std::endl; mystrcat(buffer...
TOOL
0.985558
3.663397
{ "github_metadata": { "branch": "master", "commit_count": 3, "repo_created_at": "2023-11-13T18:35: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": "27a42c58a8...
6acedb51-3706-49a0-a03b-08c31878c068
sgwrld-999/Leetcode_POTD
14thOct2023/PaintingTheWallsMemoization.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: int minCost(vector<int>& cost, vector<int>& time, int index, int remain, int sizeOfCost, vector<vector<int> >& dp) { if (remain <= 0) return 0; // NO COST if (index >= sizeOfCost) return 1e9; // Invalid case as it's out of bound...
ALGO
0.999954
5.037479
{ "github_metadata": { "branch": "main", "commit_count": 57, "repo_created_at": "2023-10-14T04:18: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": "415159b0825...
5227c486-7e62-49f6-b31b-9e21da732bf0
ZHDXZZQ/Interview-Study
leetcode/最小基因变化.cpp
// 思路: bfs广度优先搜索, 时间Onm,空间Omn,其中m为基因库中基因序列的数量,n为基因序列的长度 // 1. 对起始的基因序列的每个基因变换可能得到的情况,在基因库中且之前没有得到过则记录,此时记录的一定是最少的变化次数得到的序列 // 2. 依序对每种已经得到的基因序列做上述变化,知道得到结果 // 3. 具体看注释,宽搜利用队列,每次得到的一定都是最小值 class Solution { public: int minMutation(string startGene, string endGene, vector<string>& bank) { int n = startGene.si...
ALGO
0.999928
4.800426
{ "github_metadata": { "branch": "master", "commit_count": 448, "repo_created_at": "2023-12-26T13:51:27.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 11, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "85547f4...
4b422d1f-6ba0-4274-9545-02903a26c01d
ksergey/vrt
vr/vr_rt/src/vr/market/books/limit_order_book_io.h
#pragma once #include "vr/market/books/limit_order_book.h" #include "vr/market/prices.h" // price_book_to_print #include <boost/format.hpp> #include <iterator> //---------------------------------------------------------------------------- namespace vr { namespace market { namespace md { //.............................
TOOL
0.927018
6.434603
{ "github_metadata": { "branch": "master", "commit_count": 2, "repo_created_at": "2019-09-09T15:46: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": "cfbc289ceb...
1bfe601d-8a9f-4bc9-841a-77cd3893f1a7
emost22/cpp-boj
dp/1749.cpp
#include <iostream> #include <algorithm> #define MAX 201 using namespace std; int dp[MAX][MAX]; int N, M; void func() { int ret = -10001; for (int sx = 1; sx <= N; sx++) { for (int sy = 1; sy <= N; sy++) { for (int ex = sx; ex <= N; ex++) { for (int ey = sy; ey <= N; ey++) { ret = max(ret, dp[ex][ey] ...
ALGO
0.999968
3.342703
{ "github_metadata": { "branch": "main", "commit_count": 3886, "repo_created_at": "2020-10-21T12:31: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": "fa21896ea...
26582bc1-d852-4971-8387-6961dec0ac5c
dinhvietcuong1996/CP
contests/abc409/abc409_b.cpp
#include <iostream> #include <vector> #include <limits> // numeric_limits<type>::max(), numeric_limits<type>::min() #include <string> #include <algorithm> // sort, max, min, reverse, swap #include <unordered_set> #include <unordered_map> #include <deque> #include <queue> #include <stack> #include <set> #in...
ALGO
0.999928
5.208174
{ "github_metadata": { "branch": "main", "commit_count": 17, "repo_created_at": "2025-05-30T22:35: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": "8fb80e059e3...
bf5718fd-5cf7-4ceb-b885-06306423ce77
ishandutta2007/codeforces-p
peti1234/normal/3/D.cpp
#include <bits/stdc++.h> using namespace std; string s; long long n, cnt, ans; priority_queue<pair<long long, int> > q; vector<int> p; int main() { cin >> s; n=s.size(); for (int i=0; i<n; i++) { if (s[i]=='(') cnt++; if (s[i]==')') cnt--; if (s[i]=='?') { long long a, b...
ALGO
0.999808
3.558469
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2024-10-30T15:49:24.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "bf3d0bb4dae2...
1844520e-8343-428b-8d10-cbd4a1dd5cf2
knockcat/AtCoder
AtCoder Beginner Contest 385/b.cpp
// <NAME> // KNOCKCAT #include <bits/stdc++.h> using namespace std; #define fast \ std::ios::sync_with_stdio(false); \ cin.tie(nullptr); #define int long long int #define endl "\n" typedef unsigned long long ull; typedef long long ll; typedef long double ld; const ll mod = 1e9 + 7; ...
ALGO
0.999975
5.127974
{ "github_metadata": { "branch": "main", "commit_count": 70, "repo_created_at": "2023-01-15T11:56:38.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "9fad6f3018e...
534881af-d9f6-4622-a0d9-909cf6951144
CMaybe/BOJ
1990.cpp
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; vector<int> v; bool visit[10001]; void func(int n) { string s = to_string(n); string t1 = s; string t2 = s; t1.pop_back(); reverse(t1.begin(), t1.end()); reverse(t2.begin(), t2.end()); if (s...
ALGO
0.999952
3.551227
{ "github_metadata": { "branch": "master", "commit_count": 399, "repo_created_at": "2019-02-20T06:34: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": "3e427bb6...
a5385a4b-422b-42b6-bf86-be84005b592f
Fluctuationqt/DataStructuresRandom
task3_2.cpp
#include <iostream> #include <unordered_map> #include <unordered_set> #include <list> #include <string> using namespace std; int main () { int n; cin >> n; unordered_map<string,int> names(n); unordered_set<string> prefixes(n); string name; bool renamed; for (int i = 0; i < n; i++) { ...
ALGO
0.999863
3.746039
{ "github_metadata": { "branch": "master", "commit_count": 23, "repo_created_at": "2018-01-20T14:23:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 0, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "66a0f5ee4...
7cbf6648-c900-4019-ae80-3314ca0d4156
sdpkjc/training
S_tra/19-08-02/a.cpp
#include <cmath> #include <cstdio> #include <iostream> #include <vector> using namespace std; const int MAX_N = 100005; const int k = 350; int n, m; vector<int> G[MAX_N]; long long kv[1000]; int dep[MAX_N] = {0}; int sqk[1000][MAX_N]; long long af[MAX_N]; vector<int> dfsl; pair<int, int> pa[MAX_N]; void dfs(int x, int...
ALGO
0.999968
4.349595
{ "github_metadata": { "branch": "master", "commit_count": 8, "repo_created_at": "2019-05-03T18:52:06.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 1, "forks": 0, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "2eaf6a2567...
3ab3afb6-8f6a-44a3-a33a-3b323b692eb4
jimmyacua/TP1-2018
ListaOrdArray.h
#ifndef TP1_LISTAORDARRAY_H #define TP1_LISTAORDARRAY_H #include <iostream> using namespace std; class ListaOrdArray { public: /*ListaOrdArray(); ~ListaOrdArray();*/ //EFE: Inicializa la lista //REQ: --- //MOD: lista void iniciar(); //EFE: destruye la lista //REQ: lista inicializad...
ALGO
0.925805
5.011771
{ "github_metadata": { "branch": "master", "commit_count": 101, "repo_created_at": "2018-05-11T19:03: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": "a9ec4685...
c2011e51-8315-45ff-96ce-b5d4141fa508
Dainerx/Competitive-programming
datastructures_implementation/CF459B.cpp
#include <algorithm> #include <vector> #include <iostream> #include <fstream> #include <string> #include <stdio.h> #include <cmath> #include <complex> #include <math.h> #include <string> #include <string.h> #include<ctype.h> #include <map> #include <set> using namespace std; #define MAX(a,b,c) max(a,max(b,c)) #define ...
ALGO
0.999913
3.414486
{ "github_metadata": { "branch": "master", "commit_count": 139, "repo_created_at": "2017-04-19T14:02:56.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 5, "forks": 1, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "32e5bfa8...
1c493aab-34a6-4f9e-86e1-5d40aeecddd4
francoVillalba26/practicas-en-C-parte-4
Ejercicios 6.3 - 4.cpp
#include <iostream> using namespace std; void cambio(int, int&, int&, int&, int&, int&, int&); int main() { int dolar, cien, cincuenta; int veinte, diez, cinco, uno; cout << "Introduzca una cantidad de dinero en dolares: "; cin >> dolar; cambio(dolar, cien, cincuenta, veinte, diez, cinco, uno); cout << "E...
ALGO
0.984435
3.606893
{ "github_metadata": { "branch": "main", "commit_count": 1, "repo_created_at": "2021-04-17T18:53: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": "cf8f2b5c9e55...
12dee9b5-bbd2-4c72-a91f-75f1ae53df84
zcae1020/algorithm_problems
baekjoon/exercise/킹(1063).cpp
//#include <iostream> //#include <map> //#include <string> // //using namespace std; // //map<string, int> m; // //int kx, ky, rx, ry; //int dx[8] = { 0,0,1,1,1,-1,-1,-1 }, dy[8] = { 1,-1,1,-1,0,1,-1,0 }; // //int main() { // m.insert(make_pair("R", 0)); // m.insert(make_pair("L", 1)); // m.insert(make_pair("B", 7)); /...
ALGO
0.999882
3.252217
{ "github_metadata": { "branch": "main", "commit_count": 475, "repo_created_at": "2022-01-12T02:36: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": "9b5b523a60...
7c12c87c-a76f-448d-83c2-2cfedab6c050
libo9527/PAT
Advanced/1006.cpp
#include <cstdio> struct Student{ char name[20]; int h1, h2, m1, m2, s1, s2; }temp, first, last; bool pre(Student a, Student b){ if(a.h1 != b.h1) return a.h1 < b.h1; else if(a.m1 != b.m1) return a.m1 < b.m1; else return a.s1 < b.s1; } bool later(Student a, Student b){ if(a.h2 != b.h2) return a.h2 > b.h2;...
ALGO
0.9998
3.258664
{ "github_metadata": { "branch": "master", "commit_count": 20, "repo_created_at": "2019-01-11T10:16: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": "7b57a0108...
7c0bb5fb-7cd0-4759-be32-bb1d7c084dbe
s-bhatla/DSA-practice
Exceptionally odd - GFG/exceptionally-odd.cpp
//{ Driver Code Starts //Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template for C++ class Solution{ public: int getOddOccurrence(int arr[], int n) { // code here //when we XOR all the numbers, the ones which will occur an even ...
ALGO
0.999954
5.537963
{ "github_metadata": { "branch": "main", "commit_count": 158, "repo_created_at": "2023-02-21T17:13: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": "29d3b5d9cb...
9edce4df-fbfd-4fcb-b561-a6919a48b5ce
zhuli19901106/leetcode-zhuli
algorithms/0001-0500/0150_evaluate-reverse-polish-notation_1_AC.cpp
// medium #include <cstdio> #include <functional> #include <stack> #include <unordered_map> using std::function; using std::sscanf; using std::stack; using std::unordered_map; class Solution { public: Solution() { fun["+"] = [](int x, int y){return x + y;}; fun["-"] = [](int x, int y){return x - y;...
ALGO
0.999788
5.093626
{ "github_metadata": { "branch": "master", "commit_count": 234, "repo_created_at": "2016-12-03T04:46:30.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 557, "forks": 157, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "4be5...
d40d0f8b-a72d-4ea3-bcfb-15ae319675b8
Sakenkz118/Cplusplus
Ch8.Pr.Ex.4.cpp
#include <iostream> #include <string> using namespace std; bool isVowel(char ch); string removeVowels(string word); int main () { string str; cout << "Please enter a string: "; cin >> str; cout << endl; cout << "Without vowels a string is " << removeVowels(str) << endl; return 0; } bool ...
ALGO
0.979902
4.99894
{ "github_metadata": { "branch": "main", "commit_count": 7, "repo_created_at": "2021-04-02T06:35: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": "8a5ddb6c47bd...
01107577-70d8-4f2f-be96-2eff8cc683c3
geekysn/-CrackYourIntership
Spiral_Matrix.cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define vvi vector<vector<int>> #define vvc vector<vector<char>> #define pp pair<int, int> class Solution { public: vector<int> spiralOrder(vector<vector<int>>& matrix) { int m=matrix.size(); int n=matrix[0].size(); vector<int> v; ...
ALGO
0.999996
5.639011
{ "github_metadata": { "branch": "main", "commit_count": 24, "repo_created_at": "2024-07-31T16:00: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": "72136d8711e...
81ccd212-5238-45d1-9359-acdf566832df
wvu-navLab/RobustGNSS
gtsam/gtsam/nonlinear/ISAM2-impl.h
/* ---------------------------------------------------------------------------- * GTSAM Copyright 2010, Georgia Tech Research Corporation, * Atlanta, Georgia 30332-0415 * All Rights Reserved * Authors: <NAME>, et al. (see THANKS for the full author list) * See LICENSE for the license information * ------------...
ALGO
0.994505
4.767066
{ "github_metadata": { "branch": "master", "commit_count": 33, "repo_created_at": "2017-08-15T22:53:37.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 144, "forks": 47, "issues": 5, "pull_requests": 0 }, "file_meta": { "content_id": "ed3d3d1...
59628ca0-5631-4064-92ae-2bc3ccbc48ff
kamyu104/LeetCode-Solutions
C++/minimum-division-operations-to-make-array-non-decreasing.cpp
// Time: precompute: O(r) // runtime: O(n) // Space: O(r) // greedy, number theory vector<int> linear_sieve_of_eratosthenes(int n) { // Time: O(n), Space: O(n) vector<int> spf(n + 1, -1); vector<int> primes; for (int i = 2; i <= n; ++i) { if (spf[i] == -1) { spf[i] = i; ...
ALGO
0.999947
5.132586
{ "github_metadata": { "branch": "master", "commit_count": 19395, "repo_created_at": "2018-10-11T17:38:35.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 4939, "forks": 1616, "issues": 1, "pull_requests": 55 }, "file_meta": { "content_id": ...
a9dafe8f-845e-4c04-a302-80d2f268f206
coding-blocks-archives/Algo_17_Summer_Dwarka
18-Jun_04/spiralPrint.cpp
//<NAME>, Coding Blocks #include <iostream> using namespace std; void input2D(char mat[][10], int m, int n){ for(int i = 0; i < m; ++i){ for(int j = 0; j < n; ++j){ cin >> mat[i][j]; } } } void printSpiral(char mat[][10], int m, int n){ int left = 0; int right = n - 1; int top = 0; int bottom = m - 1; ...
ALGO
0.999925
3.813443
{ "github_metadata": { "branch": "master", "commit_count": 18, "repo_created_at": "2017-06-12T03:01:06.000Z", "is_fork": false, "is_org_owned": true, "forked_from": null, "stars": 1, "forks": 6, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "fa98804ad9...
9b9f3d30-1b50-40ef-af75-6a5268499b31
aky360/cpp
codecpp/DSA/Dynamic_Programming/DP/NinjaTraining.cpp
/* question: Ninja is planing this ‘N’ days-long training schedule. Each day, he can perform any one of these three activities. (Running, Fighting Practice or Learning New Moves). Each activity has some merit points on each day. As Ninja has to improve all his skills, he can’t do the same activity in two consecutive da...
ALGO
0.999976
4.632466
{ "github_metadata": { "branch": "main", "commit_count": 270, "repo_created_at": "2022-03-26T12:28: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": "4148ffe898...
ba3227c0-695c-426a-9e3b-8bde0a6cb1d5
magyarakoos/contest-prog
atcoder/abc395/C/main.cpp
#include <bits/stdc++.h> using namespace std; #define int int64_t const int INF = 1e18, MAXN = 1e6, MOD = 1e9 + 7; #define cases 0 void solve() { int N; cin >> N; vector<vector<int>> h(MAXN); for (int i = 0, x; i < N; i++) { cin >> x; h[x - 1].push_back(i); } int result = N + 1...
ALGO
0.999707
4.225718
{ "github_metadata": { "branch": "main", "commit_count": 6327, "repo_created_at": "2023-12-20T17:09: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": "13b86bb29...
294feceb-54e6-4d43-b657-1efa84ed2469
EarlOu/summarization
src/baseline_keyframe/va_summary.cpp
#include "database/Dataset.h" #include <stdio.h> #include <deque> using namespace std; int main(int argc, char *argv[]) { printf("Multi-view summarization using visual attention score.\n"); if (argc != 4) { printf("usage: %s <dataset_dir> <score_dir> <output.txt>\n", argv[0]); return -1; }...
ALGO
0.986489
4.753247
{ "github_metadata": { "branch": "master", "commit_count": 97, "repo_created_at": "2015-04-21T07:24:19.000Z", "is_fork": false, "is_org_owned": false, "forked_from": null, "stars": 3, "forks": 3, "issues": 0, "pull_requests": 0 }, "file_meta": { "content_id": "f33557751...
99edc58d-f53f-4dee-a2ac-e76d8f307a28
jayeshpatel8/Coding-Practise-using-Leetcode-Coding-Platform
problems/sum_of_floored_pairs/solution.cpp
class Solution { public: const int MAXN = 1e5 + 1, MOD = 1e9 + 7; int sumOfFlooredPairs(vector<int>& nums) { vector<long> freq(2*MAXN+1); long mx = 0, sum = 0, prev=0,prevsum=0; for(auto num : nums) ++freq[num], mx = max((int)mx, num); for(int i = 1; i <= 2*MAXN; ++i) freq[i] += freq[i - 1]; int k=...
ALGO
0.999953
5.237732
{ "github_metadata": { "branch": "main", "commit_count": 2992, "repo_created_at": "2021-08-22T09:43: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": "1cdd38dbf...
3f5b9bab-b847-444e-b768-e84e53357786
sam-maloney/msc_hpcse
Project/ADI_serial.cpp
#include <iostream> #include <algorithm> #include <string> #include <fstream> #include <cassert> #include <vector> #include <cmath> #include "timer.hpp" //#define USE_TIMER #define USE_TSC #ifdef USE_TSC #include "tsc_x86.hpp" #endif // USE_TSC typedef double value_type; typedef std::size_t size_type; #ifndef M_PI ...
ALGO
0.999577
5.321154
{ "github_metadata": { "branch": "master", "commit_count": 85, "repo_created_at": "2023-03-05T20:38: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": "5167f2472...