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 |
|---|---|---|---|---|---|---|---|
08b4eab9-ed00-4c13-b093-eda6521195bb | isha-24/Leetcode | Find Mode in Binary Search Tree.cpp | //https://leetcode.com/problems/find-mode-in-binary-search-tree/
/**
* 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) {}
... | ALGO | 0.999965 | 6.359267 | {
"github_metadata": {
"branch": "main",
"commit_count": 183,
"repo_created_at": "2021-06-19T16: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": "e2549a06f8... |
d4282be2-8f3d-467d-9054-76be726c7692 | hlz099/Project-zero | EMTGv8/src/kepler_lagrange_laguerre_conway.cpp | //Lagrange method Kepler solver
#include "kepler_lagrange_laguerre_conway.h"
#include "STM.h"
#include <math.h>
namespace Kepler
{
//Lagrange-Laguerre-Conway Kepler solver
void KeplerLagrangeLaguerreConway(const double* state0, double* state, const double& mu, const double& propTime, STM& stm, const bool& compute_... | ALGO | 0.999997 | 5.115727 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2024-10-23T00:53: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": "44fe61e550... |
d4194cb6-3345-4be0-89bd-947cb1d9b929 | cubercsl/The-road-to-ACMer | Codeforces/910/910B.cpp | #include <bits/stdc++.h>
using namespace std;
#define clr(a, x) memset(a, x, sizeof(a))
#define mp(x, y) make_pair(x, y)
#define pb(x) push_back(x)
#define X first
#define Y second
#define fastin \
ios_base::sync_with_stdio(0); \
cin.tie(0);
typedef long long ll;
typedef long double ld;
typed... | ALGO | 0.999777 | 3.435739 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2017-04-28T00:42:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a2fdee... |
aab74495-d912-43d4-8ed1-a7c85284b358 | HyeonJunSong/Baekjoon | 백준_3 Gold/12875_칙령.cpp | ////2022.02.03
//이해 및 설계 : 33m 11s
//입력 : 2m 11s
//구현 :3시간 오바ㅋㅋ
//tot :
#include <iostream>
#include <string>
#include <list>
using namespace std;
int mostFarPerson(int standard, string* friendship, int N);
typedef struct Node {
bool ifPassed;
int num;
int max;
}node;
int main() {
int N;
cin >> N;
int d;... | ALGO | 0.999719 | 3.430063 | {
"github_metadata": {
"branch": "main",
"commit_count": 620,
"repo_created_at": "2022-06-19T13:02:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "554dd75f86... |
d381c718-6c26-4da1-b91e-a838c6e6360b | chenghangzhang/blending-weight-BSP | BSP3/mBool/MathSurport/UtilsUtils.cpp | #include "mPch.h"
#include "UtilsUtils.h"
bool IsPerpendicular(const Vector3d& p_VectorA, const Vector3d& p_VectorB, double p_Tolerance /*= GetTolerance().Linear()*/)
{
//double te = fabs(p_VectorA.dot(p_VectorB));
if (p_Tolerance > fabs(p_VectorA.dot(p_VectorB))) //向量点积为0即垂直
{
return true;
}
return... | TOOL | 0.903025 | 4.290338 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-10-08T12:23: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": "4ea6742973... |
064088ee-713d-4e31-a793-d8ce1b0ab5fb | TheRickRV/R1CK | Arduino/soil_moisture.ino | int soilMoistureValue; //variable for mosture value
int soilMoisturePercent; //variable for moisture percent
const int airValue = 532; //value measured by sensor in the air
const int waterValue = 285; //value measured by sensor in the pure water
char input_command; //character with command received
void se... | TOOL | 0.910462 | 4.853291 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-01-23T12:17: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": "6070a933e5... |
77304b0f-be5a-411b-8c82-dac0adf03ebd | tushxr16/leetcode-solutions | Find duplicates in an array - GFG/find-duplicates-in-an-array.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
vector<int> duplicates(int arr[], int n) {
vector<int> v;
for(int i=0;i<n;i++){
int idx = arr[i]%n;
arr[idx] += n;
}
for(int i=0;i<n;i++){
... | ALGO | 0.998929 | 5.402307 | {
"github_metadata": {
"branch": "main",
"commit_count": 2052,
"repo_created_at": "2022-03-10T13:36:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17618c79f... |
5129316f-299f-4c47-9df4-4f1bf3eab8c1 | navid-ebrahimi/IUST-CP-Assignments | HW7/Eulerian_graph.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void dfs(int v, vector<vector<int>>& graph, vector<bool>& visited) {
visited[v] = true;
for (int u : graph[v]) {
if (!visited[u]) {
dfs(u, graph, visited);
}
}
}
bool countConnectedVertices(vector<vector<int>>&... | ALGO | 0.999987 | 5.081528 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2023-02-15T20:07:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b1a94d2e36... |
3381588f-ed6c-4467-8689-272ce1c89362 | alibaba/MNN | source/backend/arm82/Arm82Relu.cpp | //
// Arm82Relu.cpp
// MNN
//
// Created by MNN on 2020/2/13.
// Copyright © 2018, Alibaba Group Holding Limited
//
#if defined(__ANDROID__) || defined(__aarch64__)
#include <limits>
#include "Arm82Relu.hpp"
#include "Arm82Backend.hpp"
#include "Arm82OptFunc.hpp"
#include "core/Concurrency.h"
#include "core/Macro... | TOOL | 0.917484 | 5.546956 | {
"github_metadata": {
"branch": "master",
"commit_count": 2067,
"repo_created_at": "2019-04-15T07:40:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12546,
"forks": 2006,
"issues": 91,
"pull_requests": 9
},
"file_meta": {
"content_id": "... |
b4c477b9-6907-4a20-87d9-74cc94ce78b8 | Nirob-Barman/Data-Structures-and-Algorithms | Data-Structure/Linear-Data-Structure/Array-Data-Structure/Introduction/Multidimensional-Array/Three-Dimensional-Array/3D-Array.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int x, y, z;
scanf("%d %d %d", &x, &y, &z);
int arr[x][y][z];
for (int i = 0; i < x; i++)
{
for (int j = 0; j < y; j++)
{
for (int k = 0; k < z; k++)
{
scanf("%d", &arr[i][j][k]);
... | ALGO | 0.955013 | 4.1158 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-09-14T09:45: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": "ef087890b83d... |
8e5a1c13-29a6-40d9-ab98-5e8d4451d8ea | skalam02/C | hw8_8cross.cpp | /*
<NAME>
CS211 52B
HW #8
09/16/2016
This programs solves the Eight Cross Problem using the backtracking Algorithm.
The numbers printed from the are array indexed to the cross as follows-
**
12
*0347*
56
**
*/
#include <iostream>
#include <cmath>
using namespace std... | ALGO | 0.999919 | 4.688284 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-09-14T16:30: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": "739d7ca1ab... |
e5af174d-327d-4973-b3e2-d32d4abf39b0 | fiskercui/testlanguage | testcpp/testsort.cpp | #include <stdio.h>
#include <random>
void swap(int&x, int&y)
{
int temp = x;
x = y;
y = temp;
}
//直接插入排序
void insert_sort(int a[], int n)
{
for(int i = 1; i < n ; i++)
{
for (int j = i-1; j> 0; j--)
{
if(a[j+1] < a[j])
swap(a[j+1], a[j]);
else
break;
}
}
}
//快速排序
void quick_sort(int s[], ... | ALGO | 0.999731 | 4.502316 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2014-07-20T17:13: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": "97cb61cd... |
ad97b2cb-5ccb-457f-ab13-2358146617dc | rogers140/leetcode-oj | Insertion Sort List/Solution.cpp | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* insertionSortList(ListNode* head) {
if (head == NULL || head->next == NULL) return head;
ListNode* dummyhead = new ListNode(-1);
dummyhead->next ... | ALGO | 0.999996 | 5.465674 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2014-01-27T02:58: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": "fdd1e941... |
e6aac5e5-beec-427b-8a9f-a5422c417245 | Jonny912/feetcode | strStr/Source.cpp | #include <string>
#include <time.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <unordered_set>
#include <set>
#include <unordered_map>
#include <algorithm>
using namespace std;
class Solution {
public:
int strStr(string haystack, string needle) {
// Fast STL solution => Tim... | ALGO | 0.999543 | 5.463266 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-01-21T09:50: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": "f9550d3265b... |
761dc158-1ef5-4386-9b92-c914d62482f7 | alexandraback/datacollection | solutions_5631572862566400_0/C++/dwb/C3.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX_STUDENTS 1000
int score_arrangement(int *circle, int *bffs, int sz) {
auto left_happy = 0;
for (auto i = 1; i <= sz; i++) {
auto bff = bffs[circle[i % sz]];
if (circle[(i + 1) % sz] == bff || circle[(i - 1) % sz] == bff)
left_happy++;
el... | ALGO | 0.999852 | 4.150291 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "760f87d0f... |
2bb5bd56-93cb-4ff0-b249-eb1bb4f1802c | jariasf/Online-Judges-Solutions | UVA/Volume 108 (10800-10899)/10800 - Not That Kind of Graph.cpp | /*****************************************
***Problema: Not That Kind of Graph
***ID: 10800
***Juez: UVA
***Tipo: String Output
***Autor: <NAME>
******************************************/
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <stdlib.h>
#include <cctype>
#include <cmath>
#include <... | ALGO | 0.999078 | 3.43451 | {
"github_metadata": {
"branch": "master",
"commit_count": 698,
"repo_created_at": "2013-07-08T16:23:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 33,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "495ef6... |
54142562-1a79-46fc-b14d-57b396adb034 | playXE/NeuronNetwork3Xor | NeuronNetwork3Xor/NeuronNetwork3Xor/Source.cpp | #include <cstdlib>
#include <iostream>
#include <ctime>
#include "siec.h"
using namespace std;
const double T[] = { 0.0, 1.0, 1.0, 0.0 };
const double P0[] = { 1.0, -1.0, -1.0 };
const double P1[] = { 1.0, -1.0, 1.0 };
const double P2[] = { 1.0, 1.0, -1.0 };
const double P3[] = { 1.0, 1.0, 1.0 };
int main(int argc, ... | ALGO | 0.999425 | 3.839844 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-10-29T03:08: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": "f0a0ceb1d3... |
54af86d1-bfe7-4b68-9352-1a46a6655b8e | hooge104/RcppRollMeandB | src/roll_meandB.cpp | #include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
NumericMatrix roll_meandB(NumericMatrix x, int windowSize) {
int rows = x.nrow();
int cols = x.ncol();
NumericMatrix out(rows, cols);
for(int k = 0; k < cols; k++) {
NumericVector column = x(_, k);
for(int i = 0; i < rows; i++) {
// Ce... | ALGO | 0.99352 | 7.308485 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-07-26T12: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": "74f4dc7dd717... |
d71aa1e0-92db-4587-b3ba-8d1f39c26039 | mayank-kumar111/Programs | OOPs Lab/Q29.cpp | /*Define a class in C++ to represent bank account. The data to be stored is account number, name, balance in account. Assume maximum of 10 customers in bank
a) write member function to print name and account number of the customer with balance below RS.100
b) write member functions for withdrawal and deposit*/
#includ... | TOOL | 0.982249 | 4.887789 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-28T16:04: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": "0df2292d8e4d... |
539216f7-0209-472d-a95f-849e84fac78a | Weakie/WSN_SYSTEM | cpp/CAPSO/EvaluateCalculator.h | #include <vector>
#include "myutil.h"
#include "Node.h"
using namespace std;
#ifndef EVALUATECALCUTATOR
#define EVALUATECALCUTATOR
class EvaluateCalculator {
private:
static EvaluateCalculator evaCal;
public:
static EvaluateCalculator& getInstance();
private:
vector<double> iniPos;
vector<vector<bool>> grids;
do... | ALGO | 0.999703 | 4.306205 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-07-26T11:25:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ea3173ac4... |
3cd0d265-0218-4a9b-ab14-ea7f2b22b795 | marlovi/aulas | materialC++/exercicios09.cc | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void quadrado(vector<float> &);
void imprimir(vector<float> &);
void preencher_vetor(vector<float> &);
template<typename X> X menor(const X &, const X &);
template<typename X> void swap(const X &, const X &);
template<typename X> X maior(const ... | ALGO | 0.9945 | 3.017918 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2017-07-22T23:41:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 9,
"issues": 0,
"pull_requests": 106
},
"file_meta": {
"content_id": "483e1a... |
469014e0-e1a5-40a9-88bb-63adc64a3995 | tesseract-ocr/tesseract | src/arch/intsimdmatrixavx2.cpp | ///////////////////////////////////////////////////////////////////////
// File: intsimdmatrixavx2.cpp
// Description: matrix-vector product for 8-bit data on avx2.
// Author: <NAME>
//
// (C) Copyright 2017, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use t... | ALGO | 0.99543 | 5.129212 | {
"github_metadata": {
"branch": "main",
"commit_count": 6559,
"repo_created_at": "2014-08-12T18:04:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 68226,
"forks": 10036,
"issues": 418,
"pull_requests": 26
},
"file_meta": {
"content_id": ... |
83062628-75fd-4012-910c-b2f3d8ba9545 | rwth-i6/rasr | src/Mm/DensityClustering.hh | /** Copyright 2020 RWTH Aachen University. All rights reserved.
*
* Licensed under the RWTH ASR License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.hltpr.rwth-aachen.de/rwth-asr/rwth-asr-license.html
*
* Un... | ALGO | 0.983021 | 6.570853 | {
"github_metadata": {
"branch": "master",
"commit_count": 264,
"repo_created_at": "2020-08-10T08:34:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 57,
"forks": 16,
"issues": 7,
"pull_requests": 12
},
"file_meta": {
"content_id": "26638b... |
3e83dda7-de75-4c97-ad77-6b680828d060 | alexandraback/datacollection | solutions_5658571765186560_0/C++/misoxxx/D.cpp | #include <cstdio>
#include <string>
#include <set>
#include <iostream>
#include <cstdlib>
#include <queue>
#include <cmath>
#include <vector>
#include <map>
#include <ctime>
#include <sstream>
#include <list>
#include <algorithm>
#define pb push_back
#define FOR(a,b) for(int a=0;a<b;a++)
#define ll long long
#define P... | ALGO | 0.999449 | 3.279749 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23732aab8... |
94f55c87-7907-4042-813c-b27bbc23b7de | kaditya125/GfG_practice_Question | Difficulty: Easy/Strings Rotations of Each Other/strings-rotations-of-each-other.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to check if two strings are rotations of each other or not.
bool areRotations(string &s1, string &s2) {
// Check if lengths are equal
if (s1.length() != s2.length(... | ALGO | 0.99702 | 6.070162 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2023-12-06T19:07:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "69225f7c5f... |
c879d580-40bf-4408-a703-37ec547c1add | uminekohouse/ABC | ABC119/A.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
using LL = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
const long long LINF = 1LL << 60;
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int i = 0; i < (n); ++i)
template<class T>void chmin(T&a, T b){if(a > b) a = b;}
... | ALGO | 0.998865 | 3.621404 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-07-14T09:06:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d55399f10b... |
fa2ab502-258b-4bc4-8a3d-7ef52242aa40 | RitikJainRJ/GFG-Practice | Travelling Salesman Problem.cpp | #include<bits/stdc++.h>
using namespace std;
class Graph{
private:
int n;
vector<vector<int>> mat;
int _tsp(int u, int c, vector<bool> &visited){
if(c == n - 1)
return mat[u][0];
int m = INT_MAX;
visited[u] = true;
for(int v = 0; v < n; v++){
if(!vi... | ALGO | 0.999977 | 4.754703 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2019-12-13T09:08:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "64e6879e8... |
c58ec9ba-5cc4-40e6-802e-a7342ce74cb3 | nsj6646/PS | BOJ/1000/1939.cpp | #define N 100001
#define MAX_WEIGHT 1000000000
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
int n, m;
int src, dst;
typedef pair<int, int> pii;
vector<pii> v[N];
int visited[N];
queue<int> q;
void init() {
memset(visited, 0, sizeof(visited));
}
bool bfs(int limit) {
i... | ALGO | 0.999913 | 3.681849 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2019-03-12T08:03: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": "7c326fbef... |
beda45e9-7312-4098-8068-2d7aa2f9a183 | bhanu-kv/robocup | informed_rrt_star.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <ctime>
class Point {
public:
int x, y;
Point(int x = 0, int y = 0) : x(x), y(y) {}
};
class TreeNode {
public:
double locationX, locationY;
TreeNode* parent;
std::vector<TreeNode*> chi... | ALGO | 0.999979 | 6.004612 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-05T07:48: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": "e2a8e0562253... |
e42346e2-f143-4736-b74f-e1ebc38a3da4 | ishandutta2007/codeforces-h | hloya_ygrt/normal/621/B.cpp | #include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define ll long long
#define mp make_pair
const int maxn = 1e3 + 5, inf = 2e9;
bool a[maxn][maxn];
vector<pair<int,int> > pos;
int main()
{
// freopen("input.txt","r",stdin);
// freopen("output.txt","w"... | ALGO | 0.999744 | 3.480681 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "fe1756100a0a... |
be2db5ab-6e85-4a92-8fd2-d178e3dcc2a5 | lovebaonvwu/leetcode-cpp | 2021/perfect_number.cc | class Solution {
public:
bool checkPerfectNumber(int num) {
if (num < 2) {
return false;
}
int sum = 1;
for (int i = 2; i <= sqrt(num); ++i) {
if (num % i == 0) {
sum += i + (i == num / i ? 0 : num / i);
}
}
return num == sum;
}
};
// Runtime: 0 ms, faster than ... | ALGO | 0.999886 | 5.714808 | {
"github_metadata": {
"branch": "master",
"commit_count": 2622,
"repo_created_at": "2019-04-21T11:29:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "356c60e... |
04d4733e-f7fb-4dda-9276-adc8e855294f | LeONEL1021/LeONEL1021 | structejercicio.cpp | #include <iostream>
using namespace std;
struct ejercicio
{
string nombre;
int carnet;
int edad;
};
float cum(float suma)
{
int uv=5;
float resultado = 0;
resultado = suma * uv;
return resultado;
}
int main()
{
int estu;
float notas[3];
float suma=0;
cout << "ingresa l... | TOOL | 0.943898 | 3.54035 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-05-20T18:38: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": "86f9d6d3284d... |
a8f6ec4f-212a-4f58-80e3-b1621c0a5b12 | gnleece/Dogwood | Engine/Src/Physics/CollisionDetection.cpp | #include "Physics\CollisionDetection.h"
#include "GameObjectBase.h"
#include "Math\Transformations.h"
#include "Physics\Collider.h"
CollisionData::CollisionData(int maxContacts)
{
Contacts = new CollisionContact[maxContacts];
NextEmptyContact = Contacts;
ContactsUsed = 0;
ContactsRemaining = maxContac... | ALGO | 0.999086 | 6.834515 | {
"github_metadata": {
"branch": "master",
"commit_count": 467,
"repo_created_at": "2013-09-22T22:53:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "14eb1e0... |
18a624e3-e5d0-4fed-a09a-843dc9cb1d64 | Ping-Group-UCSC/denmat_dynm_development | src_v4.5.7/scattering_model/ElecElec_Model.h | #pragma once
#include "common_headers.h"
#include "Scatt_Param.h"
#include "lattice.h"
#include "parameters.h"
#include "electron.h"
#include "Coulomb_Model.h"
#include "mymp.h"
struct elecelec_model
{
lattice *latt;
electron *elec;
coulomb_model *coul_model;
int nk, bStart, bEnd, nb, nbpow4, bStart_wannier; // bS... | ALGO | 0.998365 | 3.438845 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2020-07-22T02:49:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebbbbe31a6... |
5223ad2e-8543-45c0-b4a1-5d86071950c7 | rashid642/SDE-SHEET | Day 8/GFG-N-meetings-in-one-room.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the maximum number of meetings that can
//be performed in a meeting room.
int maxMeetings(int start[], int end[], int n)
{
vector<vector<int>> res;
... | ALGO | 0.999977 | 5.580618 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2021-10-17T14:00: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": "d704058fd... |
0d06d8d2-047c-4a92-aaa7-9a6686943915 | Yusuf-sust/Problem_Solving | AL PRAGRAM/Algorithm Implementation/Articulation point.cpp | #include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<math.h>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
using namesp... | ALGO | 0.999987 | 3.911542 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-12-20T13:01:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e250571500b8... |
851884d7-93b9-495b-98f8-23e51dd8e8f3 | AlaminHossain01052000/competitve-programming | dynamic-programming/templates/editDistance.cpp | #include<bits/stdc++.h>
using namespace std;
//Given 2 strings. You can allow to do 3 types of operation each of them cost is 1.
// 1. Replace a character from s1 to s2 or s2 ro s1
// 2. Remove a char from s1 or s2
// 3. Adding a character is s1 or s2
// You have to calculate the minimum number of operation required to... | ALGO | 0.999992 | 4.779898 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2022-08-16T15:34:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdb1fdb341f... |
4338cfd8-4b22-4125-ae20-a7d1c1b3dacf | highweb-project/highweb-browser | android_webview/browser/aw_contents_statics.cc | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "android_webview/browser/aw_contents_statics.h"
#include "android_webview/browser/address_parser.h"
#include "android_webview/browser/aw_browser... | TOOL | 0.914188 | 7.620241 | {
"github_metadata": {
"branch": "20170926",
"commit_count": 610166,
"repo_created_at": "2016-06-29T03:06:46.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "randdkim/chromium",
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"cont... |
3967ad5d-a5b6-4c7b-92cd-bdfd22fac117 | ise-uiuc/WhiteFox | llvm-exec/source-code-data/llvm/llvm-func-body/LoopSimplifyCFGPass0.cpp | static bool simplifyLoopCFG(Loop &L, DominatorTree &DT, LoopInfo &LI,
ScalarEvolution &SE, MemorySSAUpdater *MSSAU,
bool &IsLoopDeleted) {
bool Changed = false;
// Constant-fold terminators with known constant conditions.
Changed |= constantFoldTerminators(... | TOOL | 0.990915 | 6.414102 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-10-21T21:14:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 9,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "8dd6dd8305b... |
0107e31a-f567-4996-bafa-e66aef916694 | Karlxin/OK003 | nnCostFunction_pair_3.cpp | //Implements the neural network cost function for a three layer
#include "main.h"
pair<double, Mat<double>> nnCostFunction_pair_3(Mat<double> nn_params,
Mat<int32_t> layer_size, Mat<double> X, Mat<double> y,
double lambda, Mat<uint32_t> Theta_indicator, int32_t choice)
{
//remember we starts at 0
pair<double, Ma... | ALGO | 0.995073 | 4.163964 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2017-04-19T02:35: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": "5dfd1ff95... |
a95687c3-d990-4d91-a9fe-7674f0997db7 | ishandutta2007/codeforces-a | alpha_q/normal/121/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int B = 3000;
const int M = 10005;
const int N = 100005;
const int T = (N + B - 1)/B;
char cmd[10];
vector <int> lucky;
int n, m, a[N], f[T][M], lazy[T];
int block[N], start[T], _end[T], isLucky[M];
void generate (int dig) {
for (int mask = 0; mask < 1 << dig; +... | ALGO | 0.997272 | 4.667891 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1dcc2d5de126... |
7442d667-9833-4436-9c9c-27150228fa1f | Mahi6384/Takeyouforward-DSA | DSA/LinkedList/Insertion.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
public:
public:
Node(int data1, Node *next1)
{
data = data1;
next = next1;
}
public:
Node(int data1)
{
data = data1;
next = nullptr;
}
};
Node *conver2LL(vector<int... | ALGO | 0.999968 | 5.197928 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-08T11:26: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": "60ba61a08211... |
3da08356-e4e2-46e4-b8a3-90fb6d05a6ce | WhiZTiM/coliru | Archive2/9b/923b6f2de913bb/main.cpp | #include <iostream>
#include <vector>
#include <list>
#include <stack>
#include <string>
#include <ctime>
#include <iomanip>
namespace stx
{
template < typename T, typename A = std::allocator<T>, template <typename,typename> class CNTR = std::vector >
using stack = std::stack< T, CNTR<T,A> > ;
templat... | TEST | 0.985073 | 5.617503 | {
"github_metadata": {
"branch": "master",
"commit_count": 42630,
"repo_created_at": "2016-04-21T16:34:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb12fb... |
0e28fcda-1aa8-4e56-9a71-e81b7215e83c | kowshid/Practice-Problems | Singly Linked list.cpp | //a try by kowshid
//#include <bits/stdc++.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
typedef struct node Node;
struct node
{
int data;
Node *next;
};
class LinkedList
{
public:
Node *head;
Node *tail;
LinkedList()
{
head = NULL;
tail = NULL;
}
//... | ALGO | 0.99965 | 3.627142 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-11-25T14:55: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": "7596f9535... |
79fd033d-ffed-4cbe-8316-050747021295 | DebrajRoy123/ADA-Open-ended-problems | Matrix multiplication chains.cpp | #include <iostream>
using namespace std;
int MatrixMultiplicationChains(int *p, int a, int b)
{
if (a == b)
return 0;
int m = INT_MAX;
for (int i = a; i < b; i++)
{
m = min((MatrixMultiplicationChains(p, a, i) + MatrixMultiplicationChains(p, i + 1, b) + p[a - 1] * p[i] * p[b]) , m);
}
return m;
}
int main()... | ALGO | 0.999944 | 3.548144 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-06-28T15:04: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": "bcdc6b71e7fe... |
2ca7f347-e769-48cc-87bd-639381de34fa | Bhavik-Ardeshna/COCO | DP/Longest common subsequence/Variation Problems/Shortest common supersequence.cpp | #include <bits/stdc++.h>
using namespace std;
#define forr(i, n) for (int i = 0; i < n; i++)
#define forrr(i, n) for (int i = 1; i <= n; i++)
#define rforr(i, n) for (int i = n; i >= 0; i--)
// DP array
int t[1001][1001];
// Two Approach
// 1. Used to calculate only length
int lcs(string x, string y, int n, int m)
... | ALGO | 0.999992 | 4.981679 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2021-07-01T17:13:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7b87a296... |
59f7929b-9377-4f7f-af55-a31ad902b53a | rohan-blah/cpp_codes_archive | cpp_algos/14.orderedlinkedlist.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int d){
data=d;
next=NULL;
}
node(){
next=NULL;
}
};
class list{
public:
node* head;
node* merge(node* n1,node* n2);
void sortedInsert(int);
void deletenode(int pos);
void traverse();
list(){head=... | ALGO | 0.999653 | 3.943446 | {
"github_metadata": {
"branch": "android_source_code",
"commit_count": 7,
"repo_created_at": "2021-10-30T18:09:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id"... |
2190e030-cd41-4ef9-8ede-d88eb3a8891f | Yashwants19/RcppMLPACK | src/mlpack/methods/ann/loss_functions/poisson_nll_loss.hpp | /**
* @file methods/ann/loss_functions/poisson_nll_loss.hpp
* @author <NAME>
*
* Definition of the PoissonNLLLoss class. It is the negative log likelihood of
* the Poisson distribution.
*
* mlpack is free software; you may redistribute it and/or modify it under the
* terms of the 3-clause BSD license. You shou... | ALGO | 0.978884 | 7.621128 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-04-01T15:41:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "003628a46... |
60022013-2454-4e2c-b1a8-d1d93e4fce7e | ar2745/C-Plus-Plus-Programming-Language-Projects | How to convert from binary to decimal/main.cpp | #include <iostream>
/*The author of this code is <NAME>
Date:12/24/21
This is for education
GitHub ID
Data Types
char
int
short int
long int
float
double
%s = string ""
%d = integer
%f = float
Arithmetic Operators
Addition +
Subtraction -
Divisio... | ALGO | 0.990463 | 4.273674 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-12-11T04:11: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": "392ed6b3a7f... |
2da7d55f-fec7-4f98-b4e2-22626e9ebaf9 | shubhansu-kr/WeeklyContest2022-Leetcode | 14_WeeklyContest311/q3.cpp | // https://leetcode.com/contest/weekly-contest-311/problems/reverse-odd-levels-of-binary-tree/
#include <bits/stdc++.h>
using namespace std ;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), r... | ALGO | 0.999992 | 5.964182 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2022-04-25T04:03: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": "6efa7f247... |
9e43e6c7-0f48-4b80-bdae-a6a48d569e56 | tkj2410/100DaysofCoding | 25. NQueen2/Code.cpp | bool isSafe(int row, int col,int n,vector<string> &board,
unordered_map<int,bool> &rowcheck,unordered_map<int,bool> &upper_back_diagonal,
unordered_map<int,bool> &lower_back_diagonal){
int x=row;
int y=col;
//same row
while(y>=0){
if(board[x][y] =='Q'){
return false;
}
y--;
}
//uppper back diagonal
x... | ALGO | 0.999988 | 5.70366 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2023-05-01T03:32: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": "6626e7600e... |
4551edb5-6d26-4b13-821c-3840191df512 | Zlin0509/Zlin_ACM | _CF/CONTEST/2000-2499/2044/C.cpp | //
// Created by Zlin on 2024/12/15.
//
#include "bits/stdc++.h"
using namespace std;
typedef double db;
typedef long double ldb;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
inline vo... | ALGO | 0.999721 | 4.383324 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2024-08-16T08:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e34e413454... |
8ad73816-8ede-4395-9a6b-bf69821d6804 | HyPAIR/Heterogeneous-formation-controller | heterogeneous_formation_controller/src/trajectory_tracking/plot_result3.cpp | // Created by weijian on 17/11/23.
// include ROS Libraries
#include <ros/ros.h>
#include <tf/tf.h>
#include <geometry_msgs/Twist.h>
#include <geometry_msgs/Pose2D.h>
#include <nav_msgs/Odometry.h>
#include <cmath>
#include <iostream>
#include "heterogeneous_formation_controller/vehicle_model.h"
#include "yaml-cpp/yam... | ALGO | 0.966061 | 3.480463 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-18T05:57:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c0c9a344252... |
7250961e-866f-4de2-a8e7-b6d0d8a651f1 | Strangesree/Information-Retrieval | sample.cpp | #include<bits/stdc++.h>
using namespace std;
using namespace std::chrono;
struct Node {
int val;
Node* next;
Node* skip;
};
bool hasSkip(Node* node) {
return node->skip != nullptr;
}
Node* skip(Node* node) {
return node->skip;
}
Node* constructAndAddSkipPointers(const vector<int>& v) {
Node* head =... | ALGO | 0.999894 | 4.779959 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-02-09T15:25: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": "b45c394d9094... |
edea07cb-3a23-4ad0-bc3b-c6b06e42a54d | mireskandari/Competitive-Programming | codeforces/1409/C.cpp | #include <bits/stdc++.h>
using namespace std;
namespace Util {
#ifdef LOCAL
#define dbg(a) cerr << __LINE__ << " \"" << #a << "\": " << a << '\n'
#else
#define dbg(a) 0
#endif
#define all(v) (v).begin(), (v).end()
#define long int64_t
}
using namespace Util;
signed main() {
ios::sync_with_stdio(false), cin.tie(... | ALGO | 0.999857 | 3.7012 | {
"github_metadata": {
"branch": "main",
"commit_count": 1141,
"repo_created_at": "2024-03-06T03:13: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": "8ee40cda9... |
3405bec6-3101-479f-9cad-b50013bd7ac5 | 0xpye/cp | code/107.triangle.cpp | //Pye
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i = (a); i <= (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define pair pair <int, int>
#define maxn
using namespace std;
int p, ans;
float S, x;
bool checkS(int a, int b, int c){
return S == (long long)S;
}
bool checkR(int a, int b, int... | ALGO | 0.999661 | 3.757535 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-12-15T04:18:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "023b9cc2c2cb... |
f3ffc471-b7eb-47c7-87ec-d4f4a5d197bc | Serelllka/TheRubicksCube | main.cpp | #include <windows.h>
#include <cmath>
#include <iostream>
#include "visual/visualizer.h"
#include "algorithm/algorithm.h"
#include "visual/player.h"
#include "config/parser.h"
#include "input/input_class.h"
float near_val, far_val;
std::vector<std::string> Randomize()
{
std::vector<std::string> tmp;
int n = r... | ALGO | 0.974715 | 4.918453 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-05-25T06:55: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": "fcab44094... |
b7b8e0ef-89f9-4572-9061-3e61f55335eb | PennyLaneAI/pennylane-lightning | pennylane_lightning/core/simulators/lightning_qubit/gates/cpu_kernels/avx_common/ApplyCRZ.hpp | // Copyright 2023 Xanadu Quantum Technologies Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law o... | ALGO | 0.999355 | 6.043643 | {
"github_metadata": {
"branch": "master",
"commit_count": 789,
"repo_created_at": "2020-07-06T13:55:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 120,
"forks": 44,
"issues": 25,
"pull_requests": 35
},
"file_meta": {
"content_id": "a63c... |
937a0b47-9e61-4f90-8e26-eeed490188b3 | MohamdFekry/RISC-V-RV32I-Simulator | sim.cpp | #include <bits/stdc++.h>
using namespace std;
string regs[32];
string regs_locs[32];
vector<string> mem_locations, registers_values;
long long int PC_initial, PC;
int for_printing = 1;
string dec_to_bin(string m)
{
if(m=="")
return"";
int n = stoi(m);
if (n == 0)
return to_string(0);
... | ALGO | 0.978019 | 4.028844 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-29T10:41: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": "adcfa3b2f0c6... |
2662777b-4b8d-49b8-9815-772a26de89f6 | behitek/acm-epu | SPOJ/P144SUMB.cpp | #include <bits/stdc++.h>
#define _for(i,a,b) for (int i=(a),_b_=(b);i<_b_;i++)
#define _fod(i,a,b) for (int i=(a),_b_=(b);i>_b_;i--)
#define _it(i,v) for (typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i)
#define _all(v) v.begin(), v.end()
#define __(v) memset(v,0,sizeof(v))
using namespace std;
typedef long ... | ALGO | 0.99999 | 3.450442 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-04-04T10:29:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "116c68ab62... |
73dd5703-d8fe-4a18-ad8e-c0b38850a80f | cannontwo/cannon | scripts/project_euler/euler_problem_35.cpp | #include <iostream>
#include <cassert>
#include <cannon/log/registry.hpp>
#include <cannon/math/primes.hpp>
using namespace cannon::log;
using namespace cannon::math;
/*!
* The number, 197, is called a circular prime because all rotations of the
* digits: 197, 971, 719, are themselves prime.
*
* There are thirte... | ALGO | 0.998893 | 6.273455 | {
"github_metadata": {
"branch": "master",
"commit_count": 434,
"repo_created_at": "2020-09-24T04:29:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 48,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee6780e... |
8c63c958-6c05-4fa6-97c2-ff161c5c230e | ArthurEmidio/programming-problems | uva/11068.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS 1e-7
class Point
{
public:
double x;
double y;
Point(double _x = 0, double _y = 0) : x(_x), y(_y) { }
bool operator==(const Point &p) const
{
return p.x == x && p.y == y;
}
bool operato... | ALGO | 0.99988 | 4.70437 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2016-08-18T02:30:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "176fbcf07... |
d431918a-5ad4-4cdb-b351-cd5af569d358 | ImportMengjie/Leetcode | 面试题34.二叉树中和为某一值的路径.cpp | /*
输入一棵二叉树和一个整数,打印出二叉树中节点值的和为输入整数的所有路径。从树的根节点开始往下一直到叶节点所经过的节点形成一条路径。
示例:
给定如下二叉树,以及目标和 target = 22,
5
/ \
4 8
/ / \
11 13 4
/ \ / \
7 2 5 1
返回:
[
[5,4,11,2],
[5,8,4,5]
]
提示:
节点总数 <= 10000
注意:本题与主站 113 题相同:https://le... | ALGO | 0.999963 | 5.848207 | {
"github_metadata": {
"branch": "master",
"commit_count": 148,
"repo_created_at": "2019-08-04T12:45:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3922e025... |
6fb9dd6a-594f-4553-8174-d23d3790a387 | AustenHsiao/CS199 | Su_2019_Term_1/CS199_Cpp/2_Week/Marbles_MC.cpp | //Monte Carlo simulation to find the prbability of selecting a blue marble out of a bag of blue and green marbles.
//User will enter the number of trials, number blue marbles, and number of green marbles
#include <iostream>
#include <cctype>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;... | ALGO | 0.910371 | 4.317369 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-07-25T01:28:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b09bf05950... |
8cd558a7-3814-483b-a777-5a119a546854 | Keyur1284/Competitive-Programming | Leetcode POTD/2023/894. All Possible Full Binary Trees.cpp | // Problem Link :- https://leetcode.com/problems/all-possible-full-binary-trees/
// Solved by DP
// Time Complexity :- O(2^(n/2))
// Space Complexity :- O(n * 2^(n/2))
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(... | ALGO | 0.999986 | 5.960616 | {
"github_metadata": {
"branch": "master",
"commit_count": 1296,
"repo_created_at": "2022-11-03T10:45:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8af6540... |
60786a86-71f6-4431-af4b-b227961c44ae | ANNIEsoft/ToolAnalysis | UserTools/LAPPDnnlsPeak/LAPPDnnlsPeak.h | #ifndef LAPPDnnlsPeak_H
#define LAPPDnnlsPeak_H
#include <string>
#include <iostream>
#include "nnls.h"
#include <TFile.h>
#include <TString.h>
#include <TH1.h>
#include "Tool.h"
#include "NnlsSolution.h"
/*
class LAPPDnnlsPeak
*/
class LAPPDnnlsPeak: public Tool {
public:
LAPPDnnlsPeak(); ///< Simple constru... | ALGO | 0.986127 | 4.376025 | {
"github_metadata": {
"branch": "Application",
"commit_count": 901,
"repo_created_at": "2017-12-08T20:07:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 57,
"issues": 10,
"pull_requests": 25
},
"file_meta": {
"content_id": "... |
fcd03e61-4027-4626-bbde-93ed65ab13ef | ishandutta2007/codeforces-l | linkct/normal/799/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
typedef long long int LL;
/*
4 3 2
1 5 100 100
2 3 4
3 2 3 4
201
4 3 2
1 5 100 100
1 3
2 2 4
-1
*/
int n, m, k, cost[MAXN], type[MAXN], deco[5][MAXN];
LL pf[5][MAXN]; priority_queue <int> lo;
priority_queue <int, vector <int>, greater <int> > hi;... | ALGO | 0.999598 | 3.161039 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17: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": "40bf2191b7b9... |
c62fef2e-44f0-49b5-bb0c-de9f882981ef | yaojeremy/NYU_CS_Bridge | HW/jy2179_hw3_q4.cpp | //
// jy2179_hw3_q4
//
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
const int FLOOR_ROUND = 1;
const int CEILING_ROUND = 2;
const int ROUND = 3;
double number;
int choice;
int floorInt,ceilingInt, roundInt;
cout<<"Please enter a Real number: ";
... | ALGO | 0.935838 | 3.756887 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2019-03-13T18:51: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": "6d2910338... |
a54aa8b7-7034-4e7a-a59c-a1355fb2c0a6 | PlanarG/Code | Topcoder/BichromeSky.cpp | #include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
const int N = 110;
typedef pair<int, int> P;
typedef long long LL;
class BichromeSky {
private:
int n, m, ok[N][N];
vector<P> A, B; vector<double> V;
LL cross(int x1, int y1, int x2, int y2) {
return (LL)x1 * y2 - (L... | ALGO | 0.999439 | 5.182505 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2020-04-07T07:52:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "034997ae7... |
2f6e4ca7-61b1-4f5d-ac2b-a9ddf8862fbc | 1398978500/study | leetcode/prove/findNumberIn2DArray.cpp | /*
在一个 n * m 的二维数组中,每一行都按照从左到右 非递减 的顺序排序,每一列都按照从上到下 非递减 的顺序排序。请完成一个高效的函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
示例:
现有矩阵 matrix 如下:
[
[1, 4, 7, 11, 15],
[2, 5, 8, 12, 19],
[3, 6, 9, 16, 22],
[10, 13, 14, 17, 24],
[18, 21, 23, 26, 30]
]
给定 target = 5,返回 true。
给定 target = 20,返回 false。
限制:
0 <= n <=... | ALGO | 0.999977 | 6.017015 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2022-09-24T11:01:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffa5b961de1... |
9c84feab-cf4a-478a-8504-f21fc067cfe7 | xiaolongnk/common-alglib | hdoj/1301.cc | #include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
int p[30], r[200];
int start[200],end[200],w[200];
int cmp(const int &a, const int &b){
return w[a] < w[b];
}
int find(int x){
if(x==p[x]) return x;
else return p[x]=find(p[x]);
}
int kruskra(int n){
int ans = 0;
... | ALGO | 0.999632 | 3.355517 | {
"github_metadata": {
"branch": "master",
"commit_count": 226,
"repo_created_at": "2014-05-22T06:43:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b71eb76... |
45852405-0603-4353-a66e-c5723438621a | and0ne808/CodingHW | PointerLab/pointerLab/pointerLab/main.cpp | #include <iostream>
using namespace std;
int main()
{
int myInt = 5;
int* myPtr;
myPtr = &myInt;
cout << myInt << endl;
cout << myPtr << endl;
cout << *myPtr << endl;
int* myPtr2 = myPtr;
cout << myPtr2 << endl;
cout << *myPtr2 << endl;
myInt++;
cout << *myPtr << endl;
cout << *myPtr2 << endl;
/*
... | ALGO | 0.974287 | 3.39691 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2016-02-04T21:57:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95aabda0b... |
f9260aed-90d0-402c-8575-9d73e4cd9b4e | begoon/acm | uva.onlinejudge.org/10104, Euclid Problem/problem.cpp | #include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <numeric>
#include <limits>
#include <algorithm>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
#ifdef _DEBUG
#include <... | ALGO | 0.999662 | 3.993819 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2012-09-26T14:30:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dc0d231d... |
0dd8fadf-5959-4b75-ace8-ac708418d0fe | ericniebler/range-v3 | include/range/v3/algorithm/rotate.hpp | /// \file
// Range v3 library
//
// Copyright <NAME> 2014-present
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range... | ALGO | 0.978283 | 7.635665 | {
"github_metadata": {
"branch": "master",
"commit_count": 2541,
"repo_created_at": "2013-11-11T16:05:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4273,
"forks": 457,
"issues": 262,
"pull_requests": 24
},
"file_meta": {
"content_id": ... |
5177034d-c13d-4dfc-9e83-45558515a74a | flameshimmer/leet2022 | MultiplyStrings.cpp | #include "stdafx.h"
//Given two non-negative integers num1 and num2 represented as strings, return
//the product of num1 and num2, also represented as a string.
//
//Note: You must not use any built-in BigInteger library or convert the inputs to
//integer directly.
//
//
//Example 1:
//Input: num1 = "2", num2 = "3"
/... | ALGO | 0.999264 | 5.876853 | {
"github_metadata": {
"branch": "newMain",
"commit_count": 113,
"repo_created_at": "2022-05-31T18:51: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": "2947036... |
47ee5faf-6f69-4092-a3ea-12e9da11e4cf | sybui2004/DSA---PTIT | DSA - PTIT code by C++/DSA09049 - LAN TRUYEN DINH DUONG.cpp | /*Author: <NAME> B22DCCN702 from ProPTIT with love
DSA09049 - <NAME>
*/
#include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0);
#define pb push_back
#define ll long long
#define FORU(i, a, b) for (int i = a; i < b; i++)
#define FORD(i... | ALGO | 0.999917 | 4.017836 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-02-03T14:08:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "843e45215b47... |
9466ffc4-60d7-479f-bd4c-20cf7d970764 | peppapighs/submissions | OI/JOI/Open-Contest/2018/xylophone.cpp | #include "xylophone.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 5;
int d1[N], d2[N], dir[N], ans[N];
void solve(int n) {
for (int i = 1; i + 1 <= n; i++)
d1[i] = query(i, i + 1);
for (int i = 1; i + 2 <= n; i++)
d2[i] = query(i, i + 2);
dir[1] = 1;
for (int ... | ALGO | 0.999923 | 3.471489 | {
"github_metadata": {
"branch": "master",
"commit_count": 297,
"repo_created_at": "2019-03-26T03:29:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f81f40... |
5436f143-8f2e-49d0-8e64-b8096f724889 | 1eq0/Algorithm | boj/c++/boj_1780.cpp | #include<iostream>
#define MAX 2187
using namespace std;
int n;
int board[MAX][MAX] = {2, };
int one,zero,m_one = 0;
bool allone(int size, int y, int x)
{
for(int dy = 0; dy<size; dy++)
for(int dx = 0; dx<size; dx++)
if(board[y+dy][x+dx]!=1) return false;
return true;
}
bool allzero(int si... | ALGO | 0.999883 | 4.069651 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-02-02T02:11: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": "3eba6d044c7... |
49500cd2-265c-4ef0-aeeb-66bc3bb19f00 | anirudh-bijay/graph-ranges | examples/adjacency_list/adjacency_list.cpp | /**
* @file examples/adjacency_list/adjacency_list.cpp
*
* Program demonstrating the construction and traversal of an
* adjacency list-based graph using member functions as well
* as coroutines.
*
* The container @c `AdaptedVector` included from "adapted_vector.h"
* wraps an @c `std::vector`. The wrapper can ... | ALGO | 0.98982 | 6.346715 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2025-06-03T22:29: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": "30e82fa5f31... |
48def58e-8ff8-4bf3-92fc-e305025a2408 | arrangedcupid0/summer2021 | week7/assignment14/rectangleMain.cpp | #include "Rectangle.h"
#include <iostream>
#include <fstream>
using namespace std;
double findTotalArea(Rectangle *, int);
Rectangle* findSmall(Rectangle *, int, double, int &);
void printRectangle(Rectangle *, int);
int main()
{
ifstream RectangleFile;
string location; //it's important to note that this requires ... | TOOL | 0.940012 | 3.879143 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-09-13T16:07: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": "dff033d564c5... |
e2453807-4e3e-4ddd-9cee-e034057b0cdf | lian/ofx-dev | addons/ofxBazAR/garfeild/viewsets/image_classification_forest.cpp | /*
Copyright 2005, 2006 Computer Vision Lab,
Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.
All rights reserved.
This file is part of BazAR.
BazAR is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation;... | DATA | 0.918305 | 3.816998 | {
"github_metadata": {
"branch": "master",
"commit_count": 156,
"repo_created_at": "2009-02-28T20:48:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 50,
"forks": 49,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7eb0ac... |
54fda8c8-f573-4763-a6d9-deb6728d18fe | anirvinv/Codeforces | virtCont/e.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F(i, n) for (int i = 0; i < n; i++)
#define G(x) \
ll x; \
cin >> x;
#define all(x) begin(x), end(x)
#define debug(x) cout << #x << " " << x << '\n'
void solve() {
G(n);
multiset<ll> s;
ll sum = 0;
F(i, n) {
G... | ALGO | 0.999776 | 4.278324 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-09-25T20:08: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": "ef829d4b75... |
2e5c75aa-a887-4d8b-830b-76957e0b81b8 | GauChau/CPP_MODULES | cpp09/ex02/main.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | TEST | 0.96967 | 5.366008 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2025-02-28T15:22:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4d8bb7d9df... |
dd19f333-791d-4e1c-a830-bd78473b1d24 | ishandutta2007/codeforces-i | irkstepanov/normal/1110/D.cpp | #include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
const int nmax = 1e6 + 10;
const int k = 7;
int cnt[nmax];
int dp[k][k];
int nx[k][k];
i... | ALGO | 0.999969 | 3.4947 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "592f437437ed... |
58bbf218-d1b3-4746-9bad-0128953c3af1 | hanyuanye/TicTacToe-Evolutionary-Algorithm | AiLearner.cpp | //Weight 0 is rows with 1x in a row and the rest open
//Weight 1 is rows with 2x in a row and the rest open
//Weight 2 is rows with 3x in a row.
//Weight 3 is rows with 1o in a row and the rest open
//Weight 4 is rows with 2o in a row and the rest open
#include "AiLearner.h"
#include <iostream>
#include <cstdlib>
#inc... | ALGO | 0.996866 | 4.225655 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-12-12T06:35: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": "82bcc29c5c... |
3b488cfd-e880-4833-a3c4-d14c20ed4068 | sunpho84/sunpho | Analysis_programs/projects/stag_nuc/read.cpp | #include "../../src/include.h"
void read_pseudo(int T,int njacks)
{
FILE *fin=open_file("/tmp/p","r");
jvec corr(T,njacks);
corr=0;
for(int iconf=0;iconf<njacks;iconf++)
for(int t=0;t<T;t++)
if(fscanf(fin,"%lg",&corr[t][iconf])!=1) crash("reading ijack %d t %d",iconf,t);
fclose(fin);
corr.c... | ALGO | 0.906361 | 4.122558 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2015-08-25T13:49: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": "f88e5137... |
b59efb71-df80-4ac2-990b-4403997660b9 | ilazaric/number-theory | bin/hello2.cpp | #include <ivl/divisors.hpp>
#include <ivl/factorize.hpp>
#include <ivl/lazy.hpp>
#include <ivl/multi-fns.hpp>
#include <ivl/safe.hpp>
#include <iostream>
template<typename T, typename U> std::ostream &operator<<(std::ostream &out, const std::pair<T, U> &p)
{
return out << p.first << "^" << p.second;
}
template<typ... | ALGO | 0.991633 | 5.866416 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2023-02-11T18:52:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1210be9325... |
4cb14621-f84b-48ab-8778-250c7f09fb53 | zhufeizhu/leetcode | reverse-interger.h | #include<header.h>
class Solution {
public:
int reverse(int x) {
if(x == 0) return 0;
if(x == -2147483648) return 0;
long long res = 0;
bool neg = false;
if(x < 0) {
x = -x;
neg = true;
}
bool not_zero = false;
while(x != 0)... | ALGO | 0.999823 | 4.698896 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-03-04T14:36:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f87bb0c82... |
f1d202d5-2685-4f29-b383-168cf4270069 | Ajitkumarchai/DSA | DEV C++/mergesort linked list.cpp | #include<iostream>
using namespace std;
class node
{
public:
int data;
node*next;
node(int data)
{
this->data=data;
this->next=NULL;
}
};
void insert(node* &head,int data)
{
node*temp=new node(data);
if(head==NULL)
{
head=temp;
return;
}
temp->... | ALGO | 0.999983 | 4.494518 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-15T17:13: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": "573cf440f053... |
d456053d-23c6-4f45-8c32-96051bb3f009 | fysdbd/algorithms | linkedlist/reverse-linked-list-ii.cpp |
/*
Reverse Linked List II
Reverse a linked list from position m to n.
Given m, n satisfy the following condition: 1 ≤ m ≤ n ≤ length of list.
Example
Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2->5->NULL.
notes:
*/
/**
* Definition of singly-linked-list:
*
* class ListN... | ALGO | 0.999984 | 5.963772 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2017-01-18T03:48:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6dd6a28f2... |
8a21c5b8-3e5a-4f53-ab40-31b37c278903 | NSergeevich87/C-All-Projects | GB_C++/3_Advanced_C++/4_26_05_24/task_1/main.cpp | /** Задание 1. Телефонный справочник
Что нужно сделать
Напишите программу «Телефонный справочник».
На вход программе поступают запросы трёх типов:
69-70-30 Ivanov — добавить телефон и фамилию абонента в справочник
69-70-30 — узнать фамилию абонента по номеру телефона
Ivanov — узнать телефон абонента по фамилии
Необходи... | ALGO | 0.964082 | 4.329531 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2023-11-02T08:26: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": "224c5ff747... |
39c9987b-fcd8-448e-89d1-b352acbe60c1 | dqdcisid/CODE-NOTES | algorithm/heap/heap.h |
#ifndef heap_INC
#define heap_INC
#include <vector>
#include <iostream>
using namespace std;
/*
* =====================================================================================
* Class: Heap
* Description:
* =====================================================================================... | ALGO | 0.998802 | 5.289501 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-05-29T23:10:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ff06b271... |
cf0bbe3a-3c1c-4932-951f-6a97e46edb35 | Shreedhar-Kushwaha/DSA | Find _irst_and_Last_Position_of_Element_in_Sorted_Array.cpp | class Solution
{
public:
vector<int> searchRange(vector<int> &nums, int target)
{
int n = nums.size();
int left = 0, right = n - 1, result = -1;
vector<int> ans{-1, -1};
while (left <= right)
{
int mid = left + (right - left) / 2;
if (target == num... | ALGO | 0.999917 | 6.188776 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-02-26T12:35: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": "e53953eb6141... |
6c371b9f-1135-4b2e-b9bb-b786a5a05439 | DincyJiang/Codes | LeetCode/LeetCode-Algorithm/LeetCode_30_与所有单词相关联的字串.cpp | // 给定一个字符串 s 和一些长度相同的单词 words。在 s 中找出可以恰好串联 words 中所有单词的子串的起始位置。
// 注意子串要与 words 中的单词完全匹配,中间不能有其他字符,但不需要考虑 words 中单词串联的顺序。
// 示例 1:
// 输入:
// s = "barfoothefoobarman",
// words = ["foo","bar"]
// 输出: [0,9]
// 解释: 从索引 0 和 9 开始的子串分别是 "barfoor" 和 "foobar" 。
// 输出的顺序不重要, [9,0] 也是有效答案。
// 示例 2:
// 输入:
// s = "word... | ALGO | 0.999916 | 6.213856 | {
"github_metadata": {
"branch": "master",
"commit_count": 421,
"repo_created_at": "2019-05-21T11:49:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06288311... |
b2c6861e-f005-4a7b-806b-ced52fb277a1 | kaiwangntu/sketch-system-with-third-party-libs | KWResearchWork/third_party_libs/includes/CGAL/include/CGAL/Segment_Delaunay_graph_2/Are_same_segments_C2.h | // Copyright (c) 2003,2004,2005,2006 INRIA Sophia-Antipolis (France) and
// Notre Dame University (U.S.A.). All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
//
// Lice... | ALGO | 0.993277 | 6.913201 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-08-03T13:22:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1dd9f0dd85... |
796d2cea-2cc4-46ff-b90c-8e35383c96c2 | HimanshuSarma/Problem_solving | LRU_Cache.cpp | #include <bits/stdc++.h>
using namespace std;
class Node {
public:
int key;
int val;
Node* next;
Node* prev;
Node(int key, int val) {
this->key = key;
this->val = val;
this->next = nullptr;
this->prev = nullptr;
}
};
class LRUCache {
public:
// Pointer to ... | ALGO | 0.999705 | 4.973761 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2022-08-13T16:35:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5928e47e31c... |
6c20cef4-bf2b-4ebb-829c-be4bee91424f | RoopamTaneja/cses-solutions | low/dp/grid_paths.cpp | #pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
// Datatypes
typedef long long ll;
typedef long double ld;
typedef long int l;
typedef unsigned int ui;
// Vectors
#define pb push_back
#define eb emplace_back
#define all(v) v.begin(), v.end()
typedef vector<int> vi;
typedef vecto... | ALGO | 0.999973 | 4.405807 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2023-08-02T15:47: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": "c09ef4b4d... |
7e0e7384-5bfe-4702-913f-0fa3b3285aa4 | imisumi/advent-of-code | 2024/day03/main.cpp | #include <iostream>
#include <vector>
#include <filesystem>
#include <fstream>
#include <algorithm>
#include <ranges>
std::vector<std::string> getFileInput(const std::filesystem::path& path)
{
std::vector<std::string> input;
std::ifstream file(path);
std::string line;
while (std::getline(file, line))
{
input.em... | TOOL | 0.969101 | 5.191726 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-12-01T06:55: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": "f3320ef7155... |
d048eab5-9323-4dee-9ff2-484a57b762a3 | SaiPradyumn/Loop_Parallelization | controlFlowParsing/vectorization_old.cpp | //
// Created by pradyumn on 2/25/24.
//
#include <iostream>
#include <immintrin.h>
#include <list>
#include <fstream>
#define IPV6 1000
#define IPV4 2000
#define TCP 500
struct TCP_header{
int32_t dest_port;
int32_t source_port;
};
struct Ip_header{
int32_t ip_protocol;
TCP_header *tcp_header;
};
s... | ALGO | 0.995502 | 5.170248 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-11-24T18:09: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": "a9d210afa86... |
14976485-d0e1-49c2-bbcc-d6e689857750 | buitanphat247/C-Algorithm | Code(2022-2023)/CODE_MAIN/stadium.cpp | #include <bits/stdc++.h>
using namespace std;
struct stadium
{
long long t1, t2, cs;
};
bool cmp(const stadium &a, const stadium &b)
{
return a.t2 < b.t2;
}
int main()
{
freopen("1.inp", "r", stdin);
freopen("1.out", "w", stdout);
long long n;
cin >> n;
vector<stadium> x(n);
for (long long i = 0; i < n;... | ALGO | 0.999899 | 4.233825 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-02-18T18:44: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": "feaf2c9e2a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.