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 |
|---|---|---|---|---|---|---|---|
b2783795-d0e6-4dd1-9e4c-5e7dd2379d19 | raahulsaxena/grokking-leetcode | graphs/connected-components/number-of-islands/number-of-islands.cpp | #include<vector>
using namespace std;
class Solution {
public:
int numIslands(vector<vector<char>>& grid) {
int c = 0;
int m = grid.size(), n = grid[0].size();
for(int i = 0; i < m; i++){
for(int j = 0; j < n; j++){
... | ALGO | 0.999954 | 6.324751 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-07-14T05:26: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": "feaf07ef608... |
530f5b22-892a-4f00-a829-15346fb08d0f | nifizo/sem1_lab1 | figure.cpp | #define _USE_MATH_DEFINES
#include "Figure.h"
#include <iostream>
#include <vector>
#include <math.h>
#include <Windows.h>
#include <cmath>
#include "Dot.h"
using namespace std;
Figure::Figure() {
cout << "Please enter count of figure's sides: ";
cin >> n;
}
Figure::Figure(int n) {
this->n = n;
}
void Fi... | ALGO | 0.995068 | 3.902317 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2022-12-07T16:09: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": "0d72d7b329... |
0e7049fd-373f-407e-8830-7174194bf438 | Maheeenasad/Daily-LeetCode-Sync | 2076-sum-of-digits-of-string-after-convert/sum-of-digits-of-string-after-convert.cpp | class Solution {
public:
int getLucky(string s, int k) {
// Step 1: Convert the string into the corresponding number string
std::string numStr = "";
for (char c : s) {
numStr += std::to_string(c - 'a' + 1); // Convert each character to its alphabet position
}
... | ALGO | 0.999849 | 6.730706 | {
"github_metadata": {
"branch": "main",
"commit_count": 278,
"repo_created_at": "2024-05-24T09:37:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64e056b2a7... |
1200fc48-34b5-4561-83da-b37d0ca9b9f2 | PFCal-dev/cmssw | L1Trigger/TrackFindingTracklet/src/DiskProjection.cc | #include "L1Trigger/TrackFindingTracklet/interface/DiskProjection.h"
#include "L1Trigger/TrackFindingTracklet/interface/Settings.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <algorithm>
#include <cassert>
using namespace std;
using namespace trklet;
void DiskProjection::init(Settings const&... | TOOL | 0.913549 | 6.600608 | {
"github_metadata": {
"branch": "hgc-tpg-devel-CMSSW_12_0_0_pre3",
"commit_count": 222280,
"repo_created_at": "2013-11-18T16:34:32.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "cms-sw/cmssw",
"stars": 4,
"forks": 2,
"issues": 4,
"pull_requests": 0
},
"file_... |
9d21112d-9506-4f81-af87-85b5817d42cb | pacman-project/LHOP | lhop_v1/src/utils/hopmath.h | // Collection of "math" functions and algorithms used in LHOP
#pragma once
#include "structures.h"
#include <cv.h>
// misc math functions
///////////////////////////////////////////////////////////////////////////////
template<class T> inline T sqr(const T& v)
{
return v*v;
}
// Splines
////////////////////... | ALGO | 0.997676 | 5.735368 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-07-02T10:36:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c528035c4ce... |
2f0314da-8272-4da6-901b-4fda37b8aa8c | CyFI-Lab-Public/RetroScope | external/chromium_org/cc/output/render_surface_filters.cc | // Copyright 2012 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 "cc/output/render_surface_filters.h"
#include <algorithm>
#include "base/logging.h"
#include "cc/output/filter_operation.h"
#include "cc/output... | TOOL | 0.906641 | 7.50775 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2016-05-15T23:49:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 120,
"forks": 43,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "2d79ba... |
20a12697-1ce7-4121-832e-c97810dada8c | pasyagitka/OAiP | 5. Динамические структуры данных. Односвязные списки/9/10.cpp | //10. Создать список, содержащий элементы вещественного типа.Найти произведение элементов, значение
//каждого из которых меньше 10.
#include <iostream>
#include <fstream>
#include <windows.h>
using namespace std;
struct list
{
float number;
list *next;
};
void insert(list *&, float);
float del(list *&, float);
flo... | TOOL | 0.997908 | 3.052426 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-04-22T10:11: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": "9a4a8680be... |
5567e7e6-c21f-46b8-95ea-d11aa56f547c | hcjjy/Leetcode | Remove Duplicates from Sorted List II.cpp | /*
思路1:遍历链表看前面一个结点是否是重复结点,如果不是就选择前面那个结点,否则不选择。
*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* deleteDuplicates(ListNode* head) {
if (!head || !head->next)
{
re... | ALGO | 0.999972 | 4.190943 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2016-08-24T11:43: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": "23662f244... |
4a0320b5-16fe-4927-9112-51ae8cde8d37 | miaomiaocoder/CodePractice | .leetcode/102.二叉树的层序遍历.cpp | /*
* @lc app=leetcode.cn id=102 lang=cpp
*
* [102] 二叉树的层序遍历
*/
// @lc code=start
/**
* 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),... | ALGO | 0.999929 | 6.280724 | {
"github_metadata": {
"branch": "main",
"commit_count": 158,
"repo_created_at": "2022-04-18T04:49:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a34570c98... |
46955785-b18e-4221-abf3-ffa3c29e0aa6 | susantabiswas/Software-Interview-Essentials | Leetcode/Greedy/maximum-split-of-positive-even-integers.cpp | /*
https://leetcode.com/problems/maximum-split-of-positive-even-integers/
TC: O(num^0.5)
2 + 4 + 6 + ....2 * i = S
2(1 + 2 + 3 + .... i) = S
2(i*(i + 1) / 2) = S
i*(i + 1) = S
~ i^2 = S
~ i = (S)^1/2
Greedily pick the numbers from 2 and subsequent numbers 4, 6 till we find ... | ALGO | 0.999151 | 4.806131 | {
"github_metadata": {
"branch": "master",
"commit_count": 1053,
"repo_created_at": "2019-04-01T15:21:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbe02e3... |
f37cc33d-42dc-415d-a384-886c1ad6d82a | jagdishpatil21/dsa | P9 AVL tree.cpp | #include <iostream>
#include <string>
using namespace std;
struct AVLnode {
string cWord;
string cMean;
AVLnode *left,*right;
int iHt;
};
class AVLtree {
public:
AVLnode *Root;
AVLtree () {
Root = NULL;
}
AVLnode* insert (AVLnode*, string, string);
AVLnode* deletE (AVLnode*... | ALGO | 0.999854 | 6.252683 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-05-07T12:38: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": "8ae7405a9ea3... |
747c828f-c519-4695-8514-1401741f938f | Dhruva1098/learnCpp | dsa/graphs/MSTWeight.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long n;
cin >> n;
// The cost of the MST for a complete graph with n nodes
// is the sum of the first (n-1) smallest edges.
// The smallest edges are 3, 4, ..., n+1
// S... | ALGO | 0.999911 | 4.374082 | {
"github_metadata": {
"branch": "main",
"commit_count": 178,
"repo_created_at": "2024-05-15T14:12: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": "b46833ff40... |
64277917-1f12-4c1e-9d86-7c4707d395fe | sangyomi/camel-raisim-projects-V4 | camel-tools/examples/src/example_Eigen.cpp | #include <iostream>
#include "Eigen/Dense"
Eigen::Quaternion<double> qCurrent;
Eigen::Quaternion<double> qGoal;
Eigen::Quaternion<double> q;
static const double rad2deg = 180.0 / 3.141592;
static const double deg2rad = 3.141592 / 180.0;
struct Euler
{
//radian
double roll;
double pitch;
double yaw;
}... | ALGO | 0.986984 | 5.216088 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-06-23T04:25:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c14dc82b8435... |
fd545b91-f2e4-4adb-9912-f2aa8670fe8a | yxg12138/ACM | Sublime_file/0challenge/ch2/poj2236.cpp | #include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
using namespace std;
const int maxn = 1000+10;
int pa[maxn],rank[maxn];
bool status[maxn];
bool able[maxn][maxn];
void init(const int& n){
for(int i=0; i<n; i++){
pa[i] = i;
rank[i] = 0;
}
}
int fin... | ALGO | 0.999667 | 4.127649 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2016-10-28T23:28: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": "394d4254e... |
5065c59b-e39d-4de8-bb5c-75b3d78976a3 | ibrahimjohar/OS-Lab | Labs/02/postlabtask1/task1.cpp | //<NAME>
//23k-0074
//bai-4a
//os lab - post lab - task 1
#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
int main(int argc, char* argv[])
{
if(argc < 2)
{
cout << "error: no numbers provided\n";
cout << "usage: " << argv[0] << "<int1> <int2> ... <intN>\n";
... | TOOL | 0.944262 | 4.947548 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2025-02-04T13:40: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": "f0366ec67f6... |
6f325f65-bd18-4ed2-a0f7-9d5ed7a0bb84 | ee538/Sp23_HW4_CodingGrader | 1/grader_test.cc | #include <iostream>
#include <string>
#include "gtest/gtest.h"
#include "q.h"
template <class T>
void Print2dVector(std::string name, std::vector<std::vector<T>> input) {
std::cout << name << ": {" << std::endl;
for (int i = 0; i < input.size(); i++) {
std::cout << " {";
for (int j = 0; j < input[0].size... | TEST | 0.925854 | 6.3951 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-04-08T09:15:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f54e241f1476a... |
caa509e9-d76d-4ce4-8c7e-923ff7b08636 | ghlim22/baekjoon | 백준/Silver/17103. 골드바흐 파티션/골드바흐 파티션.cc | #include <iostream>
#include <queue>
#include <vector>
#define MAX (1000000)
void findPrimes(const int n, std::vector<int> &spf, std::vector<int> &primes)
{
for (int i = 2; i <= n; ++i) {
if (spf[i] == 0) {
spf[i] = i;
primes.push_back(i);
}
for (int p : primes) {
long comp = (long)p * i;
if (comp ... | ALGO | 0.999892 | 5.140712 | {
"github_metadata": {
"branch": "main",
"commit_count": 664,
"repo_created_at": "2022-07-10T00:26: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": "ebf2788158... |
5b30ab95-e28b-4683-bea8-a9ef9a9eb54b | zhwufd/emmettLeetCode | algorithm/sortList/sortList.cpp | #include <cstdlib>
struct ListNode {
int val;
ListNode* next;
ListNode(int x): val(x), next(NULL){}
};
class Solution {
public:
void swap( ListNode* itr1, ListNode* itr2){
if(itr1 != itr2){
int tmp = itr1 -> val;
itr1 -> val = itr2 -> val;
... | ALGO | 0.999981 | 5.509744 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2015-08-20T05:40:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7486130f... |
1160bbd0-5a7d-4f2c-b5d5-0b8b67d0cda6 | RasPlex/OpenPHT | xbmc/guilib/DirtyRegionSolvers.cpp | /*
* Copyright (C) 2005-2012 Team XBMC
* http://www.xbmc.org
*
* This Program 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; either version 2, or (at your option)
* any later version.
*
... | ALGO | 0.971855 | 6.152012 | {
"github_metadata": {
"branch": "openpht-1.9",
"commit_count": 25886,
"repo_created_at": "2015-11-08T18:03:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 599,
"forks": 106,
"issues": 178,
"pull_requests": 2
},
"file_meta": {
"content_id... |
4ae44d59-b5c9-4e0f-896c-4480153f0c02 | raincross7/code-similarity | codes/train_code/problem078/problem078_289.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
using ll = long long int;
int main()
{
string S, T;
cin >> S >> T;
map<char, char> mp;
for (ll i = 0; i < 26; i++)
{
mp['a' + i] = '_';
}
bool ok = true;
for (ll i = 0; i < S.size(... | ALGO | 0.999997 | 4.054956 | {
"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": "6b396921157f... |
2ec6cbc8-380b-4e24-ae26-d9c97a8acfd4 | abed-baust/Job-practice-Coding- | 14. Bubble sort (singly LinkedList).cpp | #include<bits/stdc++.h>
using namespace std;
struct node
{
int data ;
struct node* next;
};
void show(struct node* head)
{
struct node* temp;
temp=head;
while(temp!=NULL)
{
cout<<temp->data;
temp=temp->next;
cout<<"->";
}
cout<<endl;
}
struct node *swap(struct... | ALGO | 0.999926 | 4.339635 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-04-23T20:14: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": "fb07cb48e8b8... |
3a20a934-55f6-4d51-ab4d-bcee92e9ae67 | KoumaTeacup/CS500 | shape.cpp | #include "shape.h"
#define epsilon 0.0001
bool Sphere::intersect(const Ray & ray, Intersection & it)
{
Vector3f Qbar = ray.Q - center;
float QdotD = Qbar.dot(ray.D);
float fvar = sqrt(QdotD*QdotD - Qbar.dot(Qbar) + radius*radius);
if (-QdotD - fvar > epsilon) it.t = -QdotD - fvar;
else if (-QdotD + fvar > epsilo... | ALGO | 0.972471 | 4.739688 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2016-02-01T04:54:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1be875b2b... |
a2ca713a-d03c-470d-abd8-0617c77530e0 | dynamicprash/CSIT_Lab_Reports | 5th Semester/Design and Analysis of Algorithm/4.1 Job sequencing algorithm.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
typedef struct {
char id;
int deadline, profit;
} Job;
int compare(const void* a, const void* b) {
return ((Job*)b)->profit - ((Job*)a)->profit;
}
// Job Sequencing Function
void jobSequencing(Job jobs[], int n, int* count) {
(*count)++; // Inc... | ALGO | 0.999816 | 5.338504 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-03-30T10:16:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "10affb5c22c7... |
28dd8b88-5185-4a20-b74e-72ee41bcbb9b | LonghaoQian/MakefilePractice | lib/numerical_solver/runge_kutta.h | /*************************************************************
MIT License
Copyright (c) 2023 Dr. <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without li... | ALGO | 0.994924 | 5.80457 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2021-01-24T04:00: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": "fc226bedb... |
f26c7496-02dd-4b95-8236-07167b31ae84 | Yabby1997/LeetCode-Online-Judge | 2.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
ListNode* dummyResult = new ListNode(0);
ListNode* currentNode... | ALGO | 0.999972 | 6.323702 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-02T12:07: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": "ef4e2da5bc... |
23b42a19-f633-4fc9-a807-f45bde31202b | ysmilec/Algorithms-and-Data-Structures | Algorithms-and-Data-Structures/堆栈模拟队列.cpp | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef int ElementType;
struct StackType {
int top;
int max;
ElementType* Stack;
};
typedef StackType * Stack;
int IsFull(Stack S);
int IsEmpty(Stack S);
void Push(Stack S, ElementType item);
ElementType Pop(Stack S);
int main() {
ElementType max1, max2, item... | ALGO | 0.999394 | 3.36165 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-01-25T09:03: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": "4d8fa87df0... |
1adf7b8f-fa6c-4b9b-ace1-0c14226c15ab | MehdiBenSalha/CP-Solutions | CodeForces/GNU C++17/239A | Two Bags of Potatoes/168613667.cpp | #include "bits/stdc++.h"
#include <algorithm>
using namespace std ;
#define ll long long
#define F first
#define S second
#define PB push_back
#define MP make_pair
bool isPrime(int n){
for (int i = 2; i*i<=n ; ++i) {
if(n%i==0) return false;
}
return true;
}
int sumDigit(int n){
int su... | ALGO | 0.999897 | 3.387803 | {
"github_metadata": {
"branch": "main",
"commit_count": 704,
"repo_created_at": "2023-05-01T00:32:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "20836d23b5... |
b1c12808-4083-4c34-a196-0398152454d6 | raincross7/code-similarity | codes/train_code/problem355/problem355_294.cpp | /*
これを入れて実行
g++ code.cpp
./a.out
*/
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#inclu... | ALGO | 0.999932 | 3.394715 | {
"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": "75d1bf5946c2... |
d2abd91f-342f-4708-9da2-02f77c2ee6a6 | allenanswerzq/byteme | codeforces/problems/1098a/1098a.cc | /* created : 2019-11-03 18:48:42
* accepted : 2019-11-03 20:56:16
* author : landcold7
*/
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define mt make_tuple
#ifndef LOCAL
#define trace(...)
#endif
typedef long long ll;
const int N = 1e5 + 7;
vector<int> g[N];
ll sum[N];
ll a[... | ALGO | 0.999787 | 3.680935 | {
"github_metadata": {
"branch": "master",
"commit_count": 810,
"repo_created_at": "2017-06-16T09:27:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcdf37c0... |
46b31f51-6843-43ea-987e-b54f61039010 | operrl/ege | fib.cpp | #include <iostream>
#include <chrono>
#include <unordered_map>
long long unsigned int fib(int n) {
static std::unordered_map<int, long long unsigned> cache; //словарь
if (n <= 1) return n;
if (cache.find(n) != cache.end()) return cache[n];
unsigned long long result = fib(n - 1) + fib(n - 2);
cac... | ALGO | 0.999818 | 5.321344 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-03-11T20:25: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": "9e854edb964... |
7d6a0e7b-a666-406f-99ec-2ec5c5269659 | triglav/advent_of_code | 2019/day23.cc | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <deque>
#include <iostream>
#include <optional>
#include <string>
#include <tuple>
#include <vector>
using Memory = std::vector<int64_t>;
enum class Signal {
END = 0,
ERR,
INT,
};
class Program {
public:
explicit Program(Mem... | ALGO | 0.999804 | 5.746915 | {
"github_metadata": {
"branch": "master",
"commit_count": 307,
"repo_created_at": "2019-12-04T14:48: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": "3717d14b... |
5b34958f-89a2-40e5-a74a-b9922bd4fc0a | diwujiahao/leetcode | 33. Search in Rotated Sorted Array/Solution2.cpp | // 二分搜索变形题
class Solution {
int binary_search(vector<int> nums, int target){
int left = 0, right = int(nums.size()) - 1;
while (left <= right){
int mid = (left + right) / 2;
// 查看是否结束搜索
if (nums[mid] == target){
return mid;
}
... | ALGO | 0.999991 | 5.641751 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-01-31T10:56: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": "b2f7bdf0e... |
44d93809-0d51-4db3-a574-5695ca3b9ad0 | gouroveroy/DSA-I | assignment8/Task1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
class Build2DFence
{
vector<pair<int, int>> trees;
vector<pair<int, int>> convexPolygon;
int pointNo;
static bool compare(pair<int, int> p1, pair<int, int> p2)
{
if (p1.first < p2.first)
... | ALGO | 0.999993 | 5.067652 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-09-13T04:25: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": "31fdd6af12ca... |
d26ad4f5-1b7f-4998-8bfe-e3abfd5c9db3 | mateusz-kowalczyk-12/nmk-solver | NMKSolver/MainSubfunctions.cpp | #include "MainSubfunctions.h"
void read_command()
{
char command[MAX_COMMAND_LENGTH];
strcpy(command, "");
scanf("%s", command);
if (strcmp(command, "GEN_ALL_POS_MOV") == 0)
continue_gen_all_pos_mov();
if (strcmp(command, "GEN_ALL_POS_MOV_CUT_IF_GAME_OVER") == 0)
cotinue_gen_all_po... | ALGO | 0.998319 | 3.328319 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-12T13:04: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": "0bd4f0ea4713... |
d9480fce-a86f-4fb7-abfc-2df912f8c30d | dtmoodie/EagleEye | Plugins/Core/src/VideoProc/OpticalFlow.h | #pragma once
#include <src/precompiled.hpp>
#include <Aquila/rcc/external_includes/cv_cudaoptflow.hpp>
#include "Aquila/utilities/cuda/CudaUtils.hpp"
RUNTIME_COMPILER_SOURCEDEPENDENCY
RUNTIME_MODIFIABLE_INCLUDE
namespace aq
{
namespace nodes
{
class IPyrOpticalFlow: public Node
{
publi... | ALGO | 0.993062 | 7.104444 | {
"github_metadata": {
"branch": "master",
"commit_count": 1103,
"repo_created_at": "2014-12-17T15:11:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 5,
"issues": 12,
"pull_requests": 0
},
"file_meta": {
"content_id": "36dfe... |
2247f166-38ff-4fe1-8c9d-5102eb703742 | LuanaSilveira19/Algoritmos_2 | Atividade_11_Luana_Silveira/22_divisiveis.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<ctime>
using namespace std;
main()
{
setlocale(LC_ALL,"Portuguese");
int *pvet = new int[10];
int *pdiv = new int[5];
int *a = new int(0);
int *i = new int(0);
srand(time(NULL));
while(*i < 10)
{
*p... | ALGO | 0.985604 | 3.067248 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-25T22:31: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": "38f6145c3d0f... |
6c4135c5-9c91-43fe-91fd-96a9e245a8ab | kestsaurav21/DSA_Problem | Arrays/Medium/SortColors.cpp | // Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.
// We will use the integers 0, 1, and 2 to represent the color red, white, and blue, respectively.
// You must solve this problem wit... | ALGO | 0.999985 | 5.946836 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-08-29T17:31:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf6ba390cba... |
634fa786-8fe0-4c11-a374-b66bbe41df0a | alps-jbnu/22ALPStudy | Algorithm/2022-2/Code/jys-jeong/Binary Search/1477.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, l;
int arr[1005];
int main() {
ios::sync_with_stdio;
cin.tie(0);
cin >> n >> m >> l;
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
arr[n] = 0;
arr[n + 1] = l;
sort(arr, arr + n+2);
int st = 1;
int en = l;
int res = 0;
while (st <= en) {
int mid ... | ALGO | 0.999992 | 3.7422 | {
"github_metadata": {
"branch": "master",
"commit_count": 1307,
"repo_created_at": "2022-01-20T14:29:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 36,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "f22f0b... |
ebc87951-6cd5-469a-b0ba-c28d66ff19f4 | sairatabassum/Data-Structures | Binary Search Tree/Binary_Tree.cpp | #include<bits/stdc++.h>
using namespace std;
typedef struct node Node;
struct node
{
int data;
Node *left;
Node *right;
};
Node *create_TreNode(int item)
{
Node *new_node=(Node *) malloc(sizeof(Node));
if(new_node==NULL)
{
cout<<"Error! Could not Create A New Node"<<endl;
}
n... | ALGO | 0.999925 | 4.646659 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2022-06-20T10:23: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": "5c8774afe7c... |
3e752e5c-44f9-445b-90b4-64d84bddf1c9 | PSCoder10462/dsa | miscellaneous/Find First and Last Position of Element in Sorted Array.cpp | class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
int lo1, lo2, hi1, hi2;
lo1 = lo2 = 0;
hi1 = hi2 = nums.size()-1;
bool s, e; s = e = false;
if (nums.size() == 0) {
s = e = true;
}
... | ALGO | 0.999973 | 6.344861 | {
"github_metadata": {
"branch": "main",
"commit_count": 773,
"repo_created_at": "2021-03-12T11:06:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4701db9241... |
00f49201-b47c-4a39-8ef8-34a5d61502c3 | ai5/gpsfish | osl/full/osl/search/searchState2.cc | /* searchState2.cc
*/
#include "osl/search/searchState2.h"
#include "osl/search/simpleHashRecord.h"
#include "osl/search/sacrificeCheck.h"
#include "osl/csa.h"
#include "osl/misc/milliSeconds.h"
#include <iostream>
/* ------------------------------------------------------------------------- */
osl::search::
RecordSta... | ALGO | 0.946614 | 5.624169 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-07-02T20:31:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e466084eb... |
916a55e4-3d7f-4ba4-b516-fd9c3aec36b4 | 1m188/algorithm | 算法竞赛入门经典/第3章/换低档装置.cpp | #include "iostream"
#include "vector"
#include "algorithm"
int main()
{
int n1 = 0, n2 = 0;
std::cin >> n1 >> n2;
std::vector<int> N1{}, N2{};
for (int i = 0; i < n1; i++)
{
int h = 0;
std::cin >> h;
while (h != 1 && h != 2)
{
std::cin >> h;
}
... | ALGO | 0.999956 | 3.959035 | {
"github_metadata": {
"branch": "master",
"commit_count": 2060,
"repo_created_at": "2019-07-03T03:19:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74ff868... |
ff64bc14-d007-4c29-b18e-2efde8e202ab | thang44hdai/DSA-PTIT | 2002.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define ll long long
int n;
int main()
{
ios_base::sync_with_stdio(NULL);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--)
{
cin >> n;
int a[n + 1][n + 1];
for (int i = 1; i <= n; i++)
... | ALGO | 0.999118 | 4.025177 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2022-10-29T01:37:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a48d7ee01fb... |
20945da0-4549-4e66-b648-f4ea480329f1 | ishandutta2007/codeforces-a | ainta/normal/1149/D.cpp | #include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
#define N_ 10100
#define pii pair<int,int>
priority_queue<pii>PQ;
int n, m, A, B, UF[80], G[80], C[80], cc, Dis[80];
vector<int>E1[80], E2[80];
struct Edge {
int a, b, c;
}w[220];
int Find(int a) {
if (a == UF[a])return a;
ret... | ALGO | 0.999464 | 3.568225 | {
"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": "6f9ac47a1a00... |
5c592c6c-5f3b-4ce5-8b50-abbb34f6e943 | 617076674/PAT-ADVANCED | question1068/C++/question1068.cpp | #include<iostream>
#include<algorithm>
using namespace std;
bool cmp(int a, int b);
int main(){
int N, M;
scanf("%d %d", &N, &M);
int nums[N];
for(int i = 0; i < N; i++){
scanf("%d", &nums[i]);
}
sort(nums, nums + N, cmp);
int dp[N][M + 1];
bool choice[N][M + 1];
for(int i = 0; i < M + 1; i++){
if(nums[... | ALGO | 1 | 3.33159 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-10-27T13:23:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ad75adc2... |
b93dcb52-0208-459e-92d3-e1c7da3d1e62 | vanphi34/BT-KTLT | Chuong2/B3.cpp | #include <bits/stdc++.h>
using namespace std;
//import B2.cpp
void bienluanbacnhat(float a,float b);
void bienluanbachai(float a,float b,float c);
int main(){
float a,b,c;
cout << "Nhap vao he so a: " ; cin >> a;
cout << "Nhap vao he so b: " ; cin >> b;
cout << "Nhap vao he so c: " ; cin >> c;
bienluanbachai(a... | ALGO | 0.999292 | 4.039116 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-11-01T17:46:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "886fdcae72... |
902b5048-812e-4daf-9173-aaeadb56cfba | rainboyOJ/problems | roj/10025/std.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int P = 1e9 + 7;
const int N = 65;
const int M = 60;
ll l, r, k;
int ans;
struct Matrix {
int a[N][N];
void init(int x) {
memset(a, 0, sizeof a);
for (int i = 0; i < M; i++)
a[i][i] = x;
}
Matrix operator * (const Matrix &t) cons... | ALGO | 0.999915 | 4.381545 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2020-09-10T07:14:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 32,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6d823dc... |
07873d7f-06a0-4c31-967b-f12ba03457c6 | Krishnapatil28113/Placements | SDE Sheet/Day4-Array/two_sum.cpp | /*
# Problem Statement: To find the indexes of elements that add up to the given target
---------------------------------------------------------------
# How to think:
1) Brute: O(n^2)
2) Better:
* Optimization -> Time Complexity -> O(n^2) to O(n) or O(nlogn)
* Reduce time, utilize space
* Therefore, we will come up ... | ALGO | 0.999983 | 6.165185 | {
"github_metadata": {
"branch": "main",
"commit_count": 122,
"repo_created_at": "2024-02-25T03:17:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf11a7e530... |
2ec6c34a-8e38-4657-b980-d8eca2350c63 | UniStuttgart-VISUS/implicit-topology | plugins/flowvis/src/implicit_topology.h | /*
* implicit_topology.h
*
* Copyright (C) 2019 by Universitaet Stuttgart (VIS).
* Alle Rechte vorbehalten.
*/
#pragma once
#include "implicit_topology_computation.h"
#include "implicit_topology_results.h"
#include "triangulation.h"
#include "mmcore/Call.h"
#include "mmcore/CalleeSlot.h"
#include "mmcore/CallerS... | ALGO | 0.964109 | 4.377259 | {
"github_metadata": {
"branch": "master",
"commit_count": 7380,
"repo_created_at": "2020-09-30T13:36:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a61f24f0... |
24dc08cb-bb3f-4eb2-ae2c-ee2e4bfbb3e0 | Trrenny/C-tutorial-books | path_matcher2.cpp | #include "modules/common/math/path_matcher.h"
#include <algorithm>
#include <cmath>
#include <vector>
#include "glog/logging.h"
#include <functional>
#include "modules/common/math/linear_interpolation.h"
using namespace std::placeholder;
PathPoint PathMatcher::MatchPoint(const std::vector<PathPoint> &reference_lin... | ALGO | 0.996972 | 4.991669 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-12-14T12:33:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce0fbee17... |
1e2a3b66-70d8-47f4-a9a7-235ad7aef623 | coinop-logan/cpp-hexgrid | hexgrid.h | #include <myvectors.h>
#ifndef HEXGRID_H
#define HEXGRID_H
namespace ptHexGrid {
float getInradius(float circumradius);
enum Direction {
Right, UpRight, UpLeft, Left, DownLeft, DownRight
};
float directionToAngle(Direction dir);
vector2i directionToAxial(Direction dir);
Direction dir... | ALGO | 0.978958 | 4.742669 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2021-08-06T11:08: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": "5367375ba... |
6e9e9960-7d37-4a2a-a3e0-bd9e273c552d | tranbaquang1708/Loside | InputSampler.h | //
// InputSampler.h
//
#pragma once
#include <vector>
#include <algorithm>
#include <pch.h>
namespace InputSampler {
inline std::vector<float> sampleInputUniform(float min, float max, int stepNum)
{
std::vector<float> results;
float step = (max - min) / stepNum;
for (int i = 0; i < stepNum; ++i)
{
resu... | ALGO | 0.991169 | 5.366025 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2022-11-24T07:27: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": "4780969e2... |
58d5bd0c-f57e-4341-aee2-14d45d5c8659 | tiiuae/px4-firmware | src/modules/ekf2/EKF/optical_flow_control.cpp | /****************************************************************************
*
* Copyright (c) 2022 PX4 Development Team. 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. Redistri... | ALGO | 0.958841 | 7.415309 | {
"github_metadata": {
"branch": "main",
"commit_count": 44132,
"repo_created_at": "2020-10-26T13:40:36.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "PX4/PX4-Autopilot",
"stars": 9,
"forks": 13,
"issues": 0,
"pull_requests": 23
},
"file_meta": {
"content... |
f7919bc4-ccac-4e9b-b066-0c737df715b0 | skourta/tiramisu_evaluation_scripts | wrappers/function_nussinov_MINI_wrapper.cpp | #include "Halide.h"
#include "function_nussinov_MINI_wrapper.h"
#include "tiramisu/utils.h"
#include <iostream>
#include <time.h>
#include <fstream>
#include <chrono>
#include <omp.h>
int omp_do_par_for(void *user_context, int (*f)(void *, int, uint8_t *), int min, int extent, uint8_t *state) {
int exit_status = ... | ALGO | 0.97038 | 5.056007 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-05-07T08:19: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": "e91c91de9123... |
8f242941-63e2-4941-9c26-bdfefd283ee8 | spriteboysz/LeetcodeCC | algorithm/P0482.cpp | /**
* Author: Deean
* Date: 2023-04-26 22:09
* FileName: algorithm
* Description:
*/
#include "..\common\leetcode.h"
using namespace std;
class Solution {
public:
string licenseKeyFormatting(string s, int k) {
string ss = "";
for (int i = s.size() - 1, cnt = 0; i >= 0; --i) {
if... | ALGO | 0.999882 | 5.428857 | {
"github_metadata": {
"branch": "main",
"commit_count": 217,
"repo_created_at": "2022-07-16T00:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffe2037545... |
47cd3031-2888-4f3f-980c-ea6005a07034 | RobertZubek/WaveRover | ARDUINO/ARDUINO.ino | #include <Arduino_FreeRTOS.h>
#include "semphr.h"
#define rtDelay(v) vTaskDelay(v/15)
#define triggerPINLP 5
#define echoPINLP 4
#define triggerPINPP A1
#define echoPINPP A0
#define triggerPINP A5
#define echoPINP A4
#define triggerPINL 2
#define echoPINL 3
#define infoPIN 7
int state = 1;
SemaphoreHandle_t bina... | TOOL | 0.911935 | 4.812834 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-17T18:40:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e3e5421294dd... |
3640db44-25a9-4d0e-9245-d2626cf18662 | d-SEAMS/seams-core | src/franzblau.cpp | //-----------------------------------------------------------------------------------
// d-SEAMS - Deferred Structural Elucidation Analysis for Molecular Simulations
//
// Copyright (c) 2018--present d-SEAMS core team
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of th... | ALGO | 0.999548 | 5.251536 | {
"github_metadata": {
"branch": "main",
"commit_count": 1378,
"repo_created_at": "2019-01-08T22:50:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 39,
"forks": 10,
"issues": 14,
"pull_requests": 2
},
"file_meta": {
"content_id": "9e5e707... |
459d3d6e-8224-4943-b02b-0c235a2e691a | Bhargav-2808/LeetCode | 0034-find-first-and-last-position-of-element-in-sorted-array/0034-find-first-and-last-position-of-element-in-sorted-array.cpp | class Solution {
public:
int fOcc(vector<int>& nums, int target)
{
int s=0;
int e=nums.size()-1;
int mid = s+ (e-s)/2;
int ans=-1;
while(s<=e)
{
if(nums[mid]==target)
{
ans=mid;
e=mid-1;
... | ALGO | 0.99994 | 6.349674 | {
"github_metadata": {
"branch": "main",
"commit_count": 307,
"repo_created_at": "2022-10-09T12:04:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "909819dd86... |
ed4142e5-4608-4125-8506-ad58638e9fc5 | Mu-L/TracerInteractiveUE4Plugins | Engine/Plugins/Experimental/GeometryProcessing/Source/DynamicMesh/Private/Solvers/Internal/MeshUVSolver.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "MeshUVSolver.h"
#include "Solvers/MatrixInterfaces.h"
#include "Solvers/LaplacianMatrixAssembly.h"
#include "MatrixSolver.h"
#include "MeshBoundaryLoops.h"
#include "MeshQueries.h"
//
// Extension of TSparseMatrixAssembler suitable for eigen sparse matrix... | ALGO | 0.999362 | 4.939685 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2020-03-24T02:30:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 11,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "f3ed0d6... |
ce9c0b6f-1388-43c6-965b-6050108e8a17 | sakibul-shovon/cpp-practice | CPS Graph/M_Tree_Diameter.cpp | // File Name: M_Tree_Diameter.cpp
// Date: 2025-05-02
// Time: 01:01:08
#include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define ll long long int
#define vll vector<long long int>
#define vstring ... | ALGO | 0.998783 | 3.834624 | {
"github_metadata": {
"branch": "main",
"commit_count": 94,
"repo_created_at": "2022-11-18T18:59:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "817a596f37c... |
c20bc3ae-baf0-454a-833a-bc807ca811dd | 1998apoorvmalik/competitive-programming | Hacker Earth/Code Monk/Monk and Inversions/monk-and-inversions.cpp | /*
------------------------------------------------------------------------------------------------------
Title: Monk and Inversions
Problem Description: Find number of inversions in an matrix.
Author: <NAME>
Date: 4th April, 2021
----------------------------------... | ALGO | 0.999888 | 5.507736 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-07-14T02:24: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": "f2b8e5912296... |
719b0dd4-5a8b-4c2e-a20b-02a97ce6528c | pgrynfelder/algorithmics | oi/oi24/mid/mid1.cpp | /*
DOES NOT WORK
OI24
MID
https://szkopul.edu.pl/problemset/problem/wrTmzO9-dzEbLtsRUCdMV2_W/site/?key=statement
<NAME>
*/
#include <bits/stdc++.h>
using namespace std;
constexpr int N = 30, LOGN = 21;
struct node {
node *l = nullptr, *r = nullptr, *jptr[LOGN];
int d = 0, i;
node(int _i = 0) {
f... | ALGO | 0.999959 | 5.194892 | {
"github_metadata": {
"branch": "main",
"commit_count": 346,
"repo_created_at": "2022-12-23T18:14:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c7e4e13d2... |
a1f11d6a-4289-427a-9630-669f3b6670b1 | lavavu/LavaVu | src/LinesSorted.cpp | /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
** Copyright (c) 2010, Monash University
** All rights reserved.
** Redistribution and use in source and binary forms, with or without modification,
** are permitted provided that the following conditions are met:
**
** ... | TOOL | 0.946804 | 3.748701 | {
"github_metadata": {
"branch": "master",
"commit_count": 3293,
"repo_created_at": "2015-10-29T05:50:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 55,
"forks": 13,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a27c8... |
11648ed1-f255-40e8-9373-bec838c4f0a9 | Shreyans121/Cpp-Codes | Sorting and Searching/Linear_Search.cpp | #include<iostream>
using namespace std;
int search(int arr[], int n, int x)
{
int i;
for (i = 0; i < n; i++)
if (arr[i] == x)
return i;
return -1;
}
int main()
{
int n;
cout << "Enter the number of elements: ";
cin >> n;
int arr[n];
cout << "Enter elements:" << endl... | ALGO | 0.999278 | 4.961095 | {
"github_metadata": {
"branch": "mainbranch",
"commit_count": 86,
"repo_created_at": "2020-06-25T18:15: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": "a4177... |
30758107-dc6b-46ff-a200-44b31d27e6f8 | PointCloudLibrary/pcl | features/include/pcl/features/impl/pfh.hpp | /*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2011, <NAME>, Inc.
* Copyright (c) 2012-, Open Perception, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permi... | ALGO | 0.945973 | 7.358307 | {
"github_metadata": {
"branch": "master",
"commit_count": 14566,
"repo_created_at": "2013-02-12T16:40:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10495,
"forks": 4656,
"issues": 432,
"pull_requests": 147
},
"file_meta": {
"content_id... |
34478dc9-ffe5-4bbc-b376-156489f2b648 | Isdemus/AlwaysBeCoding | alwaysCoding/abc#10.cpp | // Counting Sort and Library Sort
#include <iostream>
#include <array>
#include <vector>
#define SIZE 6
using namespace std;
// Counting sort can be optimized if we keep the min/max values of the given array
// Array<int, 6> -> Sorted Array<int, 6>
std::array<int, SIZE> CountingSort(std::array<int, SIZE> list) {
u... | ALGO | 0.999939 | 5.554484 | {
"github_metadata": {
"branch": "master",
"commit_count": 180,
"repo_created_at": "2016-02-28T00:47:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "098ab340... |
44cbc682-765e-47e8-be2e-2343c4e1cf5a | cyborg7459/Data_Structures_and_Algorithms | Algorithms/07 - Dynamic Programming/048-Painting_fence.cpp | // PS : Given a fence with n posts and k colors, find out the number of ways of painting the fence such that at most 2 adjacent posts have the same color
// Explanation : This problem can be solved using dynamuic programming. Create a dp table of size (nx2), where dp[i][0] represents the number of ways of painting 'i' ... | ALGO | 0.999969 | 4.874733 | {
"github_metadata": {
"branch": "master",
"commit_count": 461,
"repo_created_at": "2020-09-15T14:51: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": "e24b60ca... |
423d863a-d2d3-4451-8e83-698f05e648c5 | ciaranm/cpaior2019-sbs-for-subgraphs-paper | glasgow/formats/input_graph.cc | /* vim: set sw=4 sts=4 et foldmethod=syntax : */
#include "formats/input_graph.hh"
#include <algorithm>
#include <limits>
#include <string_view>
using std::distance;
using std::numeric_limits;
using std::make_pair;
using std::max;
using std::string_view;
InputGraph::InputGraph(int size, bool v, bool e) :
_has_v... | TOOL | 0.908081 | 6.766722 | {
"github_metadata": {
"branch": "master",
"commit_count": 300,
"repo_created_at": "2017-07-28T18:38: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": "45f27a35... |
96ab7be6-41d1-4d85-8ded-c8d50dbf2c68 | yamate11/compprog | zCodeForces/r605_3/f/cans.cc | #include <bits/stdc++.h>
#include <cassert>
typedef long long int ll;
using namespace std;
// @@ !! LIM(f:updMaxMin debug)
// ---- inserted function f:updMaxMin from util.cc
template<typename T>
bool updMax(T& tmax, const T& x) {
if (x > tmax) { tmax = x; return true; }
else { return false; }
... | ALGO | 0.999951 | 3.919754 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2021-03-11T06:12:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64088e73dd... |
595d8360-098c-415f-89fd-7f6049d9c2cf | SnowySparks/BOJ_Algorithm | 백준/Platinum/17412. 도시 왕복하기 1/도시 왕복하기 1.cc | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <queue>
using namespace std;
#define f(a, b, c) for (int a = b; a < c; ++a)
#define N_MAX 401
const int inf = 1e9 + 7;
vector<int> adj[N_MAX];
int capacity[N_MAX][N_MAX];
int flow[N_MAX][N_MAX];
int parent[N_MAX];
int main(void) {
... | ALGO | 0.999794 | 3.756664 | {
"github_metadata": {
"branch": "main",
"commit_count": 411,
"repo_created_at": "2024-01-11T05:37: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": "a2d1a42386... |
2f0e975a-d020-4eca-bfe8-d115021baeca | hitoring/imsf | fusion/imsf_kalman_filter.h | /*
*********************************************************************************************************
* @file imsf_kalman_filter.h
* @author <NAME>
* @version V1.0.0
* @date 2017-06-09
* @brief This file defines a Kalman filter class
for intelligent multi-sensor fusion library (imsf).... | ALGO | 0.917481 | 7.13207 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-10-18T09:47:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eeee8c5d5... |
2d7c0108-6ead-4a09-9dd6-448ebf8df512 | Hasini-Samudrala/DSA | Arrays/max_subarray.cpp | /*
Problem link - https://leetcode.com/problems/maximum-subarray/
*/
//Approach - 1
// Brute force liek in O(n^2) time complexity
//Optimised approach
//Kadane's Algorithm
class Solution {
public:
int maxSubArray(vector<int>& nums) {
int sum =0;
int max = INT_MIN;
for(int n:nums)
... | ALGO | 0.999969 | 6.137645 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2025-05-17T09:13: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": "c32f9db0c4c... |
a0e41b63-77ce-42e2-85de-278c44369dbe | metaphysis/Code | UVa Online Judge/volume100/10028 Demerit Points/program.cpp | // Demerit Points
// UVa ID: 10028
// Verdict: Accepted
// Submission Date: 2021-12-21
// UVa Run Time: 0.000s
//
// 版权所有(C)2021,邱秋。metaphysis # yeah dot net
#include <bits/stdc++.h>
using namespace std;
struct DATE
{
int year, month, day;
DATE (int year = 0, int month = 0, int day = 0): year(year), month(mo... | ALGO | 0.999618 | 4.347775 | {
"github_metadata": {
"branch": "master",
"commit_count": 1710,
"repo_created_at": "2016-03-07T13:28:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 229,
"forks": 50,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9536... |
cc88a7c3-7e71-4c3b-bbbd-d8bc556c3e94 | MarcoMustacchi/ComputerVision | Lab7/Lab7TestCopy/lib/PanoramicImage.cpp | #include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include "PanoramicImage.h"
#include "PanoramicUtils.h"
PanoramicImage::PanoramicImage(std::vector<cv::Mat> input_set, double camera_fov, int nfeatures1, double ratio1) {
assert(ratio1 >= 1); //stop if ratio is smaller than ... | ALGO | 0.995081 | 5.60096 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2022-04-23T10:17: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": "2ded3050f... |
4af36e0b-d2b2-40ab-ad5e-4d869d122632 | taketakeyyy/atcoder | abc/273/c.cpp | #define _USE_MATH_DEFINES // M_PI等のフラグ
#include <bits/stdc++.h>
#define MOD 1000000007
#define COUNTOF(array) (sizeof(array)/sizeof(array[0]))
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define intceil(a,b) ((a+(b-1))/b)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<long,lo... | ALGO | 0.999947 | 4.23488 | {
"github_metadata": {
"branch": "master",
"commit_count": 1317,
"repo_created_at": "2018-03-05T01:37:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "19ec93c... |
9d6eae7e-e891-4157-aacf-bbdcc2d26650 | dougla5s/cpp | tree.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
class TreeNode {
public:
map<int, vector<int>> adj;
map<int, bool> visited;
int count[sizeof(adj)];
void addEdge(int x, int y) {
adj[x].push_back(y);
}
void printTree() {
for (const auto &[node, children] : adj) {
cout << node << " -> ";... | ALGO | 0.999448 | 4.175621 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-07-28T08:45: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": "f33767e5f7a5... |
5ddb888f-e717-41f3-885d-3c8c7cabb2cd | kyu-h/SWEA_BJ | BJ/BFS_2178/main.cpp | #include <iostream>
#include <queue>
using namespace std;
int n, m;
int arr[101][101];
int visit[101][101];
int min_ = 1000000000;
int cnt = 1;
queue<pair<pair<int, int>, int>> q;
void bfs(int x, int y, int z){
visit[x][y] = 1;
q.push({{x, y}, z});
while(!q.empty()){
x = q.front().first.first;
... | ALGO | 0.999881 | 3.603303 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2019-03-18T07:31: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": "a89843467... |
8c0966bc-4417-48c7-b53f-7a06c943763f | ROCm/OpenFOAM_HMM | src/meshTools/algorithms/PatchEdgeFaceWave/edgeTopoDistanceDataI.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-----------------------------------... | TOOL | 0.990192 | 6.970119 | {
"github_metadata": {
"branch": "suyash/hmm",
"commit_count": 25733,
"repo_created_at": "2022-10-27T12:31:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f6... |
f11b0598-dc37-471f-b4af-ede1c42aafbd | atubo/online-judge | lintcode/P0612.cpp | // https://www.lintcode.com/problem/k-closest-points/description
// 612. K Closest Points
#include <bits/stdc++.h>
using namespace std;
#include "../utils/BinaryTree.h"
#include "../utils/Graph.h"
#include "../utils/LinkedList.h"
#include "../utils/Util.h"
struct Point {
int x, y;
Point(): x(0), y(0) {}
P... | ALGO | 0.999992 | 5.82137 | {
"github_metadata": {
"branch": "master",
"commit_count": 2295,
"repo_created_at": "2013-10-03T04:23:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ed27ad... |
52b132b8-481f-4345-80aa-1347eba5a140 | GimChi-JJiGae/baekjun_practice | 프로그래머스/2/178870. 연속된 부분 수열의 합/연속된 부분 수열의 합.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> sequence, int k) {
int s = 0, e = 0;
int sum = sequence[0];
int subLen = sequence.size() + 1;
pair<int, int> result;
while (s <= e && e < sequence.size()) {
if (sum < k){ // 더 넣어야함
... | ALGO | 0.999974 | 6.143298 | {
"github_metadata": {
"branch": "master",
"commit_count": 375,
"repo_created_at": "2022-07-27T11:31: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": "265a1c16... |
5d7bd9dc-ff45-44ed-9ae8-c600964baac4 | Anand1601/my_learning | range_query/sqrt_decomposition/sprinkler_interview_que.cpp | /*
Q. Given an array of n elements. you have to answer some querries.
in each query
you get (i,d);
find the sum of a[i]+a[i+d]+a[i+2d]+.. untill i+xd<=n;
constrains:
1<=n,q<=n;
INPUT:10 4
1 2 3 4 5 6 7 8 9 10
1 2
0 3
2 3
3 4
*/
#include<iostream>
#include <bits/stdc++.h>
using namesp... | ALGO | 0.999888 | 3.869678 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-01-21T08:57: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": "9957c73dc4b... |
8e76fcf7-e80b-4bb9-85a7-21afe0ac2ac2 | ishandutta2007/codeforces-i | -is-this-fft-/normal/281/B.cpp | #include <iostream>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ld, pair<ll, ll>> frac;
frac best;
void get_best (ll x, ll y, ll K) {
ll xK = x * K;
ll mna = xK / y;
ll mxa = mna + 1;
frac fmna = make_pair((ld) x / (ld) y - (ld) mna / (ld) K, make_pair(mna, K));
b... | ALGO | 0.99971 | 4.810093 | {
"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": "f25191a02860... |
0327af72-5f4b-4df9-9827-e975a373e0c3 | ishandutta2007/codeforces-a | avinashkartik/normal/1305/F.cpp | #pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>
using namespace std;
#define fastio ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision... | ALGO | 0.999876 | 3.812927 | {
"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": "57907008901c... |
6d944241-e29b-4c2d-b531-a1ecbe2a33e0 | MakeContributions/DSA | algorithms/CPlusPlus/Trees/in-order-predecessor-and-successor.cpp | #include <iostream>
struct TreeNode{
TreeNode* left;
TreeNode* right;
int data;
TreeNode(const int& data): data(data), left(nullptr), right(nullptr){}
};
TreeNode* find(TreeNode* root, const int& data){
/**
* Find the node that contains the given data and
* return that node
*
... | ALGO | 0.999937 | 5.42814 | {
"github_metadata": {
"branch": "main",
"commit_count": 655,
"repo_created_at": "2020-12-16T13:54:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 809,
"forks": 806,
"issues": 79,
"pull_requests": 212
},
"file_meta": {
"content_id": "974a... |
932d099d-7224-4263-ba3a-478948afeb9f | Tudor67/Competitive-Programming | LeetCode/Contests/#Biweekly#059/#Q3_NumberOfWaysToArriveAtDestination_sol1_dijkstra_with_set_O(ElogV)_time_O(E+V)_extra_space_72ms_31MB.cpp | class Solution {
public:
int countPaths(int N, vector<vector<int>>& roads) {
const long long INF = LLONG_MAX / 10;
const int MODULO = 1e9 + 7;
vector<vector<pair<int, int>>> g(N);
for(const vector<int>& ROAD: roads){
int x = ROAD[0];
int y = ROAD[1];
... | ALGO | 0.999952 | 5.705002 | {
"github_metadata": {
"branch": "master",
"commit_count": 615,
"repo_created_at": "2020-02-27T19:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "017da6a2... |
804fb648-87be-4bce-83e3-c0a044832f6e | su8y/PS-ATTACK | korsua/solved.ac/4485 녹색 옷 입은 애가 젤다지.cpp | #include <bits/stdc++.h>
#define FASTIO cin.tie(0)->sync_with_stdio(0)
#define endl '\n'
using namespace std;
/*
문제 : https://www.acmicpc.net/problem/4485 녹색 옷 입은 애가 젤다지?.cpp
*/
#define vertax tuple<int, int, int> // y,x,cost
class compare{
public:
bool operator()(vertax a, vertax b){
return get<2>(a) > get<2>(b... | ALGO | 0.999847 | 4.617832 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2022-11-03T11:00:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 7,
"issues": 5,
"pull_requests": 2
},
"file_meta": {
"content_id": "e80a9b4e52... |
e2408957-dea1-463a-8d1d-c93a2187c921 | peraro/finiteflow | src/algorithm.cc | #include <fflow/algorithm.hh>
#include <fflow/function_cache.hh>
namespace fflow {
Ret Algorithm::learn_all(Context * ctxt, Mod mod, AlgorithmData * data,
unsigned n_singular, unsigned n_learning)
{
if (n_learning == 0) {
set_learned();
return SUCCESS;
}
set_le... | ALGO | 0.994531 | 5.588217 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2019-05-20T20:41:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 46,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "94ce59a8... |
73747c08-d6a1-44d2-9006-32f9eca92ae0 | WizardPenguin/competative-programming | 1000-1500/B_Cat_Cycle.cpp | #include <bits/stdc++.h>
#include <complex>
#include <cmath>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vecto... | ALGO | 0.99996 | 4.216759 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2022-10-06T16:10: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": "db61bdda7... |
53d39d32-e03d-4190-8903-33ec0efb88b3 | EzaRasheed/CS2150 | LAB6/POST-LAB/hashTable.cpp | //name: <NAME>
//id: er6qt
//date: 03-04-19
//filename: hashTable.cpp
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include "hashTable.h"
//#include <math.h>
using namespace std;
hashTable::hashTable(int size) { //help
max_size = 0;
int prime_size = getNextPrime(size);
hash_tab... | ALGO | 0.989777 | 3.549293 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2020-01-18T20:43: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": "abd21242... |
e8cbbf32-fdde-4544-bf8a-8bb7edcda430 | nicolasreisdev/Competitive-Progamming | contest/question/sbce.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define rm pop_back
#define f first
#define s second
typedef pair<int, int> p;
typedef long long ll;
const int MAX = 1e5 + 10;
int main(){
cin.tie(0);
ios_base::sync_with_stdio(0);
vector<int> polen(1000010, 0);
int n, k;
cin >... | ALGO | 0.999987 | 4.03348 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-04-25T13:31: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": "0c24f1bd796... |
18978827-dd46-4fb0-9fad-8a4bdddb9b0d | lulamalik23/DDP-MI-23 | 02 pemasukan dan keluaran/lulamalika_soal_4.cpp | #include <iostream>
using namespace std;
int main() {
float a, b;
cin >> a >> b ;
cout << "Hasil dari Penjumlahan " << a << " dengan " << b << " adalah " << a + b << endl;
cout << "Hasil dari Pengurangan " << a << " dengan " << b << " adalah " << a - b << endl;
cout << "Hasil dari Perkalia... | ALGO | 0.942166 | 3.371429 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-09-04T08:13:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1132cbaeb0d... |
a80ee09c-4934-469b-a549-b9d4826b5e3d | sandavrannow/black_scholes_pricing_calculator | bs_demo/main_back.cpp | #include <iostream>
#include <cmath>
// EUROPEAN OPTIONS
// Black Scholes Formula = C0 = ( S0 )( N( d1 ) ) − ( X )( e ) - > to the power - > ( − r T )( N( d2 ) )
// d1 = ( ( ( ln ( S0 / X ) ) + ( r + ( ( ( sigma ) - > to the power - > ( 2 ) ) / 2 ) ) ( T ) ) ) / ( sigma ( square root T ) )
// d2 = ( d1 ) - ( sigma ( ... | ALGO | 0.999353 | 5.60702 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-08-18T02:13:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5c3d2a3f08... |
836c74a7-6b74-480b-aa48-fcdc0ea72282 | mdbrnowski/competitive-programming | Polish OI/2008/etap I/clo.cpp | #include <bits/stdc++.h>
using namespace std;
int pocz, kon;
int current;
bool found;
vector<int> visited;
vector<int> res;
vector<vector<int>> graph;
void DFS(int x, int parent) {
visited[x] = current;
for (auto& v : graph[x]) {
if (v == parent) continue;
if (visited[v] == current) {
... | ALGO | 0.999997 | 4.863765 | {
"github_metadata": {
"branch": "main",
"commit_count": 400,
"repo_created_at": "2021-04-08T20:35:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "997000f9db... |
51540426-82f8-408c-880b-99073fa6e684 | mo-snow-zingo/ScientificComputing | Project2/test_newton.cpp | //<NAME>
//Project 2
//Part A
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;
double f(const double x, void *data);
double df(const double x, void *data);
double newton(double (*f)(const double, void *data),
double (*df)(const double, void *data),
double ... | ALGO | 0.999642 | 4.634111 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-10-25T02:53:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "336bb51ce5... |
6804f310-d218-41f3-8040-411f9faacee3 | Wei-TianHao/numerical-analysis-zju | p2.cc | #include <stdio.h>
#include <math.h>
#define ZERO 1e-13 /* X is considered to be 0 if |X|<ZERO */
#define MAXN 11 /* Max Polynomial Degree + 1 */
double calc(int n, double f[], double a) {
double ret = 0, x = 1;
for(int i = 0; i <= n; i++, x *= a) {
ret += f[i] * x;
}
return ret;
}
double ge... | ALGO | 0.999877 | 3.656954 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2017-03-05T14:09:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01747c06d... |
30970e06-83b5-4768-8aee-fc91ef2c6e71 | nirme/BubbleFighter | BubbleFighter/BubbleFighter.NativeActivity/utils/Primitives2D/2DMath.h | #pragma once
#include "AABB.h"
#include "Line.h"
#include "Circle.h"
#include "ConvexPolygon.h"
#include "Pill.h"
namespace Primitives2D
{
bool figureIntersection(const Circle& _figure1, const Circle& _figure2)
{
Vec2f dist = _figure2.getCenter() - _figure1.getCenter();
float r1 = _figure2.getRadius();
floa... | ALGO | 0.976788 | 4.784107 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2019-05-08T14:06: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": "7de6da005... |
558dbb6a-c64f-4a98-9337-776e62cba14c | maxGimeno/cgal | Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/GarlandHeckbert_policies.h | // Copyright (c) 2019 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : <NAME>,
// <NAME>
//
#ifndef CGAL_SURFACE_MESH_SIMPLIFICATION_POLICIES_GAR... | ALGO | 0.999226 | 6.139101 | {
"github_metadata": {
"branch": "master",
"commit_count": 97227,
"repo_created_at": "2015-07-01T14:25:52.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "CGAL/cgal",
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
e0b3006c-548b-4ba9-b53a-690b6f0e3d30 | JoaoJoaoVF/VPLs-PDS-II-2021-2 | Modulo 1/VPL5/main.cpp | // NÃO ALTERE ESSA LINHA
//#include "avaliacao_basica_escalonador.hpp"
#include <iostream>
#include <iomanip>
#include "ListaProcessos.hpp"
#include "Processo.hpp"
int main()
{
int qtde = 0;
Processo *p;
ListaProcessos lp;
char codigo;
int id = 0, prioridade = 0;
std::string nome;
while... | ALGO | 0.987095 | 4.004276 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-07-09T00:00: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": "24a04634ef5a... |
9ffca9ee-552d-4c3a-831c-fb827dac0a24 | chrys-athome/sire | corelib/src/libs/SireMol/calculateaxes.hpp | /********************************************\
*
* Sire - Molecular Simulation Framework
*
* Copyright (C) 2006 <NAME>
*
* This program 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; eit... | ALGO | 0.992614 | 5.886225 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2015-09-07T14:02:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "9aeeb6ea9... |
d22dc998-689a-48b2-b8b0-b8ddf668d3aa | MelvinSalcedo/bioinspirada | hormigas/C_hormigas-4.cpp | #include <map>
#include <iostream>
#include <vector>
#include <time.h>
#include <cmath>
#include <stdlib.h>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
char letra_F='A';
char letra_C='A';
typedef float num;
const int maximo=4;
num D[maximo][maximo] = {{ 0,12, 6,4... | ALGO | 0.999923 | 4.009427 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-07-09T03:56: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": "b984a497dc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.