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 |
|---|---|---|---|---|---|---|---|
cd6e71e5-1b40-473d-88b8-dd8f5192bbad | ss987/DSA-Practice | Dynamic Prg/fibTopDownBottomUp.cpp | const int mod=1000000007;
long long int topdown(int n, vector<long long int> &dp) {
if (n <= 1) return n;
if (dp[n] != -1) return dp[n];
dp[n] = (topdown(n-1, dp) + topdown(n-2, dp))%mod;
return dp[n];
}
long long int topDown(int n) {
vector<long long int> dp(n + 1, -1);
... | ALGO | 0.999985 | 4.443076 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2023-10-15T16:36: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": "9c47c1a33f... |
57f8c6c3-e324-4d1e-a942-9405074d1ffe | Lin-jingy/ACM | codeforces/Codeforces Round 903 (Div. 3)/1881C.cpp | #include <bits/stdc++.h>
void solve() {
int n;
std::cin >> n;
std::string mid[n], a[n + 1];
for(int i = 0; i < n; ++i) std::cin >> mid[i];
for(int i = 1; i <= n; ++i) {
a[i] += ' ';
a[i] += mid[i - 1];
}
int ans = 0;
std::array<char, 4> s;
for(int i = 1; i <= n; ++i)... | ALGO | 0.99997 | 4.452944 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2024-02-12T15:05: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": "1ed61bf0046... |
67d99129-6b61-4294-96b9-8a5be6d8e875 | trinhminhtriet/leetcode | solutions/0100-0199/0158.read-n-characters-given-read4-ii-call-multiple-times/Solution.cpp | /**
* The read4 API is defined in the parent class Reader4.
* int read4(char *buf4);
*/
class Solution {
public:
/**
* @param buf Destination buffer
* @param n Number of characters to read
* @return The number of actual characters read
*/
int read(char* buf, int n) {
int... | ALGO | 0.973206 | 5.247058 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2024-12-09T17:55:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "acc9ce... |
0feaaf72-c8a3-4133-b710-5536a7722103 | stbrumme/euler | euler-0181.cpp | // ////////////////////////////////////////////////////////
// # Title
// Investigating in how many ways objects of two different colours can be grouped
//
// # URL
// https://projecteuler.net/problem=181
// http://euler.stephan-brumme.com/181/
//
// # Problem
// Having three black objects B and one white object W they... | ALGO | 0.999928 | 5.361732 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-12T15:07:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 136,
"forks": 36,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "ad3156b... |
d7dce06a-aec2-4a23-8dc6-023e6c55c976 | maxeboykin/DSA | trees/dfs/count-paths-for-sum.cpp | #include <iostream>
#include <vector>
class TreeNode {
public:
int val = 0;
TreeNode *left;
TreeNode *right;
TreeNode(int x) {
val = x;
left = right = nullptr;
}
};
class CountPathsForSum{
public:
static int countPaths(TreeNode *root, int S){
std::vector<int> currentP... | ALGO | 0.999835 | 5.441 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2023-08-29T13:32: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": "bb2a227ad41... |
215a7c62-f557-4a20-b541-339357366c05 | larlight/larlite | UserDev/RecoTool/CMTool/CMTAlgMerge/CBAlgoOutOfConeSeparate.h | /**
* \file CBAlgoMergeAll.h
*
* \ingroup CMTool
*
* \brief Class def header for a class CBAlgoOutOfConeSeparate
*
* @author <NAME>
*/
/** \addtogroup CMTool
@{*/
#ifndef RECOTOOL_CBALGOOUTOFCONESEPARATE_H
#define RECOTOOL_CBALGOOUTOFCONESEPARATE_H
#include <math.h>
#include <iostream>
#include "CMTool/... | ALGO | 0.988651 | 6.653791 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 3911,
"repo_created_at": "2014-10-15T09:24:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 16,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "47bd391... |
cb0034af-8179-4908-87e9-b6b0bbb1acb7 | reddy-lab-code-research/MuST-CoST | data/transcoder_evaluation_gfg/cpp/COUNT_SUBARRAYS_EQUAL_NUMBER_1S_0S.cpp | // Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include... | ALGO | 0.999559 | 5.648982 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-02-08T19:28:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0e80a1f50b... |
887db32e-11dc-4d4f-b45f-dd987666d016 | InvisiblePro/Hacktoberfest-2022 | C++/Binary Search Problems/Aggressive_cows.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Optimal Algo approach-
Logic:
We need to define a isPossible() function that checks if a distance x is possible between each of the cows.
We can use a greedy approach here by placing cows at the leftmost possible stalls such that they are at
least x distance away from... | ALGO | 0.999981 | 5.440795 | {
"github_metadata": {
"branch": "main",
"commit_count": 387,
"repo_created_at": "2022-10-01T07:29:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 118,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63b6211... |
49ae3da3-614c-42ac-9fbf-9712b9aacaa3 | Wonder-Book/Book-Extract-Engine | src/domain_layer/domain/structure/math/value_object/MatrixMathVO.re | open Js.Typed_array;
type t =
| Matrix(Float32Array.t);
let createWithoutCheck = resultFloat32Arr => Matrix(resultFloat32Arr);
let createIdentityMatrix = () =>
Float32Array.make([|
1.,
0.,
0.,
0.,
0.,
1.,
0.,
0.,
0.,
0.,
1.,
0.,
0.,
0.,
0.,
1.,
|]... | TOOL | 0.942878 | 5.525241 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2019-10-06T02:46:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 15
},
"file_meta": {
"content_id": "2eb4084ca... |
235c1933-cc66-4f20-bba8-6e75c8f90b5e | romeorizzi/portafoglioVoti_public | Algoritmi/2020-06-18/all-CMS-submissions-2020-06-18/20200618T111322.VR450788.poldo_sums.cpp | /**
* user: VR450788
* fname: CRIVELLARO
* lname: LUCA
* task: poldo_sums
* score: 8.0
* date: 2020-06-18 11:13:22.942803
*/
#include<iostream>
#include<vector>
#include<cassert>
#include<list>
using namespace std;
int panini[10000];
int gym[10000];
vector<list<int>> sol;
int N;
int index_sol = 0;
int seq[10000];
... | ALGO | 0.999996 | 3.745114 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2020-06-21T22:16:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "280862ac... |
fa730924-db9c-4d8d-ae83-1288658cab97 | microsoft/onnxruntime | onnxruntime/core/mlas/lib/qgemm_kernel_smmla.cpp | /*++
Copyright (c) Microsoft Corporation. All rights reserved.
Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the MIT License.
Module Name:
qgemm_kernel_smmla.cpp
Abstract:
This module implements smmla QGEMM kernel.
--*/
#include "mlasi.h"
#include "qgemm.h"
//
/... | ALGO | 0.954204 | 3.501499 | {
"github_metadata": {
"branch": "main",
"commit_count": 13200,
"repo_created_at": "2018-11-10T02:22:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 17252,
"forks": 3340,
"issues": 2017,
"pull_requests": 268
},
"file_meta": {
"content_id"... |
40982e0d-20ed-4beb-8ea6-9268027ed8a7 | PaolaEstradaW/SolucionSumaArreglosParalela_Paola_Estrada | SolucionsumaArreglosParalela_Paola_Estrada/SolucionsumaArreglosParalela_Paola_Estrada.cpp | // SolucionsumaArreglosParalela_Paola_Estrada.cpp : Este archivo contiene la función "main". La ejecución del programa comienza y termina ahí.
//
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#ifdef _OPENMP
#include <omp.h>
#else
#define omp_get_thread_num() 0
#endif
#define SIZE 1000
... | ALGO | 0.99956 | 5.06803 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-22T20:17: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": "b60274ef2a7f... |
d3db4a69-9fac-44cb-a527-11d84f6be4fd | milocco/sinbad | System/support/ClebschGordan.cxx | /*********************************************************************
CombLayer : MNCPX Input builder
* File: support/ClebschGordan.cxx
*
* Copyright (c) 2004-2013 by <NAME>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as pu... | ALGO | 0.999144 | 4.778954 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-02-14T23:10: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": "b29907c69e... |
66c75645-d138-4ef4-824f-308580cd7da3 | clsteimle94/CIS17A-44051_SteimleCody_2623045 | Hmwk/Assignment-1/Gaddis_7.6/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on March 1, 2017, 12:20 PM
* Purpose: Gaddis Chapter 7 Programming Challenge 6: Rain or Shine
*/
//System Libraries Here
#include <iostream> //Input and ouput
#include <fstream> //File input and output
using namespace std;
//User Libraries Here
//Global Co... | ALGO | 0.937662 | 3.334721 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-03-15T18:06: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": "2260fc98e7... |
e8d7a7b5-6e35-4ed6-b50c-a45267adf1ba | syrokomskyi/astar2d | astar2d/external/bm3.7.0/samples/sample9/sample9.cpp | /*
Copyright(c) 2002-2005 <NAME>(anatoliy_kuznetsov at yahoo.com)
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 the rights to use, copy, modi... | ALGO | 0.966771 | 5.613229 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2013-02-27T21:08: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": "34f02d2c99... |
a147a1bc-7ea5-4bd9-b496-705fcf733edf | kmjp/procon | yuki/1001-2000/1401-1500/1441.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999774 | 4.484202 | {
"github_metadata": {
"branch": "master",
"commit_count": 3966,
"repo_created_at": "2015-02-15T11:25:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "088bea... |
29c49b62-3b3c-4fda-ba27-739c226626f1 | MinaYossry/LeetCode---Problem-Solving | 0414-third-maximum-number/0414-third-maximum-number.cpp | class Solution {
public:
int thirdMax(vector<int>& nums) {
int max = INT_MIN;
int secondMax = INT_MIN;
int thirdMax = INT_MIN;
int min = INT_MAX;
for (auto num: nums)
{
if (num < min)
min = num;
if (num > max)
{
... | ALGO | 0.999978 | 5.698769 | {
"github_metadata": {
"branch": "main",
"commit_count": 336,
"repo_created_at": "2023-02-05T13:59: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": "f73f132370... |
4ff21c8b-3086-4f24-96b3-10659a20b950 | nhatminh2947/UVa-Online-Judge | 383/383.cpp | //==============================================================
// Coded by: <NAME>
// Problem Number: 383 - Shipping Routes
//==============================================================
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <dequ... | ALGO | 0.999675 | 4.17347 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2014-06-23T13:06:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7f541df1d... |
6a8b1576-9c53-4043-b541-1e816530fc83 | cebulajakub/matrix_operations | src/UkladRownanLiniowych.cpp | #include "UkladRownanLiniowych.hh"
/*
* Tutaj nalezy zdefiniowac odpowiednie metody
* klasy UkladRownanLiniowych, ktore zawieraja
* wiecej kodu niz dwie linijki.
* Mniejsze metody mozna definiwac w ciele klasy.
*/
std::ostream& operator<<(std::ostream &Strm, UkladRownanLiniowych &ukrown){
Strm<<ukrown.... | ALGO | 0.922069 | 3.668144 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-04-06T15:26: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": "6e31013019... |
d97e60ff-1581-4849-8b72-959c05c30a24 | domfarolino/algorithms | src/algorithm_practice/Dynamic_Programming/maximumSumCircularSubarray/max.cpp | #include <iostream>
#include <algorithm>
#include <vector>
// Source: https://leetcode.com/contest/weekly-contest-105/problems/maximum-sum-circular-subarray/
/**
* Maximum Sum Circular Subarray
* This is a nifty modification of the more-generic maximum sum
* subarray problem. Since the array we're dealing with in ... | ALGO | 0.999857 | 6.790784 | {
"github_metadata": {
"branch": "master",
"commit_count": 352,
"repo_created_at": "2016-09-04T01:25:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 50,
"forks": 45,
"issues": 22,
"pull_requests": 10
},
"file_meta": {
"content_id": "cd9a... |
94d7d7e8-e2a5-4194-b7b1-1605ef4ce642 | kingkk31/BOJ | source code/9631_The Alphabet Sticker.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <queue>
#include <vector>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <string>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <malloc.h>
#include <functional>
#pragma warning(disable:4996)
using namespac... | ALGO | 0.999992 | 3.780818 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2016-01-09T13:33: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": "839217397... |
a5d127de-9c9f-4c7e-92b4-c6b2f0412655 | Edwolt/Estudos | Programação Competitiva/Grafo/prim.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6;
struct edge {
int v, w;
bool operator<(const edge &that) const {
return this->w > that.w;
}
};
int n, m;
bool vis[MAXN];
vector<edge> grafo[MAXN];
int prim() {
priority_queue<edge> pq;
for (edge i : grafo[0]) {
... | ALGO | 0.999963 | 4.47507 | {
"github_metadata": {
"branch": "main",
"commit_count": 200,
"repo_created_at": "2024-05-08T11:05: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": "b51d57121c... |
faac01c2-7753-40de-a4ab-e2ba3bc9cf51 | mastree/cp | Codeforces/Gym/MatrixExpo(Gym by Errichto)/F.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define el '\n'
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using matrix = vector<vector<ll>>;
const int N = 100;
const ll INF = (ll)1e18 + 10LL;
matrix mult(const mat... | ALGO | 0.999986 | 4.241338 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-03-13T14:52:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fdc1461fb... |
41b9e4c9-3707-4efa-ab74-ab9d9585b961 | IlanPy/TAMU-classes | CSCE221 Data Structures and Algorithms/PA4-Maps/starter/ProbingHashTable.h | #ifndef LINEARPROBING_H
#define LINEARPROBING_H
#include "AbstractHashTable.h"
#include <vector>
// Linear probing hash table class
class ProbingHashTable : public AbstractHashTable {
private:
std::vector<HashEntry> table;
void resizeAndRehash();
public:
ProbingHashTable();
~ProbingHashT... | ALGO | 0.996133 | 5.870583 | {
"github_metadata": {
"branch": "main",
"commit_count": 172,
"repo_created_at": "2022-08-24T00: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": "0cc106338b... |
c79130c1-ecd8-45e4-98db-032cff50661a | theopnv/retromania | games/pacman/AStar/AStar.cpp | #include <algorithm>
#include "AStar.hpp"
namespace astar
{
AStar::AStar(const int pos, const int target, const Map &map)
{
_map = map;
_target.x = getX(target);
_target.y = getY(target);
for (size_t i = 0; i < map.map.size(); i++) {
Cell cell;
cell.cell.y = cell.cell.x = -1;
cell.G = cell.H = c... | ALGO | 0.996629 | 4.502533 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2017-07-25T08:58:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a0169038... |
e36537f7-78d2-43ef-b99e-4fc8543c3515 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1243/all/29779759_64392270.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
const int inf = 1e9 + 7;
long long gcd(long long a, long long b) {
while (b != 0) {
long long c = a;
a = b;
b = c % b;
}
return a;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
... | ALGO | 0.999984 | 4.870828 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40: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": "df7809ed5... |
e0939fde-8dae-463f-8ddb-b93858f59e4c | ishandutta2007/codeforces-v | volkov_ivan/normal/1408/D.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int N = 2007, M = 1e6 + 7;
pair <int, int> gr[N], pr[N];
int minn[M];
signed main() {
//freopen("Desktop/input.txt", "r", stdin);
ios_base :: sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
mem... | ALGO | 0.999728 | 3.5446 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "1cc11c9af7c7... |
816ffefc-b5c2-4c0d-bf36-95467a36c2a0 | GeethChadalawada/MissionRnD-C-Strings2-Worksheet | src/Consonants_Vowels.cpp | /*
OVERVIEW: Given a string, Count the number of consonants and vowels and copy them to 'consonants' and 'vowels' respectively
Notes : Neglect Space and Other Symbols .Consider Capital Letters too
E.g.: Input: "aB c" , Output: consonants should contain 2 and vowels 1
INPUTS: A string and two int pointers
OUTPUT: Mod... | ALGO | 0.998722 | 4.55401 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-01-12T07:08: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": "8e6d84a697... |
bffba441-3c6f-4363-bf18-7ac76023caa2 | DevAgarwal24/DSA | DynamicProgramming/countPathsII.cpp | // https://leetcode.com/problems/unique-paths-ii/
// https://www.codingninjas.com/studio/problems/unique-paths-ii_977241
#include <iostream>
#include <vector>
using namespace std;
// Recursive
// T.C = O(2^(m*n)) [Each box will have two possible ways and there are m*n boxes]
// S.C = O(m+n) [Auxillary stack space equ... | ALGO | 0.99997 | 5.978657 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2023-06-23T13:32: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": "e331f757f1... |
291ed06d-a3c7-4770-9524-2589938454a5 | arrows-1011/CPro | AOJ/Volume00/0043.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;
vector<int> ans;
int arr[13];
int cnt[10];
bool judge(int a[]){
int sum = 0;
for(int i = 1 ; i <= 9 ; i++){
sum += a[i];
}
if(sum == 0) return true;
for(int i = 3 ; i <= 9 ; i++){
if(a[i-2] > 0... | ALGO | 0.999956 | 4.181185 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2015-11-18T15:08:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70b72a99... |
a3d62337-288d-4ca6-9924-a10421e4b7bf | aOlsvik/inft2503 | task8/ex1/main.cpp | #include <iostream>
#include <cmath>
// Template function for equal with template types
template <typename Type>
bool equal(Type a, Type b) {
std::cout << "Using the template function for type " << typeid(a).name() << std::endl;
std::cout << "a = " << a << ", b = " << b << std::endl;
bool result = a == b;
... | ALGO | 0.993159 | 6.756067 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-10-09T14:31: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": "31cab99b176... |
a41c6457-cb25-4007-967c-db0bf5fa2784 | dvetutnev/learn_discrete_math | nice_numbers13/parallel_calculation.h | #pragma once
#include <thread>
#include <condition_variable>
#include <functional>
#include <vector>
#include <algorithm>
#include <memory>
using Range = std::pair<unsigned int, unsigned int>;
using Operation = std::function<std::size_t(unsigned int)>;
struct Thread
{
std::thread thread;
std::shared_ptr<std... | TOOL | 0.998149 | 7.014947 | {
"github_metadata": {
"branch": "master",
"commit_count": 152,
"repo_created_at": "2018-04-26T21:22: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": "ca0464a0... |
f0486b7e-9099-45b5-9715-ff77b30186c7 | linhmonkaist/Algorithm | done/mixup.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k, max_size;
vector<int> s, pos0, pos1;
vector<vector<long long>> f;
void find_pos(int i){
pos0.clear();
pos1.clear();
for (int j= 0; j< n; j++){
if ((i >> j) & 1) pos1.push_back(j);
else pos0.push_back(j);
}
}
int main(){
if... | ALGO | 0.999983 | 4.452012 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-05-17T05:57: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": "b396113047... |
3aa8c41f-009f-4633-8381-778cc2eff582 | kikkimo/OnlineJudge | LeetCode/0016 3Sum Closet/Source/016.cpp | #include <IOSTREAM>
#include <vector>
#include <algorithm>
using namespace std;
int threeSumClosest(vector<int>& nums, int target)
{
int result =0;
int size = nums.size();
if (size <= 3)
{
for (int i = 0 ; i < size ; i ++)
result += nums[i];
return result;
}
sort(nums.begin(),nums.end());
int nLa... | ALGO | 0.999985 | 5.870234 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-06-17T16:29: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": "efb04e3cd0... |
91e9d22f-561f-4ff8-ba28-faae55aca7d3 | ozline/luogu-cpp | list/111-二分查找与二分答案/P2678.cpp | /**
* @author OZLIINEX
* @brief P2678 [NOIP2015 提高组] 跳石头
* @date 2023-03-27
*/
// 最大收获是那个check函数
// 这道题我一直不知道,如何获得,拆掉一个石头后,这段距离
// 他使用了一个一个for,然后留了一个last
// 如果我们要把这个石头拆走,那么cnt++,但不更新last
// 如果我们不拆这个石头,那么更新last为这个石头的距离
// 这时候判断的话,只需要计算a[i] - last < x就可以了
// 因为我们只需要关注目前一个石头的情况嘛
// 还是想复杂了
#include "header.hpp"
#def... | ALGO | 0.999957 | 3.779969 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2023-01-11T14:46: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": "47e811624c6... |
8325a07a-de4d-48fa-b3a4-264844fffb0c | maksim1744/programming-library | hash_table.cpp | struct hash_my {
size_t operator()(int x) const {
x = ((x >> 16) ^ x) * 0x119de1f3;
x = ((x >> 16) ^ x) * 0x119de1f3;
x = (x >> 16) ^ x;
return x;
}
size_t operator()(long long x) const {
x = (x ^ (x >> 30)) * (0xbf58476d1ce4e5b9ll);
x = (x ^ (x >> 27)) * (0x... | ALGO | 0.996209 | 5.894297 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2019-03-10T15:20:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86a5b7... |
5db42699-9aec-4b0d-817b-17b08302bb86 | Maximusthr/Programacao-Competitiva | usaco/Silver/3 - Graphs/2 - Flood Fill/Problem_2_Icy_Perimeter.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
int n;
vector<string> g(n);
vector<vector<bool>> vis(n);
int pos_X[] = {-1, 0, 0, 1};
int pos_Y[] = {0, -1, 1, 0};
bool isValid(int x, int y){
return (x >= 0 && x < n && y >= 0 &... | ALGO | 0.999772 | 3.906286 | {
"github_metadata": {
"branch": "main",
"commit_count": 618,
"repo_created_at": "2025-02-09T20:56: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": "bab18af324... |
4796ba7d-4149-4efd-8bb0-100fe33c1377 | Manzood/CodeForces | Rounds/Round-825/A/A.cpp | #include "bits/stdc++.h"
#ifdef local
#include "custom/debugger.h"
#else
#define debug(...) 42;
#endif
using namespace std;
#define int long long
void solve([[maybe_unused]] int test) {
int n;
scanf("%lld", &n);
vector<int> a(n);
int cnta = 0, cntb = 0;
for (int i = 0; i < n; i++) {
scanf... | ALGO | 0.999983 | 4.376374 | {
"github_metadata": {
"branch": "master",
"commit_count": 323,
"repo_created_at": "2020-02-23T15:45:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0e3ccb4... |
cee4f7cb-5e66-4466-abfa-d2d812ca3b6b | donbasta/leetcode-submissions | Medium/886.cpp | class Solution {
public:
bool possibleBipartition(int n, vector<vector<int>>& dislikes) {
vector<bool> vis(n + 1);
vector<int> col(n + 1, -1);
vector<vector<int>> adj(n + 1);
for (auto d : dislikes) {
adj[d[0]].push_back(d[1]);
adj[d[1]].push_back(d[0]);
... | ALGO | 0.999906 | 5.792335 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-05T03:05:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8075552ab698... |
31fdefd3-6aad-4257-a671-96c36ecb9f5e | arangodb/arangodb | 3rdParty/boost/1.78.0/boost/geometry/strategies/spherical/side_by_cross_track.hpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 <NAME>, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2014-2021.
// Modifications copyright (c) 2014-2021, Oracle and/or its affiliates.
// Contributed and/or modified by <NAME>, on behalf of Oracle
// Contributed a... | ALGO | 0.999514 | 6.953609 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
e4f03a58-e817-427e-b661-afe0effd2c00 | DISASTER-RUMBLING/CODE | 算法/Leetcode/Leetcode 1898. 可移除字符的最大数目.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
class Solution {
public:
bool Check(string s, string p, vector<int> removable, int mid) {
sort(removable.begin(), removable.begin() + mid);
int nows = 0, nowp = 0, szs = s.size(), szp = p.s... | ALGO | 0.999951 | 4.935627 | {
"github_metadata": {
"branch": "main",
"commit_count": 161,
"repo_created_at": "2024-01-20T15:13: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": "1aa2dbc9af... |
74e5a934-0153-417d-b1de-99bf589e738f | Thasin-Sheikh/Codeforces-Solutions | 1703D .cpp | ///*<NAME>***///
///**Author thasin_sheikh**///
#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<class T> using myset=tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_update>;
#define MAX ... | ALGO | 0.999922 | 3.516117 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-03-27T10:45:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6eedfd45... |
f13154c5-753f-48fd-a50b-cb58a1dfb769 | seqan/seqan | include/seqan/graph_types/graph_impl_oracle.h | // ==========================================================================
// SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2025, <NAME>, FU Berlin
// All rights reserved.
//
// Redistribution and use in s... | ALGO | 0.992249 | 6.920862 | {
"github_metadata": {
"branch": "main",
"commit_count": 8409,
"repo_created_at": "2012-10-25T08:02:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 490,
"forks": 171,
"issues": 105,
"pull_requests": 4
},
"file_meta": {
"content_id": "e93b... |
e4d2c1c6-0a6d-450d-83d8-c2563d4cfd0f | MegrezZhu/LeetCode | Algorithms/1253. Reconstruct a 2-Row Binary Matrix.cpp | class Solution {
public:
vector<vector<int>> reconstructMatrix(int upper, int lower, vector<int>& colsum) {
int n = colsum.size();
vector<vector<int>> res(2, vector<int>(n, -1));
for (int i = 0; i < n; i++) {
if (colsum[i] == 0) {
res[0][i] = res[1][i] = 0;
... | ALGO | 0.999965 | 5.482376 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2020-02-10T05:21:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "060cb5e1... |
7bdc93db-18a3-46d4-b3dd-726bf16b83ce | SulfredLee/PcapReplayer | PcapReplayer/BackEnd/PlayerEngine/Config.cpp | #include "Config.h"
#include "LogMgr.h"
Config::Config()
: m_DateTime(boost::gregorian::date(1997, 7, 1)
, boost::posix_time::time_duration(0, 0, 0)){
LOGMSG_INFO("IN");
m_PlayerStatus = PlayerStatus::Stop;
m_nAdapterIdx = 0;
m_dSpeedFactor = 1;
m_vecSchedulerDay.resize(7, fals... | TOOL | 0.905816 | 5.7684 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2017-12-27T13:21:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f0cd79b1... |
4e6bcdd4-de45-4fbc-bb1a-5e85b805b727 | soham6125/Advent-of-Code-2021 | Day 9/Problem2.cpp | #include <bits/stdc++.h>
#define ll long long int
#define loop(a,b,i) for(long long int i=a;i<b;i++)
#define loopr(a,b,i) for(long long int i=a;i>=b;i--)
#define cn continue;
#define pb push_back
#define db double
#define mp make_pair
#defi... | ALGO | 0.999957 | 4.50991 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-12-04T13:30: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": "6181b92df74a... |
cc19f5d5-2b39-4f9d-8175-50e8773674c7 | mzagame74/comp2040 | ps1b/FibLFSR.cpp | // Copyright 2020 <NAME>
/** FibLFSR.cpp
* FibLFSR is a 16-bit linear feedback shift register
* <NAME> 9/19/2020
*/
#include "FibLFSR.h"
#define TAP_BIT1 13
#define TAP_BIT2 12
#define TAP_BIT3 10
/** constructors **/
FibLFSR::FibLFSR() : size(0), reg(nullptr) {}
FibLFSR::FibLFSR(std::string seed) {
size = see... | ALGO | 0.99395 | 6.194375 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-04-27T20:06:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef08c6af2d98... |
1a2f998b-731c-429f-9706-a49a995fdd4f | ArgyrisNt/IGA-implementation-in-CPP | examples/Example_Poisson_1D.cpp | // Solve Poisson 1D problem on a Nurbs circular line
#include <iostream>
#include "..\include\Assembler_1D.h"
#include "..\include\Poisson.h"
#include "..\include\BsplineCurve.h"
int main()
{
// - - - - - B-spline basis - - - - -
int degree = 2;
std::vector<double> values{ 0.0, 0.0, 0.0, 0.5, 1.0, 1.0, 1.0 };
... | ALGO | 0.999307 | 6.420321 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2023-03-20T23:02: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": "9fcbcb99f36... |
f4e01b0f-3c39-4915-9ef1-9e5f357cf54e | acoppens-umd/Multi-Compressed-Matrix-Multiplier | csr-csc/write_back_network.cpp | #include "write_back_network.h"
void write_back_network(
hls::stream<bool, DEFAULT_STREAM_DEPTH> &gate_to_network_initiation_stream,
hls::stream<DenseVal_t, DEFAULT_STREAM_DEPTH> (&gate_to_network_streams)[NUM_PES],
//out
ap_uint<32> *out_data,
int &write_back_counter,
int &atomic_write_count... | ALGO | 0.99957 | 4.695686 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-17T02:27:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cae705efa30b... |
28cf2103-cc9c-47f6-b5c9-c71ef450086c | aryan-vigyat2001/DSA-Practice | Day 1-10/MergeIntervals.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
void helper(stack<pair<int,int>>qpair,vector<vector<int>> &vec)
{
while(!qpair.empty())
{
pair<int,int>d=qpair.top();
vec.push_back({d.first,d.second});
qpair.pop();
... | ALGO | 0.999996 | 5.320388 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-07-16T20:23: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": "c751e7913bde... |
a2575c0b-5b8c-4f70-ad4c-9ec9f94baf58 | ChettriBishal/CP | GFG/FIND_THE_PATTERN_GFG.cpp | /* Find the pattern GFG
Given a sequence as follow:
1,1,7,19,73....
Find the Nth term of the given sequence.
*/
#include<iostream>
#include<vector>
#include<cassert>
using namespace std;
const int MAXN = 3;
const long MOD = 1e9+7;
typedef long long ll;
class matrix{
public:
ll data[MAXN][MAXN];
matrix(){
... | ALGO | 0.999973 | 4.149845 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-13T15:02: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": "810a1209e3fb... |
9764d74d-f19f-4f8e-9d01-d9b9cd5009df | tatsumack/atcoder | abc170/CForbiddenList.cpp | #include <bits/stdc++.h>
#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " ... | ALGO | 0.999987 | 4.000231 | {
"github_metadata": {
"branch": "master",
"commit_count": 527,
"repo_created_at": "2018-03-12T23:22: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": "51e2580c... |
70f54496-468e-4587-ac9b-badc8bf9389c | navneetk2001/CPP_Programs | Test Series/Amazon test Series/Data Structures and Algorithms/11. Binary Search Tree Questions/20. PreOrder to BST.cpp | https://practice.geeksforgeeks.org/problems/preorder-to-postorder4423/1
//Solution Approach :-
Node *buildTree( int pre[] , int &idx , int size ,int Min = -1e8 , int Max = 1e8 ){
if(idx >= size )return NULL;
if(pre[idx] < Min || pre[idx] > Max){
return NULL;
}
Node *root = newNode(pre[id... | ALGO | 0.99999 | 5.769371 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-02-14T06:01: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": "0dedad3afb... |
99dd6343-bcc4-4ef1-a088-b402f5c996e9 | joydip10/UVA | practise1.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <cmath>
#include <bitset>
#include <utility>
#include <set>
#include <numeric>
#define INF_MAX... | ALGO | 0.999681 | 3.83213 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-07-12T04:03:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58cebe0676ec... |
691a9ae7-80a0-4644-ab35-1da4268f6403 | CGAL/cgal | Surface_mesh_deformation/examples/Surface_mesh_deformation/all_roi_assign_example.cpp | #include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/Polyhedron_items_with_id_3.h>
#include <CGAL/Surface_mesh_deformation.h>
#include <fstream>
#include <iostream>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Polyhedron_3<Kernel, CGAL::Po... | ALGO | 0.981786 | 5.458112 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
03465646-cbc3-4649-95d7-c0fb2a215d9b | alstondu/lc | 209/209_1.cpp | // Practice 1
// 2024/03/26
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int minSubArrayLen(vector<int>& nums, int s){
int i = 0;
int sum = 0;
int subL = 0;
int result = INT32_MAX;
for(int j = 0; j < nums.s... | ALGO | 0.99986 | 6.247502 | {
"github_metadata": {
"branch": "main",
"commit_count": 253,
"repo_created_at": "2024-03-25T10:40: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": "df3488f413... |
31e79c1c-ea63-4e52-acf0-1830ebf7f456 | TheDev05/CARDIO | Domains/UnCategorized/LC135.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
std::cin >> n;
std::vector<int> num(n);
for (auto &i : num)
std::cin >> i;
std::vector<int> res(n, 1), left, right;
int count = 1;
for (int i = 0; i < n; i++)
{
if (i - 1 >= 0 && num[i - 1] > num[i])
... | ALGO | 0.999995 | 3.829026 | {
"github_metadata": {
"branch": "master",
"commit_count": 975,
"repo_created_at": "2021-06-04T20:37: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": "c8c5e94d... |
ea3b071b-596e-44b7-9c1f-4ebc89b17b37 | ITIvanov18/CSCB214_Introduction_to_algorithms | Bubble sort algorithm/Bubble sort algorithm.cpp | // Bubble sort algorithm.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
using namespace std;
void bubbleSort(int arr[], int size, int counter = 0) {
bool inversion = true;
while (inversion) {
inversion = false;
for (int i = 0; i < size - 1; i++) {
... | ALGO | 0.99615 | 5.214228 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2024-03-12T23:04: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": "59d1bb2df... |
ad2d815d-176c-4ee8-8c7e-4416721eb707 | BrushkouMatvey/ASM | lab6.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <windows.h>
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#define SIZE 10
#define TIMES 10000000
using namespace std;
int main()
{
srand(time(NULL));
int flag = 1;
double zero = 0.0;
clock_t begin, end;
do
{
int count... | ALGO | 0.998002 | 4.024955 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-05-15T16:23: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": "de41f4c155... |
559fb1f5-5fd7-48fe-adf0-84d7e3fcb8b3 | Sandeep-lohoni/LeetCode-Journey | palindrome_number_check.cpp | // Given an integer x, return true if x is a
// palindrome
// , and false otherwise.
// Example 1:
// Input: x = 121
// Output: true
// Explanation: 121 reads as 121 from left to right and from right to left.
// Example 2:
// Input: x = -121
// Output: false
// Explanation: From left to right, it reads -121. From rig... | ALGO | 0.99971 | 5.763494 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2024-03-26T11:56: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": "e7566e91f9... |
142f7be2-52b7-4b9c-9060-bbb6617437f1 | banimania/CompetitiveProgramming | Other/MaxCoins.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vll;
#define REP(i, a, b) for (int i = a; i < b; ++i)
#define REPV(i, a, b) for (int i = a; i >= b; --i)
#define SCAN(a) for (int i = 0; i < a.size(); ++i) cin >> a[i]
#define PRINT(a) for (int i = 0; i < a.size(); ++i) { cou... | ALGO | 0.99993 | 4.265585 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2025-01-31T20:06:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adb9f9d3f8... |
e4d42eb9-4d9c-49b0-b27a-d33290a7c07b | evan-hossain-zz/competitive-programming | contests/Others/HackerCup.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999759 | 3.362925 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-06-02T09:04:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "bd1617e0f... |
88994151-3b18-4f15-9f28-47cc2e7fcbf9 | baho0307/SnakeAI-cpp | SnakeAI/src/NeuralNet/NeuralNet.cpp | #include "NeuralNet.h"
NeuralNet::NeuralNet()
{
}
NeuralNet::NeuralNet(int input, int hidden, int output, int hiddenLayers)
{
iNodes = input;
hNodes = hidden;
oNodes = output;
hLayers = hiddenLayers;
weights = std::vector<Matrix>(hLayers + 1);
weights[0] = Matrix(hNodes, iNodes + 1);
for... | ALGO | 0.992541 | 4.303581 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2023-06-27T00:44: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": "645ac0e54... |
f2170b43-35f2-433a-b64b-c0317e2a0001 | dsaleixo/INF684T1 | INF684T1/src/ModeloGTSP_F1.cpp | #include "ModeloGTSP_F1.h"
ModeloGTSP_F1::ModeloGTSP_F1(Dados& d) :Base(d) {
;
}
void ModeloGTSP_F1::rodar() {
IloEnv env;
IloBoolVar**** X;
X = new IloBoolVar * **[d->n_locais];
for (int i = 0; i < d->n_locais; i++) {
X[i] = new IloBoolVar * *[d->Vizinhos[i].size()];
for (int li =... | ALGO | 0.99975 | 3.361358 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-11-24T09:46: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": "2d5b7bc9d... |
4bc5b477-3889-4799-9a13-acf11e328689 | Lordpilot/HestonEMcpp | src/RcppExports.cpp | // Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 1<PASSWORD>
#include <RcppArmadillo.h>
#include <Rcpp.h>
using namespace Rcpp;
// Y_euler_sim_cpp
arma::mat Y_euler_sim_cpp(arma::mat B, int n, int t, double Tt, arma::vec y0, double r, double alpha, double lambda, double sigm... | ALGO | 0.995844 | 6.179597 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-05-17T16:07: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": "1af838e34de9... |
be314599-bf48-42b7-b68b-dd9593b169dc | xerohour/xbox_leak_may_2020 | xbox_leak_may_2020/xbox trunk/xbox/private/ntos/video/nv20/drivers/ddraw/common/src/nvMem.cpp | /*
* Copyright 1993-1998 NVIDIA, Corporation. All rights reserved.
*
* THE INFORMATION CONTAINED HEREIN IS PROPRIETARY AND CONFIDENTIAL TO
* NVIDIA, CORPORATION. USE, REPRODUCTION OR DISCLOSURE TO ANY THIRD PARTY
* IS SUBJECT TO WRITTEN PRE-APPROVAL BY NVIDIA, CORPORATION.
*/
/********************************* ... | ALGO | 0.93188 | 5.509142 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-09-29T03:57:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 18,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e687b04b... |
249a735f-0e21-4852-94ed-52de5a0496aa | linda603/object-oriented-programming | problems/cpp/analyticSystem/readCsvFiles.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <unordered_map>
#include <filesystem>
namespace fs = std::filesystem;
class Analytic {
private:
std::string path;
std::unordered_map<int, int> countKeys;
std::unordered_map<int, int> sumKeys;
public:
... | TOOL | 0.907429 | 4.914527 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2025-02-18T22:44: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": "14fcd2cf324... |
963eb44b-e0dd-431a-a21a-52c1f5998d72 | SujonHasan/DataStructures-and-Algorithms | Data Structure/9. Segment Tree Lazy/Problem/section1/CAssignment_to_Segment.cpp |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lc (n << 1)
#define rc (n << 1) + 1
const int N = 1e5 + 9;
int a[N];
int t[N*4], lazy[N*4] = {-1};
void push(int n, int b, int e)
{
if(lazy[n] == -1) return;
t[n] = lazy[n];
if(b != e)
{
lazy[lc] = lazy[n];
... | ALGO | 0.99995 | 4.643333 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-02T06:13:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68b3904f4046... |
b5d18e2b-7cca-4940-bca2-77de5c0f111e | Zydiii/N-Grams | ngrams.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <sstream>
#include <fstream>
#include <string>
#include <queue>
#include <map>
#include <memory>
#include <ctime>
using namespace std;
//存储文件单词
bool set_file(string file_name, vector<string> &words)
{
ifstream infile;
stringstream word... | TOOL | 0.935562 | 3.971346 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-01-02T08:00: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": "47b42222a7... |
0e626a07-5d44-4fd4-84f0-9b74369fbe23 | m7mdkamal/Problem-Solving | codeforces/339C - Xenia and Weights.cpp | /*
* Name : 339C - Xenia and Weights
* Link : http://codeforces.com/problemset/problem/339/C
*/
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for (int i = 0; i < (int)n; i++)
#define FORN(i, n) for (int i = 0; i <= (int)n; i++)
#define ALL(x) x.begin(),x.end()
typedef long long ll;
int main() {
... | ALGO | 0.999994 | 3.477718 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-07-02T01:45: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": "4cc6ae174... |
a44efac2-c5ba-453d-9a77-61aa04249818 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0812/personal_submission/cf1090d_tiger2005.cpp | int main() {
int n, m; cin >> n >> m;
if (m == 1ll * n * (n - 1) / 2)
return puts("NO"), 0;
puts("YES");
set<pair<int, int>> st;
for (auto [a, b]: getv<int, int>(m))
st.insert(minmax(a, b));
for (int i = 1; i <= n; i ++)
for (int j = 1; j < i; j ++) if (!st.count({j, i})) {
vector<int> v(n... | ALGO | 0.999952 | 3.419279 | {
"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": "2028... |
8ce4cd6d-8365-4bfc-a86d-b3c62e2c5037 | yancouto/maratona-sua-mae | Gi/timus/1343.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef pair<int, int> pii;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
template<typename T> inline T ... | ALGO | 0.99998 | 3.872651 | {
"github_metadata": {
"branch": "master",
"commit_count": 490,
"repo_created_at": "2015-06-27T20:54:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "78262d71... |
da443752-7f33-4663-aed2-68d4472ba8b5 | deepak-ky/cpp-codes | cpp-codes/Recursion_bubble_sort.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define varname(name) #name
#define mod 1000000007
#define wer(x) cout<<"\n"<<varname(x)<<" here : "<<x
#define test int t;... | ALGO | 0.999944 | 4.841172 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-12-30T08:47: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": "7f840bb27139... |
9be2443b-5bac-4bee-972f-084229fb17a7 | akiiishiii/oi_exercises | code/4043.cpp | // 4043.cpp
#include <iomanip>
#include <iostream>
int const Maxn = 105, Maxm = 10005;
int n, k, v, cnt = 0, pre[Maxn], id[Maxn], vis[Maxn], b[Maxn];
double a[Maxn], low[Maxn], in[Maxn], ans;
struct edge {
int u, v;
double w;
edge() = default;
~edge() = default;
edge(int u, int v, double w) : u(u... | ALGO | 0.999883 | 3.758192 | {
"github_metadata": {
"branch": "master",
"commit_count": 502,
"repo_created_at": "2022-01-01T12:41: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": "7f3330b4... |
cdf3803f-3b25-4b22-999e-403bb5840671 | LoganJoe/training-data | 2019.4/2019.4.01/B.cpp | #include<bits/stdc++.h>
#define N 100005
#define ll long long
int n, head[N], ecnt;
struct edge
{
int v, w, next;
}e[N << 1];
ll f[N], Size[N], sum[N], t[N];
void add (int u, int v, int w)
{
e[++ecnt] = { v,w,head[u] }; head[u] = ecnt;
}
struct node
{
ll v, Size;
friend bool operator <(node t1, node t2)
{
return... | ALGO | 0.999968 | 3.696914 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-03-29T06:48:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d64f6194a... |
d94b9452-970f-43bb-8885-9ebbe8103a95 | mrunaltarwatkar018/Placement_Data_Structures_N_Algorithms | Arrays/2D Arrays/DFS/Number of Enclaves.cpp | /* Leetcode Problem No.: 1020. Number of Enclaves */
/*
Company Tags : AMAZON
Leetcode Link : https://leetcode.com/problems/number-of-enclaves/
*/
//Approach-1 (DFS)
class Solution {
public:
int m, n;
void dfs( vector<vector<int>>& grid, int i, int j ) {
... | ALGO | 0.999897 | 6.497916 | {
"github_metadata": {
"branch": "master",
"commit_count": 716,
"repo_created_at": "2024-06-24T13:15:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d788a23e... |
6827ae26-ef37-4672-bd0a-17d117599841 | NitkarshChourasia/pro-b_lang_master_private | downloaded_completely/C++/medium/[794] Building a Staircase [M].cpp | /*
#### Building a Staircase ####
Create a function that builds a staircase given the height and the type of building block.
[Examples]
___
buildStaircase(3, "#") ➞ [
["#", "_", "_"],
["#", "#", "_"],
["#", "#", "#"]
]
buildStaircase(4, "#") ➞ [
["#", "_", "_", "_"],
["#", "#", "_", "_"],
["#", "#", ... | ALGO | 0.998261 | 3.770655 | {
"github_metadata": {
"branch": "main",
"commit_count": 153,
"repo_created_at": "2022-12-11T14:53:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d41b6c034b... |
efa99837-af74-4d81-8307-32d97a57499a | midnightcoder/gracula | opencog/spatial/math/Matrix4.cc | /*
* opencog/spatial/math/Matrix4.cc
*
* Copyright (C) 2002-2009 Novamente LLC
* All Rights Reserved
* Author(s): <NAME>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License v3 as
* published by the Free Software Foundation and i... | TOOL | 0.99765 | 6.166042 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2010-09-06T08:37:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4d9eb62f9... |
1f8b2897-546a-400e-88de-eff94c9aeebd | fmozafari/angel | include/angel/quantum_state_preparation/sparse_qsp.hpp | #pragma once
#define _USE_MATH_DEFINES
#include "common_bdd.hpp"
namespace angel
{
using gates_sqs_t = std::vector<std::pair<target_qubit, std::vector<uint32_t>>>;
struct sparse_qsp_statistics
{
double time{ 0 };
uint32_t cnots{ 0 };
uint32_t sqgs{ 0 };
uint32_t nodes{ 0 };
uint32_t MC_gates{ 0 };
uint... | ALGO | 0.999581 | 5.249486 | {
"github_metadata": {
"branch": "master",
"commit_count": 470,
"repo_created_at": "2020-02-12T14:30:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 4,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "78aafde... |
7242aaa1-5e0c-46d9-853f-e445b67a509b | Priyadarshan2000/My-Data-Structure-Code | LAB Assignment_#6/Q3.cpp | //Implementation of Linear Queue operations like enQueue(), deQueue() and displayQ() using structure pointers.
//<NAME>
#include<stdio.h>
#include<stdlib.h>
#define MAX 50
struct lq{
int queue[MAX];
int rear;
int front;
};
void enQueue(struct lq *Q,int x) {
if(Q->rear == MAX-1){
printf("Queue is full");... | ALGO | 0.989208 | 4.396241 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-02-23T13:22:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "628f6ec91602... |
9c17f872-7f13-4ad1-a8f3-55b51cfd0609 | pz1971/Online-Judge-Solutions | lightOJ/1027 A Dangerous Maze.cpp | /*
Tutorial:
_p -> for positive attributes
_n -> for negative attributes
E = E_p + E_n
E_p = 1/n * sum(x_p)
= 1/n * sum(|x_p|) ------------- (1)
E_n = 1/n * sum(|x_n + E|) ----------- (2)
from (1) and (2):
E = 1/n * sum(|x|) + n_n/n * E
=> E = sum(|x|) / n_p
*/
#include <bits/stdc++.h>
using namespac... | ALGO | 0.999747 | 4.248331 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2019-09-01T13:03: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": "9730a215... |
21971f49-b26b-4c45-b4b9-039a4fef7368 | thanasis2222/Reaction-game | DIYReactionFestival.ino | #include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Initialize LCD (address 0x27 is common, adjust if needed)
LiquidCrystal_I2C lcd(0x27, 16, 2);
// Pin definitions
const int button1Pin = 2; // Player 1 button
const int button2Pin = 3; // Player 2 button
const int ledPins[] = {4, 5}; // 2 LEDs
const int numLeds = ... | TOOL | 0.934796 | 6.798594 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-03T15:48: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": "29184a6f1ebb... |
52766f85-f245-470f-8fa0-756620ca0002 | ULL-ESIT-IB-2021-2022/ib-2021-2022-p10_files-Albertohdez02 | ejercicioPE202-most-vowels/most_vowels.cc | /**
* Universidad de La Laguna
* Escuela Superior de Ingeniería y Tecnología
* Grado en Ingeniería informática
* Informática básica
*
* @file most_vowels.cc
* @author <NAME> <EMAIL>
* @brief programa que lee todas las palabras que hay en un fichero e imprime
* la palabra con más vocales en otro fich... | ALGO | 0.984149 | 4.968786 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-12-09T18:44:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49f2a4671f27d... |
076fefb9-ce27-4c70-9f3f-9a001626330e | wmjtxt/LeetCode | CppSolution/030. Substring with Concatenation of All Words.cpp | ///
/// @file :030. Substring with Concatenation of All Words.cpp
/// @author :wmjtxt(<EMAIL>)
/// @date :2018-12-23 15:51:57
/// @quote :
///
#include <iostream>
using namespace std;
class Solution {
public:
vector<int> findSubstring(string s, vector<string>& words) {
vector<int> res;
... | ALGO | 0.999898 | 5.244517 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2018-03-28T11:22: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": "aaa3439b... |
bd97e4c5-aafe-416d-84b2-44a572dfaf6d | truong11062002/IT001 | 20522087_03/Bai_176/Bai_176.cpp | #include<iostream>
#include<iomanip>
#include<ctime>
using namespace std;
void Nhap(int[], int&);
void Xuat(int[], int);
void XuatCon(int[], int, int, int);
void XuatTatCaCon(int[], int, int);
void XuatCon1(int[], int);
void XuatCon2(int[], int);
int main()
{
int l;
int b[100];
int k;
Nhap(b, k);
Xuat(b, k);
cou... | ALGO | 0.998035 | 3.470241 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2021-02-19T12:31: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": "4ff806d6ab43... |
0412bc94-ea52-4ed8-a714-ea583366ca1c | DavideSirico/programmazione-1 | 241106/es2.cpp | #include <iostream>
using namespace std;
/*Scrivere una funzione che ritorni true se un elemento x occorre
nella lista, false se l'elemento non occorre*/
struct node {
int data;
node * next;
};
void insert_node(node * x, node *t);
bool trova(node * head, const int x);
int main() {
node * head = new node;
... | ALGO | 0.999419 | 4.718228 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-10-07T10:41:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "958e4fd9ab6... |
12d4e679-e8ee-4788-b0e7-585621dea1c4 | e1001925/Lintcode | 142_o1-check-power-of-2/o1-check-power-of-2.cpp | /*
@Copyright:LintCode
@Author: michael18
@Problem: http://www.lintcode.com/problem/o1-check-power-of-2
@Language: C++
@Datetime: 16-10-11 07:27
*/
class Solution {
public:
/*
* @param n: An integer
* @return: True or false
*/
bool checkPowerOf2(int n) { //pay attention to the minus
... | ALGO | 0.997486 | 5.891004 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-10-18T03:55: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": "956daf3d69... |
7f7b2d5e-0ebd-4212-bbf8-8f8f733f5d69 | vxl/vxl | contrib/mul/vimt3d/vimt3d_sample_profile_trilin.h | #ifndef vimt3d_sample_profile_trilin_h_
#define vimt3d_sample_profile_trilin_h_
//:
// \file
// \brief Profile sampling functions for 3D images
// \author <NAME>
#include <vimt3d/vimt3d_image_3d_of.h>
#include <vil3d/vil3d_sample_profile_trilin.h>
#include <vnl/vnl_vector.h>
#include <vgl/vgl_point_3d.h>
#include <vgl... | ALGO | 0.903228 | 6.571585 | {
"github_metadata": {
"branch": "master",
"commit_count": 42154,
"repo_created_at": "2013-05-02T18:32:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 250,
"forks": 157,
"issues": 49,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b... |
13d5face-464c-4721-a0bf-cf3cf6f29db5 | baz241/pr | test3/source3.cpp | #include <iostream>
#include <numeric>
using namespace std;
int Nod(int A, int B) {
while (A != B) {
if (A > B) {
A -= B;
} else {
B -= A;
}
}
return A;
}
class Rational {
public:
Rational() = default;
Rational(int number) {
numerator_ = nu... | ALGO | 0.998526 | 5.665051 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-08-02T08:48:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e2779e43c6... |
4f3f995f-91a7-490f-b11a-33c8943e727f | VikasNayak405/Data_Structures | Practice/Repeat/ques3.c++ | /* Sai gave you two strings $1 and S2 of uppercase alphabets.
Your task is to find the longest string that can be constructed such that
it is a child of both A string is said to be a child of another string
if it can be formed by deleting 0 or more characters from the other string
Input format
First line of input ... | ALGO | 0.999884 | 4.464426 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-05-15T19:49: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": "debfd2bc518d... |
6f2c5edd-0a23-4dbf-a7ad-080e4b8352e3 | ETU-ADS/1373 | Lab 1/Жмуренко В.К/src/taskFunctions.cpp | #include "listFunctions.h"
#include "stackFunctions.h"
#include "taskFunctions.h"
#include <iostream>
#include <string>
using namespace std;
void dataVerification(string data, int arrayLenght, bool & resultOfChecking) // Функция проверки корректности введенных данных
{
int openingCounter = 0, closingCounter = 0;
for... | ALGO | 0.996366 | 3.413213 | {
"github_metadata": {
"branch": "main",
"commit_count": 129,
"repo_created_at": "2022-09-19T13:54:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 5,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "00559e17a36... |
6dac2e02-be99-4c19-bea7-fc7fb5fe5832 | Arastoa/BOJ | BOJ_2565/answer.cpp | #include <iostream>
#include <set>
#include <vector>
#define MaxSize 501
using namespace std;
int lis[MaxSize], size=0;
void setLIS(set<pair<int,int> >& data);
int main(){
int n; cin >> n;
set<pair<int, int> > s;
vector<int> lis;
for(int i=0 ; i< n ; i++){
int a, b; cin >> a >> b;
s.insert(make_pair(a... | ALGO | 0.999946 | 3.840532 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2015-03-06T06:03: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": "26a73027... |
1151e447-229f-49ed-8f27-77325db4d9db | DavidBShan/Competitive-Programming2022-2024 | OlympiadLevelFour/Nov 25/GoodDebugging.cpp | //find kth number
//binary search it
//idea to find kth number from seg tree
//check if current root node has enough? if no AC
//check if left child if left child has enough buggy lines? if so go to left child query
//otherwise go to right child (k-left child's buggy lines)
//get answer when we reach leaf node
#includ... | ALGO | 0.999933 | 4.46254 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-17T04:58:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fba5a70e936... |
416f263b-313c-4b4d-95d1-bb6a33e4fdad | Hsiang0128/Data_Strucure | Homework 2/main/1-3.cpp | #include <iostream>
template <typename T> //宣告一個模版資料型態命名命名為T
class Node { //宣告Node型態
public:
T data; //資料內容其資料型態宣告為T
Node* next; //下一個Node的位址
};
template <typename T> //宣告一個模版資料型態命名命名為T
class LinkedList {
private:
Node<T>* head; //宣告head為List開頭位址
public:
LinkedLis... | ALGO | 0.997722 | 4.624612 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-01T13:53: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": "dfd57047aefc... |
e36c76fd-1040-410b-9d86-ee64b9a0321f | bibibibibibi/Template | 数据结构/进阶版?/Treap(非旋转).cpp | #include<bits/stdc++.h>
#define xx first
#define yy second
using namespace std;
const int MAXN=1e5+5;
struct Treap
{
struct node
{
int fix,key,size;
int l,r;
node(){}
node(int _key):fix(rand()),key(_key),l(0),r(0),size(1){}
}tr[MAXN];
typedef pair<int,int> Droot;//用来Split... | ALGO | 0.999943 | 3.758523 | {
"github_metadata": {
"branch": "master",
"commit_count": 88,
"repo_created_at": "2018-12-27T13:07:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 49,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1c46de... |
bbe3f840-dc57-48e7-98c1-b738c47714bd | GutembergPraia/Lista_de_exercicios_C | 2_Lista_de_Exercicio/5 - Salario.cpp | /*
* Local: CETAM
* Data: 28/07/2017
* Matéria: Lógica e Linguagem de Programação
* Turma: Téc. em Automação Industrial 2017/1
* Prof.ª <NAME>
*
* 2º Lista de Exercido
*
* 5 - Faça um algoritmo que:
* a) Obtenha o valor para a variavel HT (horas trabalhadas no mês);
* b) Obtenha o valor para a variavel VH (valo... | ALGO | 0.96507 | 3.177485 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-09-10T19:56: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": "9b601f0689... |
2952a33a-b5f6-4713-b281-6803cd6b8d77 | slamaniabdelhafid/Lab1 | main.cpp | /*slamani abdelhafid. group 24.b83 . <EMAIL>*/
#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm>
#include <cstdint>
#pragma pack(push, 1)
struct BMPFileHeader {
uint16_t bfType;
uint32_t bfSize;
uint16_t bfReserved1;
uint16_t bfReserved2;
uint32_t bf... | TOOL | 0.900548 | 5.708187 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-11-04T10:16:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "1b460196d17... |
fe1928a4-9b9b-4ba4-9dc5-0753f4490bfa | FelixMatrixx/BT_04_23521215_23521704_23521494_23521821_23521208_23521327 | Bai142/Bai142.cpp | #include <iostream>
#include <iomanip>
using namespace std;
void Nhap(float[][500], int&, int&);
void Xuat(float[][500], int, int);
void XoaCot(float[][500], int, int&, int);
int main()
{
float b[50][500];
int k, l;
Nhap(b, k, l);
cout << "Ma tran da nhap la: \n";
Xuat(b, k, l);
int c;
cout << "Nhap cot can xo... | TOOL | 0.952073 | 3.415725 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2023-10-15T03:27: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": "5a6a35485... |
c58febb4-e626-4bed-a5cb-d82023671fac | Kelym/ACM_Training_Archive | Kattis/cookieselection.cpp | #include <cstdio>
#include <cstring>
#include <sstream>
#include <iostream>
using namespace std;
template<typename T>
class avl_tree{
private:
struct node{
node *ch[2];
int size, h;
T data;
inline void up(){h=ch[ ch[0]->h < ch[1]->h ]->h+1;}
node(const T&d):size(1),h(1),data... | ALGO | 0.999858 | 3.949663 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-10-05T04:17: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": "79189d5f6... |
a7e2ad63-85b6-4aa7-a7f8-0e66dda69b60 | shmohammadi86/SCINET | inst/include/stats/dens/dbinom.ipp | /*################################################################################
##
## Copyright (C) 2011-2018 <NAME>
##
## This file is part of the StatsLib C++ library.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with ... | ALGO | 0.995122 | 6.271262 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2019-07-15T22:40:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 5,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "e02ea3e6... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.