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 |
|---|---|---|---|---|---|---|---|
c8613275-a161-428e-b3d7-f8ad172e331b | mimibetty/CP-Training- | 2 Online Judge/Codeforce/2023/893/C.cpp | /*
link submit:
Note:
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;
#define MS(s, n) memset(s, n, sizeof(s))
#define All(v) (v).begin(),(v).end()
#define cntBit __builtin_popcount
#define fi first
#define se second
#define pb push_back... | ALGO | 0.998847 | 4.32727 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-04-12T06:16: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": "ef3b693fe1e... |
00e9ec43-0641-438d-9f42-1fd8a175af5c | LazySeaSeal/Problems | contest/1.cpp | #include <bits/stdc++.h>
using namespace std;
int g(int n, int x, int y, vector<vector<int>> &v)
{
if (v.size() - x < 0 || v.size() - y < 0)
return 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
if (v[i][j] == 0)
return 0;
return 1;
}
int f(int n, ve... | ALGO | 0.99987 | 4.613793 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-22T12:34: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": "785eab3d2807... |
ecb1e4d1-0e26-4b2b-8ca9-041d05705789 | Vivek084c/DSA | Linked_list/LL.cpp | #include <iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
// constructor for node class
Node(int data){
this->data = data;
this->next = NULL;
}
};
void insertAtHead(Node* &head, int data){
// creating a new node
Node* temp = new Node(data);
... | ALGO | 0.999442 | 4.818791 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-07-12T10:00:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86a2c95b2df... |
7843696c-538f-450f-a023-d9f77728b7d4 | parthh1112/LinkedList- | 3 doubly ll.cpp | #include <bits/stdc++.h>
using namespace std;
#define null NULL
class Node{
public :
int data;
Node* next;
Node* pre;
Node(int data){
this-> data = data;
this-> next = null;
this-> pre = null;
}
};
int sizeOfLL(Node *&head)
{
Node *temp = head;
int size = 0;
w... | ALGO | 0.9997 | 4.75413 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-04-10T13:55: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": "1c4d9c09b0... |
f6c9b9c3-cf1f-4500-b3db-9011d3643fdb | sastava007/Tech-Interview-Preparation | GFG/Tree/Bottom View.cpp | /* The idea is to modify vertical order traversal, to stire just last element of each vertical line */
// using Queue and map
void bottomViewUtil(Node* root, map<int,int> &m)
{
if(root==NULL)
return;
queue<pair<Node*, int>> q;
q.push({root, 0});
while(!q.empty())
{
pai... | ALGO | 0.999991 | 5.150595 | {
"github_metadata": {
"branch": "master",
"commit_count": 214,
"repo_created_at": "2019-06-11T20:32:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 571,
"forks": 107,
"issues": 4,
"pull_requests": 8
},
"file_meta": {
"content_id": "fe19... |
7f035259-f6a0-4d90-9290-71b03ea416c7 | PluckyCoward/WCH_IS_DEAD | W1234. Replace the Substring for Balanced String.cpp | class Solution {
public:
int balancedString(string s) {
vector<char> alphabet {'Q', 'W', 'E', 'R'};
unordered_map<char,int> map;
for (auto ch : s) {
map[ch]++;
}
int average = s.size() / 4;
bool balance = true;
for (char ch : alphabet) {
... | ALGO | 0.999973 | 4.531706 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2020-01-16T05:49:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c4615d68... |
502da4fb-7a56-456e-8e3b-1e7bb92a2ba4 | BhavyaBhalla-27/DSA-Supreme- | Graphs_ClassI_17th June 2023/Depth_First_Search.cpp | #include<iostream>
#include<unordered_map>
#include<list>
#include<queue>
using namespace std;
template<typename T>
class Graph{
public:
unordered_map<T,list<T>>adjList;
void addEdge(T u,T v,bool direction){
// direction = 0 -> undirected
// direction = 1 -> directed
... | ALGO | 0.999942 | 4.888155 | {
"github_metadata": {
"branch": "main",
"commit_count": 513,
"repo_created_at": "2023-01-22T10:26:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 370,
"forks": 137,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "ec6fe5... |
13e47e50-df67-44a8-a2ec-bf4b40bf21c3 | hiro99988/Eacpp | benchmarks/ParallelHpaBenchmark.cpp | #include <mpi.h>
#include <pybind11/embed.h>
#include <Eigen/Core>
#include <chrono>
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <memory>
#include <nlohmann/json.hpp>
#include <sstream>
#include <string>
#include <vector>
#include "Algorithms/HalfMpMoead.hpp"
#include "Alg... | ALGO | 0.999356 | 6.37202 | {
"github_metadata": {
"branch": "main",
"commit_count": 628,
"repo_created_at": "2024-06-20T09:46: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": "853d037329... |
6c101c95-569d-4e09-8a63-fd44156ab22f | priyanshisharma/Leetcoding-Challenge | October'20/October_20_Clone_Graph.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
vector<Node*> neighbors;
Node() {
val = 0;
neighbors = vector<Node*>();
}
Node(int _val) {
val = _val;
neighbors = vector<Node*>();
}
Node(int _val, vector<Node*> _neighbors) {
v... | ALGO | 0.999944 | 5.965847 | {
"github_metadata": {
"branch": "master",
"commit_count": 487,
"repo_created_at": "2020-05-01T08:22:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 52,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3e87f3... |
72aba0ff-c79a-4856-b807-d16df2b1ac5a | SAgarwal-24/algorithms | linked-list/linked-list.h | #pragma once
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <iostream>
using std::vector;
using std::string;
using std::queue;
using std::priority_queue;
using std::greater;
using std::cout;
using std::endl;
using std::stack;
#include "nodes.h"
ListNode* reverseList(ListNode* head);
... | TOOL | 0.932002 | 4.114436 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2020-06-16T08:11:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f07252f8... |
67120081-1904-49c1-81a7-cc4109ff3327 | whlprogram/CPP_Code | NewCoder/Shopee 2019校园招聘笔试A卷第一批-9.12/t2/main.cpp | #include <bits/stdc++.h>
using namespace std;
struct Point{
double x, y;
};
bool between(double a, double X0, double X1)
{
double temp1= a-X0;
double temp2= a-X1;
if((temp1<1e-8&&temp2>-1e-8) || (temp2<1e-6&&temp1>-1e-8)){
return true;
}else{
return false;
}
}
// 判断两条直线段是否有交点,有则... | ALGO | 0.99979 | 3.978397 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-03-30T16:43: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": "4ac5c878d2... |
ab13ddaa-fdaf-4c62-b866-b1edb7418141 | Seymour-Lee/leetcode-solutions | dynamic_programming/337. House Robber III.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
int rob(TreeNode* root) {
pair<int, int> result = dfs(root);
return max(result.... | ALGO | 0.999929 | 5.922581 | {
"github_metadata": {
"branch": "master",
"commit_count": 718,
"repo_created_at": "2018-06-21T10:48:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3616c52f... |
37b3feec-2dc1-4ae4-aaf2-cddae7b13a8c | harshbhar0629/CrackYourInternship | Graph/19_cheapest_flights_within_k_stops.cpp | #include <bits/stdc++.h>
using namespace std;
// https://leetcode.com/problems/cheapest-flights-within-k-stops/description/
#define f first
#define s second
#define pi pair<int, int>
#define ppi pair<int, pi>
class Solution
{
public:
int findCheapestPrice(int n, vector<vector<int>> &flights, int src, int dst, int ... | ALGO | 0.99981 | 4.400899 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-07-16T23:29:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84527b53e2b... |
889c0416-10b2-43fe-816f-09b8842286e8 | Gtupxx/ccpp | ex/asdf.cpp | /*
* @Author: 柚岩龙蜥
* @Date: 2024-04-06 14:36:37
* @LastEditors: 柚岩龙蜥
* @LastEditTime: 2024-04-06 14:41:25
* @FilePath: \ccpp\ex\asdf.cpp
* @Description:
*
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n = 50;
int num = 0;
ofstream file("data.txt", ios::out | ios::ate);
cout.... | ALGO | 0.972624 | 4.290115 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-06-11T03:06: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": "fb1f9ba7aed5... |
b976902c-2e14-4927-a900-94d7d919fd29 | menium878/AoC2023 | 1_part2.cpp | #include <string>
#include <iostream>
#include <sstream>
#include <regex>
void halo(std::string &cos){
cos=std::regex_replace(cos,std::regex("one"),"1");
cos=std::regex_replace(cos,std::regex("two"),"2");
cos=std::regex_replace(cos,std::regex("three"),"3");
cos=std::regex_replace(cos,std::regex("four")... | ALGO | 0.998233 | 4.360116 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-12-02T07:09: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": "a1101e37ca7... |
e4b28afb-413a-465f-bc02-64576e41e00a | shadmantabib/CSE_318 | CSE_318_AI_Sessional/Offline_1/Solution/2005103.cpp | #include <iostream>
#include <vector>
#include <string>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <limits>
using namespace std;
ofstream logFile;
struct Node {
vector<vector<int>> board;
int g;
int h;
int f;
Node* parent;
Node(ve... | ALGO | 0.999969 | 5.875607 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-19T17:03:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3361920dc3bb... |
e16b4bb4-c9cc-4ad7-bb68-18a10fa95904 | MithunDu404/DSA | Sorting/1233. Remove Sub-Folders from the Filesystem.cpp | // https://leetcode.com/problems/remove-sub-folders-from-the-filesystem/
// TC -> O(100 * n * log(n))
class Solution {
public:
vector<string> removeSubfolders(vector<string>& folder) {
int n = folder.size();
sort(folder.begin(),folder.end());
set<string> st;
vector<string> ans;
... | ALGO | 0.998808 | 5.448139 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2025-06-20T03:07:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68d298b2efd... |
52a9cc2e-0da5-4432-b61e-e0e23612316f | olesenm/openfoam | src/regionFaModels/liquidFilm/liquidFilmModel/liquidFilmModel.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-----------------------------------... | TOOL | 0.905058 | 6.887119 | {
"github_metadata": {
"branch": "master",
"commit_count": 27318,
"repo_created_at": "2019-01-05T15:15:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ecb4... |
0df02ba0-54df-4103-b5f2-aa1f16fd3096 | manassinghdewari/dsa | 05Searching/4IndexOfFirstOccurance.cpp | // index of the first occurrence
// efficinent code
// recursive approach
#include <bits/stdc++.h>
using namespace std;
int firstOccur(int arr[], int low, int high, int x)
{
if (low > high)
return -1;
int mid = (low + high) / 2;
if (x > arr[mid])
return firstOccur(arr, mid + 1, high, x)... | ALGO | 0.999953 | 4.833591 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2022-11-06T06:41: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": "0a6b92dec... |
65916c7f-464d-4cac-b3f4-b5b69baab0ea | chaeeon-lim/ProgrammingLearners | jihyun/BJ/14503.cpp | #include <iostream>
#include <queue>
#include <tuple>
using namespace std;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,1,0,-1};
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N, M; //세로, 가로
int r, c, d; //현재 로봇청소기가 있는 좌표(r,c)와 방향
cin >> N >> M;
cin >> r >> c >> d;
... | ALGO | 0.999949 | 4.633876 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2019-12-06T04:34: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": "2f9dd9f9... |
29e93281-fa22-4fdb-8797-676a1d629dcd | itzjuanma/AdvancedProgramming_URL | Project 1 - Spotify Playlists/Project 1 - Spotify Playlists/Project 1 - Spotify Playlists.cpp | #include <iostream>
#include<stdio.h>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
struct Nodo {
string dato;
Nodo* siguiente;
};
//CREAR PILA
void PilaPokemones(Nodo*& pila, string n) {
Nodo* nuevo_nodo = new Nodo();
nuevo_nod... | ALGO | 0.97924 | 3.553025 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-09-24T05:40:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9ec081fdc6... |
3d8d1a86-61e5-4b00-9eb6-8ff699a86a9a | jonasrth/FYS4150 | Project2/include/functions.hpp | //
// Including headers and declaring useful functions
//
// Ensuring header file is only included once for each compilation
#ifndef __functions_hpp__
#define __functions_hpp__
// Headers:
#include <iostream>
#include <cmath>
#include <fstream>
#include <iomanip>
#include <vector>
#include <armadillo>
// Function ... | ALGO | 0.985792 | 5.808768 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2021-08-26T11:48: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": "22ecf3b3bf4... |
53f748d4-b4e6-43af-8007-28bfba6ec86e | tarunsingh7379/Competitive-Programming-Practice | Codeforces/1900/D_Bookshelves.cpp | #include <bits/stdc++.h>
typedef long long int ll;
#define M 1000000007
using namespace std;
ll dp[51][51];
ll func(ll i, ll k, ll n, vector<ll> &a)
{
if (i >= n)
{
if (k == 0)
{
return (1LL << 60) - 1;
}
return 0;
}
if (dp[i][k] != -1)
{
return ... | ALGO | 0.999961 | 4.944809 | {
"github_metadata": {
"branch": "main",
"commit_count": 967,
"repo_created_at": "2022-12-23T12:55: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": "3b7dd13ab4... |
0658dd1e-6b16-47f2-ab38-e4e29a63d807 | cddiggs/BackTrackingClassWithTemplate | sudoku.cc | //============================================================================
// Name : sudoku.cc
// Author : Dr. <NAME> - Auburn University Montgomery
// and <NAME>
// Compile : make all
// Description : Soduku solver one row at a time
//
// Sample Input:
//
// 1 0 0 0 0 0 0 0 0
// 0 0 5 4 0 6 1... | ALGO | 0.976546 | 4.49138 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-12-23T01:54: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": "88cbcf8cc8... |
200d62f2-89b5-4433-a985-931fb6f57fca | pavel-ryzhov/global_vars | runs/004633.cpp | #include <iostream>
#include <vector>
#include <list>
using namespace std;
vector <vector <int> > graph;
vector <int> depth;
int N;
vector <vector <int> > up; // Массив 1го, 2го, 4го,... предков для каждой вершины
int l; // log(N)
vector <bool> used;
vector <int> time_in, time_out; // Время входа и выхода из ... | ALGO | 0.999952 | 3.999226 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-07-04T20:43: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": "762f0e36f3fe... |
3e628117-1203-4a3b-ba2f-0534048aece0 | mn619/cf-practise | 498/D.cpp | #include<bits/stdc++.h>
#define start_routine cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int begtime = clock();
#define end_routine int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0;
#define pb push_back
#define lb lower_bound
#define u... | ALGO | 0.999983 | 3.686627 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-06-05T06:27:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0dc6ff26... |
67612bc0-dc6c-4d82-996b-73b5afe8c995 | Rea1Got/2semCPP | week09/E.cpp | // #include <iostream>
// #include <algorithm>
// #include <cstring>
// int removeCharsFromString (std::string &str, char* charsToRemove) {
// for ( unsigned int i = 0; i < strlen(charsToRemove); ++i ) {
// str.erase(remove(str.begin(), str.end(), charsToRemove[i]), str.end());
// return 1;
// }
// }... | ALGO | 0.999596 | 4.609187 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-02-29T12:44:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0d6427287c... |
8deff6ce-4005-4c8c-b89b-4d5e7fc0c70e | CERN-PH-CMG/cmg-cmssw | DQMServices/Core/src/QStatisticalTests.cc | #include "DQMServices/Core/src/QStatisticalTests.h"
#include <TMath.h>
using namespace TMath;
//---------------------------------------------------------------------------
void BinLogLikelihoodRatio(long Nentries, long Nfailures, double epsilon_max,
double* S_fail_obs, double* S_pass_obs )
{
/*-----------... | ALGO | 0.931469 | 4.794241 | {
"github_metadata": {
"branch": "heppy_94X_dev",
"commit_count": 185721,
"repo_created_at": "2013-09-25T08:23:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 19,
"forks": 242,
"issues": 16,
"pull_requests": 1
},
"file_meta": {
"content_i... |
0168d693-3c13-4554-9c37-feb8f95fb9c6 | qiiingc/datastucture_yinrenkun | ch08_Graph/Graphmtx/Graph.h | #ifndef GRAPH_H
#define GRAPH_H
#include "MinSpanTree.h"
#include "MinHeap.h"
#include "UFSets.h"
#include "SeqQueue.h"
#include "Tree.h"
const int maxWeight = 100000;
// 图的抽象基类定义#有权无向图
// T为顶点的类型;E为边权值的类型,一般应为某一整数类型。
template <typename T, typename E>class Graph{
public:
Graph(int sz){
maxVertices = sz;
numVertic... | ALGO | 0.999204 | 3.424752 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-08-01T09:03:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36be71e3... |
1c9aa870-4398-411f-911a-f1491ffbd7a5 | pzett/green | assignments/harness_test/filter_phase.cpp | #include <iostream>
#include <cmath>
#include <complex>
#include <cstdio>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
extern int filter_phase(complex<double> * data, int data_size, double phi_hat, complex<double> * train, int train_size, double Q0, double sigma_phi_sqr, double sigma_m_sqr, com... | ALGO | 0.995603 | 3.869549 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2014-03-26T11:06:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d0ffe9b... |
4d0b46b8-c8f0-44ef-b17b-0ac6442430be | hoopizs1452/c-plus-plus-game | 數字推盤.cpp | #include<iostream>
#include<string>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<conio.h>
using namespace std;
void print(string array[4][4]) //排列
{
for(int i=0; i<4; i++)
{
for(int j=0; j<4; j++)
{
cout << setw(5) << array[i][j];
}
cout << "\n\n";
}
}
int *change(string array[4][4]) //... | ALGO | 0.994418 | 3.259435 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-12-10T10:17:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f305bf17b... |
8053df6f-8fe0-4d9b-9ed1-fb041e9aad3b | max14e97/psa1 | main2.cpp | #include "KDT.hpp"
#include <iostream>
#include <algorithm>
#include <vector>
#include<fstream>
#include<string>
using namespace std;
/**
* IMPORTANT!! YOU MUST USE THE FOLLOWING LINES OF CODE FOR PROMPTS AND OUTPUTS:
* To output size of tree: cout << "Size of tree: " << size << "\n";
* To output height of tree:... | ALGO | 0.997536 | 4.638693 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-02-19T20:24:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8af11f698... |
eee172be-da1d-41a6-b7b5-88479a3b62f1 | shogun-toolbox/shogun | src/shogun/structure/CCSOSVM.cpp | /*
* This software is distributed under BSD 3-clause license (see LICENSE file).
*
* Authors: <NAME>, <NAME>, <NAME>, <NAME>,
* <NAME>, <NAME>, <NAME>
*/
#include <shogun/structure/CCSOSVM.h>
#include <shogun/mathematics/Mosek.h>
#include <shogun/lib/SGSparseVector.h>
#include <shogun/mathematics/Math.h>... | ALGO | 0.974724 | 5.610872 | {
"github_metadata": {
"branch": "develop",
"commit_count": 17589,
"repo_created_at": "2011-04-01T10:44:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3050,
"forks": 1034,
"issues": 413,
"pull_requests": 10
},
"file_meta": {
"content_id"... |
70c4eb71-6224-495e-94de-243c84006181 | rushi026/DSA-CP | Contests/Codeforces Round/Round-719/p1.cpp | /*
Problem: A. Do Not Be Distracted!
Problem link: https://codeforces.com/contest/1520/problem/A
Contest: Codeforces Round #719 (Div. 3)
Date: 05/05/2021
Last Updated: 05/05/2021
Author: <NAME>
*/
#include <bits/stdc++.h>
using namespa... | ALGO | 0.999965 | 5.154189 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2022-12-15T01:37: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": "8001c0bdf... |
6942c511-dccc-4d26-a1f9-a5854312cf4e | akashshukla7458/LeetCode-Solutions | 1373-maximum-sum-bst-in-binary-tree/1373-maximum-sum-bst-in-binary-tree.cpp | int ans;
class sam
{
public:
bool bst; // to check tree is bst or not
int mx; // max value in a tree
int mn; // min value in a tree
int sum; // current maximum sum
sam()
{
bst = true;
mx = INT_MIN;
mn = INT_MAX;
sum = 0;
}
};
class Solution
{... | ALGO | 0.999978 | 5.816783 | {
"github_metadata": {
"branch": "main",
"commit_count": 631,
"repo_created_at": "2022-08-30T06:17: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": "efe2484156... |
7516a462-81aa-4211-b827-ba32b4a575a8 | Darjeeling47/All-CEDT-code | chula prog/6-vector/06_Vector_22.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> v, w;
int main(){
cin.tie(NULL) -> sync_with_stdio(false);
int x, mx, tmp = -1, ch = 0;
mx = 0;
while(cin >> x){
if(x != tmp){
tmp = x;
ch = 1;
}
else if(x == tmp){
ch++;
}
... | ALGO | 0.999902 | 3.798433 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-11-08T03:33: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": "5ee0f46bc3a... |
0cc4e4cd-5770-4091-8c7a-877326efb44b | gourabsingha1/LeetCode-and-GFG-Problems | 0865-smallest-subtree-with-all-the-deepest-nodes/0865-smallest-subtree-with-all-the-deepest-nodes.cpp | class Solution {
public:
vector<int> levelorderTraversal(TreeNode *root){
vector<int> res;
if(!root){
return res;
}
queue<TreeNode*> q;
q.push(root);
while (q.size()) {
int t = q.size();
vector<int> temp;
while(t--) {
... | ALGO | 0.999873 | 5.973327 | {
"github_metadata": {
"branch": "main",
"commit_count": 4708,
"repo_created_at": "2022-10-15T08:00: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": "9bb05a2a1... |
fbedac5f-e496-4bc8-a654-b34d5a01a07e | kss418/BOJ | 백준/Platinum/2516. 원숭이/원숭이.cc | #include <bits/stdc++.h>
#include <ext/rope>
#define fastio cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);
#define all(x) (x).begin(), (x).end()
#define x first
#define y second
using namespace std; using ll = long long;
using ld = long double; using pld = pair<ld, ld>;
using i128 = __int128_t; using f128 = __float... | ALGO | 0.999949 | 4.399975 | {
"github_metadata": {
"branch": "main",
"commit_count": 1502,
"repo_created_at": "2022-09-09T06:57: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": "4eaf33884... |
58bdc6bb-08f7-41d3-8a37-934702e4c164 | aaryagawade30/Competitive-Programming | Contests/C_1_Skibidus_and_Fanum_Tax_easy_version.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t; cin >> t;
while(t--) {
int n, m; cin >> n >> m;
vector<int> a(n);
for(int i = 0; i < n; i++) cin >> a[i];
int b1; cin >> b1;
bool flag = false;
a[0] = min(a[0], b1 - a[0]);
for(int i = 1;... | ALGO | 0.999913 | 3.821836 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-04-29T17:19: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": "1bf84cde53e... |
cc1ac771-e89d-4642-9d63-b42ab51ea988 | moaiweishui/leetcode | 532. K-diff Pairs in an Array/src.cpp | /*********************** Solution 1 ***************************/
class Solution {
public:
int findPairs(vector<int>& nums, int k) {
if(k < 0)
return 0;
vector<int>::iterator it;
vector<int>::iterator temp_it;
int cnt = 0;
bool flag = false;
... | ALGO | 0.999751 | 5.777299 | {
"github_metadata": {
"branch": "master",
"commit_count": 377,
"repo_created_at": "2017-07-18T03:45:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bd84293... |
7ebba18b-fa15-4f07-98f7-c8ecd7c3ff1e | lsun11/Illinois_GRMHD_radiation | arrangements/THC_neutrino_code/CPPUtils/src/utils_newton.cc | // CPPUtils: C++ utilities for Cactus
// Copyright (C) 2011, <NAME> <<EMAIL>>
//
// 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 3 of the License, or
// (at your option) ... | ALGO | 0.999897 | 5.62761 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-04-20T06:08:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "abc83c09d3bf... |
08b7c628-81b2-41f8-98af-b8c3ec65169f | naonao-cola/MyAlgorithms | 数组/数组/7_数组中的逆序对.cpp |
#include <stddef.h>
#include <vector>
#include <iostream>
#include <exception>
#include <string>
#include <algorithm>
/*
https://cuijiahua.com/blog/2018/01/basis_35.html
在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对。
输入一个数组,求出这个数组中的逆序对的总数P。并将P对1000000007取模的结果输出。 即输出P%1000000007。
*/
class Solution {
public:
int InverseP... | ALGO | 0.999788 | 4.712308 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2020-11-10T07:24:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea548ddb319f... |
c42817d6-7218-4042-bf66-1dea412976b9 | userofmeet/cpp | Function Overloading.cpp | // Create a class Telephone Directory which has following information: Telephone number,
// Name of subscriber and Address. Write a member function to perform the following tasks:
// 1. To input the details of subscriber
// 2. To print the details of subscriber according to inquiry generated from user. Inquiry is
// ei... | TOOL | 0.980663 | 4.431552 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-09-13T12:57: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": "5af70876305... |
d6cef521-fbcb-4342-9725-9cc1246ce55c | imranchowdhuryiut/Data-Structure-Algorithm | Prctice C++/Leetcode - 985/Leetcode - 985/Leetcode - 985.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> sumEvenAfterQueries(vector<int>& nums, vector<vector<int>>& queries) {
int sum = 0;
vector<int> vc;
for (int i = 0; i < nums.size(); i++) {
if (nums[i] % 2 == 0... | ALGO | 0.999904 | 5.426833 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2022-08-01T16:36: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": "626dd9cb974... |
12bde6d9-c006-4555-9b10-e5ed498839de | nikhilhassija/CompetitiveProgramming | CodeForces/812/C.cpp | #include <bits/stdc++.h>
#define lli long long int
#define pb push_back
#define pii pair <int, int>
#define pll pair <lli, lli>
#define _F first
#define _S second
#define mset(x) memset(x, 0, sizeof(x))
#define fastio() ios_base::sync_with_stdio(0)
using namespace std;
vector <lli> A;
vector <lli> C;
lli check(lli ... | ALGO | 0.999982 | 3.482417 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2015-09-19T22:09: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": "57ec05b8... |
2ea5dc9e-2643-4b8d-917d-cd2512eb462f | MOHIT-IITP/cp-codeforces | 1027A-palindromic_twist.cpp | // MOHIT-IITP
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define MOD1 998244353
#define MOD 1000000007
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(... | ALGO | 0.999989 | 5.087631 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2024-08-15T15:42:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b18b2591a... |
df4f4bd7-1edd-4398-ad8e-b480d1470828 | klb3713/aoapc-book | TrainingGuide/bookcodes/ch3/dynamic_rmq.cpp | // Dynamic RMQ
// <NAME>
// 输入格式:
// n m 数组范围是a[1]~a[n],初始化为0。操作有m个
// 1 p v 表示设a[p]=v
// 2 L R 查询a[L]~a[R]的min
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int INF = 1000000000;
const int maxnode = 1<<17;
int op, qL, qR, p, v;
struct IntervalTree {
int minv[maxnode];
... | ALGO | 0.99997 | 4.632367 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2013-09-22T01:26:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 181,
"forks": 56,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "43089... |
00bb987d-b2ef-47a9-ad96-23b8fb1c685b | MathCroc/aoc | 2022/day15/main.cpp | #include <algorithm>
#include <array>
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <numeric>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
namespace {
struct Pos
{
... | ALGO | 0.997993 | 5.558288 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2022-12-15T07:58: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": "01c26f55e... |
eb46964c-2e59-4fd6-ac70-0c4fe7d43383 | tykealy/tk-aoc | 2015/day4/day4.cpp | #include <iostream>
#include <string>
#include <openssl/md5.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
int main()
{
auto start = high_resolution_clock::now();
string input = "ckczppom";
const char *prefix = input.c_str();
size_t prefix_len = input.size();
for (int i =... | ALGO | 0.99933 | 5.865823 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-01-23T14:17: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": "d4dd7af8b01... |
93c7d226-cc0b-4123-94ac-536b33e8438d | rijonshahariar/CF_Problems | D_Double_Strings.cpp | /**
Author: <NAME>
Date: 26/01/2024
**/
#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 main()
{
fastio;
ll t;
cin >> t;
while (t--)
{
ma... | ALGO | 0.999866 | 4.575234 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-05T07:05: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": "d1940373a833... |
dc83bf42-f0d2-41dc-b3a5-8ba38fd7e402 | addiegupta/InterviewBitProblems | Heaps and Maps/Ways to form Max Heap.cpp | /*
InterviewBit : Ways to form Max Heap
Link : https://www.interviewbit.com/problems/ways-to-form-max-heap/
Max Heap is a special kind of complete binary tree in which for every node the value present in that node is greater than the value present in it’s children nodes. If you want to know more about Heaps, please ... | ALGO | 0.999808 | 4.465466 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2019-02-03T10:35:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b98421ec... |
05f658df-fb45-4f8a-b6a8-30a7e4495dc7 | nakatamaho/mplapack | mplapack/test/lin/common/Ctbt06.cpp | /*
* Copyright (c) 2021
* <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of ... | ALGO | 0.950623 | 5.637626 | {
"github_metadata": {
"branch": "master",
"commit_count": 2597,
"repo_created_at": "2017-03-29T02:30:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 95,
"forks": 13,
"issues": 22,
"pull_requests": 0
},
"file_meta": {
"content_id": "0914... |
cba304ea-9749-4962-bdbc-cf73085ed7aa | BornToDeath/cpp | algorithms/jzoffer(第2版)/JZ22_链表中倒数第k个节点.cpp | //
// Created by lixiaoqing on 2023/3/13.
//
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
#include "ListNode.h"
class Solution {
public:
ListNode *getKthFromEnd(ListNode *head, int k) {
/**
... | ALGO | 0.99983 | 5.515492 | {
"github_metadata": {
"branch": "main",
"commit_count": 800,
"repo_created_at": "2021-10-28T03:47: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": "a962e0fe19... |
588edd44-d80d-4114-89e3-f081dd361760 | AllanVasc/Competitive-Programming | Contests/Educational Codeforces Round 152 (Rated for Div. 2)/B - Monsters.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define optimize ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ALL(x) x.begin(), x.end()
#define pb push_back
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define iii tuple<int,int,int>
mt19937 rng(chrono::steady_c... | ALGO | 0.999852 | 3.710017 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2021-05-12T20:29: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": "8a55e370e0... |
cb655c4e-b7d5-4bf8-979c-08cc9b62d3bb | zyzkevin/Introduction-to-Computing | Homework/groupHwB/rmbpay.cpp | /*
* RMB Pay
* 张雨泽 1900094801
* 2019/10/31
*/
#include <iostream>
#include <cstring>
#include <iomanip>
#include <cmath>
using namespace std;
void isFactor(int, int), output(int);
int factorSum();
int cnt = 0, factor[1000] = {0};
int main()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
{
f... | ALGO | 0.999775 | 3.872063 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-05-16T03:58: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": "dfc0ad7b59... |
79af9bfc-d006-42b0-8e63-37294550e3c8 | mylvoh0714/BOJ | 1021.cpp | // BOJ 1021 회전하는 큐
#include <iostream>
#include <deque>
using namespace std;
int N, M;
int input;
int main()
{
int result = 0;
scanf("%d %d", &N, &M); // N은 총 개수, M은 뽑을 개수
deque<int> dq;
for ( int i = 1; i <= N; i++ )
{
dq.push_back(i);
}
for ( int i = 1; i <= M; i++ )
{
scanf("%d", &input);
int index = ... | ALGO | 0.999939 | 3.674096 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2018-02-11T15:05: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": "c74e28d51... |
a2d01973-cf46-4603-8f4f-e29c0481b737 | AdityaKharmaleGoat7/Dynamic-Programming_Codes | CountOfSubsetSum.cpp | #include <bits/stdc++.h>
using namespace std;
int solve(int arr[], int k, int idx)
{
if(idx < 0 && k > 0){
return 0;
}
if(k == 0){
return 1;
}
if(k - arr[idx] >= 0){
int include = solve(arr, k-arr[idx], idx-1);
int exclude = solve(arr, k, idx-1);
return include + exclud... | ALGO | 0.999687 | 4.365563 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-23T07:23: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": "4a061e10157b... |
e89f7c62-87ad-461c-8258-b1159fd3ab6d | ishandutta2007/codeforces-f | fdg/normal/653/G.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <memory.h>
using namespace std;
int mod = 1000000007;
int mPow(int a, int x) {
int ret = 1;
while (x > 0) {
if (x & 1) ret = 1LL * ret * a % mod;
x >>= 1;
a = 1LL * a *... | ALGO | 0.999958 | 4.249057 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "b4ff6322860e... |
fd1a7b08-0e21-4223-80ca-a4ffb4cd1662 | Garyxud/melodic-all | src/visp/tutorial/tracking/model-based/generic-apriltag/tutorial-mb-generic-tracker-apriltag-rs2.cpp | //! \example tutorial-mb-generic-tracker-apriltag-rs2.cpp
#include <fstream>
#include <ios>
#include <iostream>
#include <visp3/gui/vpDisplayGDI.h>
#include <visp3/gui/vpDisplayOpenCV.h>
#include <visp3/gui/vpDisplayX.h>
#include <visp3/core/vpXmlParserCamera.h>
#include <visp3/sensor/vpRealSense2.h>
#include <visp3/d... | TOOL | 0.930143 | 6.028938 | {
"github_metadata": {
"branch": "melodic-all",
"commit_count": 1,
"repo_created_at": "2020-09-14T02:37:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "239f6... |
575618a1-3ca2-4b4f-bcdf-d5fefe34ec2f | wangzhe330/leetcode | Wildcard Matching__dp__没搞定.cpp | /*
Wildcard Matching
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover the entire input string (not partial).
The function prototype should be:
bool isMatch(const char ... | ALGO | 0.999845 | 4.814334 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2015-05-03T15:52:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b5309d7f... |
ef153056-fa97-4fc9-89bf-065dcb217ba5 | ShinoharaYuuyoru/ShYy_Jianzhi | JZ24/JZ24.cpp | /*
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(int x) :
val(x), left(NULL), right(NULL) {
}
};*/
// S1: Recursion
class Solution {
public:
vector<vector<int> > FindPath(TreeNode* root, int expectNumber) {
vector<vector<int> > paths;
... | ALGO | 0.999926 | 5.628587 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2020-07-02T19:35:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cfbedf128... |
2c7c3965-04a0-4208-a0ea-758872ca8d44 | jatin-shrm/CrackYourPlacement | DAY-21/Add number II.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution
{
public:
ListNode *reverseList(ListNode *head)
... | ALGO | 0.999981 | 5.99145 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2024-08-14T10:04: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": "636a371b3c... |
ee806cb0-b17c-40cc-b0a1-990dea96479e | Vikvillka/OAIP_1_SEM | laba10oaip/lab1.2/lab1.2.cpp | //#include<locale.h>
//#include<stdlib.h>
//#include<stdio.h>
//#include <iostream>
//
//using namespace std;
//int input(const char* text) {
// int num = 0;
// printf(text);
// scanf_s("%d", &num);
// return num;
//}
//void printBinary(int value, const char* description) {
// char buffer[33]{};
// _itoa_s(value, buffe... | ALGO | 0.99722 | 3.545971 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-12-03T18:30: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": "e2b6a4125828... |
98dca928-0eb9-4e40-b561-42e2b0cee930 | silviagdiez/thesis | Sum over Paths distances/Data sets/proteins/computeKernels/AllSubsequence04.h | #include <octave/oct.h>
#include <octave/parse.h>
#include <octave/oct-alloc.h>
#include <cmath>
#include <string>
#include <vector>
#include <iostream>
using std::string;
/* This function is not valid except for the DIGITS dataset. BEWARE for other datasets!!! */
DEFUN_DLD (AllSubsequence04, args, nargout,"")
{
st... | ALGO | 0.998962 | 4.276114 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2014-09-27T19:15:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28cc82404a... |
099f0159-6a63-4414-8879-5f2f3927feb1 | mzry1992/workspace | OJ/zoj/Lott's Seal.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
const double eps = 1e-10;
int cmp(double a,double b)
{
if (fabs(a-b) < eps) return 0;
if (a < b) return -1;
return 1;
}
struct point
{
double x,y;
point(){}
point(double _x,... | ALGO | 0.999708 | 3.715657 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2012-11-03T05:40: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": "cc023c7ac... |
acca364e-cb96-4023-82b2-ce9f1d427b8c | jalaj711/leetcode-cpp | 0141-linked-list-cycle.cpp | /**
* Definition for singly-linked list.*/
#include <iostream>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
bool hasCycle(ListNode *head) {
ListNode *slow = head;
ListNode *fast = head;
whil... | ALGO | 0.999884 | 5.180387 | {
"github_metadata": {
"branch": "main",
"commit_count": 483,
"repo_created_at": "2022-10-14T17:28:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e8a36654d... |
9ad01d32-4c91-4141-98e4-32e553dece3c | RAJ8664/CS212_OOPS-cpp | Lab1/Lab_1_assignment_4.cpp | /*Author : <NAME>*/
/*Scholar id : 2212002*/
#include <iostream>
using namespace std;
class ticTacToe {
private:
char board[3][3];
char currentPlayer; // 'X' or 'O' for the current player
public:
// Default Constructor
ticTacToe() {
for (int i = 0; i < 3; ++i) {
for (int j = 0; j ... | ALGO | 0.966134 | 7.125704 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2024-02-05T17:52:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6419a00e6... |
314361e4-3a02-4480-9edf-aadac751cc9f | MAZHARMIK/Interview_DS_Algo | DP/LIS & Variants/Build Array Where You Can Find The Maximum Exactly K Comparisons.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : Recur + Memo - https://www.youtube.com/watch?v=YU9IGG5PB2Y
Bottom Up - Soon coming
Company Tags : Will Update soon
Leetcode Link : https://leetcode.com/problems/build-array-where-you-can-find-the-maximum-exactly-... | ALGO | 0.999833 | 4.569832 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
8593f13f-1705-4cbb-8ae6-53b23addf3ca | Orb-H/nojam | source/nojam/1927.cpp | #include <stdio.h>
int heap[100001] = {0,};
void add_num(int num) {
int loc = ++heap[0], t;
heap[heap[0]] = num;
while (loc > 1) {
if (heap[loc] < heap[loc / 2]) {
t = heap[loc];
heap[loc] = heap[loc / 2];
heap[loc / 2] = t;
} else {
break;
... | ALGO | 0.999936 | 3.76841 | {
"github_metadata": {
"branch": "master",
"commit_count": 737,
"repo_created_at": "2020-03-18T14:43:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "28b49b31... |
5cc8d22a-91d6-4d95-8caa-cfc0f5e4b7c3 | Viswanath1680/LeetCode-problems | 0801-is-graph-bipartite/0801-is-graph-bipartite.cpp | // My Initial thought was to detect any odd cycle in the graph and return
// is biparted accordingly. But apparently, obtaining cycle length in a graph
// is NP-complete. So my thought was the converse.
// We can tell if a graph has an odd cycle by using isBipartite() function, and
// not the reverse
// https://www.... | ALGO | 0.999851 | 5.915191 | {
"github_metadata": {
"branch": "phase2",
"commit_count": 1773,
"repo_created_at": "2024-12-11T12:00:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dcbb20e... |
d060431a-55a6-4228-a373-d2aba7722e01 | raincross7/code-similarity | codes/train_code/problem300/problem300_478.cpp | #include <iostream>
#include <vector>
int main(void){
int n, m;
std::cin >> n >> m;
std::vector<std::vector<int>> check(m);
std::vector<int> p(m);
for (int i = 0; i < m; i++) {
int k;
std::cin >> k;
for (int j = 0; j < k; j++) {
int num;
std:... | ALGO | 0.999915 | 4.031636 | {
"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": "794324e5ff23... |
78af75ae-c701-48e9-b81e-4bb56198c164 | rishisankar/icpc | cses/additional/tree_isomorphism2.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define INP(v, n) for (int i=0; i<n; ++i) { cin >> v[i]; }
#define ceil(x) (ll)ceil(x... | ALGO | 0.999779 | 5.30916 | {
"github_metadata": {
"branch": "main",
"commit_count": 324,
"repo_created_at": "2021-01-08T15:36: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": "119671d0b4... |
93553952-b0cb-48c8-bcf5-788cdbf9cbb7 | Bgdn16/Labu | Lab_2.3.cpp | #include <iostream>
using namespace std;
int main()
{ setlocale(LC_ALL, "ru")
int a, b, c, d, e, f;
cout << "Введіть 5 оцінок від 0 до 100: ";
cin >> a;
cin >> b;
cin >> c;
cin >> d;
cin >> e;
f = (a + b + c + d + e) / (float)5;
cout << "Середній бал: " << f << endl;
switch (f / 10)
{
case 10:
case 9:
... | ALGO | 0.974008 | 3.411953 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-06-23T12:36: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": "f013640cf2... |
b078e1b6-331b-4551-91c9-310ad56ea88c | Seungchan0325/baekjoon | solutions/12939_0.cpp | #include <bits/stdc++.h>
using namespace std;
const int ALPHABET = 26;
const int mod = 1e9 + 9;
const int MAX = 400;
int p;
int terminal[MAX], output[MAX], fail[MAX];
int dp[55][400][1<<7];
int ch[MAX][ALPHABET];
int get_idx(char c)
{
return c - 'a';
}
int create()
{
return p++;
}
void insert(int u, int ... | ALGO | 0.999992 | 4.39283 | {
"github_metadata": {
"branch": "main",
"commit_count": 795,
"repo_created_at": "2023-12-31T15:30: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": "fe1518db04... |
80e67c30-69ff-41d0-8eee-92c473f9ab55 | guilhermeleobas/maratona | SPOJ/orkut.cpp | /*
Problema - Orkut
http://br.spoj.com/problems/ORKUT/
<NAME>
*/
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;
typedef vector<string> connection;
... | ALGO | 0.999838 | 4.30353 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2014-07-01T17:46:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a4b5568... |
98600a04-9777-45e6-aa5d-89e98a780672 | kamyu104/LeetCode-Solutions | C++/binary-tree-vertical-order-traversal.cpp | // Time: O(n)
// Space: O(n)
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<vector<int>> verticalOrder(TreeNode* root) {
unor... | ALGO | 0.999993 | 6.532693 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
972ad607-a81c-4359-b655-6d15027afb01 | MohmedAbdAllah/Embedded-Cpp | G4/C++ Practices/Week1 _Prac/Lab/Calculator.cpp | /****************************************************************************
* Purpose: calculate sum , substraction, divion, multiplation, and reminder.
* Input: two digits from the user and the operation
* Output: the result of the operation
************************************************************************... | ALGO | 0.957427 | 3.574922 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2023-01-02T18:14:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75e7cd0f1... |
42226d25-f87e-4dfe-98f8-7908721c6a9d | CcChangJF/AlgoCodes | Templates/Bellman_ford.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int maxV = 100003;
const int maxE = 100003;
const int INF = 0x3f3f3f3f;
struct Edge{
int from;
int to;
int cost;
};
int E,V;
Edge edges[maxE];
int dis[maxV];
bool shortestPath(int s) {
for (int i = 0; i < V; ++i) {... | ALGO | 0.999963 | 4.297895 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-03-03T00:36: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": "4e0d6c5b87... |
343acc70-c696-4cb5-b065-85e510b423f8 | Luke-Tseng/DigiPen | CS280/Tree_search/tree_search_1.h | #ifndef TREE_SEARCH_1_H
#define TREE_SEARCH_1_H
#include <iostream>
#include <vector>
#include <deque>
template <typename T>
struct TNode
{
T data = T();
std::vector<TNode<T> *> children = {};
};
// recursive implementation of DFS
template <typename T>
TNode<T> const * // returns first found node that is equa... | ALGO | 0.999943 | 5.244892 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2024-01-23T05:26:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d06a1ab482... |
3fea0db5-adda-4732-abcf-59b9c4a73387 | CianGrimnir/CodeWars | cpp/7kyu-Rotate-for-max-2.cpp | /*
* Take a number: 56789. Rotate left, you get 67895.
*
* Keep the first digit in place and rotate left the other digits: 68957.
*
* Keep the first two digits in place and rotate the other ones: 68579.
*
* Keep the first three digits and rotate left the rest: 68597.
*
* Now it is over since keeping the first... | ALGO | 0.999892 | 5.61039 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-06-23T13:46:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63fbd0476... |
27cd1718-a2e8-42fb-84d4-34470fa3d23d | tudors2004/DSA_LAB2 | Matrix.h | #pragma once
//DO NOT CHANGE THIS PART
typedef int TElem;
#define NULL_TELEM 0
class Matrix {
private:
struct Tuple {
int line;
int col;
TElem value;
Tuple* next; //pointer la urmatorul element in ordine lexicografica
Tuple* prev; //pointer la elementul anterior in ordine lexicografica
};
int nrLin; //... | ALGO | 0.911242 | 4.411522 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-04-20T16:20: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": "97b7687ceb... |
4eaeb546-5121-41e5-b1df-ea771ad3e355 | j1ai/Computer-graphics-projects | raster-images/src/rgb_to_hsv.cpp | #include <algorithm>
#include "rgb_to_hsv.h"
void rgb_to_hsv(
const double r,
const double g,
const double b,
double & h,
double & s,
double & v)
{
////////////////////////////////////////////////////////////////////////////
// Replace with your code here:
double max = std::max(std::max(r,g),b);
d... | ALGO | 0.954304 | 5.567547 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-12-05T21:06:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08285cf033... |
fbce6667-1ebc-49a4-a8a5-796bee5f56e2 | kamrul17/Dsa_LoveBabbar_solution | l-22 string/maxOccuringCharacter.cpp | #include <iostream>
#include <string>
using namespace std;
char getMaxOccuringChar(string s)
{
int arr[26] = {0};
// create an array for count of character
for (int i = 0; i < s.length(); i++)
{
char ch = s[i];
int number = 0;
if (ch >= 'a' && ch <= 'z')
{
... | ALGO | 0.999681 | 4.403539 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-26T14:46: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": "01122e3f8aa5... |
574d9561-1586-47f0-9f8c-502af25a50d3 | fassetar/bender-emulator | src/6502/opcodes/STA.cc | #include"r6502.h"
#include"memory.h"
#include"globalreg6502.h"
#include"fadder.h"
void ins0x85(int address) //Zero Page
{
//pulls each bit from the accumulator
//and stores that into memory
mem.write(address, accum);
}
void ins0x8D(int address) //Absolute
{
//Pulls each bit from the accumulator
//and stores that... | TOOL | 0.953092 | 5.372941 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2013-12-20T00:46: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": "7441d2238... |
3702c9c5-e4c2-4202-aa4d-777a5b696681 | ThomasMElliott/Physics | aieBootstrap-2024/Physics/Box.cpp | #include "Box.h"
#include "Gizmos.h"
Box::Box(glm::vec2 position, glm::vec2 velocity, float mass, glm::vec2 extents,
float orientation, glm::vec4 colour)
: Rigidbody(ShapeType::BOX, position, velocity, orientation, mass)
{
m_extents = extents;
m_color = colour;
m_moment = 1.0f / 12.0f * mass * (GetWidth() * Get... | TOOL | 0.900092 | 5.44023 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2024-01-28T23:58: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": "99148a77bc4... |
9898da57-8b74-4b5e-abf0-fa09ce42799b | daburch/212RayTracer | main.cpp | #include <omp.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <cassert>
#include <cstring>
#include <cmath>
#include "vector.h"
#include "pixel.h"
#include "camera.h"
#include "light.h"
#include "material.h"
#include "object.h"
#include "list.h"
#include "plane.h"
#include "mode... | ALGO | 0.983441 | 4.806613 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2012-11-25T23:53: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": "fc9a846de5... |
54e27026-af54-4874-9dbf-04f5f29a02f3 | Garyxud/melodic-all | src/visp/modules/tracker/me/src/moving-edges/vpMeNurbs.cpp | /****************************************************************************
*
* ViSP, open source Visual Servoing Platform software.
* Copyright (C) 2005 - 2019 by Inria. All rights reserved.
*
* This software is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public... | ALGO | 0.999867 | 6.382209 | {
"github_metadata": {
"branch": "melodic-all",
"commit_count": 1,
"repo_created_at": "2020-09-14T02:37:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "07008... |
8a6a943c-ee31-4e13-8b2e-9cd39a4d1ae9 | kkygood3/BaekJoon...etc | 1004/solution.cpp | #include <iostream>
#include <cmath>
#include <vector>
using namespace std;
vector<int> v;
int main() {
int t;
cin >> t;
for (int tc = 0; tc < t; ++tc) {
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
int n;
cin >> n;
int cnt = 0;
for (int i = 1; i <= n; ++i) { //행성계의 수
int cx, cy, r;
cin ... | ALGO | 0.999943 | 3.891406 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-11-28T07:08: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": "65e60fa65... |
96ba860d-6f24-433c-91b4-afefd2f8251e | RuslanG4/PiratesGambitTrials | PiratesGambit/PiratesGambit/EnemyLandWander.cpp | #include "EnemyLandWander.h"
#include "ChaseState.h"
#include "Enemy.h"
#include "PathFindingFunctions.h"
void EnemyLandWander::Enter(Enemy& enemy)
{
std::cout << "Enemy is entering land wander state." << "\n";
enemy.SetAnimationState(UnitState::WALK);
}
void EnemyLandWander::Update(Enemy& enemy, float delta... | ALGO | 0.910438 | 5.8202 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2024-10-20T16:19: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": "24595114f3... |
51b6ab6f-eb75-4e05-acee-8fe2c51cc150 | lyoz/contest | codejam/2017/round1c/C.cpp | #include <bits/stdc++.h>
#include <omp.h>
using namespace std;
#define dump(...) cout<<"# "<<#__VA_ARGS__<<'='<<(__VA_ARGS__)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(... | ALGO | 0.999696 | 4.63885 | {
"github_metadata": {
"branch": "main",
"commit_count": 358,
"repo_created_at": "2016-04-24T12:04: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": "4e691be9f2... |
058b8334-dee0-4b3e-98e6-33d231a0475f | Marsunpaisti/RoboProject | voronoi_alg/src/caller.cpp | /* FortuneAlgorithm
* Copyright (C) 2018 <NAME>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Thi... | ALGO | 0.999699 | 5.217547 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2020-09-16T14:18:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "22e3e7c7e... |
2b506e50-fbd0-4e73-a1d9-775aac87a21e | sreerajpr06/CodechefCodes | ChefAndNotebooks.cpp | /*
Chef likes to write poetry. Today, he has decided to write a X pages long poetry, but unfortunately his notebook has only Y pages left in it. Thus he decided to buy a new CHEFMATE notebook and went to the stationary shop. Shopkeeper showed him some N notebooks, where the number of pages and price of the ith one are ... | ALGO | 0.989108 | 4.039158 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-04-12T08:44:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "955a06b4d... |
8f0af187-3abb-4dd2-a84a-2d57113f6b75 | gauravjha0711/DSA | graph/topSortBFS.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename T>
class Graph {
public:
unordered_map<T, list<T>> adjList;
void addEdge(T u, T v, bool direction = false) {
// direction false - undirected graph
// direction true - directed graph
adjList[u].push_back(v);
if (!di... | ALGO | 0.999993 | 5.505651 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2025-02-10T04:51: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": "1b82efb7720... |
8709c846-5705-4b67-b3e1-f8f08491206a | hardik302001/leetcode | problems/jump_game_iv/solution.cpp | // we need to do pruning, else we will get tle
// see below code
// also see JUMP GAME 7
// we are also getting same problem there
// tc , sc = O(n)
class Solution {
public:
int minJumps(vector<int>& arr) {
int n = arr.size();
if(n<=1)
return 0;
unordered_map<int, vector<i... | ALGO | 0.999993 | 4.817719 | {
"github_metadata": {
"branch": "main",
"commit_count": 3708,
"repo_created_at": "2022-03-01T17:28:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a78918112... |
4844df5a-3a34-4677-926f-be341299515a | zaurus-yusya/Competitive-Programming | atcoder/abc/abc157/d_uf.cpp | #include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define br cout << endl;
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vecto... | ALGO | 0.999976 | 4.07035 | {
"github_metadata": {
"branch": "master",
"commit_count": 418,
"repo_created_at": "2019-08-14T07:36: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": "79dc86b8... |
cbe687b7-aa38-49db-9699-d1beaca0c15e | fznsakib/arduino | 6_motion_control_PID/speed_controller/speed_controller.ino | #include "encoders.h"
#include "pid.h"
#define L_PWM_PIN 10
#define L_DIR_PIN 16
#define R_PWM_PIN 9
#define R_DIR_PIN 15
#define DIR_FWD LOW
#define DIR_BKD HIGH
#define kp_left 0.12
#define ki_left 0.01
#define kd_left 4.0
#define kp_right 0.12
#define ki_right 0.01
#define kd_right 4.0
PID left_pid( kp_left, k... | ALGO | 0.994693 | 5.179449 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2019-11-08T14:43: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": "19f8883d3... |
51370bd0-ed43-4498-b2d2-3b6790e35c88 | ishandutta2007/codeforces-j | jerry/normal/949/D.cpp | #include <bits/stdc++.h>
using namespace std;
int s1[100005], s2[100005];
int a[100005];
int n, d, b;
bool chk(int va)
{
int rem = 0;
long long j = 0;
for (int i = 0;i < (n+1)/2;i++)
{
for (;j <= i+1ll*(i+1)*d && j < n;j++) rem += s1[j];
if (i >= va) rem -= b;
if (rem < 0) return false;
}
rem = 0;
j = n-... | ALGO | 0.999824 | 3.441389 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42: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": "3dce7ad4cf57... |
ab0018cc-314d-4aa2-9f04-1b86c3b7905f | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/10_14834_38.cpp | #include <iostream>
using namespace std;
int M[1024], dyn[1024][10], price[1024];
int calc (int m, int t, int s) {
if (dyn[m][s] != -1)
return dyn[m][s];
int & ans = dyn[m][s];
if (m >= t/2) {
int mm = m-t/2;
if (M[mm*2] < s || M[mm*2+1] < s)
ans = -2;
else if (M[mm*2] == s || M[mm*2+1] =... | ALGO | 0.998541 | 3.291767 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00: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": "b2168ad89... |
5038156b-9956-4fd5-a8fa-d9bc1dbcb637 | dillongoostudios/goo-engine | intern/cycles/scene/curves.cpp | /* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
*
* SPDX-License-Identifier: Apache-2.0 */
#include "scene/curves.h"
#include "device/device.h"
#include "scene/mesh.h"
#include "scene/object.h"
#include "scene/scene.h"
#include "util/foreach.h"
#include "util/map.h"
#include "util/progress.h"
#include "util... | ALGO | 0.986268 | 7.113508 | {
"github_metadata": {
"branch": "goo-engine-main",
"commit_count": 132039,
"repo_created_at": "2021-05-08T09:53:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1109,
"forks": 148,
"issues": 44,
"pull_requests": 6
},
"file_meta": {
"conte... |
dfea03b5-4f09-42cb-8cbe-c90eb0944dab | yindaheng98/LittleProgramSet | 算法笔记练习工程/算法代码备份/Codeup/100000578A.cpp | #include "stdafx.h"
#include<iostream>
using std::cin;
using std::cout;
using std::endl;
char sdate[2][8];
unsigned date[2][3];
long diff = 0;
unsigned mdays[2][13] = { {0,31,28,31,30,31,30,31,31,30,31,30,31},{ 0,31,29,31,30,31,30,31,31,30,31,30,31 } };
unsigned atoi(char *a,short n)
{
unsigned i = 0;
for (short k... | ALGO | 0.99987 | 3.704617 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2019-04-23T11:47: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": "b185d48e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.