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 |
|---|---|---|---|---|---|---|---|
81c6a926-8a07-4c57-b3a9-d5ca306aa5ff | pulver22/nbs | Criteria/RFIDCriterion.cpp | //
// Created by pulver on 29/07/2019.
//
#include "Criteria/RFIDCriterion.h"
#include "Criteria/criteriaName.h"
#include "Eigen/Eigen"
#include "newray.h"
#include "utils.h"
#include <math.h>
using namespace dummy;
using namespace grid_map;
RFIDCriterion::RFIDCriterion(double weight)
: Criterion(RFID_READING, w... | ALGO | 0.997344 | 5.841524 | {
"github_metadata": {
"branch": "ral-publication",
"commit_count": 271,
"repo_created_at": "2015-04-02T08:50:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": ... |
3ec8c15a-20d2-4f1d-9e41-c97f999a3432 | tzupengwang/PECaveros | contest/ASC/ASC28/f.cpp | #include <bits/stdc++.h>
using namespace std;
struct Nd{
int vl;
Nd *tl , *tr;
Nd(){
vl = 0;
tl = tr = NULL;
}
};
#define mid ((l+r)>>1)
int Vl( Nd* now ){
return now ? now->vl : 0;
}
void assign( Nd* now , int l , int r , int p , int v ){
if( l == r ){
now->vl = v;
return;
}
if( p <= mi... | ALGO | 0.999993 | 3.739453 | {
"github_metadata": {
"branch": "master",
"commit_count": 448,
"repo_created_at": "2014-08-20T16:02:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 51,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e4fe3b... |
a970504f-a665-41a9-ba5f-ae6d06da5ae2 | matthb2/ParaView-beforekitwareswtichedtogit | VTK/Infovis/vtkCorrelativeStatistics.h | /*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile$
Copyright (c) <NAME>, <NAME>, <NAME>
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without... | ALGO | 0.980001 | 7.786983 | {
"github_metadata": {
"branch": "bgl",
"commit_count": 41030,
"repo_created_at": "2009-05-27T01:43:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6edbeb08d... |
1db402bb-8c66-4d99-b36b-a9fd2a616505 | Tudat/tudat | src/astro/relativity/relativisticLightTimeCorrection.cpp | /* Copyright (c) 2010-2019, Delft University of Technology
* All rigths reserved
*
* This file is part of the Tudat. Redistribution and use in source and
* binary forms, with or without modification, are permitted exclusively
* under the terms of the Modified BSD license. You should have received
*... | ALGO | 0.995032 | 7.225762 | {
"github_metadata": {
"branch": "master",
"commit_count": 6497,
"repo_created_at": "2016-01-22T10:01:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 87,
"forks": 148,
"issues": 1,
"pull_requests": 7
},
"file_meta": {
"content_id": "17962... |
aa0cdf83-911c-47f1-804b-66ce7e37716b | DrexelEGS/WarOfTheWorlds | WotWApp/SuperCollider-library/src/main/jni/Source/sc3-plugins/MCLDSparseUGens.cpp | #include "SC_PlugIn.h"
#include <stdio.h>
// realtime Matching Pursuit ugen
// (c) <NAME> 2012. All rights reserved.
static InterfaceTable *ft;
struct MatchingPbase : public Unit
{
// These member names are fixed by the GET_BUF macro:
SndBuf* m_buf;
float m_fbufnum;
int m_dictsize;
};
struct MatchingP : public ... | ALGO | 0.972037 | 4.884833 | {
"github_metadata": {
"branch": "master",
"commit_count": 177,
"repo_created_at": "2018-03-26T20:22: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": "db5547d6... |
78f6c55d-f2ef-4e26-8b75-96ca9d208f8d | JacobGH2/Hardware_Optimization | Branch_Prediction/predictor.cpp | #include<iostream>
#include<fstream>
#include<sstream>
#include<string>
using namespace std;
string fileName;
//ofstream outfile;
void outputResult(int correct, int branches, ofstream &out) {
out << correct << "," << branches << ";";
}
void alwaysTaken(ofstream &out) {
int numCorrect = 0, numBranches = 0;
uns... | TOOL | 0.921365 | 3.068417 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-04-25T01:15:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73b88e90c9a... |
031ab68f-5cb8-4f5f-ba32-18da4f196e64 | juarezpaulino/coderemite | problemsets/SPOJ/SPOJ/RRSCHED.cpp | /**
*
* Author: <NAME>(coderemite)
* Email: <EMAIL>
*
*/
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
#define SI(V) (int)(V.size())
typedef vector<int> VI;
struct Task { int p, v; };
int N;
Task T[50010];
long long RET[50010];
int BIT[50010];
inline void bit_... | ALGO | 0.999889 | 4.18146 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-12-12T21:51: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": "6e7d71b8af18... |
a5612ae4-8995-4492-9e5f-225663ae2624 | Vailderp/NumericalMethods | LR1/main.cpp | #include <iostream>
#include <iomanip>
#include <functional>
#include <equations>
int main()
{
using namespace std;
cn::Table<25, 16> table;
table.AddRows(5);
// Variant 5: x^4 - x^3 + 15x^2 - 30 = 0
{
constexpr float a = .0f, b = 4.f;
auto f = [](const float x) {
return powf(x, 4) - powf(x, 3) + 15 * po... | ALGO | 0.999345 | 5.052127 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2022-11-24T06:15: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": "295e6771d9f... |
2341e566-e1da-4651-add1-45e764885513 | shubhamsingh28/competitive-coding- | trie-insert-search.cpp | /*
My code is my code ,none of your code!! bitch
*/
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define fr(i,a,b) for(long long int i=a; i<b; i++)
#define rfr(i,a,b) for(long long int i=a; i>=b; i--)
#define faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ull unsigned ... | ALGO | 0.999872 | 3.291438 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-07-28T13:24: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": "47ffaf35cc... |
89ab6b4e-2cd5-4bb3-a8dc-1179a133b909 | hassan-jamshaid10/DSA-C- | HEAP/MIN HEAP.cpp | #include <iostream>
using namespace std;
void MAXheapify(int arr[], int n, int i) {
int largest = i;
int left = 2 * i;
int right = 2 * i + 1;
if (left < n && arr[left] > arr[largest])
largest = left;
if (right < n && arr[right] > arr[largest])
largest = right;
if (largest !... | ALGO | 0.99975 | 4.684838 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-05-19T11:46:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47a7e50924e... |
19cd0d4d-986b-41b2-b76c-4067185d312f | asanchez128/UVa-Solutions | 567_Risk.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
int matrix[25][25];
#define INF 100000
int main(){
//freopen("in.txt", "r", stdin);
//freopen("out.txt", "w", stdout);
int m;
int number;
int queries;
int tc = 0;
while(true){
for(int i = 1; i <= 20; ++i){
for(int j = 1; j <= 20;... | ALGO | 0.999145 | 3.561089 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2014-03-16T02:38: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": "f4072b69c... |
a0364d14-211b-49dd-b546-d868a468d7d2 | huawei-noah/bolt | compute/tensor/src/cpu/arm/fp16/convolution.cpp | // Copyright (C) 2019. Huawei Technologies Co., Ltd. All rights reserved.
// 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,... | ALGO | 0.986959 | 5.94929 | {
"github_metadata": {
"branch": "master",
"commit_count": 418,
"repo_created_at": "2019-12-02T12:06:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 950,
"forks": 163,
"issues": 40,
"pull_requests": 3
},
"file_meta": {
"content_id": "d7eb... |
3034aac2-2d80-4219-8a4c-413235f4d915 | MarcusAUm/BiliardoTriangolare | BiliardoTriangolare.cpp | #include <cmath>
#include <cstdio>
#ifndef BILIARDOTRIANGOLARE_CPP
#define BILIARDOTRIANGOLARE_CPP
struct Parameters {
double teta;
double q;
double dir;
};
class Line {
double teta;
double dir;
double q;
public:
Parameters Bounce(const Parameters s, Parameters t_0, double n) {
if (-M_PI_2 <= n * ... | ALGO | 0.998801 | 4.913479 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-05-20T10:12: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": "001f95bb4ed8... |
3e7475fc-e66c-4a5c-94e4-033d9acf0ee8 | handong1587/OJ | POJ/1274_The_Perfect_Stall_BipartiteMatching.cpp | #include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <vector>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define INF 0x3f3f3f3f
#define MAXN 205
#define MAXM 205
#define MAXV (MAXN + MAXM) // ?
// bipartite graph matching: adjacency list
bool used[MAXV];
int N, M;
int V;
vector<int> G[MAX... | ALGO | 0.999845 | 3.529733 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2015-06-28T13:52:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75b815a5... |
e16b9eca-a34c-47fc-8c31-e5daef392c64 | LevBarash/PMRQMC | PMRQMC.cpp | //
// This program implements Permutation Matrix Representation Quantum Monte Carlo for arbitrary spin-1/2 Hamiltonians.
//
// This program is introduced in the paper:
// <NAME>, <NAME>, <NAME>, A quantum Monte Carlo algorithm for arbitrary spin-1/2 Hamiltonians, Physical Review Research 6, 013281 (2024).
//
// This pr... | ALGO | 0.991255 | 4.9628 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-06-22T21:17:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b62665c55d... |
ecaefcbc-bb60-4512-9a11-ebac856982a9 | Mridul091/Leetcode | 200-number-of-islands/200-number-of-islands.cpp | class Solution {
private:
vector<vector<int>> dirs = {{0,1}, {0,-1}, {1,0}, {-1,0}};
public:
void bfs(vector<vector<char>> &grid, int n, int m ,int i, int j){
queue<int> q;
// 2d->1d= R* #col + C
// 1d->2d= R = index/#col, C = index%#col;
q.push(i*m+j);
... | ALGO | 0.999933 | 6.086487 | {
"github_metadata": {
"branch": "main",
"commit_count": 1619,
"repo_created_at": "2022-03-12T05:57:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43089e145... |
95461932-bec0-42f2-af81-50f46a0d7a97 | its-kumar-yash/BST-Problems | preOrderToBST.cpp | // Given an array arr[] of N nodes representing preorder traversal of some BST. You have to build the exact BST from it's given preorder traversal.
// In Pre-Order traversal, the root node is visited before the left child and right child nodes.
/* A O(n) iterative program for construction of BST from preorder traversa... | ALGO | 0.999926 | 6.579844 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-02-04T20:02: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": "c9b9c716b40f... |
7f4733fe-15aa-44e7-ad1c-844ebd51bfdb | ppzzyy11/LeetcodeTravel | 68.cpp | /*
* 68.cpp
* Copyright (C) 2021-05-18 pzy <<EMAIL>>
*
* Distributed under terms of the MIT license.
* Description:
*
* To implement:
* How:
*/
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <climit... | ALGO | 0.999866 | 5.791099 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2021-04-17T03:31: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": "2ed844d5d... |
6b28bad5-4d0e-47a2-b84b-651161e1d292 | allenhyp/LeetCodePractice | 297_Serialize_and_Deserialize_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 Codec {
private:
void encoder(TreeNode* root, ostringstream& out) {
if (!root) {
out << "# ";
... | ALGO | 0.997717 | 6.124918 | {
"github_metadata": {
"branch": "master",
"commit_count": 906,
"repo_created_at": "2017-05-07T10:46: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": "2d8e5997... |
ef067e39-432d-42e2-8dac-8e8e601b3434 | jylin34/Algorithm | code_hw2/dp2.cpp | //Algorithm hw2
//作法二 dp
#include<bits/stdc++.h>
#define IO cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define ll long long
#define vt vector
#define pb push_back
#define pll pair<ll,ll>
#define F first
#define S second
#define MOD 2552
using namespace std;
const ll maxn = 1e3+10;
ll t,w,h,k,q,a,b,c,d;
ll... | ALGO | 0.999766 | 3.803242 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-03-04T01:47:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a43630a83a... |
77cd4285-adca-48cd-8e0a-b9ea03460967 | RobTillaart/Arduino | libraries/RunningAverage/examples/ra_two_step/ra_two_step.ino | //
// FILE: ra_two_step.ino
// AUTHOR: <NAME>
// PURPOSE: demo two stage statistics.
// URL: https://github.com/RobTillaart/RunningAverage
#include "RunningAverage.h"
RunningAverage raHours(24); // holds hourly measurements
RunningAverage raDays(14); // holds min and max of the last seven days.
int ... | ALGO | 0.960223 | 4.082469 | {
"github_metadata": {
"branch": "master",
"commit_count": 2702,
"repo_created_at": "2011-10-09T19:53:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1523,
"forks": 3300,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e... |
b9496aea-0b2f-404a-bfc6-c5bf0d633ad9 | ANTL-KJH/BOJ-Cpp | Problem-4949/Problem-4949/main.cpp | /*
* Project Name : Problem-4949
* Program's purpose and basic function :
* - BAEKJOON Online Judge Problem-4949
* Program First Author : <NAME>
* Date of First Write : 2023.07.17
* =======================================================================================================
* Source Code Modification History... | ALGO | 0.999878 | 4.867552 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2022-12-22T11:32: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": "2c09a424c16... |
bca5efae-ab58-4d03-abe0-ea6e505f69c9 | chae-y/coding_test | cpp/17404.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int arr[1000][3] = {0, };
int dp[1000][3] = {0, };
int result = 999999999;
int n;
int solve(){
for(int i=2; i<n; i++){
dp[i][0] = min(dp[i-1][1], dp[i-1][2]) + arr[i][0];
dp[i][1] = min(dp[i-1][0], dp[i-1][2]) + arr[i... | ALGO | 0.999993 | 3.943342 | {
"github_metadata": {
"branch": "master",
"commit_count": 312,
"repo_created_at": "2021-08-06T00:59: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": "42da8290... |
fbf236a7-04d5-4d60-ac66-0cc405d53536 | kim2001sh/codetree | 250129/숫자 2배 후 하나 제거하기/multiply-two-and-remove-one-number.cpp | #include <iostream>
using namespace std;
int main() {
// Please write your code here.
int n, arr[100] = {}, min_value = 1 << 30;
cin >> n;
for (int i = 0; i < n; i++) cin >> arr[i];
for (int i = 0; i < n; i++) {
arr[i] *= 2;
for (int j = 0; j < n; j++) {
int sum = 0;
... | ALGO | 0.999967 | 3.85413 | {
"github_metadata": {
"branch": "main",
"commit_count": 938,
"repo_created_at": "2024-12-22T10:24: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": "f719e31002... |
694c5a74-6a1e-4732-9ba8-12683a0b97db | checkoutb/LeetCodeCCpp | ge2100/LT2150_2022-03-06_Find_All_Lonely_Numbers_in_the_Array.cpp |
#include "../header/myheader.h"
class LT2150
{
public:
// D D
// unordered_map<int, int> m;
// vector<int> res;
// for (int n : nums)
// ++m[n];
// for (const auto [n, cnt] : m)
// if (cnt == 1 && m.count(n + 1) == 0 && m.count(n - 1) == 0)
// res.push_back(n);
// return res... | ALGO | 0.999966 | 4.891964 | {
"github_metadata": {
"branch": "master",
"commit_count": 285,
"repo_created_at": "2019-04-22T09:20:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bcdc291... |
c8519adf-7a8c-407d-a4db-05237e7a46c6 | CRIS67/CoupeDeFrance2020 | Programmation/RPi/cdf2020/main.cpp | #include <iostream>
#include <cstdlib>
#include <pthread.h>
#include <vector>
#include <queue>
#include "web.hpp"
#include "dspic.hpp"
#include "actuators.hpp"
#include "SPI.hpp"
#include "lidar.hpp"
#include "actuators.hpp"
#include "hmi.hpp"
#include <wiringPi.h>
#include <wiringPiSPI.h>
// DStarIncludes
#include ... | TOOL | 0.992683 | 3.596306 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2019-06-27T19:36:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5a44f50e... |
6dd9c531-68bc-4342-b198-f463369e050d | vfolunin/archives-solutions | UVa Online Judge/1201.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
using namespace std;
class Graph {
class Edge {
int a, b, capacity, flow;
public:
Edge(int a, int b, int capacity) : a(a), b(b), capacity(capacity), flow(0) {}
int... | ALGO | 0.999642 | 4.253235 | {
"github_metadata": {
"branch": "master",
"commit_count": 2367,
"repo_created_at": "2017-11-27T10:19:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "b451714... |
753d36aa-ada1-480c-b7b2-8cfb6eab8b7f | benthinnick/leetcode | findfirstandlastpositionofelementinsortedarray.cpp | #include <vector>
class Solution {
public:
std::vector<int> searchRange(std::vector<int> &nums, int target) {
int found = -1;
int l = 0;
int r = nums.size() - 1;
while (l <= r) {
int mid = (l + r) / 2;
if (nums[mid] == target) {
found = mid;
break;
} else if (nums[... | ALGO | 0.999933 | 6.388236 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-05-05T14:04: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": "fdd648be85... |
830d0852-9c5e-4590-aca6-a8d9e36fd5d6 | PeterZs/SketchMeshVR | CosseratRods/CosseratRodsWithPD/src/projectivedynamics/softBody.cpp | #include "softBody.h"
#include "input.h"
void SoftBody::SetSimulationParameters(const SolverParameters& solver_p, const SimulationParameters& sim_param) {
_solver_param = solver_p;
_simulation_param = sim_param;
_h = _simulation_param.h;
/// init linear external forces
_f_ext = VectorX(_mesh->NumDOF() * 3);
for... | ALGO | 0.999314 | 5.362342 | {
"github_metadata": {
"branch": "master",
"commit_count": 387,
"repo_created_at": "2018-12-17T01:21:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0268b38c... |
f23f5e65-308e-45fc-a8b7-39abc441913d | linxigjs/AlgorithmExercise | main.cpp | //
// Created by gjs on 18-10-18.
//
//自底向上的归并排序
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
void GBSort(vector<int>& vec) {
temp = vec;
int len = vec.size();
for(int sz=1; sz<len; sz *= 2) {
for(int lo=0; lo<len-sz; lo += 2*sz) {
... | ALGO | 0.999987 | 5.428895 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-12-21T01:38: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": "516381b2c6... |
b8eafbea-8bef-4850-aa68-3e4bc9eb8ee5 | mrdv-rjgpl/hackerrank | SaveThePrisoner/save_the_prisoner.cpp | /**
*
* \brief Solution to save the prisoner challenge
*
* https://www.hackerrank.com/challenges/save-the-prisoner
*
* \author <NAME> <<EMAIL>>
*
*/
#include <bits/stdc++.h>
using namespace std;
/**
*
* \brief Compute the index of the prisoner at risk of poisoning.
*
* \param[in] n The number of prisoners... | ALGO | 0.999987 | 4.935103 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2017-07-23T06: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": "b1f927d1b... |
6cb25a5d-405b-4c54-a8d2-7e10c0629be7 | pjay20301/CheemsPlusPlus | Parser/intermediate_code_gen.cpp | #include<bits/stdc++.h>
#include <fstream>
#include "Lexer.cpp"
using namespace std;
int new_temp = 1;
map<pair<int,string>,pair<char,int>> populate_parse_table1() {
map<pair<int,string>,pair<char,int>> mp;
mp[{0,"id"}] = {'s',1};
mp[{2,"id"}] = {'s',6};
mp[{4,"id"}]= {'s',6};
mp[{5,"id"}]= {'s... | ALGO | 0.986892 | 3.603724 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2022-02-02T07:33: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": "3128833e447... |
c49329ed-767f-48e9-8071-98da2778fd0a | sunruoshi/Luogu-Codes | [算法1-2] 排序/P1177-[模板]-快速排序-3way.cpp | #include <iostream>
using namespace std;
void quick_sort(int arr[], int n) {
if (n <= 1) return;
int pivot = arr[n / 2], i = 0, j = 0, k = n;
while (i < k) {
if (arr[i] < pivot) swap(arr[i++], arr[j++]);
else if (arr[i] > pivot) swap(arr[i], arr[--k]);
else i++;
}
quick_sort... | ALGO | 0.999994 | 5.802375 | {
"github_metadata": {
"branch": "main",
"commit_count": 579,
"repo_created_at": "2021-06-24T08:41:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9475f2d5ed... |
382a3c80-706b-49b1-9d61-9d8e71caa6a0 | Ninad99/data-structures-and-algorithms | Algorithms/Two Pointers/ComparingStringscontainingBackspaces.cpp | /** Problem statement
* Given two strings containing backspaces (identified by the character ‘#’), check if the two strings are equal.
*
* Example 1:
* Input: str1="xy#z", str2="xzz#"
* Output: true
* Explanation: After applying backspaces the strings become "xz" and "xz" respectively.
*
* Example 2:
... | ALGO | 0.999829 | 6.322311 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2020-05-04T05:49:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08f7e785... |
2825f6a6-e0e4-44e7-9f7d-57f512c128e2 | raincross7/code-similarity | codes/train_code/problem469/problem469_94.cpp | #include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#... | ALGO | 0.999942 | 3.493807 | {
"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": "800c0117aea8... |
849f06d2-16be-4a93-9de6-9940f494a6a4 | esaatci/Design-Competition-2017 | sketch_may1/sketch_may1.ino | const int pwm_1=1;
const int pwm_2=2;
const int pwm_3=3;
const int pwm_4=4;
const int pwm_5=5;
const int pwm_6=6;
const int pwm_7=7;
const int pwm_8=8;
const int pwm_9=9;
int val=0;
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
forward(... | ALGO | 0.988452 | 5.227277 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-06-03T18:16: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": "0499b66423... |
0c55709a-1a3d-44d6-8310-9a29a7e4e281 | opensim-org/opensim-core | OpenSim/Common/VectorFunction.h | #ifndef OPENSIM_VECTOR_FUNCTION_H_
#define OPENSIM_VECTOR_FUNCTION_H_
/* -------------------------------------------------------------------------- *
* OpenSim: VectorFunction.h *
* -------------------------------------------------------------------------- *
* The Ope... | TOOL | 0.906442 | 7.277921 | {
"github_metadata": {
"branch": "main",
"commit_count": 16390,
"repo_created_at": "2014-06-12T16:57:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 896,
"forks": 337,
"issues": 369,
"pull_requests": 29
},
"file_meta": {
"content_id": "6b... |
e54a1a9c-2ec2-4153-b52d-6d509d1261d1 | jonatan-flyckt/chess-application | chess-application/magicslidinggenerator.cpp | #include "magicslidinggenerator.h"
MagicSlidingGenerator::MagicSlidingGenerator(){
for (int index = 0; index < 64; index++){
_bishop_masks[index] = maskBishopAttacks(index);
_rook_masks[index] = maskRookAttacks(index);
}
initaliseSliderAttacks(Bishop);
initaliseSliderAttacks(Rook);
}
... | ALGO | 0.944165 | 4.261872 | {
"github_metadata": {
"branch": "master",
"commit_count": 180,
"repo_created_at": "2020-07-04T15:52:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 12,
"pull_requests": 0
},
"file_meta": {
"content_id": "f769d03... |
274c496d-c52a-440b-bce8-1e5f04c10d72 | axzyh/odC- | B卷100分/素数之积/main.cpp | //
// main.cpp
// ODTest3
//
// Created by YuChao on 2023/6/1.
//
#include <iostream>
#include <unordered_map>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <regex>
using namespace std;
// 素数之积
// RSA加密算法在网络安全世界中无处不在,它利用了极大整数因数分解的困难度,数据越大,安全系数越高,给... | ALGO | 0.999908 | 4.636733 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-06-07T13:36:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da85842fa8... |
fbc59318-146a-47bf-a659-ebb73c65caa0 | NickM101/C-exercise | factorial_password.cpp | #include <iostream>
using namespace std;
// Function to calculate factorial
unsigned long long factorial(int n) {
// Base case: factorial of 0 or 1 is 1
if (n == 0 || n == 1) {
return 1;
} else {
// Recursive case: n! = n * (n-1)!
return n * factorial(n - 1);
}
}
int factorial_... | ALGO | 0.997021 | 5.454581 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-02-22T14:57:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab24e499224e... |
7b779cf0-f356-4a35-ab30-589d9fed2f37 | naiemofficial/Data-Structures-and-Algorithms | Linked List/Doubly Circular Linked List/Doubly Circular Linked List - Merge two unsorted lists into a sorted list.cpp | #include <iostream>
using namespace std;
struct NODE {
int data;
NODE *prev;
NODE *next;
};
class List {
public:
NODE *prevnode = NULL;
NODE *head = NULL;
NODE *tail = NULL;
};
void add(List &obj, int value){
if(obj.head == NULL){
obj.head = obj.tail = new NODE;
... | ALGO | 0.999905 | 4.9877 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-06-27T21:08:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "007d9056be8d... |
1f87e9af-f59f-4896-8905-47f672a9572f | pnquang260805/DSA-PTIT | DSA_P039.cpp | // DSA_P039 - CHỌN Ô 1
// Dynamic Programing With Bitmask
// https://viblo.asia/p/quy-hoach-dong-bitmask-Yym40r85L91
#pragma GCC optimize("O3","unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxn = 20;
int dp[1 << maxn]; // dp[1 << max] = dp[... | ALGO | 0.999916 | 5.778258 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2025-02-04T06:03: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": "6e9b0a66dac... |
52610393-18ec-480a-a96c-a1f47700a649 | spfrood/CPP-references | Chapters/Assignment_3/Gaddis_8thEd_Chap4_Prob4_RectangleAreas/main.cpp |
/*
* File: main.cpp
* Author: <NAME>
* Created on January 12, 2017
* Purpose: Gaddis, 8thEd, Chap4, Prob4
* This program will calculate the area of two rectangles and decide which
* rectangle has a larger area or if the areas are the same.
*
*/
//System Libraries
#include <iostream>
using namespace std;
... | TOOL | 0.997421 | 4.134903 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-03-30T19:58: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": "83f354ee2a... |
13a623a1-46cf-4f56-8b32-bf7d7bbc9d13 | ishandutta2007/codeforces-k | ko_osaga/normal/1209/G1.cpp | #include<bits/stdc++.h>
#define sz(v) ((int)(v).size())
using namespace std;
const int MAXN = 200005;
using lint = long long;
using pi = pair<lint, lint>;
int n, a[MAXN];
int minpos[MAXN], maxpos[MAXN];
int dx[MAXN];
int main(){
scanf("%d %*d",&n);
memset(minpos, 0x3f, sizeof(minpos));
for(int i=0; i<n; i++){
sc... | ALGO | 0.999709 | 3.786043 | {
"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": "4ca751491506... |
3af748e6-e9a8-4eb3-8d00-77ecb9f4a582 | prasadgujar/CompetitiveProgramming | a2oj/maths/hungryseq.cpp | #include <bits/stdc++.h>
using namespace std;
void sieveoferatosthenes(int res)
{
int n = 10000000;
bool prime[n + 1];
memset(prime, true, sizeof(prime));
for (int i = 2; i * i <= n; i++)
{
if (prime[i] == true)
{
for (int j = i * 2; j <= n; j += i)
{
... | ALGO | 0.999745 | 4.081857 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2018-01-14T12:28:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 230,
"forks": 69,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67e830... |
67384097-b739-4be2-9ad9-f4c365136dda | Ersatz77/advent-of-code-2020 | advent-of-code-2020/src/day_5/day_5.cpp | #include "day_5.h"
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <limits>
#include <stdexcept>
int binary_search(const std::string& bsp_string, int min, int max)
{
for (const char c : bsp_string)
{
switch (c)
{
case 'B':
case 'R... | ALGO | 0.998957 | 5.390831 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2020-12-01T16:03:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a05ffdad99... |
caea27f3-a0c7-4ba0-af9a-b9a724c00489 | shantanu-42/Computer-Graphics | cg/inside_outside_poly.cpp | #include <GL/glut.h>
#include <iostream>
#include <vector>
using namespace std;
#define MAX_VERTICES 10
vector<pair<int, int>> vertices;
vector<pair<int, int>> clickedPoints;
int numVertices;
// Function to draw the polygon
void drawPolygon() {
glColor3f(1.0, 1.0, 1.0); // White color for the polygon
glBegi... | ALGO | 0.999604 | 5.885497 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-26T13:40: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": "0ccf711df736... |
7b8d9bb7-45e6-4c2c-b37e-10e5070d0a1a | trilinos/Trilinos | packages/epetra/src/Epetra_LAPACK.h | /*
//@HEADER
// ************************************************************************
//
// Epetra: Linear Algebra Services Package
// Copyright 2011 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain ri... | TOOL | 0.908962 | 6.07897 | {
"github_metadata": {
"branch": "master",
"commit_count": 104031,
"repo_created_at": "2015-11-16T19:39:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 593,
"issues": 263,
"pull_requests": 61
},
"file_meta": {
"content_id":... |
e7306b9b-f251-42fb-aceb-e317c80532cf | lauragalbraith/AdventOfCode2021 | day07/main.cpp | // main.cpp: <NAME>
// Description: solver for Puzzles 1 and 2 of Day 7 of The Advent Of Code 2021
// See: https://adventofcode.com/2021
// Part 1: The crab movement cost is constant; How much fuel must they spend to align to that position?
// Part 2: The crab movement cost increases linearly; How much fuel must they s... | ALGO | 0.999455 | 5.665 | {
"github_metadata": {
"branch": "dev",
"commit_count": 90,
"repo_created_at": "2021-11-30T20:22: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": "78b02e8ae7ee... |
9701f7f1-43a2-4b15-a5ee-e166795f9b26 | viren-sureja/Love-Babbar-450 | 08_greedy/21_shortest_job_first_SJF.cpp | /*
link (can also refer another code here): [for non-preemptive]
https://www.geeksforgeeks.org/program-for-shortest-job-first-or-sjf-cpu-scheduling-set-1-non-preemptive/
link: [for preemptive]
https://www.geeksforgeeks.org/program-for-shortest-job-first-sjf-scheduling-set-2-preemptive/
video: https://youtu.be/9P... | ALGO | 0.999994 | 4.548048 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2021-03-21T14:17:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 356,
"forks": 169,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "30184... |
a5e3ac78-59a9-423b-bcb0-d321a1a31e2d | aospapp/aosp | external/ComputeLibrary/src/core/NEON/kernels/NEGEMMMatrixMultiplyKernel.cpp | /*
* Copyright (c) 2017-2020 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
* 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
* ri... | ALGO | 0.995745 | 5.981587 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-11-22T06:39:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 16,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da70c5c6f55... |
690d7691-5e11-4469-91f0-9088cee356e0 | mimizao/LeetCode | 92.反转链表-ii.cpp | /*
* @lc app=leetcode.cn id=92 lang=cpp
*
* [92] 反转链表 II
*/
#include <iostream>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(n... | ALGO | 0.999997 | 6.354989 | {
"github_metadata": {
"branch": "master",
"commit_count": 418,
"repo_created_at": "2022-07-01T16:24: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": "41ef06b6... |
bfccf7a2-70dd-427b-aaa3-5e732336a861 | peyojes/rsa-factoring | src/calculate_prime_numbers.cc | /**
* @name calculate_prime_numbers.cc
* @author <NAME>
* @copyright Copyright 2018 <NAME>. All rights reserved.
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include "../include/number.h"
#include"../include/cxxtimer.hpp"
using std::cout;
using std::ofstream;
using std::vecto... | ALGO | 0.989742 | 4.629747 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2020-06-25T18:12:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1cb3e02e0... |
9b66dc4a-b64f-46d2-b238-32a3d9e51449 | PranavJ123/DSA | LinkedList/ll.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node * next;
node(int val){
data = val;
next = NULL;
}
};
void insertAtTail(node * &head , int val){
node *n = new node(val);
if(head == NULL){
head = n;
return;
}
node * temp = he... | ALGO | 0.999892 | 4.024257 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-07-22T09:46: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": "23c876620... |
0ac95bf8-64ab-4fb7-a89d-6f1b5fb8bee1 | chirayu-sharma-07/my_leetcode_solutions | 0930-binary-subarrays-with-sum/0930-binary-subarrays-with-sum.cpp | class Solution {
public:
int numSubarraysWithSum(vector<int>& nums, int goal) {
// Brute force approach
// <NAME>
/*
int result=0;
int n=nums.size();
for(int e=0;e<n;e++){
int sum=0;
for(int f=e;f<n;f++){
sum+=nums[f];
... | ALGO | 0.999918 | 6.10796 | {
"github_metadata": {
"branch": "main",
"commit_count": 1158,
"repo_created_at": "2023-02-15T12:46: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": "b7a08e917... |
3faf7ecf-a934-40d6-81a1-e7d1c668f192 | theritikchoure/DS-Algo | Queue/queue.cpp | #include<iostream>
#include<string>
using namespace std;
class Queue{
private:
int arr[5];
int front, rear;
public:
Queue(){
front = -1;
rear = -1;
for (int i = 0; i < 5; i++)
{
arr[i] = 0;
}
... | TOOL | 0.988697 | 4.395447 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-01-27T04:27: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": "661c17cb59... |
ffc7e733-8921-4aac-b82e-71d313602e7a | avtomato/Basics-of-C-plus-plus-development-white-belt | week-02/13-Programming-Assignment/Solution/main.cpp | #include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;
// ответ на запрос BUSES_FOR_STOP
void PrintBusesForStop(const map<string, vector<string>>& buses_to_stops,
map<string, vector<string>>& stops_to_buses,
const string& stop) {
i... | ALGO | 0.943849 | 5.186274 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2017-06-14T19:41:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 19,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1428bba... |
74632839-168e-413a-adaf-ddf43faec952 | kisscool-fr/php_botan | Botan-1.8.11/src/pubkey/rw/rw.cpp | /*
* Rabin-Williams
* (C) 1999-2008 <NAME>
*
* Distributed under the terms of the Botan license
*/
#include <botan/rw.h>
#include <botan/numthry.h>
#include <botan/keypair.h>
#include <botan/look_pk.h>
#include <botan/parsing.h>
#include <algorithm>
namespace Botan {
/*
* RW_PublicKey Constructor
*/
RW_PublicKey::RW... | ALGO | 0.999575 | 6.941493 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2011-07-13T10:05:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "54d59426d... |
e494bad6-f448-453e-bc34-e31c97a0421a | s609dan/ktp | lab3.cpp | #include <iostream>
#include <math.h>
using std::cout;
using std::cin;
using std::endl;
double arcctg(double x) {
return M_PI_2 - atan(x); // M_PI_2 - це π/2
}
int main()
{
float t, x, y;
cout << "Please enter t = ";
cin >> t;
x = t + 0.7;
cout << "x = " << x << endl;
if (x < 0) {
... | ALGO | 0.999043 | 3.708155 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-10-09T18:13:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "323e2305606b... |
bb127f32-50e8-48c8-ace1-c3fbd4fa5f19 | likecs/Competitive-Coding | C++14/Maths/Basics/combinations.cpp | //COMBINATION LIBRARY
//Calculation C(n, r) modulo any number (prime or composite) using pascal triangle
//Pre-computation : O(n^2)
//Query : O(1)
const int MAX = 1e3 + 3;
const int MOD = 1e9 + 7;
int ncr[MAX][MAX];
void pascal() {
for (int i = 0; i < MAX; ++i) {
ncr[i][0] = ncr[i][i] = 1;
for (int j = 1; j < i... | ALGO | 0.999943 | 4.846223 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2015-07-27T13:21:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 400,
"forks": 145,
"issues": 1,
"pull_requests": 3
},
"file_meta": {
"content_id": "d01b... |
28f8621e-455a-4c97-8da8-451e64af835a | whywhyzhang/WhyZip | src/SearchCRC.cpp | // Compile command:
// cc SearchCRC.cpp -fPIC -shared -o libSearchCRC.so -O3
typedef unsigned int uint32_t;
// BEGIN CRC32
// Reference from https://web.archive.org/web/20080303102530/http://c.snippets.org/snip_lister.php?fname=crc_32.c
#define UPDC32(octet, crc) (crc_32_tab[((crc)^(octet))&0xff]^((crc)>>8))
static... | TOOL | 0.994941 | 4.931907 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-01-08T02:28: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": "d2b31365da74... |
d94c6d99-c846-4d7b-9a95-5cf854e025fb | maksymshvaiko/old_exer | algorithm/algorithm/main.cpp | #include "mylibrary.h";
using namespace std;
const int N = 20;
int main()
{
setlocale(LC_ALL, "RUS");
int arr1[N],arr2[N],counter = 1;
double t1, t2, t1sum = 0, t2sum = 0;
while (counter <= 4)
{
srand(time(0));
randArr(arr1, N, 11);//заполняем массив arr1 ранд числами
copyArr(arr1, arr2, N);//массиву... | ALGO | 0.999557 | 3.705148 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-12-02T23:43: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": "87d1cac42f... |
9b3869cf-e0f7-40dc-8622-36a93c83a8c8 | KillianBhands/C-basic-Projects | 5555.cpp | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(){
int MAX = 100;
int MIN = 1;
int GUESSES = 0;
int USER_GUESS;
int DIFFICULTY;
// hehie
srand(time(0));
int ANSWER = (rand()%MAX)+ MIN;
printf("----------------------*Rules*------------------------------- \n");
printf("---- You can have from ... | ALGO | 0.987782 | 3.126512 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-07-30T03:42:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "511be2eae3c0... |
cc5b97d1-81c4-461f-8434-5516e00bceb3 | danauclair/CardScan | tesseract-ocr/dict/stopper.cpp | /******************************************************************************
** Filename: stopper.c
** Purpose: Stopping criteria for word classifier.
** Author: <NAME>
** History: Mon Apr 29 14:56:49 1991, DSJ, Created.
**
** (c) Copyright Hewlett-Packard Company, 1988.
** Licensed under the ... | ALGO | 0.990634 | 6.244903 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2011-01-13T22:21:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 57,
"forks": 15,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "34b8a536... |
e2ee7346-96b7-44aa-ad1a-464e567cdc7d | dotdotot/algorithm | 문자열/stage_1_10.cpp | // 그룹 단어란 단어에 존재하는 모든 문자에 대해서, 각 문자가 연속해서 나타나는 경우만을 말한다.
// 예를 들면, ccazzzzbb는 c, a, z, b가 모두 연속해서 나타나고, kin도 k, i, n이 연속해서 나타나기 때문에 그룹 단어이지만, aabbbccb는 b가 떨어져서 나타나기 때문에 그룹 단어가 아니다.
// 단어 N개를 입력으로 받아 그룹 단어의 개수를 출력하는 프로그램을 작성하시오.
// 첫째 줄에 단어의 개수 N이 들어온다. N은 100보다 작거나 같은 자연수이다.
// 둘째 줄부터 N개의 줄에 단어가 들어온다. 단어는 알파벳 소문자로만 되어... | ALGO | 0.999974 | 4.51539 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2021-11-13T07:37:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "55681201... |
cc97dea1-76cc-4b0a-add1-965e886db045 | hsoft-star/CLeetcode | 812. Largest Triangle Area.cpp | class Solution {
public:
double largestTriangleArea(vector<vector<int>>& points) {
double res = 0;
for (int i = 0; i < points.size(); i++) {
for (int j = i + 1; j < points.size(); j++) {
for (int k = j + 1; k < points.size(); k++) {
res = max(area(poin... | ALGO | 0.999898 | 5.978932 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2017-05-13T21:08:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0a04a9dc... |
32b132e8-9671-4f9e-bd4a-2324c8850e0c | solomonooo/leetcode | 994.腐烂的橘子.cpp | /*
* @lc app=leetcode.cn id=994 lang=cpp
*
* [994] 腐烂的橘子
*/
// @lc code=start
class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
queue<pair<int, int>> q;
int fresh_cnt = 0, time = 0, m = grid.size(), n = grid[0].size();
for (int i = 0; i < m; i++) {
for... | ALGO | 0.999898 | 6.026735 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-02-03T00:46:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3a50790168c... |
e9d500a0-b39c-40b8-8222-6c1146045040 | RamonHossein/algoritmos_c_plus_plus | Matemática/Fatores Primos.cpp | /*
Fatores Primos
Os fatores primos de um número inteiro positivo são os números "primos" que dividem esse inteiro de forma exata.
Exemplo: fatoracao(18) = [2, 3, 3], porque '2 * 3 * 3 = 18'.
*/
#include <bits/stdc++.h>
using namespace std;
// Tamanho maximo dos números que serão analisado (10^7)
bitset<10000... | ALGO | 0.999701 | 4.841544 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-11-07T00:04: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": "bc5a2b1578... |
e567b4a4-ab45-48fd-9d43-9e754095598c | Shashwat1977/LeetCode2 | 687-longest-univalue-path/687-longest-univalue-path.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999895 | 6.27327 | {
"github_metadata": {
"branch": "main",
"commit_count": 1564,
"repo_created_at": "2022-03-31T06:54:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d92d5c241... |
436a3b25-44e8-471c-afd9-152da9d726ea | juarezpaulino/coderemite | problemsets/UVA/11308.cpp | /**
*
* Author: <NAME>(coderemite)
* Email: <EMAIL>
*
*/
#include <cstdio>
#include <string>
#include <map>
#include <queue>
#include <algorithm>
#include <cctype>
using namespace std;
struct comp {
bool operator()(const pair<int,string> &A, const pair<int,string> &B) const {
if (A.first != B.first) return ... | ALGO | 0.998178 | 3.343718 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2020-12-12T21:51: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": "e5a44cac5c10... |
b6435c2a-6b28-4066-8526-00327a487beb | dunglvt/DSA_28tech | Set Map/bai27.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <sstream>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
// input/output
#define fastIO ios_base::sync_with_stdio(false), cin.tie(nullptr)
// data type
#define ll long... | ALGO | 0.996312 | 4.697588 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-05T10:50: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": "1c9618f492f8... |
eeea21e0-ddc0-477c-a071-8d0402e212e1 | Menci/karatsuba-algorithm | BigInt.cpp | // Signed multiple precision big integer multiplication
#include <cstdint>
#include <vector>
#include <algorithm>
#include <iostream>
#include <string>
// #include <cstdlib>
// #include <fstream>
// #include <unistd.h>
// #include <gmp.h>
// std::string calculate(const std::string &a, const std::string &b, char op) {... | ALGO | 0.999983 | 5.47472 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-09-22T17:01:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9e075bed3... |
c471012f-f7ef-4a2e-8ab1-5632e45dd24f | dfelt/sml-simulator | main.cpp | #include <iostream>
#include "SimpletronH.h"
// Take two numbers from stdin and print sum
int test1[] = {
1007, // Read A
1008, // Read B
2007, // Load A
3008, // Add B
2109, // Store C
1109, // Write C
4300, // Halt
0000, // Variable A
0000, // Variable B
0000 // Variable C
};
// Reads two numbers from th... | ALGO | 0.972154 | 3.504844 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2012-09-13T19:05: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": "896cb04a2... |
040411ba-5501-4d98-a709-b41ccffc263f | hchaithanya/Data-Structure | lab5/1.cpp | #include<iostream>
using namespace std;
int rear,fron,n=5,a[5];
class que
{
public:
que()
{
rear=fron=-1;
}
int eqr(int x)
{
if((rear+1)%n==fron)
cout<<"queue is full\n";
else if (rear==-1&&fron==-1)
isempty(x);
else
{
rear=(rear+1)%n;
a[rear]=x;
}
}
int isempty(int y)
{
fro... | ALGO | 0.997384 | 3.435892 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-02-25T19: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": "df0d48e9b... |
7da96763-7a29-4249-b9de-db1a598d08e8 | xvsfekcn/Leetcode | ojleet/romantoint.cpp | /*************************************************************************
> File Name: romantoint.cpp
> Author:Kcn
> Mail:<EMAIL>
> Created Time: 2014年12月16日 星期二 02时28分00秒
************************************************************************/
#include<iostream>
#include<map>
using namespace std;
int charToInt... | ALGO | 0.999707 | 4.146152 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2014-11-08T08:50: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": "0c0d6cae... |
8b793e86-f6f6-4f46-ad2c-0fbe7aa7be0d | rnrudxo2872/algorithm_practice | Programmers_Joystick(sec).cpp | #include <string>
#include <vector>
#include <iostream>
using namespace std;
int smaller(int a, int b) {
return a > b ? b : a;
}
int solution(string name) {
int answer = 0;
int size = name.length();
string cur_str;
for (int i = 0; i < size; i++)
cur_str += 'A';
int index = 0;
... | ALGO | 0.999962 | 3.985796 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2020-07-22T04:00: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": "c4164f91... |
41f4eff9-2bd1-4e01-9931-49d82cc0c143 | JustinMamaril/DSA-CpE-010-CpE21S4 | Exercise 10/CPE010_HOA.10.1_GROUP5_sc2.cpp | #include <string>
#include <vector>
#include <iostream>
#include <set>
#include <map>
#include <queue>
template <typename T>
class Graph;
template <typename T>
struct Edge
{
size_t src;
size_t dest;
T weight;
inline bool operator<(const Edge<T> &e) const
{
return this->weight < e.weight;
... | ALGO | 0.999768 | 5.488142 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-08-12T06:39:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6919bd61240... |
546a17d8-68ee-4b01-a703-1b77be1ea393 | EasonQiu/LeetCode | 523_Continuous Subarray Sum.cpp | // Given a list of non-negative numbers and a target integer k, write a function to
// check if the array has a continuous subarray of size at least 2 that sums up to
// the multiple of k, that is, sums up to n*k where n is also an integer.
// Example 1:
// Input: [23, 2, 4, 6, 7], k=6
// Output: True
// Explanatio... | ALGO | 0.999843 | 5.635699 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-10-29T13:50:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d34e87a0... |
49331b92-118a-4919-a7f4-4d49cebf189d | nikhilgarg2797/epi_judge_cpp | buy_and_sell_stock.cc | #include <vector>
#include <limits>
#include "test_framework/generic_test.h"
using std::vector;
using std::numeric_limits;
using std::max;
using std::min;
double BuyAndSellStockOnce(const vector<double>& prices) {
int min_price_index = 0;
double current_diff;
double max_profit = 0;
for (int i = 0; i< ... | ALGO | 0.999578 | 5.92687 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-04-05T07:55:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "420c5b24617... |
7ae758ab-2a60-402e-a38e-9d1799d60719 | bbj14/atcoder | abc186/C/main.cpp | // clang-format off
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
#define rep(i, m, n) for (int i = m; i < (int)(n); i++)
#define repe(i, m, n) for (int i = m; i <= (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define yesno {cout<<"Yes"... | ALGO | 0.99842 | 3.9136 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-10-09T04:24: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": "c0be932f2fa... |
34fd0809-07b7-4762-a99d-0566528d47cb | swarooprth/password_validity_checker | Password.cpp | #include<iostream>
using namespace std;
void Password_validate(string s)
{
int l=s.length();
if(l < 6)
{
cout<<"Failure Password must be at least 6 characters long.";
return;
}
if(l > 24)
{
cout<<"Failure Password must be at max 12 characters long.";
return;
... | ALGO | 0.936887 | 3.285338 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-02-27T20:49: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": "e822ff8ce4... |
1ae4a564-1953-4a10-9eb9-69e802759381 | Volgarenok/spbspu-labs-2024-aads-a | zakozhurnikova.kristina/S2/getPostfixFromInfix.cpp | #include "getPostfixFromInfix.hpp"
#include <cctype>
#include <iostream>
#include "stack.hpp"
#include "queue.hpp"
#include "readWord.hpp"
bool isBinaryOperator(const std::string& op)
{
return op == "+" || op == "-" || op == "/" || op == "*" || op == "%";
}
bool hasMorePriority(const std::string& stack, const std::... | ALGO | 0.995859 | 5.048963 | {
"github_metadata": {
"branch": "master",
"commit_count": 5396,
"repo_created_at": "2024-02-18T16:08:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 33,
"issues": 0,
"pull_requests": 35
},
"file_meta": {
"content_id": "c1367... |
8a74267e-b61e-4bde-989a-99b370671f7e | jkrall/ocropus | ocropus/ocr-layout/ocr-pageseg-xycut.h | // -*- C++ -*-
// Copyright 2006-2008 Deutsches Forschungszentrum fuer Kuenstliche Intelligenz
// or its licensors, as applicable.
//
// You may not use this file except under the terms of the accompanying license.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you
// may not use this file excep... | CONFIG | 0.986202 | 5.244535 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2010-03-27T00:42:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 11,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "cae51c4... |
1b7dea71-d9a4-4e30-90c2-7bec381adab9 | AMReX-Codes/amrex | Src/Base/AMReX_PCI.H | #ifndef AMREX_PCI_H_
#define AMREX_PCI_H_
template <class FAB>
void
FabArray<FAB>::PC_local_cpu (const CPC& thecpc, FabArray<FAB> const& src,
int scomp, int dcomp, int ncomp, CpOp op)
{
auto const N_locs = static_cast<int>(thecpc.m_LocTags->size());
if (N_locs == 0) { return; }
... | ALGO | 0.908355 | 6.316148 | {
"github_metadata": {
"branch": "development",
"commit_count": 27456,
"repo_created_at": "2017-04-28T19:37:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 637,
"forks": 407,
"issues": 21,
"pull_requests": 19
},
"file_meta": {
"content_id... |
cf180d5c-18a1-470e-9ab9-dfaa44fd157c | Ahmad-Zaki05/Scarlet-Knights-Follow-Line-Robot-Challenge-2023 | Codes/Scarlet_Knights_Final_Code/Scarlet_Knights_Final_Code.ino | //sensors
#define LSP2 6
#define LSP 5
#define MSP 4
#define RSP 2
#define RSP2 3
//motor
#define LD 12
#define RD 10
#define LS 11
#define RS 9
//other
#define SPD 150 //FOWARD
#define SPD2 250 //MAIN WHEEL SPEED
#define SPD3 92 //SECONDARY WHEEL SPEED
#define SPD4 200 ... | CONFIG | 0.995936 | 4.223027 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-11-05T22:06:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3b8508a32e... |
453db5f1-e03c-4c89-bd26-1901730afa26 | SusmoyNath/leetcode-codes | 0990-verifying-an-alien-dictionary/0990-verifying-an-alien-dictionary.cpp | class Solution {
public:
bool isAlienSorted(vector<string>& words, string order) {
// Create a mapping of each character to its index in the alien alphabet
unordered_map<char, int> orderMap;
for (int i = 0; i < order.size(); i++) {
orderMap[order[i]] = i;
}
// Co... | ALGO | 0.999986 | 6.594458 | {
"github_metadata": {
"branch": "main",
"commit_count": 839,
"repo_created_at": "2025-02-15T19:51: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": "8688d3247d... |
26d18bc5-5e01-4384-a771-ee749dd6c26d | mastree/cp | IEEExtreme14/Infected.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>;
const int N = 2e3 + 10;
int n, m, q;
vector<int> adj[N];
int ans[N];
pii quer[N];
vector<pii> edges;
int r... | ALGO | 0.999947 | 4.006168 | {
"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": "7be1d9cf0... |
15039377-7d63-4bee-aa88-258a46ca2398 | EmmanuelEmu/DSA_-_leetcode | Leetcode/Graph/leetcode_2872. Maximum Number of K-Divisible Components.cpp | #include <bits/stdc++.h>
using namespace std;
int dfs(int node, vector<vector<int>> &adj, vector<int> &vis, vector<int> &values, int k, int &count)
{
vis[node] = 1;
long long sum = values[node];
for (auto it : adj[node])
{
if (!vis[it])
{
sum += dfs(it, adj, vis, values, k, ... | ALGO | 0.999948 | 4.652522 | {
"github_metadata": {
"branch": "master",
"commit_count": 1070,
"repo_created_at": "2024-07-12T20:20: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": "285551d... |
93d78f1d-1cd1-4ee5-b045-5b8cacbae810 | ziyi-zhang/Zebrafish | Cpp/OpticalFlow.h | #pragma once
////////////////////////////////////////////////////////////////////////////////
#include <zebrafish/Common.h>
#include <Eigen/Dense>
#include <string>
////////////////////////////////////////////////////////////////////////////////
namespace zebrafish {
typedef std::vector<Eigen::MatrixXd> FlowVeloci... | ALGO | 0.999422 | 6.550854 | {
"github_metadata": {
"branch": "master",
"commit_count": 356,
"repo_created_at": "2020-02-16T02:26:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02139596... |
e4432ae4-d608-455f-864c-381dacd6deb8 | RobotLocomotion/drake | multibody/plant/tamsi_driver.h | #pragma once
#include <vector>
#include "drake/common/default_scalars.h"
#include "drake/common/drake_copyable.h"
#include "drake/common/eigen_types.h"
#include "drake/multibody/contact_solvers/contact_solver_results.h"
#include "drake/multibody/plant/contact_jacobians.h"
#include "drake/multibody/plant/contact_resul... | ALGO | 0.986822 | 7.481048 | {
"github_metadata": {
"branch": "master",
"commit_count": 33726,
"repo_created_at": "2014-01-26T16:11:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3630,
"forks": 1305,
"issues": 690,
"pull_requests": 46
},
"file_meta": {
"content_id":... |
6ee4e6d3-b9e7-4c86-928b-9157e633cf09 | Eren121/TMXRenderer | include/config/Math.hpp | #pragma once
#include <string>
#include <iostream>
#include <SFML/Math.hpp>
#include <SFML/Graphics/Rect.hpp>
template<typename T>
std::vector<std::vector<T>> create2DVector(int dim1, int dim2)
{
std::vector<std::vector<T>> ret;
ret.resize(dim1);
for (int i = 0; i < dim1; ++i)
{
ret[i].resize... | TOOL | 0.96463 | 5.968419 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2021-05-03T11:22:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83ce6ef84... |
53336ef9-6619-4ff0-b85c-0fb6bd2a3b24 | lemonilemon/algo | prob/CF/313265/C1.cpp | /*
* Created : 2023-10-06 05:26:05 lemonilemon
* Time complexity : O()
* Space complexity : O()
* Description :
*/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long int;
#define LOCAL
// debug template
#ifdef LOCAL
#define debug(args...) _debug(#args, args)
#def... | ALGO | 0.999903 | 5.737864 | {
"github_metadata": {
"branch": "main",
"commit_count": 233,
"repo_created_at": "2022-10-24T11:06: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": "f8b9ffe556... |
0a512894-bbc1-4b71-ab54-8fce3fea9ad7 | eshibusawa/PoseEstimation | src/ThreePointRansacModel.hpp | // This file is part of PoseEstimation.
// Copyright (c) 2021, <NAME> <<EMAIL>>
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyri... | ALGO | 0.979521 | 7.578674 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2021-07-09T15:14:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89c927d422d... |
3d4f70aa-0bc9-4eda-8b8c-43aaf26646d0 | detamos/Handling-of-I-O-Devices-Interrupts-by-processor-Simulator- | src/simulator.cpp | #include <iostream>
#include "priorityQueue.hpp"
#include "../lib/priorityQueue.cpp"
using namespace cs202;
using namespace std;
class Device
{
public:
int id,burstTime,delay,priority;
bool operator<(const Device &a)
{
return (this->priority < a.priority);
}
};
int main()
{
int n;
cin>>n;
LinearList<Device... | ALGO | 0.999627 | 3.752878 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-04-24T13:15: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": "5fb2609c0f... |
bb8dbf75-0ce6-4d86-9871-816b539a1e62 | mcberry23/Collaborative-Robots | ping-ThreeSensorsTest/ping-ThreeSensorsTest.ino |
char report[80];
const int leftSigPin = 11;
long leftDuration;
int leftDistance;
const int frontSigPin = 14;
long frontDuration;
int frontDistance;
const int rightSigPin = 4;
long rightDuration;
int rightDistance;
void setup() {
Serial.begin(9600);
}
void loop() {
// Read left sensor
pinMode(leftSigPin, OU... | TOOL | 0.924457 | 4.957767 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2019-06-14T23:15:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "623ae1efc... |
88615a1c-d07a-4828-979e-df19b831a234 | arthurWangSuper/Algorithms | leetcode/AllElementsInTwoBinarySearchTree.cc | /*LeetCode 1305.All Elements in Two Binary Search Trees*/
// Given two binary search trees root1 and root2.
// Return a list containing all the integers from both trees sorted in ascending order.
#include <iostream>
#include <vector>
#include <stack>
#include <functional>
using namespace std;
struct TreeNode{
Tre... | ALGO | 0.999975 | 6.369634 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2018-01-28T15:46:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c8c2e9c7... |
9ef465f3-8aab-48ee-93a7-ff626505c1c2 | HatsuneMoe/step_by_step | LeetCode/Remove_Linked_List_Elements.cpp | #include <iostream>
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
/**
* @param head a ListNode
* @param val an integer
* @return a ListNode
*/
ListNode *removeElements(ListNode *head, int val) {
// Write ... | ALGO | 0.99996 | 5.226242 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2017-07-07T11:52: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": "c7cb9e8cd... |
00b82347-5e1d-4a3a-b50b-d6e6884dd296 | code-fans/books-source | 基础算法/第8章_高精度算法/8.1.12国王游戏/game2.cpp | //国王游戏
#include <bits/stdc++.h>
using namespace std;
struct data
{
int a,b;
} man[10005];
int CMP(data a,data b)
{
return a.a*a.b<b.a*b.b;
}
string MAX(string a,string b)
{
if(a.size()!=b.size())
return a.size()>b.size()?a:b;
return a>b?a:b;
}
string ToString(int num, string ans="")
{
for(; num; num/=... | ALGO | 0.999975 | 3.487583 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-08-24T10:16:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b0061c3c800d... |
f2fa0310-6b77-42bd-828c-2f741b1a5035 | krasnovskyi/CppMech | DODATKOVI/9_14.cpp | #include <iostream>
#include <cmath>
#include <bitset>
#include <string>
using namespace std;
unsigned* allocate_memory(int n) {
auto* arr = (unsigned*)malloc(n * sizeof(unsigned*));
return arr;
}
uint8_t* alloc_memory8_t(int n) {
uint8_t* newarr = (uint8_t*)malloc(n * sizeof(uint8_t*));
return newar... | ALGO | 0.994758 | 3.434679 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2022-06-03T11:13: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": "03624f44609... |
1ddc726a-e8fa-40c7-a826-b630e45a136d | wassimalharaki/Codeforces | 2000/MinimaxProblem.cpp | #include <bits/stdc++.h>
using namespace std;
// #define int long long
#define nl '\n'
#define v vector
void solve() {
int n, m; cin >> n >> m;
v a(n, v<int>(m));
for (auto& x : a)
for (auto& y : x)
cin >> y;
array<int, 2> ans;
auto check = [&](int k) -> bool {
v<i... | ALGO | 0.99982 | 3.82143 | {
"github_metadata": {
"branch": "main",
"commit_count": 160,
"repo_created_at": "2023-09-19T17:56: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": "e982210eb7... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.