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 |
|---|---|---|---|---|---|---|---|
c5814bd8-5ad7-4466-87d0-fdd676df8c02 | sx760/DataStructAndAlgorithm | 04_symbolTable/OrderSymbolTable/OrderSymbolTable.h | #ifndef ORDERSYMBOLTABLE_H
#define ORDERSYMBOLTABLE_H
#include <iostream>
/**
* @brief 有序符号表
*
* @tparam Key
* @tparam Value
*/
template <class Key, class Value>
class OrderSymbolTable
{
private:
class Node
{
public:
Node(Key *key, Value *value, Node *next)
{
key_ = key... | ALGO | 0.924669 | 5.643767 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2022-03-18T11:17: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": "75571e628... |
539fafea-4464-475b-b8d9-910affdda62b | wchinny/concurrent-skip-queue | transactional/DLSM.h | #ifndef _DLSM_H
#define _DLSM_H
#include "SharedSkipList.h"
class DLSM {
public:
SkipList **skip_array;
SharedSkipList *shared;
int num_threads;
int num_inserts;
DLSM(int numThreads, int numInserts, int pRelaxation) {
num_threads = numThreads;
num_inserts = numInserts;
s... | ALGO | 0.958408 | 5.037116 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2019-02-22T19:21: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": "2a5cdfac6... |
79e6e44e-f4b1-453f-b55a-a6a0fdc643c0 | suryaguntursuprapto/ExerciseLinkedList_002 | ExerciseLinkedList_002/ExerciseLinkedList_002.cpp | #include <iostream>
#include <string>
using namespace std;
class Node {
public:
int rollNumber;
string name;
Node* next;
Node* suprapto;
};
class CircularLinkedList {
private:
Node* LAST;
public:
CircularLinkedList() {
LAST = NULL;
}
void addNode();
bool search(int rollno, Node** previous, Node** current);
... | ALGO | 0.99772 | 3.92156 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-06-08T03:36: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": "428ed32c01... |
a223ea98-6586-437e-a79b-fb11446d124a | mwy3055/Algorithm-codes | baekjoon/cpp/c++/16500.cpp | #include <bits/stdc++.h>
std::string s;
std::vector<std::string> a;
int dp[101];
void getinput()
{
std::cin >> s;
int n;
std::cin >> n;
for (int i = 0; i < n; i++)
{
std::string aa;
std::cin >> aa;
a.push_back(aa);
}
}
bool solve()
{
std::memset(dp, -1, sizeof(dp))... | ALGO | 0.999876 | 4.382349 | {
"github_metadata": {
"branch": "main",
"commit_count": 1073,
"repo_created_at": "2022-01-08T11:18:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af97534a0... |
a8f10bf6-ce62-491c-830c-0d170e45e840 | adu2706/DSA_CODES | Graph/KWALK.cpp |
#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int>> vis, dis;
int dx[] = {1, 2, 2, 1, -1, -2, -2, -1};
int dy[] = {2, 1, -1, -2, -2, -1, 1, 2};
bool check(int x, int y){
if (x < 0 || x >= n || y < 0 || y >= n) {
return false;
}
return true;
}
vector<pair<int,int>> neighbour... | ALGO | 0.999876 | 5.643921 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-08-09T16:08: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": "5f50c6da722... |
2d49f786-330e-4fca-9384-face235f8850 | nstroustrup/lifespan | external_compile_libraries/InsightToolkit-4.10.0/Modules/Core/Transform/include/itkRigid3DPerspectiveTransform.h | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... | TOOL | 0.937824 | 7.004284 | {
"github_metadata": {
"branch": "flow",
"commit_count": 1446,
"repo_created_at": "2012-10-31T22:29:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 16,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "47ec3dd... |
bbb35d1b-b055-4f36-a968-7cfd21b3b71c | CurrentReal/HR | HR/Algorithms/Implementation/Manasa and Stones.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
/*
3, 1, 2
0 (+1) 1 (+1) 2
0 (+1) 1 (+2) 3
0 (+2) 2 (+1) 3
0 (+2) 2 (+2) 4
4, 10, 100
0 (+10) 10 (+10) 20 (+10) 30
0 (+10) 10 (+10) 20 (+100) 120
0 (+10) 10 (+100) 110 (+100) 210
0 (+100) 100 (+10) 110 (+10) 120
0 (+100) 100... | ALGO | 0.998917 | 3.131625 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2018-01-24T09:05: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": "ef77d3e37... |
94138ca9-b7fb-49b0-a6ad-fbb5799271f8 | shreejitverma/SDE-Interview-Prep | competitive-programming/Graph/Number of Operations to Make Network Connected.cpp | /*
https://leetcode.com/problems/number-of-operations-to-make-network-connected/
1319. Number of Operations to Make Network Connected
Medium
1515
25
Add to List
Share
There are n computers numbered from 0 to n-1 connected by ethernet cables connections forming a network where connections[i] = [a, b] represents a co... | ALGO | 0.999758 | 5.922787 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2021-07-03T14:09:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 14,
"issues": 0,
"pull_requests": 24
},
"file_meta": {
"content_id": "179b6d80... |
42d5eebe-6877-4809-a269-08be37980e83 | mikaepe/cppPro4 | matrix.cpp | // file: matrix.cpp
#include <iostream>
#include <iomanip> // for setprecision in operator<<
#include "matrix.hpp"
/* Source file for Matrix class.
* See matrix.hpp for declarations
* This class implements matrix using C-style array
* a[i+j*n] is the element on row i, col j i.e. A[i,j].
*/
using namespace std;
... | TOOL | 0.957832 | 5.386916 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2016-12-28T21:58: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": "25285772c... |
0e24918e-60fe-43f3-abbd-a9800b3e93bc | GGanj/LeetCode | 2864.最大二进制奇数/最大二进制奇数.cpp | /*
* @lc app=leetcode.cn id=2864 lang=cpp
*
* [2864] 最大二进制奇数
*
* https://leetcode.cn/problems/maximum-odd-binary-number/description/
*
* algorithms
* Easy (80.79%)
* Likes: 23
* Dislikes: 0
* Total Accepted: 30.1K
* Total Submissions: 35.6K
* Testcase Example: '"010"'
*
* 给你一个 二进制 字符串 s ,其中至少包含一个 ... | ALGO | 0.999834 | 5.414214 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-04-20T13: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": "41bc0e962b... |
2b8721f2-3155-40fb-9318-4ed6eb626f50 | hypre-space/hypre | src/FEI_mv/femli/mli_solver_kaczmarz.cxx | /******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
* HYPRE Project Developers. See the top-level COPYRIGHT file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
***************************************... | ALGO | 0.999835 | 4.231248 | {
"github_metadata": {
"branch": "master",
"commit_count": 12337,
"repo_created_at": "2018-11-19T20:42:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 763,
"forks": 210,
"issues": 132,
"pull_requests": 33
},
"file_meta": {
"content_id": "... |
d7c17c50-2154-4a56-8b8b-ae788d7600bb | Charly3012/CompetitiveP | CodeForces/Lghts in the morning idea 3.cpp | // Código para un semáforo
#include <bits/stdc++.h>
using namespace std;
bool individualCheck(int n, int d);
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n; // Traffic lights
int d; // Distance
bool control = true;
cin >> n >> d;
for (int i = 0;... | ALGO | 0.999953 | 3.707125 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2023-09-23T21:21: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": "7f5c19e4382... |
a1b8ff47-8840-4f46-bce5-0723ab2a649e | HlG4399/LeetCode-Answers | 240. Search a 2D Matrix II.cpp | /*
Problem Description:
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
Integers in each row are sorted in ascending from left to right.
Integers in each column are sorted in ascending from top to bottom.
For example,
Consider the following matrix:
... | ALGO | 0.99998 | 6.337339 | {
"github_metadata": {
"branch": "master",
"commit_count": 440,
"repo_created_at": "2017-07-17T09:30:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "432927ac... |
35a07a06-0956-47b7-9ab8-7f9b520d808e | S1ink/VisionServer | lib-vs/include/frc/spline/CubicHermiteSpline.h | // Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include <wpi/SymbolExports.h>
#include <wpi/array.h>
#include "frc/EigenCore.h"
#include "frc/spline/Spl... | ALGO | 0.987244 | 7.321783 | {
"github_metadata": {
"branch": "main",
"commit_count": 284,
"repo_created_at": "2021-11-10T03:09:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6e2b8be2a... |
aabda092-f17a-4877-a0a9-fbfc49ec50ad | jgelliott/BullsCowsGame | main.cpp | //library
#include <iostream>
#include <string>
//using namespace std;(only when one or few namespaces)
void PrintIntro();
void PlayGame();
std::string guess();
bool PlayAgain();
int main()
{
do
{
PrintIntro();
PlayGame();
}
while (PlayAgain() == 1);
return 0;
}
//functions
//print introductio... | TOOL | 0.98239 | 3.566912 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-01-07T19:05: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": "629953d99b... |
e0d20caa-c180-48b4-a5a9-2f805d5334c5 | wpilibsuite/allwpilib | wpimath/src/main/native/thirdparty/sleipnir/src/optimization/inertia.hpp | // Copyright (c) Sleipnir contributors
#pragma once
#include <Eigen/Core>
namespace slp {
/**
* Represents the inertia of a matrix (the number of positive, negative, and
* zero eigenvalues).
*/
class Inertia {
public:
int positive = 0;
int negative = 0;
int zero = 0;
constexpr Inertia() = default;
/... | ALGO | 0.983422 | 7.155754 | {
"github_metadata": {
"branch": "main",
"commit_count": 7447,
"repo_created_at": "2014-09-30T20:51:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1185,
"forks": 658,
"issues": 433,
"pull_requests": 134
},
"file_meta": {
"content_id": "d... |
a36ae1c1-b37d-4b03-98b1-497a9846b834 | SirPseudocode/Competitive-Programming | TOKI/TLX_PEMROGRAMAN_KOMPETITIF_DASAR/02. Matematika Diskret Dasar/E_PERKENALAN_KOMBINASI_DAN-ARITMATIKA-MODULAR.cpp | #include <bits/stdc++.h>
#include <numeric>
#define ll long long
#define ull unsigned long long
#define unset unordered_set
#define mset multiset
#define v vector
#define f first
#define s second
#define pb push_back
using namespace std;
const int mod = 1e9 + 7;
void precomputeCombination(int N, vector<vector<int>>& C... | ALGO | 0.99995 | 4.547403 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-07-02T15:21: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": "bc36955a34f... |
cd666ac7-caa3-4c94-b6ab-b19f87efdc76 | Vsherry/Practise | SortString.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <string>
#include <stdlib.h>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
vector<string> getWord(string worldList);
string reverse(string sentence);
vector<string> sortString(vector<str... | ALGO | 0.99992 | 4.007462 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-11-14T02:01: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": "3d8e80846... |
46b21a2a-df38-4803-9511-3ac9d604796b | pauvrepetit/POJ | 3169.cpp | // 构造图
// 找最短路
// 若有负环 则无解
// 若大于INF 则为无穷大
#include <cstdio>
#include <iostream>
#include <queue>
#define INF (0x7FFFFFF)
using std::cin;
using std::cout;
using std::endl;
using std::queue;
int main() {
int N, ML, MD;
cin >> N >> ML >> MD;
int num[1010][1010];
for (int i = 0; i <= N; i++) {
... | ALGO | 0.999949 | 3.746461 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2019-11-06T13:45: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": "674bf986c... |
e6ea318d-287d-4582-a269-97668ccbddab | TsotsosLab/SMILER | models/matlab/QSS/qdct_impl/hamilton_product.cpp | /**
* Copyright 2011 <NAME>. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of cond... | ALGO | 0.990264 | 5.931372 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2018-12-20T18:32:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 46,
"forks": 16,
"issues": 16,
"pull_requests": 7
},
"file_meta": {
"content_id": "b598a3... |
efbda14c-e8e6-4152-b4f3-cdf0af50fda6 | enlighten0707/CS158_OpenJudge_Solution | myOJ/1049_2/main.cpp | #include <iostream>
using namespace std;
const int MAXSIZE=1003;
int go[MAXSIZE],stack[MAXSIZE];
int n,m;
int pos=0;
class Queue
{
//private:
public:
int *elem;
int front;
int rear;
int currentLen;
public:
Queue();
~Queue();
bool isEmpty()const;
void enQueue(const int &x);
int deQu... | ALGO | 0.999983 | 3.830551 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-21T03:00: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": "31b0b97570... |
12c1d125-4a69-4067-892f-6d28fe8b52cc | Pesteves2002/AOC-2021 | 1-day/part2.cpp | #include <iostream>
#include <fstream>
#include <string>
int main()
{
std::ifstream input("input.txt");
std::string line;
int counter = 0;
if (input.is_open())
{
int values[3] = {-1, -1, -1};
int prev_sum = 0;
while (getline(input, line))
{
if (!prev_su... | ALGO | 0.999581 | 4.526373 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2021-12-01T18:28:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd3fd94f59... |
ca6660a0-d80e-44e3-bb22-a99899d0228d | dbkwce/CA22-23 | Assignment 1/2020BTEIT00059/main.cpp | /*
In this algorithm, we sort the array by divide and conquer method or partition method.
1. We consider a pivot at low position in each recursive call and run a while loop atleast once until (i>j) (i=low+1, j=high, pivot = arr[low]).
2. Find element greater than pivot with help of i and element less than p... | ALGO | 0.999997 | 5.667078 | {
"github_metadata": {
"branch": "main",
"commit_count": 206,
"repo_created_at": "2022-07-29T09:04:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 80,
"issues": 0,
"pull_requests": 66
},
"file_meta": {
"content_id": "f5fe4c9e... |
c725c650-cdc5-4f3c-a3aa-2cf2584e27d6 | didw/coding | algospot/algosrc/src/disjoint/disjoint.cpp | #include<cstdio>
#include<iostream>
#include<string>
#include<vector>
using namespace std;
// 트리를 이용해 상호 배제적 집합을 구현한다.
struct NaiveDisjointSet {
vector<int> parent;
NaiveDisjointSet(int n) : parent(n) {
for(int i = 0; i < n; i++)
parent[i] = i;
}
// u 가 속한 트리의 루트의 번호를 반환한다
int find(int u) const {
if(u ==... | ALGO | 0.999809 | 3.288529 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2015-12-01T04:53:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "77262cf41... |
aa8c27b4-86cf-4777-93b8-ae72bab4c926 | callmePicacho/Data-Structres | 编程作业/35.QQ帐户的申请与登陆.cpp | /*
#include<iostream>
#include<stdlib.h>
#include<string>
#include<cmath>
#define MAXTABLESIZE 1000000
using namespace std;
typedef struct Node Cell;
struct Node{
bool exist;
string acc; // 账号
string pas; // 密码
};
typedef struct HashTBL *HashTable;
struct HashTBL{
int TableSize;
Cell *users;
};
int Hash(int... | WEB | 0.990212 | 3.552622 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-05-08T11:51:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3576,
"forks": 513,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "5424... |
e8c7c851-bb0c-4e20-9555-037e1c7e44ad | cryoco/Paddle-NX | paddle/fluid/operators/controlflow/compare_all_op.h | /* Copyright (c) 2016 PaddlePaddle 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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... | TOOL | 0.922665 | 7.458554 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-05-17T02:12:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6591bf3f7918... |
e7f41ee0-8ed4-4f83-a5bc-38b6630df081 | ankitchy123/Leetcode | Divide & Conquer/427. Construct Quad Tree.cpp | /*
// Definition for a QuadTree node.
class Node {
public:
bool val;
bool isLeaf;
Node* topLeft;
Node* topRight;
Node* bottomLeft;
Node* bottomRight;
Node() {
val = false;
isLeaf = false;
topLeft = NULL;
topRight = NULL;
bottomLeft = NULL;
bot... | ALGO | 0.999979 | 6.442526 | {
"github_metadata": {
"branch": "main",
"commit_count": 497,
"repo_created_at": "2022-07-08T06:55: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": "a018eda51f... |
487fce73-3194-4786-9746-f7ef578bf772 | anthonygedeon/playground | exercism/cpp/protein-translation/protein_translation.cpp | #include "protein_translation.h"
#include <vector>
#include <iostream>
#include <string>
#include <map>
//TODO: Come back and refactor
namespace protein_translation {
const std::map<std::string, std::string> map{
{"AUG", "Methionine" },
{"UUU", "Phenylalanine"},
{"UUC", "Phenylalanine"}, ... | ALGO | 0.99925 | 5.008985 | {
"github_metadata": {
"branch": "main",
"commit_count": 485,
"repo_created_at": "2022-02-15T02:28: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": "d3370fada3... |
c9fa5a87-9441-4aa0-836a-786991625146 | man02123/leetcode-solutions | 0652-find-duplicate-subtrees/0652-find-duplicate-subtrees.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.999915 | 6.332398 | {
"github_metadata": {
"branch": "main",
"commit_count": 2280,
"repo_created_at": "2023-01-05T16:25: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": "085ba6980... |
41f65405-d1f6-4fd2-813d-d9350118ffa6 | cbrl/Hyperion | Math/src/geometry/geometry.cpp | module;
#include <algorithm>
#include <cmath>
#include <DirectXMath.h>
#include "datatypes/vector_types.h"
module math.geometry;
import :bounding_volume;
using namespace DirectX;
bool intersects(const f32_3& ray_origin, const f32_3& ray_direction, const BoundingSphere& sphere) {
const f32 a = std::pow(ray_direc... | ALGO | 0.997276 | 6.117482 | {
"github_metadata": {
"branch": "master",
"commit_count": 901,
"repo_created_at": "2019-04-24T22:05: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": "6f18d491... |
cd04078b-8c4b-4edd-be31-fa1ba95b4694 | Darmsztadt/Cpp | nauka_2/search_2/3.cpp | #include <iostream>
using namespace std;
void obliczPrzesunieciaKMP(int tablica[], string wzorzec, int M)
{
int i = 0, j = 0;
tablica[0] = -1;
for (i = 0, j = -1; i < M; i++, j++)
{
tablica[i] = j;
while (j >= 0 && wzorzec[i] != wzorzec[j])
j = tablica[j];
}
}
void prin... | ALGO | 0.999904 | 4.699369 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-05-25T17:53: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": "856db35ae0b2... |
9e6f049c-a3b1-41f4-92a4-635b0aa85378 | chloechsu/curve-smoothing | src/WillmoreFlow1D.cpp | #include "WillmoreFlow1D.h"
#include "Utility.h"
#include <cmath>
#include <iostream>
using namespace std;
namespace DDG
{
WillmoreFlow1D :: WillmoreFlow1D( Mesh& _mesh )
: mesh( _mesh )
{}
void WillmoreFlow1D :: integrate( double dt )
{
// TODO Compute the gradient (just call the appropriate... | ALGO | 0.995528 | 5.548691 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-09-13T14:33: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": "5ebecd1530... |
dd809c0d-1da2-4405-a6d1-1149f10eae7a | romeric/Fastor | Fastor/expressions/linalg_ops/unary_trace_op.h | #ifndef UNARY_TRACE_OP_H
#define UNARY_TRACE_OP_H
#include "Fastor/meta/meta.h"
#include "Fastor/simd_vector/SIMDVector.h"
#include "Fastor/tensor/AbstractTensor.h"
#include "Fastor/tensor/TensorTraits.h"
#include "Fastor/expressions/expression_traits.h"
#include "Fastor/expressions/linalg_ops/linalg_traits.h"
namesp... | ALGO | 0.979657 | 7.487732 | {
"github_metadata": {
"branch": "master",
"commit_count": 778,
"repo_created_at": "2016-05-24T01:40:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 795,
"forks": 76,
"issues": 31,
"pull_requests": 2
},
"file_meta": {
"content_id": "46ad... |
0c43435a-8274-487e-bd95-e9a79ca568b2 | Codemigod-666/CodingNinjasDSA-CPP | Arrays/arrangeNumbersInArray.cpp | // this program is to arrange the array in the provided way
#include <iostream>
using namespace std;
// #include "solution.h"
// this is the function for solution
void arrange(int *arr, int n)
{
//Write your code here
int j = 0;
if(n%2 == 1){
for(int i = 1 ; i<=n ; i+=2){
arr[j] = i... | ALGO | 0.999846 | 4.728872 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2023-01-21T10:27:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7f22c45878... |
91e5465d-8b82-4caa-aa74-fb1df89e5758 | RAJ4823/Codes | LeetCodes/paths-in-matrix-whose-sum-is-divisible-by-k/9-3-2023, 10_32_01 AM/paths-in-matrix-whose-sum-is-divisible-by-k.cpp | // Link: https://leetcode.com/problems/paths-in-matrix-whose-sum-is-divisible-by-k
/** Submission Info:
*
* AUTHOR: the_247 | <NAME>
* TITLE: paths-in-matrix-whose-sum-is-divisible-by-k
* RUNTIME: 405 ms
* MEMORY: 134.9 MB
* DATE: 9-3-2023, 10:32:01 AM
*
*/
// Solution:
class Solution {
public:
int ... | ALGO | 0.99996 | 6.076407 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2022-07-27T10:16:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1e4307e... |
a1ff9501-b1f7-4008-8ae6-e8525f78a440 | TalleresGuisao/RootLectures | Module1_cpp/lecture4/example5_busquedalineal.cpp | #include <iostream>
using namespace std;
int busquedaLineal( const int [], int, int );
int main(){
const int tamanioArreglo = 100;
int a[ tamanioArreglo ];
int claveBusqueda; // valor a localizar en el arreglo a
for ( int i = 0; i < tamanioArreglo; i++ ){
a[ i ] = 2 * i;
}
cout << "Introduzca... | ALGO | 0.999334 | 4.103224 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-06-12T04:17:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3b1908a09e1... |
3bcee18d-5ef4-4efb-91a2-529e03d594cd | Exawind/nalu-wind | include/edge_kernels/MomentumOpenEdgeKernel.h | // Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS), National Renewable Energy Laboratory, University of Texas Austin,
// Northwest Research Associates. Under the terms of Contract DE-NA0003525
// with NTESS, the U.S. Government retains certain rights in this software.
//
// This sof... | ALGO | 0.975787 | 6.784985 | {
"github_metadata": {
"branch": "master",
"commit_count": 2492,
"repo_created_at": "2018-05-03T15:39:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 137,
"forks": 93,
"issues": 18,
"pull_requests": 7
},
"file_meta": {
"content_id": "b519... |
4e442df2-8390-4b68-a1b8-b877ad971c4a | legendsovermyths/DSA | C++/WaterConnectionProblem.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
void dfs(int s, map<int, vector<int>> &graph, int &MI, vector<bool> &visited, vector<int> &ass)
{
visited[s] = true;
if (graph[s].size() == 0)
{
ass[1] = s;
... | ALGO | 0.999874 | 5.348407 | {
"github_metadata": {
"branch": "master",
"commit_count": 159,
"repo_created_at": "2020-09-28T20:13:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b684b417... |
df65ef7e-f561-4256-bf2e-66331b426108 | Ajay35/spoj | B/virtual_friends.cpp | /* 11503 - Virtual Friends */
#include<bits/stdc++.h>
using namespace std;
int r[100005], p[100005];
void init(int n) {
for(int i = 0; i <= n; i++)
r[i] = 1, p[i] = i;
}
int findp(int x) {
return p[x] == x ? x : (p[x]=findp(p[x]));
}
int joint(int x, int y) {
x = findp(x), y = findp(y);
if(x !=... | ALGO | 0.999977 | 4.009106 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2018-05-26T15:19: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": "559f83726... |
1b72e85f-ae22-41d4-9986-726aeda9bb58 | kendallb/scitech-mgl | src/snaprtl/complex/atan.cpp | /****************************************************************************
*
* Open Watcom Project
*
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
*
* This file contains Original Code... | ALGO | 0.950601 | 4.847262 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-03-28T05:40:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 42,
"forks": 14,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4e76a84... |
2f36ba02-d7f9-400e-9ce5-74d961b63902 | akotadi/Competitive-Programming | Interview/LeetCode/BinaryTree/Path Sum.cpp | /*
* Copyright (c) 2019 ManuelCH.
*
* This file is part of Interview-solutions
* (see https://github.com/akotadi).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of ... | ALGO | 0.999982 | 6.165011 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2019-03-21T19:12:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d892d7fc8... |
4550c523-2d79-4dd0-9d3c-b84b274f0eb7 | sandialabs/GenTen | src/Genten_GCP_SS_Grad_Streaming_Def.hpp | //@HEADER
// ************************************************************************
// Genten: Software for Generalized Tensor Decompositions
// by Sandia National Laboratories
//
// Sandia National Laboratories is a multimission laboratory managed
// and operated by National Technology and Engineering Soluti... | ALGO | 0.993108 | 5.741047 | {
"github_metadata": {
"branch": "master",
"commit_count": 1661,
"repo_created_at": "2023-06-13T18:01:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b5dc1f6... |
487987f4-3ccb-4f8c-bab2-a128fb7077d5 | leonardooliveira42/Exercicios-de-Ed | Lista 3/ex12.cpp | // Exercicio 12 - Pilhas dinamicas
// Estrutura de dados 1
// <NAME>
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
#include <stdlib.h>
#include <locale.h>
/*******************************************************************
DEFINIÇÃO DA PILHA
**********************************************************... | ALGO | 0.998602 | 4.386908 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-04-06T02: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": "b500e60c41... |
537c3589-e432-4fba-8b69-3415b93dc3cf | StarRocks/starrocks | be/src/exprs/min_max_predicate.h | // Copyright 2021-present StarRocks, Inc. 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required ... | TOOL | 0.935409 | 6.077178 | {
"github_metadata": {
"branch": "main",
"commit_count": 21361,
"repo_created_at": "2021-09-04T02:29:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10338,
"forks": 2050,
"issues": 499,
"pull_requests": 376
},
"file_meta": {
"content_id":... |
472e20e4-db3f-4179-9772-f099470e0894 | Kaustubh1504/Striver-s-A2Z-DSA-Sheet | graph/wordladder.cpp | class Solution {
public:
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
/*
1. set ds to store all the words in wordlist
2. do a bfs traveral {string,steps}
3. to get the children of each word change each word from a to z and check wheter it is pres... | ALGO | 0.999952 | 5.626466 | {
"github_metadata": {
"branch": "main",
"commit_count": 213,
"repo_created_at": "2023-03-02T05:15: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": "dca9786629... |
73e62d10-1ac4-4406-94c4-6e741b346ad9 | Lee-Duck-03/template_cp | codetumlumtala/Array Painting.cpp | #include<bits/stdc++.h>
#define MOD 1000000007
#define fo(i, n) for(int i = 0; i < (n); i++)
#define pb push_back
#define ff first
#define ss second
#define vt vector
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin())
u... | ALGO | 0.999935 | 3.575 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-28T04:16: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": "9933ba83b0f6... |
6d678d09-93c8-4175-ae9f-765685c5a113 | keaideni/2016_06_29 | OP.cpp | #include "OP.h"
struct Eigstruct
{
int q;
double lamda;
VectorXd state;
};
std::string itos(int i)
{
std::stringstream s;
s << i;
return s.str();
}
bool comp(const Eigstruct& a, const Eigstruct& b);
bool comp(const Eigstruct& a, const Eigstruct& b)
{
return (a.lamda > b.lamda);
}
OP::OP... | ALGO | 0.998122 | 3.812543 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-06-29T08:36: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": "d4a2bf1fd2... |
43e62b1e-66c8-4a95-9ab7-86fd685e604f | FahimShahriar273/Phitron | Basic Data Structures/Module 6/add_tail.cpp |
#include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node* next;
Node(int val)
{
this->val=val;
this->next=NULL;
}
};
void insert_at_tail(Node*&head, int v)
{
Node* newNode= new Node(v);
if(head == NULL)
{
head = newNode;
retu... | ALGO | 0.998769 | 4.235114 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2024-06-18T20:55: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": "a2c1107e0dd... |
5a56bbe3-d43b-4b37-88f4-d2c17fe2a4fd | sanduler/OSU-CS161 | Assignment 2/Project 2a/main.cpp | /*******************************************************************************
** Author: <NAME>
** Date: October 10th, 2021
** Description: Write a program that asks the user for five numbers and
** then prints out the average of those numbers
******************************************... | ALGO | 0.978121 | 4.092266 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2021-10-02T05:07: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": "f224e7503ad... |
ad6f984c-3fbc-4184-85c1-0f10c19e12e1 | shion0625/atcoder | atcoder.jp/abc229/abc229_c/Main.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i = 0; i < (n); ++i)
// エイリアス
using ll = long signed long;
using ull = long unsigned long;
using ld = long double;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
#define INF LONG_LONG_MAX // ll INF
#defin... | ALGO | 0.999987 | 3.928227 | {
"github_metadata": {
"branch": "main",
"commit_count": 410,
"repo_created_at": "2022-03-06T10:26:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "882724dc34... |
f178a23b-3a03-44cc-8a5a-8059db7876b6 | trenin17/LSS-LRTAstar | Visualization/Visualization/main.cpp |
//
// Disclaimer:
// ----------
//
// This code will work only if you selected window, graphics and audio.
//
// Note that the "Run Script" build phase will copy the required frameworks
// or dylibs to your application bundle so you can execute it on any OS X
// computer.
//
// Your resource files (images, sounds, fon... | TOOL | 0.943766 | 3.915809 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2021-03-18T13:00:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0302e5320... |
5a1945b3-5863-4216-b747-6372fbfe0d3f | NilanjanaLodh/OnlineJudge | SEPTLong16/CHEFNFRN.cpp | //<NAME>
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef vector<int> vi;
typedef vector<lli> vli;
typedef vector<bool> vb;
const lli inf= 9000000000000;
const lli mod= 1000000007;
vector<vb> adj;
vector<vi> neigh;
vi color;
int n;
bool color_graph(int start)
{
int node,i,s;
... | ALGO | 0.999977 | 4.281257 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2016-07-08T10:05: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": "8500053f9... |
c8918888-959e-4a7b-9c46-90d27dbb9e18 | studouglas/GEANT4-GPU | geant4.10.02/source/processes/electromagnetic/polarisation/src/G4PolarizedBhabhaCrossSection.cc | //
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration... | ALGO | 0.974542 | 4.324533 | {
"github_metadata": {
"branch": "master",
"commit_count": 518,
"repo_created_at": "2015-09-13T23:36:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 40,
"forks": 18,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4144ea... |
844e0eda-e805-4ea8-8360-780ef5fee500 | virtyaluk/leetcode | problems/44/solution.cpp | class Solution {
public:
bool isMatch(string s, string p) {
int m = size(s),
n = size(p),
i = 0,
j = 0,
pAllMathStart = -1,
sAllMathStart = -1;
while (i < m) {
if (j < n and (p[j] == '?' or s[i] == p[j])) {
... | ALGO | 0.999935 | 5.405344 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-01-19T04:27:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1d4ac8e1... |
c011b4fe-97e7-4a71-9341-bebccfe12434 | thekartikwalia/DS_Course | DS_Lab/Q8_D.cpp | // ========================================= QUEUE USING LINKED LIST =========================================
#include <iostream>
using namespace std;
class Node{
public:
int data;
Node *next;
Node(int data){
this->data = data;
next = nullptr;
}
};
class Queue{
private:
Node *front;... | ALGO | 0.985361 | 4.871885 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2023-10-02T16:41: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": "3d832861fc0... |
40252795-ef7c-487a-a482-a73e9cae2d39 | ilpincy/argos3-kilobot | src/plugins/robots/kilobot/simulator/kilobot_communication_medium.cpp | #include "kilobot_communication_medium.h"
#include "kilobot_entity.h"
#include <argos3/core/simulator/entity/embodied_entity.h>
#include <argos3/core/simulator/simulator.h>
#include <argos3/core/simulator/space/space.h>
#include <argos3/core/simulator/space/positional_indices/grid.h>
#include <argos3/core/utility/confi... | TOOL | 0.923771 | 7.083921 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2015-09-24T13:44:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 13,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "763e260... |
ba8108f4-ac4d-4bbe-827c-911a06065500 | ssafy11-study/algorithm | src/week7/30504_1조_정종화.cc | // Subject: Study of Algorithm with SSAFY
// ProblemNo: B30504
// Language: C++
// Author: pasta (JungJonghwa)
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <numeric>
using namespace std;
using lld = long long;
#define MX 200000
#define MOD 1000000007
#define fastio cin.tie(0)->sync... | ALGO | 0.999948 | 3.645405 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2024-02-17T08:42:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9175ddaa2fd... |
0b53b979-999a-48b7-9d13-2e2b12d37600 | HIITMetagenomics/dsm-framework | incbwt/parallel_build.cpp | #include <algorithm>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <vector>
#ifdef MULTITHREAD_SUPPORT
#include <omp.h>
#endif
#include "rlcsa_builder.h"
#include "misc/utils.h"
using namespace CSA;
double getRLCSA(RLCSABuilder& builder, const std::string& base_name);
double indexParts(std::v... | DATA | 0.965894 | 4.581302 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2013-08-21T13:05:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f64f0a101... |
b1409c6e-5a75-4e14-9494-c2158a4bf050 | kidaa/Parallel-Algorithms | cilklab/sorting/sortTime.cpp | #include <iostream>
#include <algorithm>
#include "CycleTimer.h"
#include <cilk/cilk_api.h>
#include <getopt.h>
using namespace std;
#define ROUNDS_REPEAT 3
void serialSort(double *A, int n);
void parallelSort(double *A, int n);
void print_time(const char *desc, double start, double end) {
printf("%s:\t%.3fs", de... | ALGO | 0.997907 | 5.482595 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-12-29T15:12:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6c1869ebb... |
fac8c1a8-cdef-4a6f-b8a2-75565b0330ad | squaresLab/BatFix | results/transcoder/translations/py/EULERIAN_PATH_UNDIRECTED_GRAPH.cpp | void findpath ( vector < vector < int >> & graph ) {
int n = graph . size ( ) ;
vector < int > numofadj ;
for ( int i = 0 ;
i < n ;
i ++ ) numofadj . push_back ( sum ( graph [ i ] ) ) ;
int startpoint = 0 ;
int numofodd = 0 ;
for ( int i = n - 1 ;
i >= 0 ;
i -- ) {
if ( ( numofadj [ i ] % 2 == 1... | ALGO | 0.999998 | 4.122281 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-05-21T15:21:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "575aefea6c25... |
0aa6f9c2-0017-4705-b766-4bdae9c99f24 | cwong907/CSCI1300 | hmwk5/readBooks.cpp | // CSCI 1300 Fall 2019
// Author: <NAME>
// Recitation: 203 - <NAME>
// Homework 5 - Problem 2
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
/*
1. Write a main function that stores 2 arrays, the size of the array, a file name (books.txt), and the number of books stored.
2. Write a func... | TOOL | 0.995303 | 5.309373 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-07-25T20:59:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "893ec7ce5... |
75393a7f-6842-4283-a419-9f2d1c7d269c | Tudat/tudat | src/astro/ephemerides/fullPlanetaryRotationModel.cpp | /* Copyright (c) 2010-2019, Delft University of Technology
* All rigths reserved
*
* This file is part of the Tudat. Redistribution and use in source and
* binary forms, with or without modification, are permitted exclusively
* under the terms of the Modified BSD license. You should have received
*... | ALGO | 0.976605 | 7.552061 | {
"github_metadata": {
"branch": "master",
"commit_count": 6497,
"repo_created_at": "2016-01-22T10:01:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 87,
"forks": 148,
"issues": 1,
"pull_requests": 7
},
"file_meta": {
"content_id": "5bd6c... |
f99ebef9-6312-401b-aa3f-0e159781007b | TanzimRusho/OLD-MATERIALS | Online_Judge/UVA_Solutions/11278 - One-Handed Typist Character Output.cpp | /*
* Author: Quickgrid ( <NAME> )
* Site: https://quickgrid.wordpress.com
*/
#include<stdio.h>
#define N 128
#define IO 1001
/**
* Heart of the problem. Be careful with mapping, one typo in mapping and the verdict is wrong.
* Here standard contains all the characters in standard keyboard including capital an... | ALGO | 0.999687 | 4.097216 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-08-11T20:01: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": "aa5afa123a... |
ac79c3fb-2258-44db-b24c-3c83da16e023 | songboning/SuperTyper | SuperTyper/analyse.cpp | #include "analyse.h"
Analyse::Analyse(const char* data, int len)
{
for(n=1; n<len; n<<=1);
x = new complex<double>[n];
for(int i=0; i<len; i++)
x[i] = complex<double>((double)data[i]);
}
Analyse::~Analyse()
{
delete [] x;
}
bool Analyse::fft(int on)
{
if(abs(on) != 1)
return false... | ALGO | 0.964962 | 4.221004 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-06-16T08:22: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": "017620203d... |
4720f296-ea5e-4189-a333-a82cde38c80d | fryzito/ACM-problems-solved | UVA/UVA_550.cpp | #include <bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define ii pair<int,int>
#define vii vector<ii>
#define REPN(i,x,y) for(int i=x;i<y;i++)
#define REP(i,y) REPN(i,0,y)
#define REPR(i,y,x) for(int i=y;i>=x;i--)
#define CLR(A,x) memset(A,x,sizeof(A))
#define INF (1<<30)
#define EPS (1e-9)
#define ALL(v... | ALGO | 0.999395 | 3.371056 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2015-01-08T18:11: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": "4cb03b22eef... |
398cfdeb-94da-422b-b652-274625308e8c | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/sate/bfs_lee/train/0f7499a5-40ad-11ec-af88-dc7196033e92.cpp | #include <fstream>
#include <vector>
#include <queue>
using namespace std;
void citire( int &n, vector< pair<int, int> >* &la, int &x, int &y, ifstream &f)
{
int m, it, i, j, cost;
f >> n >> m >> x >> y;
la = new vector< pair<int, int> >[n+1];
for(it = 1; it <= m; it++)
{
... | ALGO | 0.999635 | 3.281597 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-03-06T17:44:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db2cf2be61622... |
769f9af0-0f1e-4ea0-93eb-f9a88b13da20 | deagman/SVD | rocSOLVER-rocm-5.4.3/library/src/lapack/roclapack_getri.cpp | /* ************************************************************************
* Copyright (c) 2019-2021 Advanced Micro Devices, Inc.
* ************************************************************************ */
#include "roclapack_getri.hpp"
template <typename T, typename U>
rocblas_status rocsolver_getri_impl(rocbla... | ALGO | 0.98788 | 6.706755 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-10-14T13:51: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": "61ba2aa2e4fc... |
b45bc512-151a-44da-ac7e-d11e23097772 | d1l1ne/OOP-3 | main.cpp | #include <iostream>
#include <string>
#include <fstream>
#include "shape.h"
#include "parallelogram.h"
#include "base-types.h"
#include "rectangle.h"
using namespace std;
Shape* sortshapes(Shape** shapearray, int len);
void shapesfromfile();
string delSymbol(string str, char symbol);
int main() {
cout << "Creati... | TOOL | 0.986436 | 3.508253 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-17T14:55: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": "3ed462705926... |
7e4bc679-eafc-4ef2-bbd8-091ae9d31435 | EnzoIdk/TA-Algoritmos-Avanzados | Prueba/Intento1/Genetico.h | #ifndef GENETICO_H
#define GENETICO_H
#include <vector>
#include "Mapa.h"
class Genetico {
public:
std::vector<int> mejorRuta;
//CONSTRUCTOR, COPIA, DESTRUCTOR
Genetico();
virtual ~Genetico();
//GETTERS Y SETTERS
void SetHoraActual(int horaActual);
int getHoraActual() const;
//M... | ALGO | 0.981873 | 4.516639 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2024-11-26T06:05: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": "b1354ee745e... |
77743912-b78a-440b-9e0c-692105c1da4c | alexandria-org/alexandria | src/indexer/index.h | /*
* MIT License
*
* Alexandria.org
*
* Copyright (c) 2021 <NAME>, <<EMAIL>>, et al.
*
* 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 limitati... | TOOL | 0.97659 | 6.315306 | {
"github_metadata": {
"branch": "main",
"commit_count": 796,
"repo_created_at": "2021-04-18T09:12:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 192,
"forks": 8,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "1352f827... |
8b941090-54f0-4d56-ba74-108d87f1b8d6 | minhazmiraz/Codeforces_AC_Submission | 295A[Greg_and_Array].cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
typedef pair< LL, pair< LL, LL > > pii;
LL n,m,k, arr[100005], tree[3][400005], lazy[3][400005];
pii Q[100005];
void push(int f, int i, int tl, int mid, int tr){
tree[f][2*i]+=lazy[f][i]*(mid-tl+1);
tree[f][2*i+1]+=lazy[f][i]*(tr-mid);
lazy[f][2*i]... | ALGO | 0.999986 | 4.364906 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-01-26T11:14: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": "787f0571d6... |
b5a67de2-f919-43a9-b9c4-f385f4a8861a | Lee-ji-soo/algorithm | 심화1/unionFind/unionFind.groupMemberCnt.cpp | // 그룹내의 사람 수 카운트 하기.
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int myBoss[10] = {0};
int sum[10] = {0};
int findBoss(int n)
{
if (myBoss[n] == 0)
{
return n;
}
int boss = findBoss(myBoss[n]);
return boss;
}
void setBoss(int t1, int t... | ALGO | 0.999901 | 3.538704 | {
"github_metadata": {
"branch": "main",
"commit_count": 426,
"repo_created_at": "2022-09-30T13:52: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": "3d3459a020... |
7edddf69-d526-4a43-89f7-5be21eeb3f7a | contact-vs/info | code_samples/cpp/ReaderWriter.cpp | #include <iostream>
#include <stack>
#include <shared_mutex>
#include <random>
//--------------------------------------------------------------
// Simple multithreaded reader-writer synchronization.
// Respectful to waiting writers, so they skip the line asap.
// In C++14 can be replaced with shared_timed_mutex/shared... | ALGO | 0.977591 | 6.989191 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2022-08-16T19:03: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": "59a2722f6ef... |
5f1a5c76-9697-46cd-8485-d0da9a9bb9ff | facebookincubator/velox | velox/connectors/hive/storage_adapters/s3fs/S3Util.cpp | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | TOOL | 0.918882 | 5.651876 | {
"github_metadata": {
"branch": "main",
"commit_count": 11073,
"repo_created_at": "2021-07-23T23:00:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3811,
"forks": 1370,
"issues": 880,
"pull_requests": 356
},
"file_meta": {
"content_id": ... |
8a6e52e4-a1d8-4c4b-a2ef-94c2a997fad7 | Bhola18coding/Striver-DP | 05-House Robber-I Or Max Adj Element/Lec05-HouseRob.cpp | //MEMOIZATION
// TC = O(N)
// SC = O(N)+O(N)
// class Solution {
// public:
// ///Maximum Adjacent Element
// int maxi(vector<int>&nums, int idx , vector<int>&dp)
// {
// //Base case
// if(idx==0)
// {
// return nums[idx];
// }
// if(idx<0)
// {
// ... | ALGO | 0.999914 | 5.372295 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-01-13T05:52: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": "1a7c357c0b5... |
eab20380-3b77-4c10-b58d-4695e1e59fcd | devashish1099/C-CPP | heapSort.cpp | #include<iostream>
using namespace std;
void heapify(int A[] , int n , int i){
int parent = i;
int left = i*2;
int right = 2*i+1;
if(A[left-1] > A[parent-1] && left <= n){
parent = left;
}
if(A[right-1] > A[parent-1] && right <= n){
parent = right;
}
if(parent != i){
... | ALGO | 0.999897 | 4.831934 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-03-13T13:49: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": "509f745e95... |
93c5a74a-c389-4f12-9015-b3ec1a2cc935 | ctjandra/ddopt-cut | ddopt/src/problem/bp/bp_domains.cpp | /**
* Domain for binary problems
*/
#include "bp_domains.hpp"
void BPDomains::init(int _nvars)
{
nvars = _nvars;
nvars_set_zero = 0;
nvars_set_one = 0;
domains.resize(nvars + 2);
for (int i = 0; i < nvars; ++i) {
domains[i].domain = DOM_ZERO_ONE;
domains[i].var = i;
}
int start = start_index();
int end... | ALGO | 0.991091 | 6.30055 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-11-07T19:56:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6047eb5d7... |
13ee8686-4a41-486c-af05-830a414ad628 | NamYunje2002/algorithm | Boj_C++/20055.cpp | #include <bits/stdc++.h>
using namespace std;
/*
arr : 각 칸의 내구도 배열
robot : 로봇이 올라가 있으면 1, 없으면 0을 저장하는 배열
*/
int ans, arr[202], robot[202];
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, k; cin >> n >> k;
for (int i = 1; i <= 2 * n; i++) cin >> arr[i]; // 각 칸의 내구도 입력
int st = 1, en = n; //... | ALGO | 0.999972 | 3.731493 | {
"github_metadata": {
"branch": "main",
"commit_count": 195,
"repo_created_at": "2024-03-08T07:03: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": "19e15139f4... |
8b71200f-ad26-440c-bf34-190899a880ce | qpwoeirut/competitive-programming | AtCoder/AHC/023/0_sample.cpp | #include <vector>
#include <iostream>
#include <queue>
using namespace std;
int T, K, H, W, i0;
vector<int> S, D;
vector<vector<bool>> h, v;
void read_input() {
cin >> T >> H >> W >> i0;
h.resize(H - 1, vector(W, false));
for (int i = 0; i < H - 1; ++i) {
string s; cin >> s;
for (int j = 0... | ALGO | 0.999908 | 3.631005 | {
"github_metadata": {
"branch": "master",
"commit_count": 348,
"repo_created_at": "2020-09-17T05:10:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4146689... |
4c62de39-4d0c-4766-9893-79f6ccedd636 | ishandutta2007/codeforces-a | atreus/normal/35/B.cpp | #include <iostream>
#include <stack>
#include <map>
#include <fstream>
using namespace std;
string mp[60][60];
int main() {
ifstream fin("input.txt");
ofstream fout("output.txt");
ios_base::sync_with_stdio(false);
int n, m, k;
fin >> n >> m >> k;
for (int i = 1; i <= n; i++)
for (int ... | ALGO | 0.999812 | 3.590272 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e404492f7f87... |
3248e20c-aba9-42f1-a525-49a2c42caafd | Alex2262/AltairChessEngine | src/nnue.cpp | //
// Created by <NAME> on 6/16/23.
//
#include <iostream>
#include "nnue.h"
#include "position.h"
#ifdef _MSC_VER
#undef _MSC_VER
#endif
#include "incbin.h"
INCBIN(nnue, "src/ceres-net.bin");
// INCBIN(nnue, "/Users/alexandertian/CLionProjects/Altair/src/ceres-net.bin");
const NNUE_Params &original_nnue_parameter... | ALGO | 0.997347 | 6.642619 | {
"github_metadata": {
"branch": "master",
"commit_count": 825,
"repo_created_at": "2022-09-20T03:05:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 60,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09f7574... |
43148731-65c1-4b84-9c33-230cc2d7caf7 | kaushkay/learning_cplusplus | standard_template_library/containers/sequence_containers/vectors_capacity.cpp | /*
size() – Returns the number of elements in the vector.
max_size() – Returns the maximum number of elements that the vector can hold.
capacity() – Returns the size of the storage space currently allocated to the vector expressed as number of elements.
resize() – Resizes the container so that it contains ‘g’ elemen... | ALGO | 0.981197 | 4.465501 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-05-28T18:14:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2a46b41604... |
0297d7a5-868b-41ef-b37b-087367b6da03 | acsl-technion/eleos | face_verification_server/enclave_samples/trusted/face_verification/face_verification.cpp | #include <string.h>
#include "face_verification.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdint.h>
#include <sgx_trts.h>
#include <stdio.h>
#include "../samples.h"
#include "../samples_t.h"
#include <sys/types.h>
#include "Aptr.h"
#include "mem.h"
#include "../common_structs.h"
#include <sgx_tcrypto.h>
#de... | TOOL | 0.981346 | 3.834873 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-02-24T14:49:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 33,
"forks": 11,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "855bfcdf... |
c1610cc4-1b57-4f54-8472-d58471c96bf6 | tomzss/bezier-tests | code/Bezier.cpp | #include "Bezier.hpp"
#include <glm/exponential.hpp>
glm::vec2 lerp(glm::vec2 cref a, glm::vec2 cref b, float t) {
assert((0 <= t) and (t <= 1));
return (1 - t) * a + t * b;
}
glm::vec2 getBezierPointFor(glm::vec2 cref p0, glm::vec2 cref p1, glm::vec2 cref p2, glm::vec2 cref p3, float t) {
assert((0 <= t... | ALGO | 0.989643 | 6.41806 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-18T19:24: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": "b9841ddd1919... |
0660cde6-bd6d-4016-b615-4e28166eac5f | ZixuanWang1210/acm_ws | 数据结构/树上问题/P_3384_模板_轻重链剖分_树链剖分.cpp | #include <bits/stdc++.h>
#define endl "\n"
#define debug(x) cout << #x << ": -----> " << x << endl;
#define LL long long
// typedef long long ll;
// typedef unsigned long long ull;
#define int long long
using namespace std;
const int maxn=500005;
//son该节点的重儿子编号
//id对树重新标号的新编号,top[x] x所在链的链头节点的编号
int dep[maxn],pa[maxn]... | ALGO | 0.999923 | 4.4851 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2022-01-15T09:52: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": "6e17a47bf3... |
28dcb4ad-60e8-4735-9167-77d8162bb87f | OrigenesZhang/-1s | codeforces/R537/CF1111D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i)++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i)--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define sqr(x) ((x) * (x))
#define all(x) (x).begin(), (x).end()
#de... | ALGO | 0.999993 | 4.313421 | {
"github_metadata": {
"branch": "master",
"commit_count": 1525,
"repo_created_at": "2017-02-01T16:05:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ec7b2a... |
68605175-0c63-4746-acae-0b90a6a44a59 | Nalowo/BookDatabase | include/comparators.hpp | #pragma once
#include "book.hpp"
namespace bookdb::comp {
struct LessByAuthor {
bool operator()(const Book &lhv, const Book &rhv) const { return lhv.author < rhv.author; }
};
struct LessByGenre {
bool operator()(const Book &lhv, const Book &rhv) const { return lhv.genre < rhv.genre; }
};
struct GreaterByRa... | TOOL | 0.994147 | 6.464976 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-06-09T14:26: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": "c1770832a23a... |
4cb6530e-505f-4ef0-a355-d631e97de6b1 | chengts95/EED | EED_VC/seu_nsga2/crowddist.cpp | /* Crowding distance computation routines */
# include "basicfun.h"
# include <math.h>
/* Routine to compute crowding distance based on objective function values when the population in in the form of an array */
void assign_crowding_distance_indices(int nobj,population *pop, int c1, int c2)
{
int **obj_array;
... | ALGO | 0.999997 | 6.271676 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-01-15T13:45:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81005507d4... |
6c31a753-c50c-418d-a030-db17d0924bb3 | BadMisterH/HaliteAI | MyBot.cpp | #include "hlt/game.hpp"
#include "hlt/constants.hpp"
#include "hlt/log.hpp"
#include <random>
#include <ctime>
#include <unordered_set>
#include <algorithm>
#include <cmath>
using namespace std;
using namespace hlt;
struct ShipHaliteComparator {
bool operator()(const shared_ptr<Ship>& a, const shared_ptr<Ship>& b... | ALGO | 0.960785 | 4.164119 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-23T09:15: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": "fce17a6e138b... |
88211aa3-5b29-48ba-b17f-0c84ed85f66f | GRTLCollaboration/Chombo | lib/src/EBAMRElliptic/NeumannViscousTensorEBBC.H | #ifdef CH_LANG_CC
/*
* _______ __
* / ___/ / ___ __ _ / / ___
* / /__/ _ \/ _ \/ V \/ _ \/ _ \
* \___/_//_/\___/_/_/_/_.__/\___/
* Please refer to Copyright.txt, in Chombo's root directory.
*/
#endif
#ifndef _NEUMANNVISCOUSTENSOREBBC_H_
#define _NEUMANNVISCOUSTENSOREBBC_H_
#i... | ALGO | 0.940256 | 5.914971 | {
"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": "dfb0a2b49e... |
53a4ba1f-8c98-4929-85ac-d70da3a5a2eb | mothaibatacungmua/Algorithms-C-Plus | src/algorithms/graph/kruskal.cpp | /*
* Kruskal.cpp
*
* Created on: May 16, 2016
* Author: asm
*/
#include <stdio.h>
#include <iostream>
#include "../../../headers/data-structures.hpp"
#include "../../../headers/algorithms.hpp"
using namespace std;
using namespace DataStructures;
namespace Algorithms{
namespace GraphF{
bool Kru... | ALGO | 0.998828 | 5.478635 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2016-04-16T16:02:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39758f4cf... |
67611299-6afe-4a2e-9c7e-fd2cb2363f99 | ishandutta2007/codeforces-a | aropan/normal/1637/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin())
#define sz(v) ((int)(v).size())
#define vec1d(x) vector<x>
#define vec2d(x) vector<vec1d(x)>
#define vec3d(x) vector<v... | ALGO | 0.999761 | 4.566777 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2283e243a510... |
c99abd62-9661-4e52-931d-14fd7def7fb1 | Hades210/year17 | stage1/Cplusplus/Reference/Algorithm/replace_ifCheck.cpp | // file : replace_ifCheck.cpp
// template <class ForwardIterator, class UnaryPredicate, class T>
// void replace_if(ForwardIterator first, ForwardIterator last, UnaryPredicate pred, const T& new_value);
// Assigns new_value to all the elements in the range[first,last) for which pred returns true.
// The behavior of thi... | ALGO | 0.953211 | 5.332825 | {
"github_metadata": {
"branch": "master",
"commit_count": 671,
"repo_created_at": "2017-02-13T08:40: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": "5a749ff2... |
35b51e7d-f171-4f0a-9a27-2307b7915357 | exsat-network/contract-of-consensus | contracts/rwddist.xsat/rwddist.xsat.cpp | #include <blkendt.xsat/blkendt.xsat.hpp>
#include <exsat.xsat/exsat.xsat.hpp>
#include <rwddist.xsat/rwddist.xsat.hpp>
#include <utxomng.xsat/utxomng.xsat.hpp>
#include <gasfund.xsat/gasfund.xsat.hpp>
#ifdef DEBUG
#include "./src/debug.hpp"
#endif
[[eosio::action]]
void reward_distribution::setrwdconfig(reward_config... | TOOL | 0.98848 | 7.047726 | {
"github_metadata": {
"branch": "main",
"commit_count": 194,
"repo_created_at": "2024-06-27T02:02:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "be680105661... |
2e7ed0d8-1821-419e-aa63-6b0657925d8c | ChoiSaRangRang/Data-structure | 자료구조/연결리스트 노드 삽입 삭제.cpp | #include <iostream>
using namespace std;
class Node {
public:
int data;
Node* link;
};
Node* Head = NULL;
void insert_node_at_middle(Node* new_node) { //A
}
void insert_node_at_rear(Node* new_node) { //B
if (Head == NULL) {
Head = new_node;
}
else {
Node* list = Head;
while (list->link != NULL) { //마지막 원... | ALGO | 0.996637 | 4.682414 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-09-21T03:22: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": "7b7c324c9b... |
f03ab0d3-9e44-4538-b546-ec8b28649321 | PaddlePaddle/Paddle-Lite | lite/kernels/xpu/norm_compute.cc | // Copyright (c) 2019 PaddlePaddle 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required... | TOOL | 0.965036 | 7.037054 | {
"github_metadata": {
"branch": "develop",
"commit_count": 7526,
"repo_created_at": "2017-09-20T11:41:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7124,
"forks": 1620,
"issues": 68,
"pull_requests": 17
},
"file_meta": {
"content_id": ... |
6a073bc9-545e-4b8b-83a1-5f1bdc40b8ca | Ghader-Ahmad/Problem-Solving | Programming Advices/007_Algorithm And Problem Solving Level 3/Problem_14.cpp | #include <iostream>
#include <iomanip>
using namespace std;
bool AreScalarMatrices(int Matrix[3][3], short Rows, short Cols)
{
int FirstDiagElement = Matrix[0][0];
for (short i = 0; i < Rows; i++)
{
for (short j = 0; j < Cols; j++)
{
if (i == j && Matrix[i][j] != FirstDiagElement)
{
return false;
... | ALGO | 0.993405 | 4.047576 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-06-06T12:33: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": "c58c21012799... |
a4b136bd-4029-46b1-92fc-ec97ca2cdd9b | NinjaThanh/Coder | movie.cpp | //thiet ke lop film gom ten films, dao dien, nam phat hanh
//nhap vao 2 bo film, in thong tin film so sanh 2 film co cung dao dien hay khong
//dinh nghia toan tu vao, toan tu ra, toan tu so sanh, ham tao, ham tao sao chep, doi ten dao dien cua film thanh ten t
#include<bits/stdc++.h>
using namespace std;
class Movie{
... | TOOL | 0.990714 | 3.611655 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-09-19T12:53: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": "47773579c3... |
cb39e866-04a9-4943-b654-910d37cd870d | C-2023-4-6/8209230607- | cpp/实验四6.cpp | #include <iostream>
using namespace std;
void count(const char s[], int counts[]) {
int len = strlen(s);
int x[100] = {};
for (int i = 0; i < len; i++) {
if ((int)s[i] >= 65 && (int)s[i] <= 90)
x[i] = (int)s[i] - 65;
else if ((int)s[i] >= 97 && (int)s[i] <= 122)
x[i]... | ALGO | 0.999771 | 3.547224 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2023-11-16T03:44:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d787eb757a8... |
67982a5c-5a39-444b-a317-5bbd3416ce6e | Aleshkev/algoritmika | archive/3/budowanie_wiez.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int I;
const I mod = 1e6;
int main()
{
cout.sync_with_stdio(false);
cin.tie(0);
I k, n;
cin >> k >> n;
const I lim = 5000;
I t[lim + 1] = {0};
t[0] = 1;
for(I i = 0; i <= lim; ++i) {
for(I j = 1; i + j <= lim; +... | ALGO | 0.999862 | 4.01827 | {
"github_metadata": {
"branch": "master",
"commit_count": 290,
"repo_created_at": "2018-09-16T12:43:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0996229... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.