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 |
|---|---|---|---|---|---|---|---|
f8f277d0-2b82-45e8-8fc7-ac9b8dea6cc7 | kitsas151/siemens_poc | syntaxhelloworld/a42vector.cpp | #include <iostream>
#include <vector>
#include <string>
namespace MedicalDomain {
class MedicalDevice {
private:
std::string name_;
std::string serialNumber_;
public:
MedicalDevice(const MedicalDevice &m):name_(m.name_), serialNumber_(m.serialNumber_) {
std::cout ... | TOOL | 0.903125 | 5.382392 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-05-27T04:36: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": "33f48a22e8c... |
aa069dbf-d0cd-4770-be34-b1e4a0c5d5d9 | tushxr16/leetcode-solutions | Generate Parentheses - GFG/generate-parentheses.cpp | // { Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
vector<string> AllParenthesis(int n) ;
// } Driver Code Ends
//User function Template for C++
// N is the number of pairs of parentheses
// Return list of all combinations of balanced parantheses
class Solution
{
p... | ALGO | 0.999376 | 5.959097 | {
"github_metadata": {
"branch": "main",
"commit_count": 2052,
"repo_created_at": "2022-03-10T13:36:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "067d5205e... |
e5640460-6fea-4426-afe2-998339477931 | SaverioNapolitano/mdp | lectures/08audioExample/main.cpp | #include <numbers>
#include <vector>
#include <cmath>
#include <fstream>
int16_t saturate(int32_t value) {
if (value > 32767) {
return 32767;
}
if (value < -32767) {
return -32767;
}
return value;
}
void write_samples(const std::string& filename, const std::vector<int16_t>& samples) {
std::ofstream os(filen... | TOOL | 0.925843 | 4.672432 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2025-03-18T21:13:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e5c24fec... |
53b31e92-a7eb-4ca9-a998-048d433bf68c | tejasshinge/llama.cpp | sgemm.cpp | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
// vi: set et ft=c++ ts=4 sts=4 sw=4 fenc=utf-8 :vi
//
// Copyright 2024 Mozilla Foundation
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software")... | ALGO | 0.998267 | 6.961977 | {
"github_metadata": {
"branch": "main",
"commit_count": 2710,
"repo_created_at": "2024-04-27T01:01: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": "b902dbb93... |
af4b6a44-6e55-427d-9ac1-94d21d6a8ee7 | ParthKataria/DSA | pw1.cpp | // https://practice.geeksforgeeks.org/problems/last-index-of-15847/1
int lastIndex(string s)
{
for(int i=s.size()-1;i>=0;i--)
if(s[i]=='1')
return i;
return -1;
}
// https://practice.geeksforgeeks.org/problems/missing-number-in-array1416/1
int MissingNumber(vector<in... | ALGO | 0.999141 | 4.111967 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-08-06T06:57: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": "3c6885c1d28... |
cae0c082-0c31-43ba-b12d-01e55b58a32a | 313581041DanielHsu/Leetcode | week06/problem140/problem140.cpp | class Solution {
public:
vector<string> wordBreak(string s, vector<string>& wordDict) {
unordered_set<string> dict(wordDict.begin(), wordDict.end());
vector<string> result;
vector<string> path;
backtrack(s, 0, dict, path, result);
return result;
}
void backtrack(cons... | ALGO | 0.999599 | 6.162278 | {
"github_metadata": {
"branch": "main",
"commit_count": 199,
"repo_created_at": "2025-03-03T07:28:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26a3961733... |
e9341c33-24a5-4dbb-8c04-2d4617f32a69 | luliCloud/CPP_Beyond_Skillset | primer_practice 1-7/exercise6_33.cpp | /** 编写一个递归函数,输出vector对象的内容。使用alias,iterator */
#include <iostream>
#include <vector>
using namespace std;
using Iter = vector<int>::const_iterator;
void print(Iter first, Iter last) {
if (first == last) {
cout << "meet the end" << endl;
return;
}
cout << *first << " ";
// pass first + 1... | TOOL | 0.993966 | 5.059734 | {
"github_metadata": {
"branch": "main",
"commit_count": 349,
"repo_created_at": "2024-04-16T21:45: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": "98efcee5f7... |
9c966372-2490-4b25-a647-7b92c14298df | OP-ACE/CPP-Template-Generic-Programming | CPP-Template-Complete-Guide-2nd/ItIsMyUglyCode/p20220308d_stack_push_pop_top_empty_friend_tempalte_implicit.cpp | #include <iostream>
#include <string>
#include <vector>
template<class T>
class Stack
{
private:
std::vector<T> v;
public:
void push(T a);
void printOn(std::ostream & os) const;
template <typename U>
friend std::ostream& operator<< (std::ostream& out, const Stack<U> & s);
};
//!... | TOOL | 0.952839 | 5.446682 | {
"github_metadata": {
"branch": "main",
"commit_count": 139,
"repo_created_at": "2022-02-25T08:33:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76be82546d... |
b0112eb8-0e58-45db-a999-3cec3bf1a067 | MasterIceZ/IMSO | Retired/codeforces/H_The_Most_Reckless_Defense.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <queue>
#include <string>
#include <utility>
#include <vector>
const int INF = std::numeric_limits<int>::max() / 2;
struct state_t {
int v, w;
state_t(int _v, int _w):
v(_v), w(_w) {}
bool operator<(const state_t& other) c... | ALGO | 0.999511 | 4.712616 | {
"github_metadata": {
"branch": "main",
"commit_count": 127,
"repo_created_at": "2022-01-04T04:37:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b3c41b18d... |
704378b4-1d6d-48d0-a3c1-f2e4ba6bff2b | SakibulMowla/competitive-programming-solutions | Root/CF/Div1-D Counting Rectangles is Fun.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void RD(int &x){scanf("%d",&x);}
void RD(ll &x){scanf("%I64d",&x);}
void RD(double &x){scanf("%lf",&x);}
void RD(int &x,int &y){scanf("%d%d",&x,&y);}
void RD(ll &x,ll &y){scanf("%I64d%I64d",&x,&y);}
void RD(double &x,double &y){scanf("%lf%lf",&x,&y... | ALGO | 0.99982 | 3.859583 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2020-05-24T23:22:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "226176681... |
75b663e9-8c67-4eea-b412-c5d9c94596fb | Xilinx/Vitis-Tutorials | Vitis_System_Design/Feature_Tutorials/01-Vitis_Functional_Simulation/aie_hls/64kifft/aie_src/front_ifft_with_twid/ifft256p4_rot.h | //
// Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved.
// SPDX-License-Identifier: MIT
//
// Author: <NAME>
#pragma once
#include <adf.h>
#include <aie_api/aie.hpp>
using namespace adf;
template< unsigned NSTREAM, unsigned PHASE>
class ifft256p4_rot {
public:
typedef cint32 TT_DATA;
typedef... | ALGO | 0.987345 | 6.963869 | {
"github_metadata": {
"branch": "2025.1",
"commit_count": 3080,
"repo_created_at": "2019-09-30T17:08:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1419,
"forks": 572,
"issues": 14,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca... |
065ee794-7b55-4537-8c51-9a905f29fada | bletelier/HyperLogLog | include/hyperloglog/hyperloglog.hpp | #ifndef HYPERLOGLOG_HPP
#define HYPERLOGLOG_HPP
#include <string>
#include <MurmurHash2.h>
#include <cassert>
#include <set>
#include <vector>
#include <bitset>
#include <cmath>
namespace sketch {
class hyperloglog {
public:
typedef uint64_t t_64;
typedef uint32_t t_32;
typedef uint16_t t_16;
... | ALGO | 0.978035 | 4.411547 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-09-12T12:33:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "775601da04e... |
a85f8ad3-ba2b-4127-8da0-ea3ebe3d7c4d | ishandutta2007/codeforces-s | saketh/normal/1159/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})
#define all(x) (x).begin(), (x).end()
... | ALGO | 0.999976 | 4.253048 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62dc5d551f1c... |
f781760c-8b76-49ac-8e4f-eaf721b694fb | Lrapava/CS106B-Homework | assignment-5/pqueue-linkedlist.cpp | /*************************************************************
* File: pqueue-linkedlist.cpp
*
* Implementation file for the LinkedListPriorityQueue
* class.
*/
#include "pqueue-linkedlist.h"
#include "error.h"
LinkedListPriorityQueue::LinkedListPriorityQueue() {
head = new linkedListElement();
}
LinkedListPr... | ALGO | 0.986901 | 6.101479 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2025-06-16T08:57:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7364e3ec... |
9506f3ad-6144-4c73-a1a7-33a264bd4e0c | opengm/opengm | include/opengm/operations/and.hxx | #pragma once
#ifndef OPENGM_OPERATION_AND_HXX
#define OPENGM_OPERATION_AND_HXX
namespace opengm {
/// Conjunction as a binary operation
///
/// \ingroup operators
struct And
{
/// neutral element (with return)
template<class T>
static T neutral()
{ return static_cast<T>(true); }
/// neutral e... | TOOL | 0.983924 | 7.349925 | {
"github_metadata": {
"branch": "master",
"commit_count": 2107,
"repo_created_at": "2012-06-01T11:37:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 421,
"forks": 153,
"issues": 58,
"pull_requests": 9
},
"file_meta": {
"content_id": "36... |
04778a41-efa9-466d-a95a-4bbc2337aac5 | TRAN-THUY-NGOC/UPCODER | UPCODER/Other/MAZE2.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
int maTran[1001][1001];
string res("");
int dx[] = {1, 0, 0, -1};
int dy[] = {0, 1, -1, 0};
char dc[] = {'X', 'P', 'T', 'L'};
void Try(int x, int y) {
if (x == n && y == n) {
cout << res << '\n';
} else {
for (int i = 0; i < 4; i++) {
... | ALGO | 0.999894 | 4.126234 | {
"github_metadata": {
"branch": "main",
"commit_count": 1676,
"repo_created_at": "2024-10-01T07:47:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb0dd6c0a... |
13358e7a-a6c4-4931-b178-659d60197bf8 | GaussGreen/old-code | Sirius/Common/Include/cMatrix.h |
#ifndef CMatrixH
#define CMatrixH
#include <assert.h>
#include "TContainer.h"
static int Max(int n,int m)
{
if ( n > m )
return n;
else
return m;
};
class CVectorString
{
char** p;
int _size;
public:
CVectorString();
virtual ~CVectorString();
void resize(int n);
int getsize()const{return _size;... | TOOL | 0.915049 | 3.155933 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-02-17T09:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eb29dca0606d... |
0bafae21-e623-4f12-8a52-5ef641108a71 | Mallhw/CompetitiveProgramming | HSPC/USIOT/GoodPairs.cpp | #include <bits/stdc++.h>
using namespace std;
#define max(a, b) (a < b ? b : a)
#define min(a, b) ((a > b) ? b : a)
#define dbg(x) cerr << __LINE__ << ": " << #x << "=" << x << endl;
#define mod 1000000007
#define FOR(a, c) for (int(a) = 0; (a) < (c); (a)++)
#define FORL(a, b, c) for (int(a) = (b); (a) <= (c); (a... | ALGO | 0.999921 | 3.903653 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2024-12-12T22:26:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5c729458321... |
f3dbcc7f-9a8f-426b-a538-4ba54fc4fec3 | Sooh317/cp_env | CP/library_cpp/Binomial_coefficient.cpp | struct Combination{
private:
int N;
const long long MOD = 1000000007;
std::vector<long long> Fact;
std::vector<long long> Finv;
std::vector<long long> Inv;
public:
Combination(int _N, int _MOD):N(_N), MOD(_MOD){
Fact.resize(N + 1);
Finv.resize(N + 1);
Inv.resize(N + 1);
... | ALGO | 0.999933 | 4.295518 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-07-11T14:03:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd028b2c81... |
4a412d77-c99f-4ff5-9ff3-899139b2430a | palilo815/ps | baekjoon/1000/1613.cpp | #include<bits/stdc++.h>
using namespace std;
#define loop(i,n) for(int i=0;i<n;++i)
bool adj[401][401];
int main()
{
cin.tie(NULL), cout.tie(NULL);
ios::sync_with_stdio(false);
int V, E; cin >> V >> E;
while (E--) {
int u, v; cin >> u >> v;
adj[u][v] = true;
}
// Bellman-Ford
... | ALGO | 0.999957 | 4.345105 | {
"github_metadata": {
"branch": "master",
"commit_count": 6725,
"repo_created_at": "2020-01-12T04:58:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef90321... |
7352c5a7-3ba6-41cd-bc7f-8d772572ed9d | sagarrrr21/CPP | Linked List/two-pointer.cpp | #include <iostream>
using namespace std;
class node
{
public:
int val;
node *next;
node(int data)
{
val = data;
next = NULL;
}
};
class linkedlist
{
public:
node *head;
linkedlist()
{
head = NULL;
}
void insert(int val)
{
node *new_node = ... | ALGO | 0.997818 | 5.290345 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2024-02-21T15:33:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "7d4b5a19b2... |
06980e74-b666-4a65-a889-a083da1554b0 | jizhang-cmu/autonomy_stack_mecanum_wheel_platform | src/slam/arise_slam_mid360/include/arise_slam_mid360/FeatureExtraction/LidarKeypointExtractor.h | //
// Created by ubuntu on 2020/9/14.
//
#ifndef LIDARKEYPOINTEXTRACTOR_H
#define LIDARKEYPOINTEXTRACTOR_H
#include <bitset>
#include <memory>
#include <numeric>
#include <unordered_map>
#include <vector>
#include <pcl/point_cloud.h>
#include "arise_slam_mid360/config/parameter.h"
#include "arise_slam_mid360/sensor_... | ALGO | 0.952323 | 6.793007 | {
"github_metadata": {
"branch": "jazzy",
"commit_count": 86,
"repo_created_at": "2024-08-16T13:03:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 135,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4ac9fc2... |
22cea1e0-f07f-426a-b6fb-133d01ce4cc7 | sontungexpt/UIT-Workspaces | C_C++/HocKi2_Nam1/UIT-Together/MangHaiChieu/Bai149/Bai149.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <cctype>
#include <math.h>
using namespace std;
#define MAXR 500
#define MAXC 500
//initalize function
void Nhap(string, float[][MAXC], int&, int&);
void Xuat(float[][MAXC], int, int);
void ThemCot(float[][MAXC], int, int&, int);
... | ALGO | 0.985847 | 3.018265 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-03-06T11:58: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": "711dabe457a... |
a2b77a67-4b96-420f-bf23-4271d1eb98ed | abhishekboadgurjar/DSA | 15 Heaps/Code/Class Code/Heap Class Level 3/3_SmallestRangeinKLists.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
class Solution {
public:
vector<int> smallestRange(vector<vector<int>>& nums) {
priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> pq;
int n = nums.size();
int mini = INT_MAX;
... | ALGO | 0.99996 | 6.606558 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-03-18T04:16:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4b4da4dc02... |
46827218-475b-4307-a85c-5253c0bd67f3 | uzh/QHG | QHG3/tools_ico/LonLatSplitter.cpp | #include <stdio.h>
#include <math.h>
#include <algorithm>
#include "types.h"
#include "smallprimes.h"
#include "icoutil.h"
#include "EQsahedron.h"
#include "BasicTile.h"
#include "BasicSplitter.h"
#include "LonLatTile.h"
#include "LonLatSplitter.h"
//-----------------------------------------------------------------... | ALGO | 0.989451 | 4.38768 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-11-29T17:18:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49c0bd9e0e1... |
48b774aa-ff4b-484b-aa4a-85fda4deb1c1 | Pandey-SaurabhP/CP | Codeforces/1954/c.cpp | #include <bits/stdc++.h>
using namespace std;
// Macros
#define pb push_back
#define pf push_front
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, x, n) for(int i = x; i <= n; ++i)
#define rrep(i, x... | ALGO | 0.999996 | 4.894863 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2023-04-13T08:49:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b668b72dae... |
9b6146c2-3f09-49bd-a6ac-af347c623471 | priyansh004-sahu/CPP | apna_collage/chap_8/swap_min_max.cpp | #include <iostream>
#include <climits> // For INT_MIN and INT_MAX
using namespace std;
void swapMinMax(int arr[], int size) {
//edge case
if(size <= 0) {
cout << "value must be greater than 0:" << endl;
}
// Initialize indices and values
int minIndex = 0, maxIndex = 0;
int minValue = INT_MAX,... | ALGO | 0.999917 | 5.676891 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-04-17T06:27:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc2a7ef4d3a2... |
4ebc5dd6-5ccb-41a9-b406-a1680f880db2 | ThonnyRG/Leetcode | Leetcodes/Leetcode632.cpp | class Solution {
public:
vector<int> smallestRange(vector<vector<int>>& nums) {
vector<pair<int, int>> v;
for (int i = 0; i < nums.size(); i++) {
for (int j = 0; j < nums[i].size(); j++) {
v.push_back({nums[i][j], i});
}
}
sort(v.begin(), v.end... | ALGO | 0.999988 | 6.326786 | {
"github_metadata": {
"branch": "main",
"commit_count": 592,
"repo_created_at": "2024-02-14T18:25:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3116be19ef... |
98f346ae-0d5d-4852-a756-d068d2a7edd4 | arkamajumd/USACO | wormhole/wormhole.cpp | /*
ID: arka.ma1
PROG: wormhole
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <cassert>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
struct wormhole {
int x;
int y;
// int i;
wormhole* next = NULL;
wormhole* pair = NULL;
};
inline bool operator<(const wormhole& lhs, co... | ALGO | 0.999215 | 3.814124 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2018-01-16T05:11: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": "8a2df29d8... |
a5cadbb4-4ce9-4142-879a-5dc2ed924e97 | openvinotoolkit/openvino | src/core/reference/include/openvino/reference/gru_cell.hpp | // Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <cmath>
#include "openvino/reference/add.hpp"
#include "openvino/reference/clamp.hpp"
#include "openvino/reference/matmul.hpp"
#include "openvino/reference/multiply.hpp"
#include "openvino/reference/relu.hpp"... | ALGO | 0.965431 | 6.961512 | {
"github_metadata": {
"branch": "master",
"commit_count": 19551,
"repo_created_at": "2018-10-15T10:54:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8597,
"forks": 2656,
"issues": 303,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
59704de4-6348-48f5-9bf6-37c853ed30da | alexandraback/datacollection | solutions_2645486_1/C++/tfliao/B.cpp | #include <iostream>
#include <cmath>
using namespace std;
typedef long long ll ;
#define MAXN 10001
int T, nCase = 1 ;
ll E, R, N, v[MAXN];
void input()
{
cin >> E >> R >> N;
for ( int i=0;i<N;++i ) cin >> v[i];
}
ll solv_r ( int l, int r, ll startE, ll endE )
{
// requirement: endE - startE <= (r-l)*R
if ( ... | ALGO | 0.9999 | 4.061972 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c6e416c6e... |
315153f3-298e-45a8-82dd-0c7066c24198 | raushanranjan103/Leetcode-GFG-Practice | 16. Positive Negative Pair - GFG/16.-positive-negative-pair.cpp | // { Driver Code Starts
// Initial function template for C++
#include <bits/stdc++.h>
#include <unordered_map>
#include <math.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution{
public:
//Function to return list containing all the pairs having both
//negative a... | ALGO | 0.999859 | 5.132864 | {
"github_metadata": {
"branch": "main",
"commit_count": 825,
"repo_created_at": "2022-04-02T17:33: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": "7bc07b3914... |
907e05ca-2e14-46a9-bdf1-d2faa239ab79 | naokato/kyopro_tessoku | b39/MainGreedy.cpp | #define DEBUG 1
#include <iostream>
using namespace std;
int N, D, X[200009], Y[200009];
int main() {
cin >> N >> D;
for (int i = 1; i <= N; i++) cin >> X[i] >> Y[i];
int answer = 0;
for (int i = 1; i <= D; i++) {
int maxIncome = 0;
int maxDate = 0;
for (int j = 1; j <= N; j++) {
if (i < X[... | ALGO | 0.999902 | 3.336466 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2023-02-15T13:28: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": "4bc34c913e2... |
4d7f88dd-0bba-4c6b-b6da-33ba57244e49 | bjarkimb/EQ2443-2445-Project-Group2 | include/gnuradio/atsc/viterbi_decoder_impl.h | /* -*- c++ -*- */
/*
* Copyright 2002 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* GNU Radio 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, or (at your option... | ALGO | 0.981685 | 6.475381 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-12-19T09:13:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3117dc9606... |
4e668e57-e102-404a-a7bf-3f1c0d99ddaa | Maithani-ji/CPP-DSA | 0021-merge-two-sorted-lists/0021-merge-two-sorted-lists.cpp | /**
* Definition for singly-linked list.
* 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) {}
* };
*/
// Create a structure definition for a singly-lin... | ALGO | 0.999989 | 6.433508 | {
"github_metadata": {
"branch": "main",
"commit_count": 553,
"repo_created_at": "2023-08-16T18:52:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c686dd2c1a... |
b692ed3c-546d-450e-9cda-fdd25922a41c | ApolloAuto/apollo | modules/common/math/box2d.h | /******************************************************************************
* Copyright 2017 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
... | TOOL | 0.913141 | 7.690641 | {
"github_metadata": {
"branch": "master",
"commit_count": 19341,
"repo_created_at": "2017-07-04T19:03:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25847,
"forks": 9793,
"issues": 895,
"pull_requests": 104
},
"file_meta": {
"content_id... |
d193b0a0-09ab-4859-98ee-4671cce972d4 | joaopmatias/Competitions | codeforces/637_div2/D.cpp | #include <iostream>
#include <stdio.h>
#include <cstring>
#include <string>
#include <math.h>
#include <vector>
#include <stdlib.h>
#include <algorithm>
#include <limits.h>
#include <deque>
#include <set>
using namespace std;
template <class T>
bool compare (const T a, const T b) //Use templates
{
return ( a < b );... | ALGO | 0.999904 | 3.397519 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2017-10-25T02:14: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": "17768fff9... |
222e4cec-2112-48dc-bd88-bfac4d6847cb | Paras-Pandey/Competitive-Programming | cp/C_Sum_of_Substrings.cpp | #include"bits/stdc++.h"
using namespace std;
#define go(i, s, n) for (int i=(s), end=(n); i<=end; i++)
#define rgo(i, s, n) for (int i=(s), end=(n); i>=n; i--)
#define getstr getline (cin,str)
#define vi vector <int>
#define vs vector <string>
#define pii ... | ALGO | 0.999785 | 3.887624 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-16T16:41: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": "1cfc9f6bba3a... |
35f89b04-0fec-48ad-84dd-b2ae58647db2 | D4NZ-jpg/Competitive-Programming | Archive/(C) XOR-distance.cpp | // Problem: C. XOR-distance
// Contest: Codeforces - Codeforces Round 922 (Div. 2)
// URL: https://codeforces.com/problemset/problem/1918/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// Start: 14-02-2024 22:07:31
// Duration: 1:43:21
// End: 2024-02-14 23:50:52
// Rating: 1400
#include <bits/stdc++.h>
using namespa... | ALGO | 0.999972 | 5.494738 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2022-12-23T22: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": "b63f02670... |
4aeab4c6-e5cd-48cb-8f4c-f7719fe24224 | pushrsp/Algorithm | 백준/Silver/30875. Recovering the Region/Recovering the Region.cc | #include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
#define ll long long
using namespace std;
int N, Map[51][51];
int DY[4] = {-1, 0, 1, 0};
int DX[4] = {0, -1, 0, 1};
bool Visited[51][51];
bool in_range(int y, int x) {
return 1 <= y && y <= N && 1 <= x && x <= N;
}
void ... | ALGO | 0.999937 | 4.359022 | {
"github_metadata": {
"branch": "main",
"commit_count": 1110,
"repo_created_at": "2022-05-23T09:32: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": "a7ae11f55... |
b7b14222-c461-4448-b063-406772bd183c | kloseyan/kornblume | codeforces/262/B.cpp | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define LENGTH 100001
int a[LENGTH];
bool cmp(int a, int b) {
return a < b;
}
bool even(int p) {
return p % 2 == 0;
}
int sum1(int* a, int n) {
int total = 0;
for (int i = 0; i < n; i ++) {
total += a[i];
}
ret... | ALGO | 0.999981 | 3.930237 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2013-01-11T05:25:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30c56fb12f... |
57eb53df-9613-4dfe-a02a-aaa1e48913ff | DongChengrong/ACM-Program | UVA/11900-11999/11992.cpp | //尽管v始终大于零,但是我们需要把整个区间赋值为零,所以需要使用setv应该用-1做标记
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
#define N 140000
#define INF (100000000)
int ql, qr, r1, r2;
int r, c, m, op, v;
int _sum, _min, _max;
struct IntervalTree{
int add[N], sum[N], setv[N], minv[N], maxv[N];
void push... | ALGO | 0.999719 | 3.841753 | {
"github_metadata": {
"branch": "master",
"commit_count": 215,
"repo_created_at": "2017-07-26T00:35:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06841f6a... |
714d9b81-b8b2-4f49-a0ef-2c97a2fdd495 | brownfox2k6/Codeforces-solutions | CodeForces/GNU C++17/1029C | Maximal Intersection/223755565.cpp | /**
* author: brownfox2k6
* created: Sun 17 Sep 2023 23:38:09 Hanoi, Vietnam
**/
#include <bits/stdc++.h>
using namespace std;
#define N 300005
int L[N], R[N], prefL[N], prefR[N], sufL[N], sufR[N];
int ans;
main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
for (int i = 1; i <= n... | ALGO | 0.999983 | 4.860354 | {
"github_metadata": {
"branch": "main",
"commit_count": 331,
"repo_created_at": "2023-10-02T14:16: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": "eacb29fc3a... |
f8b78c97-24e5-4117-bfdd-b5e80d03a0cc | shizsun0609tw/UVA | 109 - SCUD Busters.cpp | #include<iostream>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<cstdlib>
using namespace std;
int cross(pair<int, int> P, pair<int, int> A, pair<int, int> B) {
return (A.first - P.first) * (B.second - P.second) -
(A.second - P.second) * (B.first - P.first);
}
int len(pair<int, int> P, pair<int, ... | ALGO | 0.99893 | 4.349849 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-04-26T11:57:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f04f291d09... |
77db3c36-87be-4713-bb75-cc5f62244c98 | Jikky1618/AtCoder | other-contest/dp/b.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = (1 << 30) - 1;
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
int main(){
cin.tie(nullptr);
ios::sync_with_... | ALGO | 0.999818 | 4.166666 | {
"github_metadata": {
"branch": "main",
"commit_count": 1910,
"repo_created_at": "2022-08-14T03:49:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf60c1c2c... |
a08b6d01-5e52-4bcf-8659-3223f977e57b | andavarapulikith/STRIVERS-SDE-SHEET-CHALLENGE | (104)karpalg.cpp | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
vector<int> stringMatch(string txt, string pat) {
vector<int> res;
int d = 256;
int q = 101;
int M = pat.length();
int N = txt.length();
if (M > N) {
return res;
}
int i, j;
int p = 0;
int... | ALGO | 0.999969 | 5.530077 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-06-06T04:46: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": "7a2a91549b5... |
2c5ae93c-8420-4e08-a16f-df1f4bdbf6f0 | shlomi1993/design-patterns | src/Composite.h | //
// Created by Shlomi on 15/04/2021.
//
#include <vector>
#include <algorithm>
#include <iostream>
#include <list>
#include <string>
#include "iostream"
// Composite is a structural DP that allows to create a dynamic hierarchy in a form of a tree where the leafs do the
// job and the composites have a list of child... | ALGO | 0.965631 | 5.221047 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-04-16T15:49:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3cd06b6f46d9... |
8cb5c4f7-ba73-4303-b6a5-7452c57332fc | kek-flip/bmstu-iu6 | Object-oriented programming/lab6/source.cpp | #include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <time.h>
using namespace std;
bool ascendingSort(int a, int b) {
return a > b;
}
bool descendingSort(int a, int b) {
return a < b;
}
void heapify(int arr[], int n, int i, bool (*comp)(int, int)) {
int chosenVal = i;
int l = 2 * i +... | ALGO | 0.999906 | 4.91125 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2022-08-04T08:56:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "295fce902d2... |
506edd6b-c740-4bb5-af4f-97f91897f2bf | GRTLCollaboration/Chombo | lib/src/AMRTools/QuadCFStencil.cpp | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
#include "QuadCFStencil.H"
#include "LayoutIterator.H"
#include "BoxIterator.... | ALGO | 0.998689 | 5.603288 | {
"github_metadata": {
"branch": "main",
"commit_count": 89,
"repo_created_at": "2018-01-30T14:07:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 16,
"forks": 12,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "761ae57d51... |
cb30e6d0-081f-48ad-b50f-1f4ec2e25487 | beomjunlim/codetree-TILs | 240518/2차원 폭발 게임/The-2D-bomb-game.cpp | #include <iostream>
#include <cstring>
using namespace std;
int n,m,k;
int ans;
int arr[100][100];
void bomb();
void gravity();
void rotation();
void rotation(){
int copy[100][100];
memset(copy, 0, sizeof(copy));
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
copy[j][i] = arr[n-i-1][... | ALGO | 0.999987 | 3.63634 | {
"github_metadata": {
"branch": "main",
"commit_count": 1537,
"repo_created_at": "2023-12-27T08:03:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f43d687ce... |
5533284f-9e75-43ca-a7b2-6e836c5ad02e | Trilasha/myCodingStuffs | CONTESTS_21_6_23_/HACKEREARTH/Nov_Easy/Range_Queries.cpp | /* <NAME> */
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define ff first
#defi... | ALGO | 0.999821 | 4.489108 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2022-09-21T15:16:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "650c383d8... |
dd444fc7-bafc-4b24-ba18-f8805f39e074 | hak0/eye_mouse | opencv_proj/mapping.cpp | #include "mapping.h"
void mappingModel::pushPoints(const cv::Point2d & eyePoint, const cv::Point2d & screenPoint)
{
eyePoints.push_back(eyePoint);
screenPoints.push_back(screenPoint);
}
void mappingModel::clear()
{
std::vector<cv::Point2d>().swap(eyePoints);
std::vector<cv::Point2d>().swap(screenPoints);
}
void ... | ALGO | 0.995711 | 4.508612 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-02-29T23:34:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "052e0fadf... |
f23a45a3-1099-4273-9435-b856a866eb9d | ILLUSE/Review_Project | Review_Project/pointer_swap.cpp | #include <stdio.h>
// 두 정수의 포인터를 받아서, 가리키는 값을 서로 바꾸는 함수
void swap(int* a_adress, int* b_adress) { //a와 b의 주소를 받음 / a_adress안에는 a의 주소(&a)가, b_adress안에는 b의 주소(&b)가 들어가있음
int temp = *a_adress; // 첫 번째 인자의 값을 임시 변수에 저장
*a_adress = *b_adress; // 두 번째 인자의 값을 첫 번째 인자가 가리키는 곳에 저장
*b_adress = temp; // ... | ALGO | 0.99848 | 5.438382 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-07-01T15:17: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": "467b51732af... |
7dcbc996-0df9-4a5f-a2fe-ae2ae74e59bb | LucasHenrique-dev/treino-maratona | exercicios_programacao_dinamica/cut_ribbon/cut_ribbon.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_PEDACO = 100000;
int pedacos[4009];
int cortar(int tamanho, int a, int b, int c) {
if (pedacos[tamanho] != -1) return pedacos[tamanho];
pedacos[tamanho] = -MAX_PEDACO;
if (tamanho >= c) pedacos[tamanho] = max(pedacos[tamanho], 1 + cortar(taman... | ALGO | 0.999848 | 3.858264 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2021-10-05T18:56: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": "df026e2710b... |
5835e58f-3b96-4f35-ab51-aea9305abb65 | fricai/competitive-programming | codeforces/216/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, a, b) for (auto i = (a); i < (b); ++i)
#define per(i, a, b) for (auto i = (b); i-- > (a); )
#define trav(e, x) for (auto &e : x)
#define eb(x...) emplace_back(x)
#define all(x) begin(x), end(x)
#define rall(x) (... | ALGO | 0.999973 | 3.270918 | {
"github_metadata": {
"branch": "master",
"commit_count": 2301,
"repo_created_at": "2021-09-29T18:57:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d00a1fe... |
fdf2e88e-ec5b-461d-a4d5-381a53719789 | HTI-OVGU/task-mapping-evaluator | TaskMapping/PEFTMapper.h | #pragma once
#include "TaskMapperWithSchedule.h"
#include "TopologicalSorting.h"
#include <unordered_map>
#include <list>
class PEFTMapper : public TaskMapperWithSchedule {
public:
Mapping get_task_mapping(System const& sys) const {
Mapping mapping;
task_schedule = std::priority_queue<std::pair<Time, Task*>>();... | ALGO | 0.954662 | 6.084603 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-10T14:31:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff81daaa5d9e... |
defcb4b4-258b-4e7d-8c21-cbf41f53968c | takashigoto1207/atcoder | abc2xx/abc258/abc258_b.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using namespace atcoder;
using ll = long long;
const int di[] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int dj[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int main() {
int N;
cin >> N;
vector<vector<int>> A(N, v... | ALGO | 0.999845 | 4.613047 | {
"github_metadata": {
"branch": "main",
"commit_count": 1239,
"repo_created_at": "2021-12-11T07:36: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": "4aa74bd5a... |
bbe03013-d16d-4db9-bc93-599d08e3ec6f | sudhanshugautam2911/CPP | DSA/2_recursion_aman.cpp | #include<iostream>
using namespace std;
// Question 1*
bool sorted(int arr[], int n) {
if (n==1)
{
return true;
}
bool resetArray = sorted(arr +1, n-1);
return arr[0] < arr[1] && resetArray;
}
// Question 2
void dec(int n) {
if (n==0)
{
return;
}
cout <<... | ALGO | 0.999857 | 4.450341 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2022-08-17T08:33: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": "456af561d42... |
666e7f3c-b247-40fe-8d2f-bdcfd5addde4 | kevininder/Stanford-Algorithms-Specialization | Course4/Week4/assignment.cpp | /* Iconic 2SAT problem with concept of CNF, implication graph and Kosaraju's algorithm.
Note to self, normal array is way faster than map in this regard.
But in order to tackle all six graphs at the same time, only map seems to work.
*/
#include <iostream>
#include <fstream>
#include <map>
#include <vector>
#in... | ALGO | 0.998441 | 4.535599 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-11-13T07:32:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc4f08e53ed... |
40b43b2a-7e20-4fcf-b87b-a6d4ead5d2cc | chenchuw/EC327 | happy.cpp | // Copyright 2020 <NAME> <EMAIL>
// Working principle:
// After conducting the happy number calculation,
// happy number will result in 1
// unhappy number will result in 4
#include <iostream>
using std::cin;
using std::cout;
int happycalculator(int num) {
int rem = 0, sum = 0;
while (num > 0) {
rem = num % ... | ALGO | 0.999405 | 3.964936 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-11-08T19:53: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": "b981befecc08... |
5b9d9361-c1ad-479e-8b9b-6d6311621655 | skyguidance/intelparallelcourse | Week4-Memory Traffic/memory-fft/worker.cc | #include <mkl.h>
#include <hbwmalloc.h>
#include <string.h>
// Reference:https://github.com/1UC1F3R616/Fundamentals-of-Parallelism-on-Intel-Architecture/tree/master/week%204
//implement scratch buffer on HBM and compute FFTs, refer instructions on Lab page
void runFFTs(const size_t fft_size, const size_t num_fft, MKL_... | ALGO | 0.989507 | 4.515032 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-12-12T04:04:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccf61bb65d... |
a40680b8-8768-4e91-923a-d258488b5dec | ChangmooMoon/PS | boj/14503.cpp | #include <iostream>
using namespace std;
int dr[] = {-1, 0, 1, 0}; // 북동남서
int dc[] = {0, 1, 0, -1};
int n, m;
int r, c, d; // (r,c), 0123
int a[50][50]; // 빈칸 0, 벽 1, 청소2
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
cin >> n >> m;
cin >> r >> c >> d;
... | ALGO | 0.999572 | 4.733174 | {
"github_metadata": {
"branch": "main",
"commit_count": 269,
"repo_created_at": "2020-10-19T05:36: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": "95e5f0e811... |
8d12a6c6-6353-4ee5-843b-8d262c718f50 | Deepali-Srivastava/data-structures-and-algorithms-in-cpp | sorting/merging.cpp | /*
Copyright (C) <NAME> - All Rights Reserved
This code is part of DSA course available on CourseGalaxy.com
*/
#include<iostream>
using namespace std;
#define MAX 20
void merge(int a1[], int a2[], int temp[], int n1, int n2);
int main()
{
int a1[MAX], a2[MAX], temp[2*MAX], n1, n2, i;
cout << "Enter the numbe... | ALGO | 0.999954 | 4.61778 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2022-02-18T11:16:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "367c0e123c2... |
833f2434-829e-42a5-a1c6-15232710ba45 | datovard/ParallelNeuralNets | 4 - OpenMPI Multilayer Perceptron/NeuralNetworkTrain.cpp | #include <sys/time.h>
#include <mpi.h>
#include "../util/FileReading.cpp"
#include <iostream>
#include <fstream>
#include <cstring>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <iterator>
#include <algorithm>
using namespace std;
// Training image f... | DATA | 0.998471 | 4.684225 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2021-11-12T04:31: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": "46b692988... |
72772aa0-d32a-493d-8a07-c80ea57edcf8 | Shriya-Jaiswal/DSA_POTD_Questions_solving | 567_Array_to_BST_GFG.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int data){
this -> data = data;
this -> left = NULL;
this -> right = NULL;
}
};
Node* insertIntoBST(Node* root, int dat... | ALGO | 0.999982 | 5.644026 | {
"github_metadata": {
"branch": "main",
"commit_count": 768,
"repo_created_at": "2023-10-01T15:53:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ba39830cc... |
a413bffd-e1e0-45d4-b8b3-60e22eb9b2a0 | ryancoleman/lotsofcoresbook2code | Pearls2_Chapter09/Dependencies/src/qdpxx/include/scalarsite_sse/sse_blas_vscal3_g5.h | // $Id: sse_blas_vscal3_g5.h,v 1.4 2007-08-20 17:08:14 uid4709 Exp $
/*! @file
* @brief Generic Scalar VAXPY routine
*
*/
#ifndef QDP_SSE_BLAS_VSCAL_G5
#define QDP_SSE_BLAS_VSCAL_G5
#if defined(__GNUC__)
#include "qdp_config.h"
#include "qdp_sse_intrin.h"
namespace QDP {
#if BASE_PRECISION==32
// (Vector) ... | ALGO | 0.97855 | 5.928607 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2015-08-31T00:21:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 38,
"forks": 24,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aee1aee... |
c39fa5e8-4725-4968-a7e8-b275b4d6456a | iFocusing/DataStructure_2013_C | cpp算法——助教给的资料/图元识别.cpp | #include <iostream>
#include <queue>
using namespace std;
int map[9][9]= {{0,0,0,0,0,0,0,0,0},
{0,0,0,1,0,0,0,0,0},
{0,0,0,1,1,0,0,0,0},
{0,0,0,0,0,1,0,0,0},
{0,0,0,0,1,1,0,0,0},
{0,0,1,0,0,1,0,1,0},
{0,1,1,1,0,0,0,1,0},
... | ALGO | 0.999495 | 3.383119 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-06-27T05:44: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": "bdd8ca2b1e... |
ea55e8cc-03c5-4828-872f-85e85e4c3123 | EelKor/Beakjooon_Problem_Solving | cpp/2693.cpp | #include <iostream>
#include <algorithm>
int main()
{
int count = 0;
std::cin >> count;
int** pp_num;
pp_num = (int**)malloc(sizeof(int*) * count);
for (int i = 0; i < count; i++)
{
*(pp_num + i) = (int*)malloc(sizeof(int) * 10);
}
for (int i = 0; i < count; i++)
... | ALGO | 0.998398 | 3.798657 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2022-03-27T16:33: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": "c3aed992f... |
19feb581-17b8-43f2-ae89-3179e3a9b1bb | tabletan1/c-code | Valid Palindrome/Valid Palindrome/main.cpp | //
// main.cpp
// Valid Palindrome
//
// Created by <NAME> on 5/12/16.
// Copyright © 2016 <NAME>. All rights reserved.
//
#include <iostream>
#include <string>
using namespace std;
bool isPalindrome(string s);
int main(int argc, const char * argv[]) {
// insert code here...
string a = "1a2";
bool b ... | ALGO | 0.991353 | 4.982653 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-04-09T23:14: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": "088d173cbb... |
97299616-9db9-47f8-9c67-f3b216513a28 | liu-moon/slambook | src/ch7/src/triangulation.cpp | #include <rclcpp/rclcpp.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <chrono>
#include <cv_bridge/cv_bridge.hpp>
#include <sensor_msgs/msg/image.hpp>
#include <opencv2/calib3d/calib3d.hpp>
using namespace std;
using namespace cv;
cl... | ALGO | 0.982652 | 5.671543 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2024-10-11T15:08: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": "53bfbda4dad... |
da579a9f-c0e6-4c3c-9a6f-3adce3a61d89 | IiroAijala/OlioOhjelmointiSyksy2023 | kotitehtava1/main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
int game (int maxnum) {
std::srand(std::time(0));
int answer = std::rand() % maxnum + 1;
int guess;
int attempts = 0;
std::cout << "Guess a number between 1-" << maxnum << "." << std::endl;
do {
std::cout << "Guess: ";
std... | ALGO | 0.968031 | 3.918603 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-09-03T15:11: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": "6bc5d3ef174f... |
9ce7b9f6-2d53-4683-bc15-897828c2c345 | dhruvvarshney1/sudo-solver | main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <TGUI/TGUI.hpp>
using namespace std;
// Function prototypes
int validateCol(int column, int grid[][9], int candidate);
int validateRow(int rowIndex, int grid[][9], int candidate);
int validateBox(int rowIndex, int column, int grid[][9], int candidate);
... | ALGO | 0.965282 | 6.817497 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-11T04: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": "03a2d71d0100... |
a8d102c3-dd67-4d7c-8f13-5808a263ac0d | EarthMessenger/icpc-snippet | verify/math/subset_convolution.test.cpp | #define PROBLEM "https://judge.yosupo.jp/problem/subset_convolution"
#include "lib/math/convolution.hpp"
#include "lib/math/static_modint.hpp"
signed main()
{
using namespace std;
ios::sync_with_stdio(false); cin.tie(0), cout.tie(0);
using mint = static_modint<998244353>;
auto read_int = [x = int()](... | ALGO | 0.999857 | 4.133797 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2023-05-28T05:30:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1f15f091... |
d7aeb7a5-3abb-4424-befe-ee239c4419dc | thierry-sousbie/DisPerSE | src/mse/sortID.hxx | /*
# Copyright (C) 2009-2013 <NAME>
# University of Tokyo / CNRS, 2009
#
# This file is part of porject DisPerSE
#
# Author : <NAME>
# Contact : <EMAIL>
#
# Licenses : This file is 'dual-licensed', you have to choose one
# of the two licenses below to apply.
#
... | ALGO | 0.994689 | 5.724673 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2015-09-22T00:45:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 44,
"forks": 24,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "65245f... |
318b286b-e4b4-4707-8a94-5ea176507883 | alvaro9rqc/programacion-competitiva | uva/439-Knight-Moves.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int movx[] = {1,1,-1,-1,-2,-2,2,2};
int movy[] = {2,-2,2,-2,1,-1,1,-1};
bool chess[8][8];
int main () {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string org, dest... | ALGO | 0.99996 | 4.472591 | {
"github_metadata": {
"branch": "main",
"commit_count": 340,
"repo_created_at": "2024-01-30T22:23:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "336021c8a8... |
22cde049-9cee-4a6f-87ae-4ddb1ce0769e | kinetic-rb/kinetic-rb.github.io | code/P1019.cpp | #include <iostream>
using namespace std;
string str[20];
char use[20];
int length, n;
inline static int match(string str1, string str2) {
for (int i = 1; i < min(str1.size(), str2.size()); i++) {
bool flag = true;
for (int j = 0; j < i; j++)
if (str1[str1.size() - i + j] != str2[j])
flag = fa... | ALGO | 0.99997 | 3.385392 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2022-11-19T06:37: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": "b1d15a6909b... |
544766da-8fab-4883-8bd1-8a278fda7de6 | Bernini0/Codes | atcoder_practise/Given Length and Sum of Digits.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int m, n;
scanf("%d %d", &m, &n);
int k = n;
k--;
if(n==0 && m != 1){
printf("-1 -1\n");
return 0;
}
if(m==1 && n==0){
printf("0 0\n");
return 0;
}
char arr[m];
if(n > m*9){
printf(... | ALGO | 0.999965 | 3.408177 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-08-08T08:01: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": "ad34cf1e49d2... |
c0f8c861-b98c-4566-96bf-be7af61b926c | mejibyte/competitive_programming | UVa/11590 - Prefix lookup/11590.5.cpp | /*
Runtime error
*/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
using namespace std;
#define D(x) cout << #x " is " << (x) << endl
typedef unsigned long long uint64;
const int BUFSIZE = 512;
char buf[BUFSIZE];
struct node{
string s;
bool end;
node * left;
node * ri... | ALGO | 0.999819 | 3.44617 | {
"github_metadata": {
"branch": "master",
"commit_count": 355,
"repo_created_at": "2011-10-27T01:25:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 196,
"forks": 66,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "1d065... |
3f66fdc2-16e7-4763-ae19-e533667cd859 | Mertvy/PhysicsEngine | src/Engine/collision.cpp | //
// Created by Alex on 7/27/2023.
//
#include "collision.h"
#include "../util/Vector3D.h"
#include "world.h"
#include <math.h>
const float SPRING_CONSTANT = 100;
// check whether distance between objects is greater than sum of their radii, else apply a repulsive force
void circleCircleCollision(Circle* cir1, Circle... | ALGO | 0.997937 | 5.17676 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2023-07-19T01:39: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": "c5881930a64... |
4a28a62e-4201-45bc-834c-31414d105d8e | ishandutta2007/codeforces-s | subscriber/normal/653/G.cpp | #include<stdio.h>
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<memory.h>
#include<map>
#include<set>
#include<queue>
#include<list>
#include<sstream>
#include<cstring>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define SS stringstream
#define sqr... | ALGO | 0.999941 | 4.054752 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e3a9bd093d8... |
f9aa8534-6f32-4d08-a038-165655052c56 | gupta-manas6268/learning-C | TLE Eliminators/TLE Eliminators Level-3/Ch-005/004_Quiz.cpp | // Write it in 'Register-Notes' immediately, gadhe.
// I think about it's Solution, but write it in
// 'Register-Notes' because it is Hard-Question.
// Correct.
// This is Mentor's code.
// <NAME>
// https://codeforces.com/contest/1992/problem/F
#include<bits/stdc++.h>
using namespac... | ALGO | 0.999858 | 5.195333 | {
"github_metadata": {
"branch": "main",
"commit_count": 569,
"repo_created_at": "2023-05-18T17:22:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9d76fa6335... |
6a0c81d0-8f57-4602-9bc2-c7060efdf32d | SurabhiMahale/Design-and-Analysis-of-Algorithms | merge_sort_simplified.cpp | #include <iostream>
using namespace std;
void merge(int arr[], int low, int mid, int high) {
int leftSize = mid - low + 1;
int rightSize = high - mid;
int left[leftSize], right[rightSize];
for (int i = 0; i < leftSize; i++) //copying into left subarray
left[i] = arr[low + i];
for (... | ALGO | 0.999996 | 5.713885 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-05-01T18:17: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": "bdebea8454ac... |
6aa6b0e1-0a84-4890-a75b-0811e618f20f | YashavikaSingh/leetcodegrind | mostfreqsubs.cpp | #include <vector>
#include <string>
#include <iostream>
#include <map>
#include <algorithm>
using namespace std;
string most_freq(string word, int length)
{
map<string, int> m;
for (int i = 0; i < word.size(); i++)
{
string subs = word.substr(i, length);
cout << "subs: " << subs << endl;
... | ALGO | 0.999948 | 4.555251 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2020-10-17T16:52: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": "e1dc59fe09e... |
a9a66b04-4e9e-4424-b010-285dd6ed944d | RickyL-2000/cpp-learning | Algorithm/Data_Structure(Summer2020)/pp07_tree.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
int main() {
int left[12],
right[12];
bool visited[12];
fill(left, left+12, -1);
fill(right, right+12, -1);
fill(visited, visited+12, false);
int n, root;
char temp1, temp2;
scanf("... | ALGO | 0.999951 | 3.277464 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2019-06-15T01:55:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b33af81e... |
e3be27f6-f0ca-40d5-9663-74e20710433f | miiitomi/atcoder | other/practice2/k.cpp | #include <bits/stdc++.h>
#include <atcoder/modint>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
struct Data {
mint x;
int siz;
Data(mint x, int siz): x(x), siz(siz) {}
};
struct Act {
mint s, t;
Act(mint s, mint t): s(s), t(t) {}
bool operator==(const Act &other)... | ALGO | 0.999719 | 5.733205 | {
"github_metadata": {
"branch": "main",
"commit_count": 765,
"repo_created_at": "2021-03-02T13:45: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": "422bc55552... |
62c2251b-a6b1-479c-9a27-2786b69f1c65 | OmNikam04/pict_se_labs | CGL/revision/line_clipping.cpp | #include<GL/glut.h>
#include<bits/stdc++.h>
using namespace std;
const int xmax = 600, ymax = 600;
float u1, v1, u2, v2;
int flag = 0;// for lines to be drawn on mouse click
// window coordinates
int xl = 200, yl = 200, xh = 400, yh = 400;
struct code{
int t,b,r,l;
};
void init(){
glClearColor(1.0, 1.0, 1.0, 1.0... | ALGO | 0.99325 | 4.088984 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2023-04-27T02:38:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38a811376... |
d7dba77b-d829-4d49-835e-51269e73b153 | SephDB/Advent-of-Code | 2016/Day01.cpp | #include <iostream>
#include <string>
#include <string_view>
#include <array>
#include <map>
#include <charconv>
#include <numeric>
#include <algorithm>
#include <complex>
std::vector<std::string_view> split(std::string_view in, char delim) {
std::vector<std::string_view> ret;
std::size_t pos = 0;
while((p... | ALGO | 0.999673 | 5.235011 | {
"github_metadata": {
"branch": "master",
"commit_count": 241,
"repo_created_at": "2019-12-14T09:45:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0f95380... |
26e920a5-effe-4fc1-9f94-a2dc77c834cc | snehilchopra/Competitive-programming-solutions-to-uva-problems | uva_ahoypirates.cpp | //
// uva_ahoypirates.cpp
// Solution
//
// Created by <NAME> on 9/26/18.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string.h>
#include <queue>
#include <climits>
#include <unordered_map>
using namespace std;
int segm... | ALGO | 0.999572 | 3.902547 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-09-26T07:11:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "848eb28360... |
8629a8df-2bc5-47d5-89fe-039b654f5b9d | hritwik567/cplusplus-questions | 05-template-art-zip.cpp | #include <type_traits>
// ==================================================================
template<int... I>
struct Vector {};
template<typename>
struct remove_head;
template<int H, int... T>
struct remove_head<Vector<H, T...>>
{
static constexpr int val = H;
using type = Vector<T...>;
};
template<int, ... | TEST | 0.923836 | 5.752694 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-06-07T19:09: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": "5673df4b9a52... |
6be33ec9-6ba3-4711-848b-07b1d8d738ca | smjn/programs | ccpp/amazon/tree.cpp | #include <iostream>
#include "bits/stdc++.h"
using namespace std;
class tree{
public:
class node{
public:
node *left;
node *right;
int val;
node(int val){
this->left = nullptr;
this->right = nullptr;
this->val = val;
}
};
tree::node *root;
tree(){
root = nullptr;
... | ALGO | 0.999935 | 4.99593 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2015-07-23T00:21:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "84cdcdde... |
b948f158-b687-4033-8373-56ed1de0e77d | darthsuogles/phissenschaft | algo/hackerrank/birthday_bar.cxx | #include <cmath>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n; cin >> n;
vector<int> nums(n);
for (int i = 0; i < n; ++i) cin >> nums[i];
int m, d; cin >> d >> m;
// Rolling sum with bound check
int i = 0, j = 1;
int curr_sum = nums[0]... | ALGO | 0.999918 | 3.853574 | {
"github_metadata": {
"branch": "develop",
"commit_count": 190,
"repo_created_at": "2017-03-12T05:28:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52c9205... |
cd06c034-a41f-4bb3-8cb0-ed7c9894176d | mcastrorib/AstarPathfinder | src/PathFinder/mGrid.h | #ifndef GRID_H
#define GRID_H
// include Configuration file
#include "PathFinder.h"
using namespace std;
class mGrid
{
public:
int gridSize;
int gridDimX;
int gridDimY;
mNode *nodes;
int connectivity;
mGrid(int _dimX, int _dimY) : gridDimX(_dimX), gridDimY(_dimY), gridSize(_dimX*_dimY), connectivity(4)
{
n... | ALGO | 0.980646 | 3.992289 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2021-04-04T23:53:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98dd7a37deb... |
4e4d18a2-36c9-4179-868d-786480b3f91f | AGV-IIT-KGP/eklavya-2015 | move_base_ros_pkg/costmap_2d/src/footprint.cpp | /*
* Copyright (c) 2013, <NAME>, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of ... | ALGO | 0.999344 | 6.109653 | {
"github_metadata": {
"branch": "master",
"commit_count": 162,
"repo_created_at": "2015-05-08T18:43:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 43,
"issues": 23,
"pull_requests": 10
},
"file_meta": {
"content_id": "61d694... |
eee20a5d-b833-4538-8c4e-e463bce81ec0 | wm-kim/Problem_Solving | PS/Project1/Baekjoon/9252.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
string LCS(string str1, string str2) {
int m = str1.length();
int n = str2.length();
vector<vector<int>> dp(m + 1, vector<int>(n + 1, 0));
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
if... | ALGO | 0.999995 | 5.326882 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2023-05-07T11:16: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": "1e7efe64c8b... |
107b5a61-d8be-41e7-8508-280b79ce96be | JeevanPurohit11/Splitwise-Algorithm-Design | cash_Transaction_min.cpp | #include <bits/stdc++.h>
using namespace std;
//money splitwise algorithm
//graph implementation
//output=contain all details with transaction
//rakesh pay= 100 to jevven
//jeevan pay =50 to bhavesh
//bhavesh pay =40 to rakesh
ṇ
//our algo make above transaction sort to
//rakesh pay=50 to jeevan
//rakesh pay =10 to ... | ALGO | 0.999967 | 5.153172 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-02-22T07: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": "621d8138bb49... |
f852b224-60a2-47ba-b3c4-0e93c3955a7d | Manyahfernandez/LaboratorioAlgoritmos2 | Semana 10/arbol.cpp | #include <iostream>
using namespace std;
//En este caso color sera establecido de la siguiente manera para nodo Negro = 0, Rojo = 1
class Node {
public:
int color;
int info = -1;
int posicion = -1;
Node *parentNode;
Node *childLeft;
Node *childRight;
};
class arbolRojoNegro{
public:
... | ALGO | 0.999988 | 4.680702 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-05-06T15:31: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": "c2770db0ece... |
7e74bbe6-4285-463f-a95a-c3160d425404 | martyushev/relPoseSolvers | solvePoly.h | #define THIRD 0.3333333333333333333
#define SQRT3 1.7320508075688772935
#define MAXIT1 50 // number of iterations for root isolating and polishing
#define ACC 1.e-15 // root is polished to an approximate accuracy ACC
// all real roots of a polynomial p(x) lie in (bound[0], bound[1])
// Kioustelidis' method
template ... | ALGO | 0.999925 | 4.008894 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2022-06-02T16:16:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6fbe64726d... |
97245252-6530-4f1d-8c00-5f405f5de0d6 | AhmedNabilHAL/problem-solving | 250DIVII - SRM523/250DIVII - SRM523/Source.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class AlphabetPath {
public:
string doesItExist(vector <string> letterMaze)
{
string alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int rows = letterMaze.size() - 1;
int cols = letterMaze[0].length() - 1;
int i = 0; int j = 0; int k = 1;
... | ALGO | 0.99982 | 3.868135 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-05-01T17:44: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": "6b01159fc8... |
964abca3-39ee-4e95-9bd6-20cb52acc197 | tawhidkuet04/LeetCode-Solve | 931-minimum-falling-path-sum/931-minimum-falling-path-sum.cpp | class Solution {
public:
// int solve(int i, int j, vector<vector<int>>& matrix, vector< vector<int> > &dp){
// if(i >= matrix.size() || j >= matrix[0].size() || j < 0) return 10000000;
// if( i == matrix.size() - 1) return matrix[i][j];
// if(dp[i][j] != - 1... | ALGO | 0.999997 | 5.842871 | {
"github_metadata": {
"branch": "main",
"commit_count": 1344,
"repo_created_at": "2021-12-25T09:19:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe25cfe79... |
d47bc795-58f5-4c32-8ada-3fbe34a734c7 | yuvimey/competitive_programming | codeforces/codeforces_12_01_22/main.cpp | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int main() {
int t;
cin >> t;
vector<int> results;
for(int i = 0; i <t; i++ ){
int n, l;
cin >> n >> l;
vector<int> count = vector<int>(l, 0);
for(int j = 0; j<n; j++){
int word;
... | ALGO | 0.999973 | 3.536896 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-11-16T13:26: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": "a0c1d973c2f8... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.