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 |
|---|---|---|---|---|---|---|---|
9c0d93f5-1bae-44c2-9dba-b57e6408ba62 | andreidecuseara19/Decryptor | codingdecoding1/codingdecoding1.cpp | #include <iostream>
#include <fstream>
using namespace std;
// codifica textul dupa cheia data
char codificare(char c)
{
if (isalpha(c))
{
c = toupper(c);
if ((int)c <= (int)'L')
c = (char)((int)c + (int)'O' - (int)'A');
else
c = (char)((int)c - ((int)'M' - (int)... | ALGO | 0.999324 | 3.278916 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-03-03T09:57:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec1fa3b792e8... |
f634864e-9990-49e5-bf67-ab3ffd536f97 | timothyliu0912/itsa | Deadline-deadline-and-deadline.cpp | #include <bits/stdc++.h>
#define pb push_back
using namespace std;
bool cmp(pair <int,int > a, pair <int,int > b)
{
if(a.second != b.second) return a.second < b.second;
else return a.first < b.first;
}
int main()
{
int T;
// scanf("%d",&T);
cin>>T;
while(T--)
{
... | ALGO | 0.999993 | 3.258722 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-12-31T03:51: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": "79835f18d0... |
ad5bcb99-e999-4d8a-bcfb-1f5f4c880c16 | progheal/adventofcode | 2022/10.cpp | #include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include "aoc/aoc.h"
#include "aoc/aocmachine.h"
#include "aoc/ocr.h"
using namespace std;
int main(int argc, char* argv[])
{
bool partb = AOC::PartB(argv[0]);
char crt[6][41] = {};
vector<int64_t> intercept;
int cycleCount = 0;
auto cyc... | ALGO | 0.998377 | 5.072094 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2022-12-01T03:43: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": "6f9d24e8... |
e3743151-3a30-4a7d-b9aa-b458b734d29f | subratamondalnsec/Pw-cpp-code | 10searching/class/13finding_theminimum_capacity_shipneeded_to_ship_all_packages_l-1011.cpp | #include <bits/stdc++.h>
using namespace std;
// Helper function to check if a given capacity can ship all weights within the given number of days
bool check(int mid,vector<int>& a, int days){
int count =1;
int m=mid;
int n=a.size();
for(int i=0;i<n;i++){
if(m>=a[i]){
... | ALGO | 0.999987 | 5.335481 | {
"github_metadata": {
"branch": "main",
"commit_count": 272,
"repo_created_at": "2024-09-22T18:08: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": "bc882cee18... |
70f96c32-4301-42d3-b2c1-d45206faad5a | weak-kid/code_examples | cpp-solutions/orderbook/orderbook_circ_buff.hpp | #pragma once
#include "types.hpp"
#include <vector>
#include <cstdint>
#include <cassert>
#include <cmath>
#include <algorithm>
#include <limits>
class CircularSide {
public:
CircularSide()
: base_price_(0),
capacity_(0),
size_(0)
{}
void snapshot(const std::vector<std::pair<u... | ALGO | 0.966384 | 6.518218 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-02-18T19:31: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": "d4b8e4503002... |
b5fe3df5-504b-4fa5-a4db-7d07396ea09b | Xyronix99/Deep3DMark | model/backend/_ext/src/sampling.cpp | // Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
#include "sampling.h"
#include "utils.h"
#include "cuda_utils.h"
void gather_points_kernel_wrapper(int b, int c, int n, int npoints,
... | ALGO | 0.933783 | 6.456504 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-22T07:00:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1c7c86c322... |
1858cd41-471c-4da3-9e05-c3beb46b8012 | yuchaozh/LeetCode | Remove duplicatees from sorted array/duplicates.cpp | /**
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place with constant memory.
For example,
Given input array A = [1,1,2],
Your function should return length = 2, and A is now ... | ALGO | 0.999983 | 5.754247 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2014-02-13T07: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": "d0985926c... |
fe9d4b50-b71f-4695-b714-42cdccd5146d | pledge24/Problem-Solving | 백준_수동/에센셜문제/에센셜_2/1676.cpp | #include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
int main(void){
fastio;
int N; cin >> N;
// 왼쪽 -> 오른쪽 순으로 자리수가 커짐
vector<int> digits(2000);
vector<int> calcRes(2000);
digits[0] = 1;
for(int n = 2; n <= N; n++){
fill(calcRes.... | ALGO | 0.999943 | 3.983673 | {
"github_metadata": {
"branch": "main",
"commit_count": 506,
"repo_created_at": "2023-12-28T06:09:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75a5063c71... |
58c8e9de-5691-4225-abb1-d3b9b92f7475 | HassanGhauri/Data-Structure-codes | Files1/Project5.cpp | #include<bits/stdc++.h>
using namespace std;
int IsOperator(char c)
{if(c=='^') return 3;
if(c=='*') return 2;
if(c=='/') return 2;
if(c=='%') return 2;
if(c=='+') return 1;
if(c=='-') return 1;
if(c=='(') return 4;
if(c==')') return 4;
return 0;
}
int... | ALGO | 0.999891 | 4.032606 | {
"github_metadata": {
"branch": "development",
"commit_count": 2,
"repo_created_at": "2025-04-15T14:44: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": "ed116... |
941fc225-e849-42b8-8bc4-07cce1fd8580 | tuanacetinkaya/Daily-Leetcode-Challenge | February 2021/10.02.2021/Kaan.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 6.428724 | {
"github_metadata": {
"branch": "main",
"commit_count": 280,
"repo_created_at": "2021-01-23T22:11:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc29449161... |
0e9ffed0-0e20-4752-81d8-1826ee85e7fb | Rahul1827/Cdac | CDAC/Cpp/14september/14sepProblem question.cpp | //Problem Definition:
//
//Given an unsorted array of integers, find the leader element in the array. A leader element is an element that appears more than half the size of the array.
//
//Example:
//
//Consider the array [2, 1, 3, 2, 2]. The leader element is 2 because it appears 3 times, which is more than half the s... | ALGO | 0.999954 | 4.416343 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-11-09T13:41:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e866126894ba... |
3ecc0949-b326-4de4-b6f1-021a207d5603 | Scrubpai/Competitive-Programming | DMOJ/CCO/CCO '18 P4 - Gradient Descent.cpp | #include <bits/stdc++.h>
using namespace std;
int R, C, K, cnt; map<pair<int, int>, int> mp;
int query(int r, int c){
if(mp.count({r, c})) return mp[{r, c}];
cout << "? " << r << " " << c << endl;
int val; cin >> val;
cnt++; assert(cnt <= K);
return mp[{r, c}] = val;
}
int main(){
cin >> R >> ... | ALGO | 0.999844 | 3.103402 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-12-29T02:05:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17f48f54267... |
19220be7-9de8-4b84-af1d-083c55c1f48d | ishandutta2007/codeforces-i | i_love_tanya_romanova/normal/1220/C.cpp | /*
5th of May, V-Day is just around the corner
1945 the fuhrer reign is at its end
Jenny at the gates, as the SS open fire
There's no time to waste, the final battle has begun
After the downfall, a castle besieged
Facing the Nazis awaiting relief
Gangl and Lee and their men set the prisoners free
An it's the end of ... | ALGO | 0.999947 | 3.217466 | {
"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": "700181b6ffbb... |
dca00e3e-4977-45a2-9710-c0f588fcec41 | bda-uni-lu/AIR | src/relational/SortAggregation.hpp | /**
* Copyright (c) 2020 University of Luxembourg. 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.995096 | 5.519931 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-08-28T15:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c671cab371... |
ce3b1ef5-8690-45c1-84fc-b68886598bd8 | khanhnamle1994/technical-interview-prep | LeetCode/Evaluate-Division.cpp | // Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point
// number). Given some queries, return the answers. If the answer does not exist, return -1.0.
/* Example:
Given a / b = 2.0, b / c = 3.0.
queries are: a / c = ?, b / a = ?, a / e ... | ALGO | 0.999731 | 5.71745 | {
"github_metadata": {
"branch": "master",
"commit_count": 1000,
"repo_created_at": "2017-05-22T05:00:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 668,
"forks": 203,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3c... |
3085968b-9cc3-4360-856b-33ccf52e20b4 | expeditow/Maratona | contest/maratona2024/H/H.cpp | #include "bits/stdc++.h"
using namespace std;
#define forn(i, n) for (int i = 0; i < n; i++)
using ll = long long;
using f64 = double;
using ii = pair<int, int>;
using ull = unsigned long long;
using vi = vector<int>;
using vii = vector<ii>;
using vll = vector<ll>;
using lolo = pair<ll, ll>;
const string ENDL = "\... | ALGO | 0.999751 | 3.998524 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-10-08T01:31:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "803dfcdc81dd... |
b5d9d3a3-08bb-4d1a-97e4-e8d155b192c6 | FABhishek/CodeforcesContests | Sublime/CSES ProblemSet/AtcoderPracticeB&C/b-intersection.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
// Policy based data structure
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long int
#define pii pair<ll,ll>
#define rep(i,s... | ALGO | 0.999859 | 3.606086 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-06-15T16:58: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": "392b63674d... |
2144b5a9-cd45-4a8e-9bc9-d2c13ee44780 | hamishHay/GeodesicODIS | src/drag.cpp | #include "drag.h"
#include <math.h>
#include <iostream>
#include <sstream>
void linearDrag(int & node_num, double & drag_coeff, Array2D<double> & dv_dt, Array2D<double> & v)
{
int i;
for (i=0; i<node_num; ++i)
{
dv_dt(i,0) -= v(i,0) * drag_coeff;
dv_dt(i,1) -= v(i,1) * drag_coeff;
}
}... | ALGO | 0.998909 | 4.277291 | {
"github_metadata": {
"branch": "master",
"commit_count": 898,
"repo_created_at": "2017-07-11T11:52:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe171cb7... |
9834186e-3000-46fa-b144-71831e36629e | Jackson-Yuan/Algorithm | Dawn-Blossoms-Plucked-At-Dusk/data-structure-master/搜索/数独.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<math.h>
#include<stdio.h>
#include<string.h>
using namespace std;
int map[9][9];
int flag;
/*判断次数在此行,此列,此3*3的小方格有没有重复的数*/
bool judge(int number, int x, int y) {
for (int i = 0; i < 9; i++) {
if (map[x][i] == number) return ... | ALGO | 0.998816 | 4.304548 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2020-10-28T14:09: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": "4f38d9ab8... |
466ea74f-7b21-4da1-b321-f8c1e7e1d375 | hhhhaura/competitive-programming | AA2/pE.cpp | #define wiwihorz
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma loop-opt(on)
#define rep(i, a, b) for(int i = a; i <= b; i ++)
#define rrep(i, a, b) for(int i = b; i >= a; i --)
#define ceil(a, b) ((a + b - 1) / (b))
#define all(a) a.begin(), a.end()
#define int long long int
#define lld long double
#de... | ALGO | 0.999969 | 3.948267 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-06-13T13:34:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "471820f6dea6... |
13811715-40cd-4d1a-83cc-1fb1b81a50cb | SakibulMowla/leetcode-solutions | solutions/0050. Pow(x, n).cpp | // Recursion
// Time - O(n)
// Memory - O(log n)
class Solution {
private:
double myPowHelper(double x, long long n) {
if (n == 0) return 1.0;
if (n == 1) return x;
double half = myPowHelper(x, n / 2);
return (n % 2) ? half * half * x : half * half;
}
public:
double myPow(... | ALGO | 0.999998 | 6.396408 | {
"github_metadata": {
"branch": "master",
"commit_count": 520,
"repo_created_at": "2019-02-02T00:59:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08c953c5... |
b4fecab7-4942-443b-a6df-96e48e862762 | montib/rays1bench | src/step1/rayweek1.cpp | #ifdef _WIN32
#define _CRT_SECURE_NO_WARNINGS
#ifdef _DEBUG
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#endif
#endif
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <float.h>
#include <ctime>
#ifndef _countof
#define _countof(a) (sizeof(a) / sizeof((a)[0]))
#endif
#... | ALGO | 0.986988 | 5.069349 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-12-28T14:06:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ab2d78a8b... |
96f25be3-e2a2-4aaa-8a48-63d12b310957 | akhikolla/testpackages | fuzzedpackages/gaston/src/export-aireml-logit-nk.cpp | #include <Rcpp.h>
#include "matrix-varia.h"
#include "any.h"
#include "ai-reml-logit-nk.h"
#include "ai-reml-logit-nk-covar.h"
using namespace Rcpp;
typedef Map<MatrixXd> Map_MatrixXd;
//[[Rcpp::export]]
List AIREMLn_logit_nofix(NumericVector Y, List K_, bool constraint, NumericVector min_tau_, int max_iter, double ... | ALGO | 0.992053 | 3.943622 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3807d28929... |
953e4f81-eef4-4cb9-b1bd-d21706a31ae7 | FMonitor/SZUOJ | 数据结构/图的遍历/DS图六度空间.cpp | #include<bits/stdc++.h>
using namespace std;
int n, m;
struct Edge {
int to, next;
} edge[1000];
int head[1000], cnt;
int disInSixCount[1000];
bool vis[1000];
void addEdge(int u, int v) {
edge[cnt].to = v;
edge[cnt].next = head[u];
head[u] = cnt++;
}
void init() {
cnt = 0;
memset(head, -1... | ALGO | 0.999765 | 4.181009 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-10-16T05:59:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b573f11400... |
182ac9a5-7d65-47da-b4eb-d8dc39c44135 | VladChira/ray-tracer | src/math/transform.h | #pragma once
#include "utilities.h"
namespace raytracer
{
class Transform
{
public:
Transform()
{
m = Eigen::Matrix4f::Identity();
inv_m = Eigen::Matrix4f::Identity();
}
Transform(const Eigen::Matrix4f matrix)
{
m = matrix;
... | TOOL | 0.949985 | 7.017775 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2023-07-10T21:00: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": "634eb570393... |
453d1047-250f-4385-8b94-d7725bf7c70c | uxlfoundation/oneDAL | cpp/daal/src/algorithms/ridge_regression/ridge_regression_train_kernel.h | /* file: ridge_regression_train_kernel.h */
/*******************************************************************************
* Copyright 2014 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy o... | TOOL | 0.943848 | 6.613559 | {
"github_metadata": {
"branch": "main",
"commit_count": 2361,
"repo_created_at": "2016-03-28T22:39:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 636,
"forks": 224,
"issues": 23,
"pull_requests": 37
},
"file_meta": {
"content_id": "cfaf... |
3751a35d-e96b-44f7-982e-2c240c55f170 | yhwtianya/dstest | datastruct/graph_list/graph_list.cpp | #include "graph_list.h"
#include "queue_ds.h"
using namespace DS;
void InitAdjList(PAdjList& pal, GraphKind kind)
{
if (NULL != pal)
{
printf("the AdjList is not NULL\n");
return;
}
pal = (PAdjList)malloc(sizeof(AdjList));
pal->arcnum = pal->vexnum = 0;
pal->kind = kind;
for (size_t i = 0; i < GRAPH_MAX_VE... | ALGO | 0.999055 | 4.101419 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2017-07-06T13:48: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": "11a8f0b51... |
e3e8e99a-8016-41f9-a086-c07a0b1d2aac | srskhan/Leetcode-Solutions | Singly_linked_list/Palindrome_Linked_List.cpp | /*
🔹 Problem: Palindrome Linked List
🔗 https://leetcode.com/problems/Palindrome-Linked-List/
🧠 Approach: Trying to do by linked list sratched, not efficient
⏱️ Time: O(n)
📦 Space: O(n)
*/
class Solution {
public:
void insert_at_tail(ListNode* &head, ListNode* &tail, int val)
{
ListNode* newnode = ... | ALGO | 0.999924 | 6.310797 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-06-25T06:38: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": "03419ae000d2... |
c5d0ee4d-45e2-470f-a7ef-da1b21274fcd | ishandutta2007/codeforces-c | chitanda/normal/850/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mkp make_pair
#define fi first
#define se second
#define ll long long
#define M 1000000007
#define all(a) a.begin(), a.end()
int n;
char s[1 << 21];
int f[1 << 20];
int c[1 << 20];
void FWT(int x[], int l, int r, int v){
if(l == r) return;
in... | ALGO | 0.999997 | 3.852791 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17: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": "60fcc39c094a... |
8ed3bc1c-39c6-4021-8aa4-f9cfd5a59fdc | cnsky1103/docs | docs/leetcode/code/52.n-queens-ii.cpp | /*
* @lc app=leetcode id=52 lang=cpp
*
* [52] N-Queens II
*/
// @lc code=start
#include "vector"
#include "string"
using namespace std;
class Solution {
public:
int res;
int totalNQueens(int n) {
res = 0;
vector<string> board(n, string(n, '.'));
backtrack(board, 0);
return r... | ALGO | 0.999903 | 6.130852 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-02-27T22:44: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": "3c493515a9a... |
52368c99-2925-4672-abac-ae466b106008 | ishandutta2007/codeforces-m | mr.robot_28/normal/1039/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int const1 = 1e9 + 7;
int power(int a, int b)
{
if(b == 0)
{
return 1;
}
else if(b % 2 == 0)
{
int t = power(a, b / 2);
return t * t % const1;
}
else
{
int t = power(a, b / 2);
t = t * t % const1;
return t * a % const1;
}
}
in... | ALGO | 0.999996 | 4.278697 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "46b67d10e24a... |
a933498e-2d17-47f5-9528-c3380cd4bdc3 | Cccmm002/my_leetcode | 098-validate-binary-search-tree/validate-binary-search-tree.cpp | // Given a binary tree, determine if it is a valid binary search tree (BST).
//
// Assume a BST is defined as follows:
//
//
// The left subtree of a node contains only nodes with keys less than the node's key.
// The right subtree of a node contains only nodes with keys greater than the node's key.
// Both the left... | ALGO | 0.999982 | 6.808025 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-05-17T03:50: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": "c02d2bf94... |
f5fdc944-ee3d-4711-a9a6-997a8d8c0830 | SaqlainAveiro/Competitive-Programming-Solves | CodeForces/Petya and Java.cpp | #include<bits/stdc++.h>
using namespace std;
#define FastIO ios_base :: sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define read(in) freopen("Input.txt","r",stdin)
#define write(out) freopen("Output.txt","w",stdout)
#define pf printf
#define sf scanf
#define fr0(i,n) for(long long int i=0 ; i<n ; i++)
#define fr1... | ALGO | 0.998523 | 3.159836 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-06-04T22:13: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": "6a367f2b412... |
00415be3-f07f-4574-b40a-59a748432e5c | RPChe-6626/Gomoku-AI | Minimax/sample.cpp | #include "AIController.h"
#include <utility>
#include <cstring>
extern int ai_side; //0: black, 1: white
std::string ai_name = "your_ai_name_here";
int turn = 0;
int board[15][15];
//init function is called once at the beginning
void init() {
/* TODO: Replace this by your code */
memset(board, -1, sizeof(board));
... | ALGO | 0.985295 | 4.705702 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-23T21:11:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04e344373326... |
f257e162-62c0-4058-a625-3a94a7bc98ee | Jaechan-So/ps-public | problems/leetcode/0800/827.cpp | // 827. Making A Large Island
// https://leetcode.com/problems/making-a-large-island/
using namespace std;
#include <set>
#include <vector>
class Solution {
public:
const int xDir[4] = {1, -1, 0, 0};
const int yDir[4] = {0, 0, 1, -1};
int largestIsland(vector<vector<int>> &grid) {
int n = grid.size();
... | ALGO | 0.999525 | 6.656959 | {
"github_metadata": {
"branch": "main",
"commit_count": 596,
"repo_created_at": "2022-04-30T12:21: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": "68b56f59f7... |
321c8cb4-5f07-40be-af8f-e5c136987058 | lysanyikkseniia/dsba-ads2020-hw1 | multiplication.h | #include <vector>
const short TEN = 10;
class Number
{
public:
Number(){}
void push_back(short i) {_inf.push_back(i);}
int size() const {return _inf.size();}
void deleteLeadingZeroes();
Number multTen(int i) const;
std::pair<Number, Number> splitIntoHalves() const;
short& operator[](int ... | ALGO | 0.990259 | 4.003586 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-04-24T09:49:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "1610386c4... |
abcf2920-f5bc-4eb9-afd7-6696f5f635d7 | cnolan3/clex | src/fa/fa.cpp | /**
* @file fa.cpp
*
* @author <NAME>
**/
#include <climits>
#include "fa.h"
#include <iostream>
using std::cout;
using std::endl;
/**
* FA constructor
*
* @param table transition table to use in FA
* @param alpha output alphabet
**/
FA::FA(const FAtTable& table, FAAlpha& alpha)
: m_tTable(table... | ALGO | 0.991498 | 6.311178 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2018-09-05T18:15: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": "db1a5242d... |
9dac817f-8e7d-45ea-ab25-aebafa86f5a5 | Tarunagg1/Ds_Alog_notes | Delannoy_Number/Delannoy_Number.cpp | /*
DELANNOY NUMBER
This number denotes the number of different paths available from
bottom-right corner of a grid i.e. (0,0) to top-left corner (m,n).
The constraint is that we can only use a step east, north or,
north-east(diagonal).
*/
#include<bits/stdc++.h>
using namespace std;
int check(int x, int y, int row, i... | ALGO | 0.999909 | 5.408365 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-19T04:18:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a02ca1f0c... |
9d473546-7469-4620-a077-ea99fbd14288 | gobby/obby | inc/jupiter_algorithm.hpp | /* libobby - Network text editing library
* Copyright (C) 2005, 2006 0x539 dev group
*
* 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 of the License, or (at your option... | ALGO | 0.966999 | 7.435874 | {
"github_metadata": {
"branch": "master",
"commit_count": 612,
"repo_created_at": "2013-05-14T22:08:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1aca0b90... |
3c386e6a-b514-47a9-a9e8-ab9f5f358458 | rezanej/NFA_DFA_projects | acceptNFA_DFA/main.cpp | #include <iostream>
using namespace std;
#include "operations.h"
void show(NFA DNFA,string name)
{
cout<<name<<" with states : ";
for (int i = 0; i <DNFA.getStates().size() ; ++i) {
cout<<DNFA.getStates()[i].getName()<<" ";
}
cout<<"\nAlphabets : ";
for (int i = 0; i <DNFA.getAlphabets().si... | ALGO | 0.991375 | 4.572024 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-05-13T18:53:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ab80f22b035... |
aab26e4d-e6b0-4ec1-94e8-e2ded7670020 | Abubakar0111/University_data | Semester 2/OopSubjectAssignment/Ass4Task2.cpp | #include <iostream>
using namespace std;
class Marks
{
private:
int MARKS1;
int MARKS2;
public:
Marks() : MARKS1(5), MARKS2(8) {}
Marks(int MARKS1, int MARKS2)
{
this->MARKS1 = MARKS1;
this->MARKS2 = MARKS2;
}
void operator=(Marks &marksObj)
{
marksObj.MARKS1 =... | TOOL | 0.946894 | 4.099102 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-11-05T16:01:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3d1d9954ea0... |
63c81d1c-3013-4c8d-bfba-4a6805e8146c | manni2000/Blind_75 | Two-Pointer/3Sum.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<vector<int>> threeSum(vector<int> &nums)
{
sort(nums.begin(), nums.end()); // nums = {0,1,2,-1,-1,-4}
set<vector<int>> s;
vector<vector<int>> result;
for (int i = 0; i < nums.size(); i++)
{ ... | ALGO | 0.999772 | 5.919153 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-06-01T06:08:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a2c4390096... |
5b0bb5cb-042e-4937-80b2-cf80bdb3c0e9 | PanagiotisIatrou/VelociFlow | Examples/NavierStokes/vorticy_ball_unsteady.cpp | #include <NavierStokesUnsteady.hpp>
#include <chrono>
#include <cmath>
#include <fstream>
#include <iostream>
#include <string>
const int grid_size_x = 300;
const int grid_size_y = 300;
const double domain_size_x = 1.0;
const double domain_size_y = 1.0;
const double velocity = 1.0;
const double viscosity = 0.00001;
co... | ALGO | 0.950488 | 5.591478 | {
"github_metadata": {
"branch": "main",
"commit_count": 244,
"repo_created_at": "2024-11-11T16:23:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2df503eaad... |
f88893ad-ecc3-4d68-82f5-1894638ec5ed | Rahul93-zz/SPOJ-CODECHEF-COMPETITIVE | EDIST.cpp | //#include<iostream>
//#include<climits>
//using namespace std;
//
//int dp[2001][2001];
//
//int convert(string &a, string &b, int i, int j) {
// if(a[i] == '\0' || b[j] == '\0'){
// if(a[i] == '\0') {
// return b.length()-j;
// } else {
// return a.length()-i;
// }
// ... | ALGO | 0.999968 | 4.239189 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-06-27T21:20: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": "27b1b1ce8... |
682cec8e-1cbf-4b48-86a7-2817ea208911 | dbdxnuliba/impedance_control.git-good | src/mraic.cpp | #include <impedance_control/mraic.h>
#include <stdlib.h>
#include <iostream>
mraic::mraic(void)
{
time_ = 0.0;
ym0_ = 0.0;
dym0_ = 0.0;
g0_ = 0.0;
kp0_ = 0.0;
kd0_ = 0.0;
wp_ = 0.0;
wd_ = 0.0;
kp_ = 0.0;
kd_ = 0.0;
g_ = 0.0;
q_ = 0.0;
u_ = 0.0;
e_[0] = 0.0;
e_[1... | ALGO | 0.996726 | 5.302662 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2020-05-08T06:13:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2b68b585... |
830f97ad-e3cc-4737-aa85-b45c926ccc1e | riops/Lyapunov-Analysis | src/Analysis.cpp | //
// Created by berko on 3/20/2023.
//
// #include <iostream>
#include "../include/Analysis.h"
#include "../include/Systems.h"
#include <cmath>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
// Function to calculate the average of a vector of numbers
long double Calculat... | ALGO | 0.999248 | 4.585179 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2025-04-25T13:47: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": "38e1e976e9a... |
c20990e6-2efe-42d6-8fb0-6e5f94ccdf11 | CJCforNICK/Data-Structure-2023Summer | Practice3/gridmaze.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#define ll long long
using namespace std;
vector<vector<char>> maze;
vector<vector<int>> dis;
int n, m;
struct path
{
int row;
int column;
path(int row, int column)
: row(row), column(column){};
};
queue<path> q;
stack<char> stk... | ALGO | 0.999994 | 3.957028 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-11-14T18:32: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": "ba9971d616... |
73dad023-1f46-46f3-bc35-70b01f05a828 | bluemix/mallba | rep/newGA/dnafa/ContigBuilder.h | /*********************************************************************
* File: ContigBuilder.h
* Author: <NAME>
* Date: May, 2003
*
* Description: This ContigBuilder class is used to process contigs
*... | ALGO | 0.941716 | 4.46207 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2014-08-09T12:31:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdcb75ca41... |
89366e6e-93ef-4a24-ba75-23b0a92023c1 | Kvngjaid04/cis-5 | Hmwk/Assignment_4/Savitch_9Ed_Chap4_Prob2_FuelEff/main.cpp | /*
* File:
* Author:
* Created on
* Purpose: Creation of Template to be used for all
* future projects
*/
//System Libraries
#include <iostream> //Input/Output Library
#include <iomanip>
using namespace std;
//User Libraries
//Global Constants, no Global Variables are allowed
//Math/Physics/C... | TOOL | 0.982029 | 4.196632 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-07-19T15:29: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": "fabc1cc98f03... |
590f05b4-9642-402d-a748-48779273f8a6 | kyungmax/AlgorithmStudy | STL/7785_revision.cpp | #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#define FOR(i,n) for(int i=0;i<n;i++)
typedef unsigned long ul;
using namespace std;
ul hashing(const string key, int num_partitions) {
unsigned long hash = 5381;
int c;
int i=0;
while ((c = ... | ALGO | 0.999666 | 3.588175 | {
"github_metadata": {
"branch": "master",
"commit_count": 220,
"repo_created_at": "2018-09-17T04:31: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": "1146d26b... |
8068e78e-9954-4ea8-9bb0-198af9fa3e90 | lballabio/QuantLib | ql/methods/finitedifferences/utilities/cevrndcalculator.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2018 <NAME>
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modif... | ALGO | 0.998462 | 7.604327 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
2b87f8d7-e4e5-4ec2-aff0-17fcefa55ced | PrinceS17/Cancellation | uhd_transceiver/qpsk_tranceler.cpp | #include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/exception.hpp>
#include <uhd/types/tune_request.hpp>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <boost/thread.hpp>
#include <boost/math/special_functions/round.hpp>... | ALGO | 0.921776 | 3.599129 | {
"github_metadata": {
"branch": "master",
"commit_count": 179,
"repo_created_at": "2017-08-02T21:25:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d31ba03... |
505c9b41-a6b4-4527-956d-0e6cfbc370e4 | RanjanBa/Challenges | Codechef/Challenge/Jan Div2/watching_cpl.cpp | #include<bits/stdc++.h>
#define ll long long
#define ld long double
#define phb push_back
#define ppb pop_back
#define arr array
#define rep(i,s,x,inc) for(int i = s; i < x; i+=inc)
#define repr(i,e,x,dec) for(int i = x - 1; i >= e; i-=dec)
#define repv(v, li) for(auto v : li)
#define sz(li) (int)li.size()
#define all(... | ALGO | 0.999896 | 4.261325 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2017-08-25T15:20: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": "64543ee46... |
ae65f9b7-3a37-4637-813b-96d4c8d55077 | Ragu1313/Problems-Solved | 2793-count-the-number-of-complete-components/2793-count-the-number-of-complete-components.cpp | class Solution {
public:
vector<int> bfs(int i,vector<vector<int>>& adj ,vector<int>& vis ,int cnt){
vector<int> arr;
vis[i] = cnt;
queue<int> q ;
q.push(i);
arr.push_back(i);
while(!q.empty()){
int node = q.front();q.pop();
for(auto k : adj[no... | ALGO | 0.999906 | 5.876466 | {
"github_metadata": {
"branch": "main",
"commit_count": 1787,
"repo_created_at": "2024-06-24T08:01: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": "3ccd3c0fd... |
9c4fe7f9-4270-4221-b911-96587068b5fd | Ayaad72/DSA-3rd-Semester | StackAndQueue-master/QueueLinked.h | #include <iostream>
using namespace std;
// Custom exception class for queue errors
class QueueLinkedListException
{
private:
string msg;
public:
QueueLinkedListException(string str) : msg(str) {}
string getMessage() const { return msg; }
};
template <class T>
class QueueLinkedList
{
struct Node
{... | TOOL | 0.916045 | 6.168738 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-10-31T21:55:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b769031d3a0c... |
9d87b6a3-2b65-4afd-addb-700775ccb3f6 | simba518/Utility | SRC/ElasticModel/FullSimulator.cpp | #include <stdio.h>
#include <string.h>
#include <assertext.h>
#include <Log.h>
#include <Timer.h>
#include <Eigen/SparseLU>
#include <Eigen/SparseQR>
#include <Eigen/UmfPackSupport>
#include <Eigen/CholmodSupport>
#include "FullSimulator.h"
using namespace SIMULATOR;
void LagImpFullSim::setConM(const VecT &C_triplet,c... | ALGO | 0.998697 | 4.850021 | {
"github_metadata": {
"branch": "master",
"commit_count": 180,
"repo_created_at": "2013-06-17T13:17:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76616192... |
de72b536-4d73-4689-9c46-a540307a528c | zurikz/algoprog | lvl2/2c/additional_2/Path.cpp | #include <iostream>
#include <vector>
#include <limits>
using namespace std;
int solve(vector<vector<int>> table) {
int n = table.size();
int m = table[0].size();
vector<vector<int>> ans(n, vector<int> (m, 0));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (i == 0 ... | ALGO | 0.999989 | 4.738771 | {
"github_metadata": {
"branch": "main",
"commit_count": 143,
"repo_created_at": "2021-05-29T07:21:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7fc7c7dffb... |
0ff32f5d-9db0-4ff3-8ab7-62a286316862 | ybouret/yocto4 | src/mk/yocto/math/fcn/intg.cxx | #include "yocto/math/ztype.hpp"
#include "yocto/math/fcn/intg.hpp"
#include "yocto/code/utils.hpp"
namespace yocto
{
namespace math
{
////////////////////////////////////////////////////////////////////////
//
// range
//
////////////////////////////////////////... | ALGO | 0.951596 | 6.27983 | {
"github_metadata": {
"branch": "master",
"commit_count": 5572,
"repo_created_at": "2015-04-10T11:19:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6994f09... |
c0725bde-aaf9-4510-adce-5c15dc7f77ce | 0dyk/algorithm | 백준/Gold/16234. 인구 이동/인구 이동.cc | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int dx[4] = {0,0,1,-1};
const int dy[4] = {1,-1,0,0};
// N : 인구수, L ~ R명 사이
int N, L, R;
// map
int arr[51][51];
bool visited[51][51];
void solve() {
queue<pair<int, int>> q;
queue<pair<int, int>> qq;
int time = 0;
// 시간 초마다 반복... | ALGO | 0.999932 | 4.09841 | {
"github_metadata": {
"branch": "main",
"commit_count": 387,
"repo_created_at": "2023-07-29T14:12: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": "06112f5f66... |
ff8392ff-d57b-4fea-9d3c-2f98042e3b8c | MarceloHAyala/Agenda-de-telefones-lista-contigua-estatica | teste7.cpp | /*
Escreva um programa para simular uma agenda de telefones. Para cada pessoa deve-se
armazenar os seguintes dados: nome, e-mail, endereço (contendo os campos rua, número, complemento, bairro, CEP, cidade, estado, país), telefone (contendo campo
para DDD e número), data de aniversário (contendo campo para dia, mês, ano... | TOOL | 0.938299 | 4.623417 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-23T16:04: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": "070b095fb085... |
bab8ad69-f846-4f30-8e58-3ee588fc75b4 | parkes811-inu/codetree-TILs | 240202/섞기 전 카드 위치/card-position-before-shuffling.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> sequence(n), final_state(n), initial_state(n);
vector<int> position(n);
// 수열 A를 입력받아 위치 매핑을 생성합니다.
for (int i = 0; i < n; i++) {
cin >> sequence[i];
position[sequence[i] - 1]... | ALGO | 0.999996 | 5.202792 | {
"github_metadata": {
"branch": "master",
"commit_count": 686,
"repo_created_at": "2024-01-23T13:29:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71420276... |
350b0899-2e7b-43fe-b697-c3e81826d02f | adsarode/Algorithms | DynamicProgramming/MaximumWeightIndependentSet.cpp | /*
Maximum Weight Independent Set using Dynamic Programming
https://en.wikipedia.org/wiki/Independent_set_(graph_theory)
<NAME> 18 August 2018
*/
#include <algorithm>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <stack>
#include <map>
#include <queue>
#include <fstream>
#... | ALGO | 0.999893 | 3.861852 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-11-03T16:05:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbb5de230... |
2cb27537-8c28-4b96-8842-55581e3057ac | AbhayMadaan9/Programs | RotateMatrix.cpp | #include <bits/stdc++.h>
//similiar to spiral traversal
//https://www.codingninjas.com/codestudio/problems/rotate-matrix_981260?leftPanelTab=1
void rotateMatrix(vector<vector<int>> &mat, int n, int m) {
// Write your code here
int topleft = 0, topright = m - 1, bottomright = n - 1, bottomleft = 0;
while (topleft... | ALGO | 0.999992 | 5.458738 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-02-01T11:49: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": "901f388bb51... |
6b788818-f4cc-4faf-9adb-c9ea4298d115 | pviafore/AdventOfCode2015 | challenges/challenge19.cpp | #include <cctype>
#include <iostream>
#include <map>
#include <set>
#include "input.h"
using Mappings = std::vector<std::pair<std::string, std::string>>;
using SplitMappings = std::vector<std::pair<std::string, std::vector<std::string>>>;
std::set<std::string> getDistinctMolecules(const std::string& molecule, const ... | ALGO | 0.999522 | 4.574446 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-01-02T22:41:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65659bfd0... |
53dff2a0-7bde-452e-858e-64d3ac16efbe | ParadigmMango/CS2300ClassCode | PA1/part_three/part_three.cc | // <NAME>
// CS2300(T/R)
// 02/06/2023
#include <cmath>
#include <iostream>
#include <fstream>
#include <random>
#include <sstream>
#include <string>
#include <vector>
#include <eigen3/Eigen/Dense>
enum class Operation {
kAddition = 0,
kSubtraction = 1,
kScaling = 2,
kDotProduct = 3,
kCosineAngle = 4,
kProje... | TOOL | 0.97134 | 5.869846 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-05-19T23:26: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": "24cb51e25d03... |
7354f13c-2e46-4e90-aa0e-207196a2d3a0 | HarshitRai121/6Companies30Days | Google/05-stone-game-vi.cpp | class Solution {
public:
int stoneGameVI(vector<int>& aliceValues, vector<int>& bobValues) {
int n = aliceValues.size();
// Priority queue to store stones with their combined values in descending order
priority_queue<pair<int, int>> valueQueue;
for (int i = 0; i < n... | ALGO | 0.999997 | 5.773187 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-12-31T17:28: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": "f49be8998936... |
22f8bd95-7a1e-42fe-89b8-4c3e3a8a00bb | guziqiu/qiu | guziqiu/11.春招突击班/05.qianxin/07.queue.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
typedef struct queue {
int *data;
int head;
int tail;
int length;
} queue;
queue *init(int _length) {
queue *q = (queue *)malloc(sizeof(queue));
q->data = (int *)malloc(sizeof(int) * _length);
q->length = _length;
q->head = q... | ALGO | 0.986034 | 3.929327 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-07-01T09: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": "0a9c5f9299... |
6fbe447d-78c5-4de6-9237-f719b2500a4b | augustboyy/SM_JYP_CHULKI_LETSGO | autodrive1234567.ino | #include <SoftwareSerial.h>
#include <AFMotor.h>
AF_DCMotor motor_L(1);
AF_DCMotor motor_R(4);
int Lspeed = 115; //좌측 모터 속도
int Rspeed = 400; //우측 모터 속도
int TrigPin = A0; //초음파센서 출력핀(trig)과 입력핀(echo), 변수, 함수 선언
int EchoPin = A1;
long duration, distance;
int dL, dR;
void Obstacle_Check();
void Di... | TOOL | 0.972118 | 5.834971 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2023-11-10T07:46:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58162c32dc1... |
5a63cf54-0a99-4285-b960-a3ce5554242e | mhiu05/Code_PTIT | C++/CPP0343_Day_uu_the.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define ms(a, n) memset(a, n, sizeof(a))
#define endl "\n"
using namespace std;
using ll = long long;
typedef pair<ll, ll> pl;
typedef vector<pl> vll;
typedef pair<int, int> pi;
typedef vector<pi> vii;
const int modi = 1000000007;
const ll modl = 1e18 + 7;
... | ALGO | 0.99955 | 5.400481 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-09-17T15:48:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f68b9c27b0... |
e28d5c6d-bb3c-4760-8cdd-450cb2059605 | JOOHOJANG/Problem_Solving | boj_sources/1197.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef pair<int, int> pii;
vector<vector<pii>>v;
bool vis[10001];
int ans;
struct compare {
bool operator()(pii a, pii b) {
return a.second > b.second;
}
};
priority_queue<pii, vector<pii>, compare> pq;
v... | ALGO | 0.99995 | 3.873703 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-05-18T05:54: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": "5e5308b48e... |
e0c40df1-e596-4aeb-9f18-e0106b10b9cf | whxwhx/codeforces | PWTC/2016day3/merge.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define dep(i,a,b) for(int i = a; i >= b; i--)
using namespace std;
const int N = 2010, mod = 1000000000 + 7;
int a[N], b[N], f[N][N], len[N][N], g[N], c[N * 2][N * 2];
int main(){
int n; scanf("%d",&n);
rep(i,1,... | ALGO | 0.999995 | 3.660409 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-12-18T06:24: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": "b2741d006... |
2f92787f-3ceb-4b83-ab09-8019448baf63 | izumo27/competitive-programming | AtCoder/ABC/141-150/150/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for... | ALGO | 0.999997 | 4.190494 | {
"github_metadata": {
"branch": "master",
"commit_count": 401,
"repo_created_at": "2018-03-03T08: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": "0902a8be... |
57188635-d165-4958-8107-b0ce754516f4 | NielsHolst/UniSim | src/plugins/vg/leaf_radiation_absorbed.cpp | /* Copyright (C) 2013 by <NAME>, AgroTech [<EMAIL>] and
** <NAME>, Aarhus University [<EMAIL>].
** Copyrights reserved.
** Released under the terms of the GNU General Public License version 3.0 or later.
** See www.gnu.org/copyleft/gpl.html.
*/
#include <usbase/exception.h>
#include <usbase/test_num.h>
#include "leaf_r... | ALGO | 0.989457 | 5.980112 | {
"github_metadata": {
"branch": "master",
"commit_count": 207,
"repo_created_at": "2010-01-19T15:20:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e1a80f1... |
be44fc0d-1ac5-4f25-915f-2c42413b8999 | ishandutta2007/codeforces-p | peti1234/normal/1361/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int c=500002, q=1050002;
vector<int> sz[q], s[q], sol;
vector<pair<int, int> > p;
bool v[c];
int n, t[2*c], pos[q];
void dfs(int a) {
while(pos[a]<sz[a].size()) {
int x=sz[a][pos[a]], y=s[a][pos[a]]; pos[a]++;
if (!v[y]) {
p.push_back(... | ALGO | 0.999937 | 3.173774 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49: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": "6735e92319b4... |
769ad1be-d264-4e6a-8155-30ef6dfbec1b | Ljy0109/Graphics_algorithms | GAMES101/texture/hm3/rasterizer.cpp | //
// Created by goksu on 4/6/19.
//
#include <algorithm>
#include "rasterizer.hpp"
#include <opencv2/opencv.hpp>
#include <math.h>
#include <stdexcept>
rst::pos_buf_id rst::rasterizer::load_positions(const std::vector<Eigen::Vector3f> &positions)
{
auto id = get_next_id();
pos_buf.emplace(id, positions);
... | ALGO | 0.968824 | 4.769274 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-12T14:00: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": "93ea35e65f0d... |
3ba3760b-c2bc-425c-858a-1b860b62f85a | krayong/Data-Structures-and-Algorithms | Searching&Sorting/min_swaps_to_sort.cpp | #include <bits/stdc++.h>
using namespace std;
/*************************************************************************************************************
*
* Link : https://practice.geeksforgeeks.org/problems/minimum-swaps/1
* Description:
Given an array of n di... | ALGO | 0.999923 | 4.973217 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2021-01-02T08:00:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec9e0ee68... |
04a838be-7941-44b8-abef-fcfefce37010 | xioumu/STL | 计算几何/圆的面积并.cpp | const int zx[] = {0, 1, 0, -1};
const int zy[] = {1, 0, -1, 0};
int sgn(double x) { return (x > eps) - (x < -eps); }
void get_min(double& x, double y) { x = min(x, y); }
void get_max(double& x, double y) { x = max(x, y); }
struct P {
double x, y;
P() {}
P(double _x, double _y): x(_x), y(_y) {}
P ope... | ALGO | 0.999347 | 3.919506 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-06-10T16:21:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08e346dc7... |
c322966e-67e7-497b-8c03-69e093f97a07 | osom8979/tbag | libtbag/string/ArgumentParser.cpp | /**
* @file ArgumentParser.cpp
* @brief ArgumentParser class implementation.
* @author zer0
* @date 2019-10-09
*/
#include <libtbag/string/ArgumentParser.hpp>
#include <libtbag/string/StringUtils.hpp>
#include <libtbag/string/Format.hpp>
#include <libtbag/filesystem/File.hpp>
#include <libtbag/filesystem/Pat... | TOOL | 0.964213 | 6.336099 | {
"github_metadata": {
"branch": "master",
"commit_count": 4323,
"repo_created_at": "2016-03-29T10:02:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "414f84... |
517362b2-faf2-407b-8fc0-d1d5ab5c9b08 | H0Kyun/CodingTest | SWExpertAcademy/D2/1948(날짜 계산기).cpp | // 문제 출처: https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PnnU6AOsDFAUq
#include<iostream>
using namespace std;
int main(int argc, char** argv)
{
int test_case;
int T;
cin >> T;
for(test_case = 1; test_case <= T; ++test_case)
{
int left_month, left_day, right_mo... | ALGO | 0.999783 | 3.873395 | {
"github_metadata": {
"branch": "master",
"commit_count": 522,
"repo_created_at": "2021-01-16T17:12: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": "cfbe1473... |
c3dc02d8-3c58-43da-852e-948c9eddc2ee | Saltykub/CP | usaco_guide/Silver/Graph/Traversal/862B.cpp | #include<bits/stdc++.h>
#define ll long long
#define st first
#define pii pair<ll,ll>
#define nd second
#define pb push_back
using namespace std;
const int N = 2e5+10;
bool CASE = false;
vector<int> adj[N];
vector<int> col(N,0);
void dfs(int node,int prev){
if(col[node] != 0) return;
if(prev == -1 || prev == 2... | ALGO | 0.99986 | 4.265912 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-05-12T11:10:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf43114ea53... |
7b70350f-4ec1-4751-a153-690e8b84aaf6 | 2009fang/Calculator | Calculator/calculator.h | #pragma once
#ifndef _CALCULATOR_H_
#define _CALCULATOR_H_
#include <vector>
#include <string>
#include <sstream>
#include <corecrt_math_defines.h>
_STD_BEGIN
vector<string> operators({ "+", "-", "*", "/", "^", "(", ")", "sin", "cos", "tan", "log", "log10", "asin", "acos", "atan", "sqrt", "cubr" });
vector<string>... | TOOL | 0.947245 | 3.581609 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-08-29T08:18:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e49beb7f... |
8dc9d474-021b-4ef5-8859-f6a895cb717d | CrossCRS/umcs-metnum | lb8/zad1.cpp | #include <cstdio>
#include <cmath>
#include <chrono>
using namespace std::chrono;
double factorial(double n) {
if (n == 1 || n == 0) {
return 1;
}
return factorial(n - 1) * n;
}
double maclaurin_exp(double x, double e) {
double result = 0;
double term = 0;
int i = 0;
do {
... | ALGO | 0.996801 | 4.966708 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-06-11T13:25: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": "917dc8fd71... |
8af5a4b1-d0c4-42ff-b44c-e523d9c839fe | hanasol/OOP | Assign_1/소스-14.cpp | #include <iostream>
using namespace std;
void perfect(int num);//완전수인지 판별하는 perfect함수 선언
int main() {
cout << "Perfect numbers between 1 and 1000:" << endl;
for (int i = 2; i < 1001; i++) {
perfect(i);//1은 완전수가 아니므로 2부터 1000까지 반복하며 완전수를 출력
}
return 0;
}
void perfect(int num) {
if (num % 2 == 1) {//1000까지의 완전수 중 ... | ALGO | 0.998884 | 4.464447 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-12-26T13:07:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d6bc19165b6... |
289493ab-7f34-4d6a-b70e-50e97f8d4e5c | TrenchBroom/vecmath | include/vecmath/vec_io.h | /*
Copyright 2010-2019 <NAME>
Copyright 2015-2019 <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 limitation the rights to use, copy, modify, mer... | TOOL | 0.972587 | 7.534645 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2019-10-02T13:44:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "738c4931f... |
c8f0ce6e-8bc1-43bf-ada4-7e25eb8bea6f | ayuljain7/August-LeetCoding-Challenge | Day 23/solution.cpp | class Trie{
Trie *children[26];
bool endOfWord;
public:
Trie():endOfWord(false){
for(int i = 0; i < 26; ++i) children[i] = nullptr;
}
void insert(string s){
Trie *t1 = this;
for(char c: s){
if(t1->children[c-'a'] == nullptr)
t1->children[c-'a'... | ALGO | 0.999829 | 5.95984 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-08-01T16:31: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": "19cefb4bc... |
27b0de8e-14b7-4181-8910-44f246cb2a49 | hechsewa/cpp-classes | lab3/smarttree/SmartTree.cpp | //
// Created by hushmans on 20.03.17.
//
#include <ostream>
#include <string>
#include <stack>
#include <regex>
#include <memory>
#include "SmartTree.h"
using namespace datastructures;
std::unique_ptr <SmartTree> datastructures::CreateLeaf(int value){
std::unique_ptr <SmartTree> new_leaf = std::make_unique<Smart... | ALGO | 0.966131 | 4.542704 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2017-03-08T18:31: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": "fcc76fef... |
9cd0c9ea-b960-4b81-b8b4-60c14af79b51 | exoticorn/spidr-android | sources/collision.cpp | #include "collision.hpp"
#include <stdio.h>
#define EPSILON 0.0001f
bool testHitLineLevel(const Line& line, const Line* pLevel, int numLevelLines, Vector2* pIntersection)
{
Vector2 lineDir = line.end - line.start;
Vector2 normal = Vector2(lineDir.y, -lineDir.x).normalize();
for(int i = 0; i < numLevelLines; i++)... | ALGO | 0.998992 | 5.632789 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2012-06-10T10:23:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dee24f3ef... |
af6db1bc-42f0-430f-a81d-3fb1ae24b948 | vaibhavtale/ultimate-c-course-completed | backtracking1.cpp | #include<iostream>
using namespace std;
# define N 4
bool is_safe(int x,int y,int maze[N][N]){
if(x < N && y < N && maze[x][y] == 1){
return true;
}
return false;
}
bool solve_maze(int maze[N][N],int x,int y,int vis[N][N]){
if(x == (N-1) && y == (N-1) ){
vis[x][y] = 1;
retu... | ALGO | 0.999897 | 3.752553 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-01-20T08:13: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": "494caa180a... |
6be34050-6443-4a8f-b6ac-63e7346cb3e1 | r-universe-org/macos-libs | opt/R/x86_64/include/geos/triangulate/IncrementalDelaunayTriangulator.h | /**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
*
* Copyright (C) 2012 Excensus LLC.
*
* This is free software; you can redistribute and/or modify it under
* the terms of the GNU Lesser General Licence as published
* by the ... | ALGO | 0.98673 | 7.6196 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2023-04-08T22:10:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d142185e0d... |
93783d27-0744-45fc-a7b0-5c70c882a7a6 | calofmijuck/BOJ | Codes/16900/16928.cpp | #include <bits/stdc++.h>
using namespace std;
#define START 1
#define END 100
typedef struct {
int position;
int moves;
} game_state;
map<int, int> event;
bool visited[101];
int bfs() {
queue<game_state> q;
game_state initial = {START, 0};
q.push(initial);
visited[initial.position] = tr... | ALGO | 0.999986 | 3.745761 | {
"github_metadata": {
"branch": "master",
"commit_count": 895,
"repo_created_at": "2018-11-02T11:50:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c0832df... |
a155b87d-712c-4631-9f39-22b3ea398a2f | gptjddldi/Algorithm | Algorithm/21.04/BinaryTreeRightSideView.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999948 | 6.063619 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2021-01-14T06:46:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1e1669b909... |
d19b6ba0-8c17-40eb-b92f-a078f6b098cb | priyanshusharma80/CPQuestions | 5_MeetingFriends.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
/*
3 Friends
Ox straight line
first friend -> x1
second -> x2
third -> x3
we've to find out minimum distance they have to travel in order to meet
7 1 4
let's say 7 is that point ->
1->... | ALGO | 0.999992 | 4.012292 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2024-01-13T04:34: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": "42d518b12... |
3a75aaca-e982-4366-907f-c347bbb7d6d4 | vijayKota2776/DSA | circular_linked_list_insert_end.cpp | // Create circular linked list data structure & perform insert at end and display operations.
#include <iostream>
using namespace std;
class Node {
public:
int data;
Node* next;
Node(int val) {
data = val;
next = nullptr;
}
};
class CircularLinkedList {
Node* last;
public:
Circ... | ALGO | 0.991995 | 6.111561 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-04-23T16:24: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": "00b8342f78e... |
d87ad477-170a-48fc-b935-d56df8831215 | rbenic-fer/progauthfp | examples/google-code-jam/Aros/2B.cpp | #include<cstdio>
#include<cstring>
#include<cmath>
#include<ctime>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
const int MAXN = 1000+5, MAXM = 1000+5;
const int INF = 0x3f3f3f3f;
const double eps = 1e-7;
int T, N, W, L;
double r[MAXN];
double x[MAXN], y[... | ALGO | 0.998752 | 3.355839 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-05-28T20:29: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": "d0105a5fd... |
d37652a7-9636-45c8-a65e-c5d8c81da708 | he-actlab/AxBench | parrot.c/src/ParrotGenerator/parrot/inversek2j.avx.parrot.cpp | /*
* Neural Parrot!
*
* <NAME>
* <<EMAIL>>
*/
#include "parrot_avx_hwsigmoid.h"
static __m256 _a0_a1 __attribute__ ((aligned(32)));
static __m256 _a0_a1_a2_a3_a4_a5_a6_a7 __attribute__ ((aligned(32)));
static __m256 _m0_m1 __attribute__ ((aligned(32)));
static __m256 _m0_m1_m2_m3_m4_m5_m6_m7 __attribute__ ((alig... | ALGO | 0.996633 | 4.498331 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2021-04-05T04:00:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "035c4c4e88... |
7b46c32e-c193-4fe7-9d28-854669fa74d6 | ishandutta2007/codeforces-h | halyavin/normal/753/B.cpp | #ifdef __GNUC__
#pragma GCC target("sse4,avx")
#endif
#include <immintrin.h>
#include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#include <cstdint>
#include <numeric>
#include <array>
void run(std::istream &in, std::ostream &out) {
std::vector<std::array<int, 4>> combs;
for (int i1 = 0; i1... | ALGO | 0.999741 | 4.268372 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68f9d921b659... |
a5a41749-a33e-4a34-8011-fee62ff4511c | ufoproger/Coursework--1 | cpoint.cpp | #include <iostream>
#include <cmath>
#include "cpoint.h"
cPoint::cPoint () {}
bool cPoint::operator== (cPoint a)
{
return (x == a.x && y == a.y);
}
std::ostream& operator<< (std::ostream &out, cPoint a)
{
out << "(" << a.x << ", " << a.y << ")";
return out;
}
cPoint::cPoint (double _x, double _y)
{
x = _x;
... | TOOL | 0.994021 | 4.288643 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2010-03-08T16:49:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fe93d7ac... |
04797435-d2f9-45db-95c6-61bdb7abf5a2 | hikusama/testing_workspace | cpp/leetcode/twosum.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution
{
public:
vector<int> twoSum(vector<int> &nums, int target)
{
vector<int> res[nums.size()-(1)];
for (int i = 0; i < nums.size(); i++)
{
for (int j = i + 1; j < nums.size(); j++)
{
... | ALGO | 0.999883 | 5.379231 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-05-25T06:11:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b1c4e6c6b69... |
407bf55b-1e4c-4a92-841c-a86b873e21bb | lsaejn/leetcode | 778-reorganize-string/reorganize-string.cpp | // Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same.
//
// If possible, output any possible result. If not possible, return the empty string.
//
// Example 1:
//
//
// Input: S = "aab"
// Output: "aba"
//
//
// Example 2:
//
//
// Input: S... | ALGO | 0.999982 | 5.598438 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-10-20T07:07:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f0a004ecc... |
5546c234-3eec-4bee-8cae-745bd6fc3b5e | zhupeijun/Algorithm | topcoder/SRM681/FleetFunding.cpp | #include <queue>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <functional>
#include <utility>
using namespace std;
typedef pair<int,int> pii;
#define MP(a, b) make_pair(a, b)
class FleetFunding {
public:
bool good(int m, const vector<int>& k, const vector<int>& a, const vector<int>& b, int ... | ALGO | 0.999936 | 4.002945 | {
"github_metadata": {
"branch": "master",
"commit_count": 248,
"repo_created_at": "2014-12-02T09:36: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": "78c7e9d5... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.