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 |
|---|---|---|---|---|---|---|---|
b6fff097-3d0a-4a11-a16a-756b1f870d12 | mcastrorib/RandomWalk_NMR | src/backend/GA/ParticleSwarm_deprecated/appPSO.cpp | #include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include "PSO.h"
#include "../NMR_Simulation/NMR_Simulation.h"
using namespace std;
void PSO_app(NMR_Simulation &NMR, uint nvar, double (*NMRfitnessFunction)(vector<double> &, NMR_Simulation &))
{
// Problem Definition
PSO_problem pro... | ALGO | 0.999965 | 4.949055 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2020-11-22T14:17:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "289fff4f0b... |
27ee4b4e-e48f-4b50-8013-7088b56d2f74 | ermig1979/Simd | src/Simd/SimdSse41SynetConvolution8iNhwcDirect1x1.cpp | /*
* Simd Library (http://ermig1979.github.io/Simd).
*
* Copyright (c) 2011-2024 <NAME>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation th... | ALGO | 0.956941 | 3.400354 | {
"github_metadata": {
"branch": "master",
"commit_count": 4063,
"repo_created_at": "2015-03-25T15:24:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2179,
"forks": 437,
"issues": 30,
"pull_requests": 1
},
"file_meta": {
"content_id": "0... |
70a5581f-fc18-4862-b649-9c85df0bdda9 | raujika418/GoodOldDays | llvm/lib/Transforms/Scalar/ADCE.cpp | //===- ADCE.cpp - Code to perform aggressive dead code elimination --------===//
//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===--------... | ALGO | 0.990376 | 6.232789 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-07-11T12:11: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": "431aceb5fa... |
95c4b8a8-6b42-4c79-bd10-48120601a10a | target511/SolvedAlgorithm | 2023.08/B1074(Z).cpp | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int N, R, C;
int result = 0;
void Z(int n, int r, int c) {
if (n < 1) {
return;
}
int middle = pow(2, n - 1);
if (r < middle && c < middle) { // 좌상단
Z(n - 1, r, c);
}
else if (r < middle && c >= middle) { // 우상단
result += pow(2,... | ALGO | 0.999706 | 3.743774 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2023-07-25T13:38: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": "17a12afb056... |
5d440de5-ed5b-45ea-a25b-93bf66179a1f | stevenhalim/cpbook-code | ch8/maxflow.cpp | // Disclaimer: This code is a hybrid between old CP1-2-3 implementation of
// Edmonds Karp's algorithm -- re-written in OOP fashion and the fast
// Dinic's algorithm implementation by
// https://github.com/jaehyunp/stanfordacm/blob/master/code/Dinic.cc
// This code is written in modern C++17 standard
#include <bits/st... | ALGO | 0.999702 | 4.988085 | {
"github_metadata": {
"branch": "master",
"commit_count": 392,
"repo_created_at": "2018-11-27T05:30:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2175,
"forks": 515,
"issues": 22,
"pull_requests": 14
},
"file_meta": {
"content_id": "d... |
44cb5e7e-072a-47c0-a094-4bbefb32aaca | thirofoo/atcoder-archives | abc046/abc046_b_34671793_AC.cpp | /*
* Author: through
* Submission URL: https://atcoder.jp/contests/abc046/submissions/34671793
* Submitted at: 2022-09-07 18:39:39
* Problem URL: https://atcoder.jp/contests/abc046/tasks/abc046_b
* Result: AC
* Execution Time: 7 ms
*/
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>... | ALGO | 0.999986 | 3.919153 | {
"github_metadata": {
"branch": "main",
"commit_count": 5513,
"repo_created_at": "2022-12-17T09:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "cc8ae6f99... |
943a6e92-dfd0-4f8e-b545-d4deeff87249 | stevensameh/Competitve-Programming- | Flows & Matching/HopCroftKarp and Minumum Vertex Cover.cpp | /*
Hopcroft-Karp algorithm
Time : O(E * sqrt(V))
Note : the verticies are 1-based. if the graph is 0-based change int bfs() and maximumMatching().
*/
/*
Minimum Vertex Cover
Finds a minimum vertex cover in a bipartite graph.
The size is the same as the size of a maximum matching, and
the ... | ALGO | 0.999853 | 3.965972 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-11-09T05:25:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e3437ba755... |
6bb59a92-c26d-433a-9ad0-01ac68e896ef | Nayeem-XTREME/UVa | 10035.cpp | #include <bits/stdc++.h>
#include <stdio.h>
#include <string.h>
int main()
{
char A[11], B[11], C[21], D[21];
int i, j, k, c, m, l1, l2;
while (1) {
scanf("%s %s", A, B);
if (A[0] == '0' && B[0] == '0')
break;
else {
c = 0;
m = 0;
l1 = strlen(A);
l2 = strlen(B);
if (l1 > l2) {... | ALGO | 0.999793 | 3.696272 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-07-25T19:08: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": "5c1a05dc9b... |
ea1f4e4b-6cb4-4d6d-9a8a-170f498642e6 | robin1001/kaldi-aslp | src/aslp-nnet/nnet-activation.h | // nnet/nnet-activation.h
// Copyright 2011-2013 Brno University of Technology (author: <NAME>)
// 2016 ASLP (Author: zhangbin<NAME>)
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except i... | DATA | 0.966518 | 5.462244 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2017-04-30T02:20:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 41,
"forks": 33,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "8b474f... |
058e7906-7315-482c-b26a-f9133f0bec57 | Beprominent/patest | 005.cpp | //
// Created by xie on 18-5-21.
//
#include <iostream>
#include <string>
using namespace std;
class Solution {
public:
string longestPalindrome(string s) {
string result;
int mmax = -1;
int length = s.length();
for(int i = 0; i < length; i++){
int length1 = 0;
... | ALGO | 0.999981 | 5.198932 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-04-18T04:55:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "87c480adc... |
0246a98a-f51d-4dd6-8e06-050a15cd8659 | melpiro-old-projects/Omega | Src/AI/AIFunctions.cpp | #include "AI/AIFunctions.hpp"
namespace O
{
namespace AI
{
namespace CostFunction {
long double linear(long double y, long double y_) { return std::pow(y - y_, 2.0);}
long double logarithmic_categorical(long double y, long double y_){
return y * log(y_);
}
long double logarithmic_binary(long double y, long doub... | ALGO | 0.968595 | 3.718604 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-09-23T08:15:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2232231f28... |
1e68e37a-32df-42a3-93f1-780b43fca13e | psykulsk/CarBrandDetector | main/main.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include "ellipses.hpp"
#include "preprocessing.hpp"
cv::Mat naiveScan(cv::Mat image , cv::Mat original_image){
int imageHeight = image.rows;
int im... | ALGO | 0.998404 | 4.835195 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-01-08T16:00:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01513026e... |
4bd77430-ec58-4ebc-8246-db401eff86e6 | fkdl0048/Algorithm | LeetCode/Implement_Trie_Prefix_Tree.cpp | class TrieNode {
public:
// 자식 노드들
TrieNode* children[26];
// 단어의 끝 여부
bool isEnd;
TrieNode() {
// 모든 자식 노드를 nullptr로 초기화
memset(children, 0, sizeof(children));
isEnd = false;
}
};
class Trie {
private:
TrieNode* root;
public:
/** 생성자 */
Trie() {
ro... | ALGO | 0.99954 | 5.386002 | {
"github_metadata": {
"branch": "main",
"commit_count": 549,
"repo_created_at": "2021-12-20T01:36:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 46,
"pull_requests": 0
},
"file_meta": {
"content_id": "664d949d7... |
8a55755a-04e0-4177-8112-83e771f15e83 | ploffer11/CPP | FastFourierTransform.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//#define int long long
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int INF = 987654321;
const int MOD = 1e9 + 7;
using cp = complex<double>;
using func = vector<cp>;
... | ALGO | 0.999234 | 3.718215 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-01-08T06:23: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": "c3027a657... |
bc07d716-6b55-46dd-aeac-e9b685329fb0 | vearch/vearch | internal/engine/third_party/scann-1.2.1/scann/tree_x_hybrid/tree_x_hybrid_smmd.h | // Copyright 2021 The Google Research Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law... | ALGO | 0.995924 | 4.182326 | {
"github_metadata": {
"branch": "master",
"commit_count": 1133,
"repo_created_at": "2019-05-13T02:37:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2195,
"forks": 343,
"issues": 163,
"pull_requests": 0
},
"file_meta": {
"content_id": "2... |
01289dd0-01fe-4614-900e-288a4557a5e1 | k-nam/lib_calvin_old | src/sorting/in_place_merge_sort_parallel.h | #ifndef LIB_CALVIN__SORT__IN_PLACE_MERGE_SORT_PARALLEL_H
#define LIB_CALVIN__SORT__IN_PLACE_MERGE_SORT_PARALLEL_H
#include "thread.h"
#include "in_place_merge_sort.h"
#include "random.h"
namespace lib_calvin_sort
{
template <typename Iterator,
typename Comparator = std::less<typename std::iterator_traits<Iterator... | ALGO | 0.99989 | 6.741365 | {
"github_metadata": {
"branch": "master",
"commit_count": 724,
"repo_created_at": "2020-04-18T05:44: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": "4f0dbfbe... |
cc386628-915b-422f-85bf-099d0937ebba | S-Huzaifa-Ali/OOP-Spring-2024 | labs/02/Task02.cpp | /*
Programmer: <NAME>
Roll no: 23K-0004
Description: Library management using structures
*/
#include <iostream>
#include <string>
using namespace std;
struct Book {
string title;
string author;
int year;
string genre;
};
void displayBook(const Book& book);
int findBook(const Book library[], int size... | TOOL | 0.990216 | 6.938866 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-02-01T09:21: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": "5e48f048090... |
5745ecfe-b683-4996-94d4-8c2a955d16b0 | NoviceCoderInfinity/DSA_CP | leetcode/236.Lowest_Common_Ancestor_Of_Binary_Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
string encode_node(TreeNode* root, TreeNode* p, string curr) {
if (root == p) {return c... | ALGO | 0.999976 | 6.119105 | {
"github_metadata": {
"branch": "main",
"commit_count": 122,
"repo_created_at": "2024-08-19T08:23:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1d057e02f... |
50f36c09-ca2f-42a0-96fd-33369138d460 | vs-uulm/3p3-evaluation | src/dc/FairnessProtocol.cpp | #include <numeric>
#include "DCNetwork.h"
#include <cryptopp/oids.h>
#include <iomanip>
#include "FairnessProtocol.h"
#include "../datastruct/MessageType.h"
#include "SecuredInitialRound.h"
#include "InitState.h"
std::mutex cout_mutex1;
FairnessProtocol::FairnessProtocol(DCNetwork &DCNet, size_t numSlices, size_t slo... | ALGO | 0.999436 | 6.182737 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2020-08-21T10:27:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bb8bf3e0... |
18691e20-540d-47c4-ae6d-83e7b7f7b87b | Alpha255/Rockcat | Source/DeadCode/Learner/sort.hpp | #pragma once
#include "Gear/Gear.h"
NAMESPACE_START(FORT)
/// O(N^2) steady
template <typename T> void InsertSort(T *pBegin, T *pEnd, std::function<bool8_t(const T &, const T &)> compFunc = [](const T &left, const T &right)->bool8_t {
return left <= right;
})
{
ptrdiff_t length = std::distance(pBegin, pEnd);
uint... | ALGO | 0.99881 | 6.205186 | {
"github_metadata": {
"branch": "main",
"commit_count": 298,
"repo_created_at": "2017-04-05T15:12: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": "3e2047a96a... |
b6f3fe76-4459-4310-8ac3-78d2bd9985c0 | raincross7/code-similarity | codes/train_code/problem338/problem338_434.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <climits>
#include <algorithm>
#include <utility>
using namespace std;
using Int = long long int;
using UInt = unsigned long long int;
using VI = vector<long long int>;
namespace BasicMath {
// 最大公約数を求める(ユークリッドの互除法)
// O(log m... | ALGO | 0.999932 | 4.32843 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9167837f3d96... |
a58b0104-d2dd-45f7-ba66-fac880c9834f | Eyad-Bereh/Singly-Linked-Lists-Class | versions/1.0/SLList.h | /*
SSList (Singly Linked Lists) Class
*/
#ifndef __SSLIST__
#define __SSLIST__
#include <iostream>
#include <ctime>
#include <cstdlib>
/*
The Node Class Holds Only Two Data Memebers:
1-)The "next" Field Which Is A Pointer Of The Type Node.
2-)The "data" Field Which Is Just An Integer.
*/
template<class T>
class Node {... | TOOL | 0.9867 | 4.368951 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-07T15:24: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": "0554ce5686... |
207beaef-98fd-4671-b05d-4a5c396a3f93 | anissen/WikiAdventure | WikiAdventure/Source/Project/Util.h |
#ifndef UTIL_H
#define UTIL_H
#include <vector>
using std::vector;
#include <string>
using std::string;
#include "Shlwapi.h" // For the PathFileExists function
#include <direct.h> // For the mkdir-function
#include "../WA-SDL/Globals.h"
//#include "Globals.h"
/** Get text between two specified tags.
@param sTe... | TOOL | 0.967801 | 5.677356 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2012-06-03T19:14:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba6accfcb4... |
a0ea0bc5-87e1-4792-a587-fd2964ba1ff5 | tyxeron/AlgorithmsLab-AS19-ETHZ | return_of_the_jedi/src/algorithm.cpp | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <set>
#include <string>
#include <vector>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/prim_minimum_spanning_tree.hpp>
#include <boost/graph/kruskal_min_spanning_tree.hpp>
#include <boost/graph/... | ALGO | 0.999807 | 3.300816 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-02-21T20:41: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": "bffa1b6f60... |
6ab0d76f-5e4d-4925-9e40-2b3cc3c799ae | sewbacca/Lizard-Old | src/search.cpp |
#include <cassert>
#include <iostream>
#include <algorithm>
#include "textutils.h"
#include "search.h"
#include "movegen.h"
#include "eval.h"
#include "attacks.h"
#include "pv.h"
#include "msclock.h"
static void check_up(SearchInfo& info)
{
if (info.cur_depth <= 1)
return;
U64 cur_time { msclock() };
if (info... | ALGO | 0.999356 | 5.108273 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2020-01-23T22:36: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": "a80bb328f... |
84bfda75-bfd2-408c-9e87-36512d545e69 | chen-jy/competitive-programming | dmoj/vm7wc/vm7wc16c5p4 - Jayden Eats Chocolate.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int pieces[100001] = {};
int main()
{
cin.sync_with_stdio(0);
cin.tie(0);
//freopen("DATA.txt", "r", stdin);
memset(pieces, -1, sizeof(pieces));
pieces[0] = 0;
int N, X, Y, Z;
cin >> N >> X >> Y >> Z;
for (int i = 1; i <= N; i+... | ALGO | 0.999808 | 3.524155 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-03-24T21:55: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": "d0e6aa0a2d... |
486350d0-4a5b-4dd2-aa6f-c50a031f5660 | ShivanshKumarJha/Coding-Dump | Udemy/Strings and Vector/vector_project.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cout<<"Enter the number of tries"<<endl;
cin>>t;
while(t--){
int n;
cout<<"Number of values you want to enter in the vector"<<endl;
cin>>n;
vector <int> v(n);
for(int i=0;i<n;i++){
cin>>v.... | ALGO | 0.996691 | 3.707173 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2024-10-21T11:34: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": "e8fbe5d95fc... |
e9655415-2061-4953-863d-744434d610a4 | ishitagupta09/potd-gfg | April-2023/Geek's Village and Wells.cpp | class Solution{
public:
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
vector<vector<int>> chefAndWells(int n,int m,vector<vector<char>> &c){
// Code here
//vector<vector<bool>>vis(n,vector<bool>(m,false));
vector<vector<int>>ans(n,vector<int>(m,-1));
queue<pair<pair<int,int>,int>>q;
... | ALGO | 0.999971 | 4.936872 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2023-04-01T10:49:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0cbd1e09a... |
b7739f00-9230-4c00-ad16-48aabdcee56c | sterluan/leetcode | Remove_Linked_List_Elements.cpp | /* Remove all elements from a linked list of integers that have value val.
*
* Example
* Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6
* Return: 1 --> 2 --> 3 --> 4 --> 5
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(... | ALGO | 0.999823 | 5.767858 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2015-04-23T18:20: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": "21a88117c... |
448057f7-0c38-4452-a5b2-a7a03261021f | cms-sw/cmssw | Geometry/TrackerGeometryBuilder/test/testLocalXY.cpp | void oriCode(int & binoffy, int & pitchMul) {
int m_pitchy=1;
int local_pitchy=1;
if (binoffy>416) { // ROC 8, not real ROC
binoffy=binoffy+17;
} else if (binoffy==416) { // ROC 8
binoffy=binoffy+16;
local_pitchy = 2 * m_pitchy;
} else if (binoffy==415) { // ROC 7, last big ... | ALGO | 0.961386 | 3.277338 | {
"github_metadata": {
"branch": "master",
"commit_count": 251237,
"repo_created_at": "2013-06-26T14:09:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1144,
"forks": 4480,
"issues": 947,
"pull_requests": 108
},
"file_meta": {
"content_id... |
1ed6fd5a-c58a-4b95-aa11-8c8d2b16020f | LaMoldy/data_structures | double_linked_list/main.cpp | #include <iostream>
using namespace std;
struct Node
{
int data;
Node* next;
Node* prev;
Node (int data)
{
this->data = data;
this->prev = nullptr;
this->next = nullptr;
}
};
void traverse_forwards (Node* head)
{
int index = 1;
while (head != nullptr)... | ALGO | 0.999002 | 5.290686 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-06-24T22:07: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": "07ef2a3d67f... |
34365ac0-a66c-4cb1-8a17-7f1904772261 | marcoskwkm/code | Contests/Junior Contest/B/b.cpp | #include <bits/stdc++.h>
using namespace std;
#define debug(args...) fprintf(stderr,args)
typedef long long lint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;
const int MAXN = (int)1e5 + 10;
char st[MAXN];
int len;
int main() {
st... | ALGO | 0.999968 | 3.906823 | {
"github_metadata": {
"branch": "master",
"commit_count": 399,
"repo_created_at": "2016-04-27T23:39:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb2ca5c0... |
5122ac75-ce3a-46a5-9d99-a79aff0d43d4 | alekssand/Project-Euler | 62.cpp |
#include <stdio.h>
#include <string.h>
void stringsort(char *);
int main(int argc, char **argv) {
char cube[10000][15];
char cubedigits[10000][15];
for(int n = 0; n < 10000; n++) {
sprintf(cube[n], "%.0f", (double)(n+1)*(double)(n+1)*(double)(n+1));
strcpy(cubedigits[n], cube[n]);
str... | ALGO | 0.999706 | 3.816422 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-01-11T18:32: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": "72a3b572d4... |
394581ce-9f43-4d97-9f4d-2e23bf7c5b20 | CubixPro/Semester-03-04 | OOP and Programming/Assignment 4/p3.cpp | #include<iostream>
using namespace std;
class Array{
int *p;
int size;
public:
Array(int size)
{
if(size >= 1)
{
p = new int[size];
this->size = size;
for(int i = 0 ; i < size ; i++)
{
p[i] = 0;
}
}
else
{
this->size = 0;
p = NULL;
}
... | ALGO | 0.991621 | 3.728118 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2019-08-14T09:24: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": "b83951ca5... |
d0fe8173-2256-423c-b30b-b6a7f99021e2 | rfiba/Metody_numeryczne | euler_forward_method/main.cpp | #include <iostream>
/*
* @author: <NAME> 2018
* Forward Euler Method
* Input:
* [numberOfPoints] [xMin] [xMax] [value of xMin]
*/
using namespace std;
double calculateFunction(double t, double x)
{
return x/(2*t+2);
}
void calculateEulerMethod(double xMin, double xMax, int numberOfPoints, double valueOfXMin... | ALGO | 0.999597 | 3.649553 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2018-03-01T12:19:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffdf4e24b... |
bc5c364c-9829-4cde-a526-3d13d489bcb3 | ankithans/Data-structures-algorithms | Hashing/02. count-distinct-elements.cpp | #include <bits/stdc++.h>
using namespace std;
void inputOutput() {
#ifndef ONLINE_JUDGE
freopen("../input.txt", "r", stdin);
freopen("../output.txt", "w", stdout);
#endif
}
// Naive Solution - O(n^2)
int countDist(int arr[], int n) {
int res = 0;
for (int i = 0; i < n; i ++) {
bool flag = false;
for (int j =... | ALGO | 0.999846 | 4.834701 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2020-07-27T12:39:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "cba0afa13... |
bffad63c-9420-4972-bd0f-39c09859ae6b | dgcnz/competitive-programming | codeforces/1610D-not-quite-lee.cpp | #ifdef DBG_MACRO_NO_WARNING
#include <dbg.h>
#else
#define dbg(...) ((void)0)
#endif
#include <atcoder/modint>
#include <bits/stdc++.h>
#include <cplib/math/utils>
#include <cplib/utils/io>
#include <cplib/utils/misc>
#define all(c) begin(c), end(c)
#define isz(c) (int)(c).size()
using namespace std;
using namespace c... | ALGO | 0.999969 | 4.164986 | {
"github_metadata": {
"branch": "master",
"commit_count": 380,
"repo_created_at": "2020-01-08T16:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1360a9f... |
c3e50419-e225-4060-8c20-0548f250d6dd | KaranDubey400/coding-problems-solution- | 3753-maximum-difference-between-even-and-odd-frequency-i/3753-maximum-difference-between-even-and-odd-frequency-i.cpp | #include <string>
#include <vector>
#include <algorithm> // For std::max and std::min
#include <limits> // For std::numeric_limits
class Solution {
public:
int maxDifference(std::string s) {
// Use a vector to store frequencies of 'a' through 'z'
// Index 0 for 'a', 1 for 'b', ..., 25 for 'z'
... | ALGO | 0.999587 | 5.852229 | {
"github_metadata": {
"branch": "main",
"commit_count": 685,
"repo_created_at": "2023-03-27T19:57: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": "e7cf78928f... |
91c9e5be-bddb-4dd7-89ab-7ef6caae00cc | shenyczz/KLibrary | KindMath/src/KIntegral.h | /******************************************************************************
** Header File: KIntegral.h
** Announce:
if it works, I know it was written by
ShenYongchen(<EMAIL>),live in ZhengZhou,HeNan.
if not, then I don't know nothing.
** Name: KIntegral - 数值积分类
** Version:
... | ALGO | 0.999096 | 4.21581 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-09-18T02:00: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": "d4c4357bbd... |
5f931b2f-2294-4f46-bd14-f48c01ddf0be | vivekh-git/prepare | recursion/test/bracketcombo2.cc | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | ALGO | 0.997035 | 4.621562 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-07-02T06:11: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": "a4bb855287... |
7ac2f973-afc2-4ef8-8486-6d5cc17fc53f | Ad0t/Cpp-Programming | Sorting-Algo/5-quick-sort.cpp | #include<bits/stdc++.h>
using namespace std;
int partition (vector<int> &arr, int low, int high) {
int pivot = arr[low];
int i = low, j = high;
while (i < j) {
while (arr[i] <= pivot && i <= high - 1) {
i++;
}
while (arr[j] >= pivot && j >= low + 1) {
j--;
... | ALGO | 0.99999 | 5.763554 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-17T17:48: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": "9a14c4718470... |
f7e26c2d-c90e-43e7-9566-46d022112ae2 | unValerio/Curso-Estructura-de-Datos | Estructuras/Pilas/ProyectoExpresionesMatematicas.cpp | // Nombre del programa: Proyecto de Expresiones Matemáticas con Pilas
// Descripción:
// Responsables:
// Profesor: Dr. <NAME>
// Alumno: <NAME>
// Fecha: 19-Febrero-2014
//------------------------------------------------------------------------------------... | ALGO | 0.999283 | 3.739248 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2014-01-27T13:49:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd2119796... |
881f2169-caf0-4fec-b2c9-be3027e74b76 | frogitcher/oop_misis_works_2022 | AfanasevMA/contest2/a.cpp | #include <queue>
#include <iostream>
int main() {
long int n;
long long int k_inputs;
std::cin >> n >> k_inputs;
long int k = std::min(k_inputs, (long long int) n - 1);
std::deque<std::pair<long int, long int>> players;
std::vector<long int> wins;
for (long int i = 0; i < n; i++) {
... | ALGO | 0.999993 | 4.369023 | {
"github_metadata": {
"branch": "main",
"commit_count": 184,
"repo_created_at": "2022-09-13T23:55:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "6564d3fff6... |
d2c578b7-ee88-436a-9bd2-43caadcf8dd0 | minhvpham/Competitive_Programing | Vnoj/fc117_khoangcach.cpp | // Onegai no bug
// Author : 13minusone
#include<bits/stdc++.h>
using namespace std;
#define task "akarui"
#define SZ(c) (c).size()
#define getbit(x,i) (((x) >> (i)) & 1)
#define turnoff(x,i) (x)&(~(1<<(i)))
#define __builtin_popcount __builtin_popcountll
#define all(x) (x).begin(),(x).end()
#define pb(x) push_back(x)
... | ALGO | 0.999919 | 3.329042 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-10-11T15:35:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51feab2751fb... |
39670b10-a23a-459b-a0c5-3da04bed4387 | heres-aayush/Algorithms | Complete Search/gsmet2.cpp | /*Problem Statement :
subsets based on bit representation of integers
Solution strategy :
Bit manipulation
1<<i is
"Shift the number 1 to the left by i positions in binary."
So:
1 << 0 = 1 → binary: 0001
1 << 1 = 2 → binary: 0010
1 << 2 = 4 → binary: 0100
1 << 3 = 8 → binary: 10... | ALGO | 0.999783 | 5.044652 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-07T17:40: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": "8e20529a6db2... |
0265df72-1bc7-42a8-9dca-33b60df78474 | shashwatw/DSA | GFG Product Based Test Series/Amazon/Graphs/number-of-distinct-islands.cpp | //* https://www.geeksforgeeks.org/batch/test-series-bundle/track/amazon-graphs/problem/find-the-number-of-islands
class Solution
{
private:
void bfs(int row, int col, vector<vector<int>> &vis, vector<vector<char>> &grid)
{
vis[row][col] = 1;
queue<pair<int, int>> q;
q.push({row, col});
... | ALGO | 0.99983 | 6.480493 | {
"github_metadata": {
"branch": "master",
"commit_count": 937,
"repo_created_at": "2023-03-24T05:42: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": "528dc73e... |
0d16b497-da7f-40e2-9e2c-4384a102194c | FlowLoveV/nav_cxx | src/core/solver/spp.cpp | #include "solution/spp.hpp"
#include <cpptrace/from_current.hpp>
#include <print>
#include "io/custom/solution_stream.hpp"
using navp::i32;
using namespace navp::solution;
class MySpp : public SppServer {
public:
using SppServer::SppServer;
virtual ~MySpp() override = default;
void set_output_file(std::str... | WEB | 0.918796 | 4.641764 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-04-27T15:04:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ecdd1ed2f2a... |
12a7662c-3df8-4a7a-8e52-2451402f0650 | ishandutta2007/codeforces-e | enkognit/normal/914/D.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimise("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#define {a...} make_struct(a...)
#define ll long long
#define fr front()
#define mp make_pair
#define fi first
#define... | ALGO | 0.999719 | 4.483051 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "e99d6cac782a... |
030a698b-f88e-42b2-8004-87440904b366 | tigmanshu-malik/Data-Structures-Algorithms | linked_list/doubly.cpp | #include <iostream>
using namespace std;
struct node {
int data;
node* next;
node* prev;
node(int value) : data(value), next(nullptr), prev(nullptr) {}
};
node* start = nullptr;
void append(int value) {
node* temp = new node(value);
if (start == nullptr)
start = temp;
else {
... | ALGO | 0.99975 | 4.662071 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-07-11T19:09: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": "862dfa5afcd... |
a91f0115-bd31-4377-9b6a-458db5813f94 | enatalie122/cpsc350-fall2020-assignment2 | mirror_simulator.h | /*
<NAME>
2313895
<EMAIL>
CPSC 350-01
Assignment 2
mirror_simulator.h is the header file for the MirrorSimulator class.
*/
#ifndef MIRROR_SIMULATOR_H
#define MIRROR_SIMULATOR_H
#include "abstract_simulator.h"
//The MirrorSimulator Class extends from the AbstractSimulator Class, and simulates the Game of Life with m... | ALGO | 0.944381 | 5.724315 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2020-10-08T00:12: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": "819a4fb1ae5e... |
b19e9029-ec53-4d3e-a423-e43ddb2dd8bd | darthchild/DSA-practice | linked list/IntersectionLL.cpp |
/*
160. Intersection of Two Linked Lists
Easy
Given the heads of two singly linked-lists headA and headB, return the node at
which the two lists intersect. If the two linked lists have no intersection at
all, return null.
*/
#include <bits/stdc++.h>
using namespace std;
class ListNode{
public:
int data;
... | ALGO | 0.999837 | 5.496062 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2023-12-14T17:11: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": "1dc4ffdfae7... |
e95404c1-be02-441a-992a-2536a0158732 | rachit0045/LEARNING-DSA | ARRAY 2.0/FUNDAMENTAL OF ARRAY/QUESTION PRACTICE/question3.cpp | // Find the element x in the array . Take array and x as input
#include <iostream>
using namespace std;
int main()
{
int n, x;
cout << "Enter the size of array : " << endl;
cin >> n;
int arr[n];
cout << "Enter the element of array : ";
for (int i = 0; i < n; i++)
{
cin >> arr[i];
... | ALGO | 0.999293 | 4.929089 | {
"github_metadata": {
"branch": "main",
"commit_count": 151,
"repo_created_at": "2024-03-06T11:20:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed35882671... |
49d967b1-08cd-4128-a391-75727412dce7 | SERGIODSA/EjerciciosC | Funcion y Procedimiento/EJ1.CPP | #include <conio.h>
#include <stdio.h>
#define n 5
void llenar_vector (long int v[n]);
long int capicua (long int c);
void imprimir (long int v[n]);
/* dado un vector de numeros enteros imprimir
las posiciones de los numeros capicuas */
void main (){
clrscr();
long int vector[n];
llenar_vector (vect... | ALGO | 0.99865 | 3.524825 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-07-31T19:55: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": "c5bd689f20... |
e449459e-17a2-4181-b963-52c0be23271d | ioncoincore/ion | src/masternode/masternode-payments.h | // Copyright (c) 2014-2019 The Dash Core developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef MASTERNODE_PAYMENTS_H
#define MASTERNODE_PAYMENTS_H
#include "util.h"
#include "core_io.h"
#include "key.h"
#includ... | TOOL | 0.940716 | 7.591244 | {
"github_metadata": {
"branch": "master",
"commit_count": 18625,
"repo_created_at": "2019-12-03T08:17:24.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "dashpay/dash",
"stars": 5,
"forks": 6,
"issues": 11,
"pull_requests": 4
},
"file_meta": {
"content_id... |
0563fd6b-5a6d-4d68-912e-b885ec9f1fe3 | burningDown/my_leetcode | hard-1210-Minimum_Moves_to_Reach_Target_with_Rotations/1210-Minimum_Moves_to_Reach_Target_with_Rotations.cpp | class Solution {
public:
int minimumMoves(vector<vector<int>>& grid) {
int i, j, n, state, step, minSteps = -1;
bool visited[105][105][2];
queue<vector<int>> stateQueue;
vector<int> it;
memset(visited, 0, 105*105*2);
n = grid.size();
stateQueue.push({0,0,0,0... | ALGO | 0.999995 | 5.22138 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-03-27T02:01: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": "3764033dd... |
0fa45543-dc10-4dd8-875f-bee91b96db40 | whitneygriffith/StudentList | main.cpp | #include <iostream>
#include <string>
#include <fstream>
using namespace std;
class studentType
{
public:
string lastName;
string firstName;
int ID;
string city;
};
struct nodeType
{
nodeType *next;
studentType info;
};
class UnsortedListType //This holds the linked List of students
{
publ... | TOOL | 0.975996 | 3.56177 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-10-11T20:38: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": "c60b2aacda... |
727d13b4-ac5e-4ba8-a385-5b36df52a951 | MultivacX/leetcode2020 | algorithms/medium/1353. Maximum Number of Events That Can Be Attended.h | // 1353. Maximum Number of Events That Can Be Attended
// Runtime: 1532 ms, faster than 5.11% of C++ online submissions for Maximum Number of Events That Can Be Attended.
// Memory Usage: 128.2 MB, less than 100.00% of C++ online submissions for Maximum Number of Events That Can Be Attended.
class Solution {
public:
... | ALGO | 0.999759 | 5.845566 | {
"github_metadata": {
"branch": "master",
"commit_count": 1856,
"repo_created_at": "2019-12-31T13:19: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": "6f00db2... |
7ca01a50-6377-496f-b300-9818636b7508 | qulacs/scaluq | include/scaluq/circuit/circuit.hpp | #pragma once
#include <set>
#include <variant>
#include "../gate/gate.hpp"
#include "../gate/param_gate.hpp"
#include "../types.hpp"
namespace scaluq {
template <Precision Prec, ExecutionSpace Space>
class Circuit {
public:
using GateWithKey =
std::variant<Gate<Prec, Space>, std::pair<ParamGate<Prec, Sp... | ALGO | 0.98286 | 7.275007 | {
"github_metadata": {
"branch": "main",
"commit_count": 1180,
"repo_created_at": "2023-06-02T05:10:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 8,
"pull_requests": 1
},
"file_meta": {
"content_id": "77323666df... |
a4b7216e-94b6-48b4-a921-cc5256d1d122 | tezkerek/uni-lfa-lab | src/lnfa.cpp | #include "lnfa.hpp"
#include <queue>
void LNFA::add_state(StateType state) {
transition_map[state] = SymbolMap();
lambda_closures[state] = {state};
}
void LNFA::add_transition(StateType src_state, StateType dest_state,
SymbolType symbol) {
transition_map[src_state][symbol].push_b... | ALGO | 0.979882 | 6.648833 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-04-23T16:07: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": "4fee845a61... |
47ff4382-23d7-4ea3-8450-8d74f1593113 | HDSRL/Distributed_NMPC_A1 | src/Old_Codes/MPC_dist copy.cpp | // Author: <NAME>
// Date: 01/20/2022
#include "MPC_dist.hpp"
#include <fstream>
#include "RobotModel.hpp"
#include <chrono>
using namespace ifopt;
MPC_dist::MPC_dist() // inside arguments (const StateInfo* st)
{
static int agent_counter = 0;
log_ID = agent_counter;
agent_counter++;
if(agent_cou... | ALGO | 0.995164 | 3.754868 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-22T05:43:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5752b4d22f00... |
e1ec47de-c64e-472a-8e73-c066de2e8bf5 | federico-calandra/codici-sorgente | c++/1_array e vector/21_sequenze-uguali.cpp | /* legge due sequenze di numeri interi (terminate con 0 o con FINE, a vostro piacimento) e controlla se sono uguali (stessa dimensione e valori identici negli stessi posti) */
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> seq1, seq2;
int n;
cout << "inserisci elemento seque... | ALGO | 0.997631 | 3.786943 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2021-08-02T21:52: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": "aba6f063d... |
f2f8e0c7-9284-40e6-abcb-725ebf2504c4 | AryanJ2004/DSAL-SE-2019-Pattern | BFS And DFS/BFS And DFS.cpp | #include <iostream>
using namespace std;
void BFS(int A[][10], int n) {
cout << "Enter Starting Vertex:" << endl;
int vtx;
cin >> vtx;
int q[20]{0};
int visited[10]{0}; // Assuming the maximum size for the matrix is 10
int f = 0, r = -1;
q[++r] = vtx;
visited[vtx] = 1;
while (f <... | ALGO | 0.999978 | 6.227178 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2024-02-02T11:05:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a40016135e... |
8b9c2f2e-31ed-4a2b-897b-397245bf2402 | j0x7c4/ARPathPlaner | src/search/Search.h | #include <queue>
#include <iostream>
#include <cmath>
#include <vector>
#include <PPMap.h>
#include <opencv2/opencv.hpp>
using namespace std;
class Node{
public:
// Parameter
int name;
int x, y;
double cost;
double priority;
int parent;
// Constructor
Node(){
}
Node(int nName, int nX, int nY,... | ALGO | 0.999601 | 3.019532 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2013-01-03T07:01: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": "21e260c22... |
d28243ae-2e6d-49a8-b013-5297e63f67ec | algorithmsmachine/algorithmscpp | graph_algorithms/adj_weighted.cpp | #include<bits/stdc++.h>
using namespace std;
#include<bits/stdc++.h>
using namespace std;
void addEdge(vector<pair<int,int>> adj[],int u, int v, int w){
adj[u].push_back(make_pair(v,w));
adj[v].push_back(make_pair(u,w)); // for directed remove this line
}
void printGraph(vector<pair<int,int>> adj[],int V){
... | ALGO | 0.999926 | 5.236733 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-08-09T04:22:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "821ccbc01b... |
d0aeb81f-ca4b-4201-a0a9-e0a7bfa3fca4 | mangoqwq/competitive-programming | Other/oly20practice112.cpp | #include <bits/stdc++.h>
using namespace std;
#define ms(x,a) memset(x,a,sizeof x)
typedef long long ll;
const int mod=1e9+7,seed=131,MAXN=301;
int n, k, c[1<<8], val[1<<8];
ll dp[27'000'000];
char s[MAXN];
int get(int l, int r, int m){
return l*90000+r*300+m;
}
int main(){
cin.tie(0)->sync_with_stdio(0);
... | ALGO | 0.999907 | 3.881779 | {
"github_metadata": {
"branch": "master",
"commit_count": 540,
"repo_created_at": "2020-08-28T16:37:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0845ac45... |
6be5d2d0-0d32-4519-8a70-5cb61afebecf | ishandutta2007/codeforces-k | kraskevich/normal/260/E.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
const int N = 100 * 1000 + 2;
vector<int> tr[4 * N + 10];
int L[4 * N + 10], R[4 * N + 10];
vector<int> atx[N];
void build(int pos, int l, int r)
{
L[pos] = l;
R[pos] = r;
if (l == r)
{
tr[pos] = atx[... | ALGO | 0.999777 | 3.088981 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe914d019f24... |
ca6cd72a-43ff-491f-ab80-da43ceffddd7 | Lord-Lava/DSA-CPP-Apna-College | Programs/7 Character Arrays/largestWordInSentence.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
cin.ignore();
char arr[n+1];
cin.getline(arr,n);
cin.ignore();
int currLen=0, maxLen=0;
int st,maxSt; //st is analogous to currLen and maxSt is analogous to maxLen.
// int i=0; used in case you ... | ALGO | 0.999132 | 3.087157 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-04-04T17:41:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 52,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3af8e3727... |
70bee571-232d-480f-af12-1063cb58b461 | vlad-nitu/google-kickstart-2022 | coding-practice-session-#3/GBusCount.cpp | //
// Created by <NAME> on 29.08.2022.
//
#include "GBusCount.h"
#include <iostream>
#include <vector>
#define NMAX 5001
int T, N, P;
int left, right, city;
std::vector<int> constructDifferenceArray (std::vector<int> D) {
std::vector<int> arr(NMAX);
for (int i = 0; i < NMAX; ++i){
if (i == 0)
... | ALGO | 0.999816 | 5.806074 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-08-29T17:28: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": "022db624658... |
3bf2423c-1932-4161-8665-779b4a695b3e | Mackenzie-98/Solutions | AtCoder/ABC/152/c.cpp | /**
* @author: Mackenzie
**/
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_wi... | ALGO | 0.999965 | 4.530415 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-08-24T01:41: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": "2c61517d0404... |
3160d25d-5f83-415d-98b2-9003f7428233 | redantlabs/utils | union_find/include/utils/union_find.hpp | /*
Copyright 2018 <NAME>, Redant Labs SAS
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 agreed to in writing, sof... | ALGO | 0.979955 | 7.233514 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2018-06-09T17:19: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": "f5bf6fa55... |
1a6723b2-5071-42ee-9088-85ba7a2cb6b2 | Dantae-Jekins/Filas | main.cpp | #include <iostream>
#include <ctime>
#include <stdio.h>
#include "problema.h"
using namespace std;
using namespace Distributions;
int main() {
srand(time(NULL));
// Distribuicoes
Distributions::Normal chegada06_10(25, 2);
Distributions::Normal chegada10_12(10, 3);
Distributions::Normal chegad... | ALGO | 0.999156 | 4.466017 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-05-20T21:48: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": "636890d1a9c... |
fb8daff9-5456-4f3d-912d-3c2fd7a47396 | ohdoyoel/problem-solving | boj/4256/main.cpp | #include<bits/stdc++.h>
#define endl "\n"
using namespace std;
vector<int> pre;
vector<int> in;
void printPost(int preStart, int preEnd, int inStart, int inEnd) {
if (preStart>=preEnd || inStart>=inEnd) return;
int root = pre[preStart];
int rootIdxIn = inStart;
for (int cand=inStart; cand<inEnd;... | ALGO | 0.999989 | 4.368647 | {
"github_metadata": {
"branch": "main",
"commit_count": 373,
"repo_created_at": "2022-09-12T14:57:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b70d72224... |
20102a29-1199-4f6d-96de-ecbb360d493d | coding-ninja-dsa-competitive-package/codig-ninja-dsa-learning | 02-data-structure-algorithms/modules/017-dynamic-programming/code-part-1/005-Num-Balanced-BTs.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<climits>
#include<vector>
#include<stack>
#include<queue>
#include<unordered_map>
#include<unordered_set>
#include<map>
#include<set>
#include<list>
using namespace std;
/**
* Code : No. of balanced BTs
* - Given an integer h, fin... | ALGO | 0.999991 | 5.142676 | {
"github_metadata": {
"branch": "main",
"commit_count": 510,
"repo_created_at": "2021-06-04T19:58:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 81,
"forks": 30,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54b80ac66... |
286f88fd-e42f-405f-85f4-fee0b8d79228 | DarkMiclos/bevprogdrillek | chapter 4 drill/Source.cpp | #include "std_lib_facilities.h"
double convert(double &temp_conv,double temp,const string unit)
{
constexpr double cm_to_m = 100;
constexpr double in_to_m = 0.0254;
constexpr double ft_to_m = 0.0254 * 12;
if(unit == "cm")
{
temp_conv = temp /cm_to_m;
}
else if(unit == "m")
{
temp_conv = temp;
... | TOOL | 0.976511 | 5.441463 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2020-09-12T16:09:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c9f157e2... |
ac35d780-f7e4-4d57-9983-5da90abf74fe | lxuegod/DAA | Branching bounds/单源最短路径问题.cpp | #include <bits/stdc++.h>
using namespace std;
class MinNode {
public:
int id;//顶点编号
int length;//当前路长
friend bool operator<(MinNode A, MinNode B) {
return (A.length > B.length);//不能带等于号
}
};
class Graph {
private:
int n , m ;//顶点数,边数
vector<int> prev;//路径上的前驱数组;
vector<int> dist;/... | ALGO | 0.999992 | 4.330698 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2022-11-21T08:49:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef9be47b4... |
3bd5469d-7fc5-4da4-92be-74920abf0ad8 | ezxzeng/GENE_121 | assignment_2/assignment_2.1.cpp | // <NAME> and <NAME>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
using namespace std;
int main()
{
double degree = 0, radius1 = 0;
cout << "please enter the angle of the removed section in degrees ";
cin >> degree;
double rad = degree*M_PI/180;
cout << "please enter the radius of t... | ALGO | 0.989155 | 4.650373 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-01-25T12:09: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": "56861ff17c... |
cebcdabb-b8ed-4c8c-bd06-d5f4cfb44630 | Maciej-Poleski/athina-submits | C2.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
#define pion 1
#define poziomB 0
#define poziomE 2
inline unsigned int mpow2(unsigned int n)
{
unsigned int wynik=1;
while(wynik<n)
wynik<<=1;
return wynik;
}
struct kartez
{
int x,y;
bool operator<(const kartez &o) const
{
if(x<o.x)
retur... | ALGO | 0.9998 | 3.281341 | {
"github_metadata": {
"branch": "master",
"commit_count": 222,
"repo_created_at": "2021-08-04T20:29:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bb82e67... |
d3d72e66-e46a-414e-9c63-cb49f3b8e993 | ChrisMoutsos/moosey | src/legal.cpp | /*
----------------------------------
~Moosey Chess Engine~
legal.cpp
----------------------------------
*/
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include "common.h"
#include "board.h"
#include "ltexture.h"
bool Board::legalMove(int mF, int mT, bool s, bool v) {
bool isInC... | ALGO | 0.996603 | 4.671791 | {
"github_metadata": {
"branch": "master",
"commit_count": 508,
"repo_created_at": "2015-01-23T03:44:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e5f5230... |
a0ee1f11-df79-4d0f-b6ca-7a822d96ade3 | BVP-ISTE/Hacktober2022 | CPP/task/Pairofroses.cpp | // Deepak has a limited amount of money that he can spend on his girlfriend. So he decides to buy two roses for her. Since roses are of varying sizes, their prices are different. Deepak wishes to completely spend that fixed amount of money on buying roses for her.
// As he wishes to spend all the money, he should choos... | ALGO | 0.999891 | 4.129976 | {
"github_metadata": {
"branch": "main",
"commit_count": 457,
"repo_created_at": "2022-09-23T06:30:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 64,
"issues": 57,
"pull_requests": 8
},
"file_meta": {
"content_id": "0cbd9149a... |
f78ecd9d-8471-465e-82f8-9a38860835c7 | DavidSolid/AlgAdv | algorithms/prim.h | //
// Created by Enrico on 07/04/2020.
//
#ifndef ALGADVGRAPHS_PRIM_H
#define ALGADVGRAPHS_PRIM_H
#include "../graph_structures/Edge.h"
#include "../graph_structures/AdjacencyList.h"
#include "../data_structures/MinHeap.h"
#include <climits>
template <typename W>
AdjacencyList<W> Prim(AdjacencyList<W>);
template <t... | ALGO | 0.99988 | 5.560424 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2020-03-31T18:21:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c31849475... |
f05f0a61-5506-452a-b31c-94ae3fe21b54 | Mohamedkhaled687/Problem_Solving | Leetcode/Longest Plaindrome.cpp | #include <bits/stdc++.h>
using namespace std;
string s;
int dp[1000][1000];
string longest_palindrome;
bool is_Palindrome(int r , int c){
for(int i = r, j = c; i <= j; i++, j--){
if(s[i] != s[j])
return false;
}
return true;
}
int generate_all(int i , int j){
if(i > j)
re... | ALGO | 0.999938 | 4.717367 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2024-07-01T21:12:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7de781f4c5... |
258c66cf-38c0-4e10-9459-e6607152f25b | SandeepTimalsina/1st-Semester-C-programming-Lab | Labsheet2/Qno.7/Untitled7.cpp | /*Write a program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros entered.*/
#include<stdio.h>
int main()
{
int limit, num, positive = 0, negative = 0, zero = 0;
printf("Enter the limit\n");
scanf("%d", &limit);
printf("Enter ... | ALGO | 0.999333 | 3.556756 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-04-26T07:05: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": "fecea72e0c08... |
1364b5f5-fbb1-433a-8fee-8ad4afbd1360 | gorkamagda/PSI_GC01_zima_2017-2018_Magdalena_Gorka | lab2_neuron.cpp | #include <iostream>
#include <time.h>
#include "lab2_neuron.h"
#include <fstream>
#include <string>
using namespace std;
double Neuron::fun_act(double suma){
return (2/(1+exp(-2*0.2*suma)) - 1); //B - wspolczynnik uczenia (0.1 lub 0.5), tangens hiperboliczny - zwraca wartosci od -1 do 1
}
void Neuron::losuj_wagi()... | ALGO | 0.948056 | 3.900903 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-10-20T10:41:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "ea959ed406... |
cb3a297a-95f5-4db6-b5bd-820e8943e147 | kushagrarastogi2014/-6Companies30days | Microsoft/spirally-traversing-a-matrix.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to return a list of integers denoting spiral traversal of matrix.
vector<int> spirallyTraverse(vector<vector<int> > matrix, int r, int c)
{
vector<int> ans;
... | ALGO | 0.999941 | 5.642987 | {
"github_metadata": {
"branch": "main",
"commit_count": 113,
"repo_created_at": "2022-01-06T06:01: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": "7968545e2b... |
62938d1d-434e-4679-a2bb-f8363afcc090 | Ashish65733/DSA-with-cpp | Chapter/42 - Tries/Prefix_Problem.cpp | #include<iostream>
#include<unordered_map>
#include<vector>
#include<string>
using namespace std;
class Node{
public:
unordered_map<char, Node*> children;
bool endOfWord;
int freq;
Node(){
endOfWord = false;
}
};
class Trie{
Node* root;
public:
Trie(){
root = new Node();
... | ALGO | 0.999494 | 5.255821 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2025-05-19T05:34:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a14758b7e9d... |
af5bfd05-9879-4235-9a22-3cfdd079078f | hiroshi-maybe/topcoder | solutions/WolfPackDivTwo/WolfPackDivTwo.cpp | #include <fstream> // for greed plugin
#include <iostream>
#include <algorithm> // max,min
#include <vector>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>... | ALGO | 0.999961 | 4.523291 | {
"github_metadata": {
"branch": "master",
"commit_count": 1437,
"repo_created_at": "2015-05-24T07:26:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68cbdcb... |
4dbc267b-0fcd-40ff-afb5-38bcddbdef90 | shivanibhat24/CPP-Programs | Leetcode Programs/meetingrooms3.cpp | class Solution {
public:
int arr[100];
int mostBooked(int rooms, vector<vector<int>>& meetings) {
vector<pair<int,int>> v;
int n=meetings.size();
for(int i=0;i<n;i++) {
v.push_back(make_pair(meetings[i][0],meetings[i][1]));
}
sort(v.begin(),v.end());
... | ALGO | 0.999998 | 5.817191 | {
"github_metadata": {
"branch": "main",
"commit_count": 1115,
"repo_created_at": "2024-10-06T04:35: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": "6097b35e5... |
511f1fab-e52b-49ca-8f61-02699f44609c | mrrajamiaraj/CSE-225 | Lab Manuals/Lab 05/timeStamp.cpp | #include <bits/stdc++.h>
#include "timeStamp.h"
using namespace std;
timeStamp::timeStamp()
{
this->s = 0;
this->m = 0;
this->h = 0;
}
timeStamp::timeStamp(int s, int m, int h)
{
this->s = s;
this->m = m;
this->h = h;
}
bool timeStamp::operator==(timeStamp t)
{
if ((s == t.s) && (m == t.m... | ALGO | 0.900114 | 3.723896 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-04-15T16:38: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": "6cf4094d52f... |
f96e43d1-a16e-42e9-838a-61419a6d4925 | expertisesolutions/fvtk | include/fastdraw/output/vulkan/buffer.hpp | ///////////////////////////////////////////////////////////////////////////////
//
// Copyright 2019 <NAME>.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/foreach for documentat... | TOOL | 0.923828 | 7.372862 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2019-05-27T22:01:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a00930c47... |
75b7dc70-cdde-4186-97f3-bc2d1922c512 | anuragtomer/practice_coding | leetcode/Medium/994.rotting-oranges.cpp | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
class Solution {
public:
int orangesRotting(vector<vector<int>> &grid) {
queue<pair<int, int>> bfs;
for (int i = 0; i < grid.size(); ++i)
for (int j = 0; j < grid[0].size(); ++j)
... | ALGO | 0.999784 | 5.566828 | {
"github_metadata": {
"branch": "master",
"commit_count": 392,
"repo_created_at": "2017-12-18T11:39: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": "4fe31856... |
b5dddd9b-f957-44c9-b6e4-0a638e6d06eb | Neelrana/RCC | AP/FILE/prgs.cpp | /* WAP to define class STUDENT with details of student and marks of three subjects Sub1, Sub2 and Sub3.
Display the highest marks among three students and their details in proper format for each student.
*/
#include<iostream>
#include<string>
#include<conio.h>
using namespace std;
class student
{
int rollno;
string ... | TOOL | 0.994545 | 4.321675 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-07-26T16:33: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": "48078faafc... |
18fee945-3555-4f52-8333-efc986da60aa | anshalchauhan/DSA-Questions | shortest_path_in_a_Directed_Acyclic_Graph_(BFS,toposort)_GRAPH.cpp | class Solution {
public:
vector<int> shortestPath(int n,int m, vector<vector<int>>& edges){
vector<int> ans(n,1e9), topo, indegree(n,0);
vector<pair<int,int>> adj[n];
queue<int> q;
for(int i=0;i<m;i++)
{
adj[edges[i][0]].push_back({edges[i][1],edges[i][... | ALGO | 0.999982 | 4.966308 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2022-03-19T11:59: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": "a471d425d9c... |
2fcead14-43ba-4efe-9144-8c0068e266e7 | dfuentes-uah/Robust-people-detection-using-depth-information-from-an-overhead-Time-of-Flight-camera | Funciones_pcl.cpp | //para operaciones opencv
#include <stdio.h>
#include <pmdsdk2.h>
#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/contrib/contrib.hpp>
#include <opencv2/core/core.hpp>
#include <pcl/ModelCoefficients.h>
#include <pcl... | ALGO | 0.995992 | 3.301059 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-23T23:03: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": "027570a2c640... |
b79d9260-434e-4657-8896-41e8497a8bc8 | Shahin-Sheikh/Competitive-Programming | Contests/bs23/A.cpp | //Input
//The first line contains three integers x, p, q(2 ≤ x ≤ 105; 1 ≤ p ≤ 3·105; 1 ≤ q ≤ 105).
//Each of the next p lines contains three integers ai, bi, ci(1 ≤ ai, bi ≤ x; ai ≠ bi; 1 ≤ ci ≤ 109).
//Each of the next q lines contains two integers ti and wi(2 ≤ ti ≤ x; 1 ≤ wi ≤ 109).Every city will,
//without a dou... | ALGO | 0.996813 | 3.787845 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2021-05-02T07:59:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "82562b93013... |
5a8140e3-9385-40b6-8c42-7bccbf2e4bab | llenroc/CP | LeetCode/tags/design/lru-cache.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define MOD 1000000007
bool az(int x) { return 97<=x && x<=122; }
bool AZ(int x) { return 65<=x && x<=90; }
bool number(int x) { return 48<=x && x<=57; }
class LRUCache {
private:
int size=0;
list<int> cache;
unordered_map<int, pair<int, list<... | ALGO | 0.999818 | 4.817631 | {
"github_metadata": {
"branch": "master",
"commit_count": 656,
"repo_created_at": "2021-04-08T08:43: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": "f4a386c3... |
cf5d0a55-aaba-4b15-91de-78df7df93f5e | vldk-exists/LeetCode-daily-tasks | task53.cpp | /*
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.
Merge nums1 and nums2 into a single array sorted in non-decreasing order.
The final sorted array should not be returned by the function, b... | ALGO | 0.999988 | 5.925368 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2025-05-14T16:31: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": "1438bb1c1e2... |
e0306d84-4e45-4587-9b90-a257279559ef | mukerem/ICPC-Journey | 2019 icpc ragional practice/hackerearth/deltafunctions.cpp |
#include<bits/stdc++.h>
using namespace std;
#define N 100005
#define mod 1000000007
typedef long long ll;
ll x[N];
ll ss[N+5];
int main(){
ll n,ans, g,q=150;
n = q;
for(ll i=1;i<=n;i++){
ans = 0;
for(ll j=1;j<i;j++){
g = __gcd(i,j);
a... | ALGO | 0.999639 | 3.376451 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-08-27T18:33:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e21db8436... |
21a85617-a673-4322-a68a-7b902b42b5bc | IMClick-Project/Programming | Codeforces/Destroying Array.cpp | //Hecho por: <NAME>
//Fecha: 31 de Mayo de 2018
//Codeforces - 722C
//Union-Find
//dado un arreglo, se van a quitar por turno un número, por cada turno hay que decir la máxima suma de los subarreglos restantes
//verlo del final al inicio, inicialmente no hay dsus, por turno unir y agregar el número a los dsus que se en... | ALGO | 0.999975 | 3.794269 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-11-10T21:15: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": "a817b95e27f... |
c7c3a3ca-aed7-46c8-b2b1-83bc696d2f34 | ubsuny/CompPhys | Calculus/integrals.cc | #include <vector>
#include <iostream>
#include <math.h>
#include "integrals.h"
using namespace std;
int main()
{
unsigned n1=1,n2=0;
cout << "Trapezoid quadrature of sin(x) [0, pi/2]" << endl;
while ( n1 % 2 != 0 ) {
cout << "Enter number of intervals desired for trapezoidal rule (must be even)" << endl; ... | ALGO | 0.997766 | 4.965499 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2019-07-02T19:00:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 32,
"forks": 39,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c730d9384... |
06307f38-959f-437a-9f62-8441f144a11b | watashi/AlgoSolution | livearchive/2010/Europe.Northwestern/4944.cpp | #include <list>
#include <cstdio>
#include <vector>
#include <utility>
#include <algorithm>
#include <functional>
using namespace std;
const int MAXN = 218;
int main() {
int re, n, m, d;
int a[MAXN], b[MAXN];
vector<pair<int, int> > p;
list<int> c;
scanf("%d", &re);
for (int ri = 1; ri <= re; ++ri) {
scanf(... | ALGO | 0.999927 | 3.524878 | {
"github_metadata": {
"branch": "master",
"commit_count": 522,
"repo_created_at": "2011-10-06T10:40:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 204,
"forks": 61,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "075de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.