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 |
|---|---|---|---|---|---|---|---|
651d810b-2951-401d-a1bd-769b3cf46a4f | tracyzhu/Algorithm-Contest | CodeLibrary/Graph Theory/MaxFlow.cpp | #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <memory.h>
#include <vector>
using namespace std;
const int N = 6000+5;
const int M = 100000+5;
const int inf = 200000000;
class Graph{
public:
struct Edge{
int v,next;
int cap;
}e[M];
int pre[N],hea... | ALGO | 0.998634 | 3.347485 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2013-10-18T18:12:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e0397da2... |
d9374cde-2600-46f1-b868-9ef79dd1f2fa | Alaxe/noi2-ranking | 2019/solutions/A/IYS-Shumen/beatle.cpp | #include <bits/stdc++.h>
using namespace std;
struct line
{
pair<int,int>lft;
pair<int,int>rgt;
};
vector<line>lines;
vector<int>v[131072];
int n,used[131072],t;
bool cmp(line a,line b)
{
if(a.lft.second==b.lft.second)return a.lft.first<b.lft.first;
return a.lft.second>b.lft.second;
}
void read()
{
... | ALGO | 0.99999 | 4.150256 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-03-20T21:56:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23f3cb09c... |
fdbb7b75-cd54-4aec-8506-eb18a3c7b4b0 | AlexeyDudin/Combinatorycs | Lab3_3/Lab3_3/Source.cpp | /*
* 3.3. [# 50] Для заданного графа, содержащего ?? вершин, найдите количество остовных
деревьев.
Вход. Первая строка исходного файла содержит одно целое число ?? (1 ? ?? ? 100) –
количество вершин. Вершины пронумерованы от 1 до ??. В последующих ?? строках
содержатся по ?? чисел, разделенных пробелами: вес ребер межд... | ALGO | 0.999859 | 4.868787 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-02-09T12:29: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": "56012ecf770... |
70febbb4-328f-4755-a305-09dd8cb06c08 | ishandutta2007/codeforces-r | rniya/normal/1272/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(v) (v).begin(),(v).end()
#define debug(x) cout << #x << '=' << x << '\n'
const long long MOD=1e9+7;
//const long long MOD=998244353;
const int INF=1e9;
const long long IINF=1e18;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const... | ALGO | 0.999933 | 4.000197 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58: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": "f4bfe77d5785... |
45ba7f70-8a3b-4736-8a1e-5cf3d5a0f6ef | LeKSuS-04/Competitive-Programming | Other/MEPhI Entry Contest/G.cpp | /* <NAME> */
// Date: 1 Sep 2022, 12:13:27 (+02:13)
// Run time: -
// Memory: -
// Verdict: WA
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, pair<int, char>> iic;
vector<char> days;
vector<iic> things;
void read_with(int day, char type) {
int price; cin >> price;
things.push_back({price, {da... | ALGO | 0.975586 | 4.064138 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2021-10-13T17:29: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": "29e8cf47e... |
e1677afc-8c2a-432e-8d52-8f525907a4b9 | 498-search-engine/lib | include/core/vector.h | /**
* @file vector.h
* @author <NAME>, <NAME>
* @brief C++20 compliant std::vector implementation
* @version 1.1
* @date 2025-04-27
*
* @copyright Copyright (c) 2025
*
*/
#ifndef LIB_VECTOR_H
#define LIB_VECTOR_H
#include <algorithm>
#include <compare>
#include <cstddef>
#include <initializer_list>
#includ... | TOOL | 0.946492 | 7.153157 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2025-01-17T18:51:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 11,
"pull_requests": 2
},
"file_meta": {
"content_id": "0b8158427bb... |
294eb151-a29d-470e-989c-5be8c6f6645f | Ra1nWarden/Online-Judges | BestCoder/32/a.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
struct Node {
int f, s, i;
Node() {};
Node(int a, int b, int c) : f(a), s(b), i(c) {};
};
bool _cmp(const Node& a, const Node& b) {
if(a.f - a.s != b.f - b.s) {
return a.f - a.s > b.f - b.s;
}
if(a.s != b.s) {
return a.... | ALGO | 0.999932 | 3.718967 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2014-04-02T05:35:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 38,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0aec77... |
13ccaa2e-dbd6-4555-b5a3-2e5fa18934f9 | MongsangGa/BOJ | 백준/Gold/5052. 전화번호 목록/전화번호 목록.cc | #include <bits/stdc++.h>
using namespace std;
#define fastio cin.tie(NULL), ios_base::sync_with_stdio(false)
vector<string> arr;
int t, n;
int Compare(string &a, string &b) {
if (a.size() >= b.size()) return 0;
for (int i = 0; i < a.size(); i++)
if (a[i] != b[i])
return 0;
return 1;
}... | ALGO | 0.999926 | 4.230843 | {
"github_metadata": {
"branch": "main",
"commit_count": 581,
"repo_created_at": "2023-03-24T15:57:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "daa979f93e... |
7a6bdc03-7dd0-461a-8428-4b2e28c1af8f | apache/openoffice | main/tools/source/generic/line.cxx | /**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to y... | ALGO | 0.970766 | 6.040764 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 9123,
"repo_created_at": "2013-11-13T08:00:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1049,
"forks": 341,
"issues": 0,
"pull_requests": 18
},
"file_meta": {
"content_id": "6c8... |
63b37d03-fbde-40fb-b498-4fe9f33f65f4 | stephenkwong/TwitchProgrammingChallenge | spellcheck/src/spellCheckerBinary/BinaryNode.cpp | // BinaryNode.cpp
#include "BinaryNode.h"
#include "stdlib.h"
#include "stdio.h"
#include "ctype.h"
BinaryNode::BinaryNode()
{
left = right = NULL;
word = "";
}
BinaryNode::BinaryNode(std::string s)
{
lowerTheWord(s); //sets word in our Node to all lower case
left = right = NULL;
sortWord();
}
bool Bin... | ALGO | 0.997974 | 3.439391 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-01-23T06:22: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": "27006cf694... |
30491590-b9ea-4913-ad56-2158166bbc1f | squaresLab/BatFix | results/transcoder-st/results/java/java_semantics/program_DIVIDE_LARGE_NUMBER_REPRESENTED_STRING.cpp | // Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include... | ALGO | 0.999805 | 4.571979 | {
"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": "2ec65e1707f1... |
73e1f09e-d83d-4dcd-8f97-1bb6c940327f | alattafa/A_project | A_project/State.cpp | #include "State.h"
using namespace std;
State::State(table start_table, int d)
:depth(d), fvalue(-1), distance(-1), zero_col(-1), zero_row(-1), father(0)
{
for (int i = 0; i < SIZE; ++i) {
for (int j = 0; j < SIZE; ++j)
{
data[i][j] = start_table[i][j];
if (!start_table[i][j]) {
zero_row = i;
zero_c... | ALGO | 0.999956 | 3.728729 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2022-01-13T03:03:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "896e4751b... |
3914347a-fe76-4106-8ab2-b44bd6a31362 | Aniljangir89/linked-list | Lab-05/que05.cpp | // Q . print middle of linked list
// <NAME> (2212090)
#include <iostream>
using namespace std;
class node
{
public:
int data;
node *next;
node(int val)
{
data = val;
next = NULL;
}
};
void traverse(node *&head, int data)
{
node *new_node = new node(data);
new_node->next = h... | ALGO | 0.999819 | 3.963997 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2023-09-21T06:48:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "c1f885f0a08... |
09aac056-c192-4b5e-815c-13086be616ad | organicmaps/organicmaps | 3party/osrm/osrm-backend/algorithms/route_name_extraction.hpp | /*
Copyright (c) 2015, Project OSRM contributors
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 conditions and the f... | ALGO | 0.955302 | 6.308044 | {
"github_metadata": {
"branch": "master",
"commit_count": 42613,
"repo_created_at": "2020-12-27T19:02:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11487,
"forks": 1128,
"issues": 2796,
"pull_requests": 182
},
"file_meta": {
"content_i... |
deda9da0-9ab9-4106-b564-bde62641f0aa | LucasPayne/Continuum | FiniteElements/NavierStokes/compute_linear_term_matrix_bottom_left.cpp | #include "NavierStokes/NavierStokesSolver.h"
std::vector<BottomLeftEntry> NavierStokesSolver::compute_linear_term_matrix_bottom_left()
{
auto coeffs = std::vector<BottomLeftEntry>();
// For each basis trial function psi^p ...
//------------------------------------------------------------
// For ea... | ALGO | 0.999531 | 4.64646 | {
"github_metadata": {
"branch": "main",
"commit_count": 193,
"repo_created_at": "2021-05-02T06:20: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": "add9eaa93d... |
299591de-3c01-42fa-977f-2ae04a8eb378 | itsnotTalha/CPP | CF_DIv3_C.cpp | #include <iostream>
#include <cmath>
using namespace std;
bool isPrime(long long n) {
if (n <= 1) return false;
if (n <= 3) return true;
if (n % 2 == 0 || n % 3 == 0) return false;
for (long long i = 5; i * i <= n; i += 6) {
if (n % i == 0 || n % (i + 2) == 0) return false;
}
return tru... | ALGO | 0.999804 | 4.667856 | {
"github_metadata": {
"branch": "main",
"commit_count": 435,
"repo_created_at": "2025-01-27T09:39:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5b71b08b4... |
066cf267-bac7-45ae-a87d-faac754b1466 | codemonkeyricky/lc | 1980.cpp | #include <iostream>
#include <vector>
#include <cassert>
#include <stack>
#include <queue>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <cmath>
using namespace std;
struct TreeNode
{
int val;
TreeNode *left;
... | ALGO | 0.999964 | 4.456249 | {
"github_metadata": {
"branch": "main",
"commit_count": 126,
"repo_created_at": "2024-11-11T05:29: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": "fab42293bd... |
ae43620e-835d-49d5-91ef-3b3f0290d80f | dormon/prj | vk/main.cpp | #include<iostream>
#include<sstream>
#include<vector>
#include<memory>
#include <dlfcn.h>
#include "comp.hpp"
#define VK_NO_PROTOTYPES
#include<vulkan/vulkan.h>
#include<spirv/1.0/spirv.h>
#define ___ std::cerr << __LINE__ << std::endl
constexpr char const*vkResultString(VkResult const&err){
#define IF_ERR_RETURN... | TOOL | 0.932394 | 4.977198 | {
"github_metadata": {
"branch": "master",
"commit_count": 250,
"repo_created_at": "2017-04-29T22:21: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": "785f4488... |
11284d8b-d132-4142-915e-ae540b6a7660 | Azhuan-zhou/C-experiment | dataStructure/fifth/main.cpp | #include <iostream>
#include "Dijkstra.h"
#include "queue.h"
// 预先访问的函数,用于深度优先搜索和拓扑排序
void PreVisit(Graph *G, int v) {
cout << "PreVisit vertex " << v << "\n";
}
// 后续访问的函数,用于深度优先搜索和拓扑排序
void PostVisit(Graph *G, int v) {
cout << "PostVisit vertex " << v << "\n";
}
// 深度优先搜索算法
void dfs(Graph *G, int v) {
P... | ALGO | 0.999949 | 4.277857 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-03-06T15:45:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "286819c372fd... |
6c477295-d65a-40c3-a428-e44a8d2f838d | rashed-001/Code | 1722D.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int arr[100005];
ll gcd(ll a, ll b)
{
if (!a)
return b;
return gcd(b % a, a);
}
bool isPrime(int n)
{
if (n <= 1)
return false;
if (n <= 3)
return true;
if (n % 2 == 0 || n % 3 == 0)
return false;
... | ALGO | 0.999943 | 3.914176 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-08-02T05:39: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": "095f16b80809... |
6aaad1a3-cdf0-4de5-97c3-763bf2029613 | ishandutta2007/codeforces-a | agua_podrida/normal/1220/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> vvvc;
typedef vector<double> ... | ALGO | 0.999772 | 4.081398 | {
"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": "85b59f14e12b... |
a7e5c3de-9300-42e1-8e9d-65a708406867 | SantySantos/LeetCodeCommonProblemsRepo | LeetCodeCommonProblems/TwoSum.cpp | #include <iostream>
#include "HashMap.h"
#include <unordered_map>
#include <vector>
/*
* Problem: Two Sum
* Description: Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target
* Link: https://leetcode.com/problems/two-sum/
*
* Approach: first we get the... | ALGO | 0.999725 | 6.05549 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2025-05-09T23:52:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7e346fe714... |
f842472f-b14c-4339-a478-6a8098537a88 | showmanlee/HowCanISolveThisQuestion | BOJ/10000/10776.cpp | // 제국
// https://www.acmicpc.net/problem/10776
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
typedef pair<int, int> pr;
typedef pair<pr, int> prr;
int main(void) {
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int k, n, m;
cin >> k >> n >> m;
vector<vector<p... | ALGO | 0.999846 | 3.95026 | {
"github_metadata": {
"branch": "master",
"commit_count": 1741,
"repo_created_at": "2020-09-16T11:55:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8bc13e... |
798bd0d9-dcca-4712-aec0-e863ec1784fd | LeoBrilliant/LeetCodeLib | P51~100/MaximumSubarray.cpp | /*
* MaximumSubarray.cpp
*
* Created on: 2016年10月25日
* Author: LeoBrilliant
*/
#include "P51~100.h"
int MaxSubSum(vector<int> & nums, int left, int right)
{
if(left == right) return nums[left];
int middle = (left + right) / 2;
int leftsum = MaxSubSum(nums, left, middle);
int rightsum = MaxSubSum(nums,... | ALGO | 0.999796 | 4.966538 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2016-11-18T11:08:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a59f6376e... |
3d4a0012-6500-40b8-8b3d-0400d2da4cd4 | Pranitha-Gaddam/Simcity-Project | Commercial.cpp | #include <iostream>
#include <vector>
#include "Commercial.h"
#include "cell.h"
using namespace std;
void Commercial(vector<vector<struct Cell>> &city, int cityRows, int cityCols, int &numWorkers, int &numGoods)
{
for (int i = 0; i < cityRows; i++)// looping through the city to check for 'C'
{
for (in... | ALGO | 0.999387 | 5.302867 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-01-02T18:58:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f470e8c88a71... |
bba906bb-54ec-4502-b1b7-88f6a3047de9 | xcheng85/vulkan-bazel | leetcode/mst/1135.h | #pragma once
#include <vector>
#include <memory>
#include <algorithm>
#include <unordered_set>
#include <iostream>
#include <format>
// minimum spanning tree
// a weighted, connected, undirected graph
// return all the edges
// return the minimum weighted sum
// two algorithms
// 1. Kruskal (Greedy Algorithm)
// so... | ALGO | 0.999857 | 5.762379 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2023-11-05T14:19:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76a44add87a... |
06aa5532-bf29-40b4-8eec-6a9587a0bd14 | tanishq1g/cp_codes | Interviewbit/Graph/Black Shapes.cpp | void dfs(int x, int y, vector<vector<bool> > &vis, vector<string> &ve, int &n, int &m){
if(x < 0 || y < 0 || x >= n || y >= m){
return;
}
if(vis[x][y] || ve[x][y] != 'X')
return;
vis[x][y] = true;
dfs(x - 1, y, vis, ve, n, m);
dfs(x + 1, y, vis, ve, n, m);
dfs(x, y - 1, vis, ... | ALGO | 0.999502 | 4.379595 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-02-14T09:08: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": "6aa521fff... |
eb4af358-fd63-4fea-a65e-a582d676a391 | ishandutta2007/codeforces-j | juve45/normal/453/B.cpp | #include <bits/stdc++.h>
#define st first
#define nd second
using namespace std;
void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prn... | ALGO | 0.999984 | 3.380843 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8d90902a576... |
447f5918-8b28-48e7-9f2e-5b79eb3f5733 | febiosoftware/FEBio | NumCore/BlockSolver.h | /*This file is part of the FEBio source code and is licensed under the MIT license
listed below.
See Copyright-FEBio.txt for details.
Copyright (c) 2021 University of Utah, The Trustees of Columbia University in
the City of New York, and others.
Permission is hereby granted, free of charge, to any person obtaining a... | ALGO | 0.999077 | 6.117233 | {
"github_metadata": {
"branch": "develop",
"commit_count": 8010,
"repo_created_at": "2020-06-15T23:52:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 217,
"forks": 75,
"issues": 28,
"pull_requests": 3
},
"file_meta": {
"content_id": "91e... |
43baabad-381e-48c0-a6db-e33582164dfa | Super262/AcWingSolution | Problem0858.h | //
// Created by <NAME> on 2021/6/10.
//
#ifndef ACWINGSOLUTION_PROBLEM0858_H
#define ACWINGSOLUTION_PROBLEM0858_H
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
class Problem0858
{
private:
static const int INF = 0x3f3f3f3f;
int prim(const int &n, const vector<vector<int>> &... | ALGO | 0.99986 | 4.545076 | {
"github_metadata": {
"branch": "master",
"commit_count": 1469,
"repo_created_at": "2021-05-22T13:11:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79ce557... |
a9eea79b-7538-4d1b-af02-aa5fcefa4bbd | ZhanyuGuo/multi-pc-multi-thread | MultiPCMultiThread-old/myServer_f.cpp | /* -------------------------------------------
*
* File_name: myServer.cpp
* Create: 2020.12.28
* Update: 2021.1.7
* Author: <NAME>, <NAME>.
* Note: Single thread || Multi-PC-multi-thread.
*
* -----------------------------------------*/
#define SERVER
#include "mySrvClt_f.h"
void merge()
{
int index[MAX_TH... | ALGO | 0.998932 | 4.002008 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2023-01-13T12:19:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b36122e64... |
1352e346-b54b-49e6-9db0-d2f31d5ef2df | Wizmann/ACM-ICPC | UVA OJ/120.cc | // Result: Wizmann UVA 120 Accepted 0 KB 22 ms C++ 4.5.3 1605 B
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cctype>
using namespace std;
#define print(x) cout << x << endl
#define input(x) cin >> x
const size_t SIZE = 128;
... | ALGO | 0.999844 | 3.47153 | {
"github_metadata": {
"branch": "master",
"commit_count": 3480,
"repo_created_at": "2011-12-19T02:04:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 63,
"forks": 29,
"issues": 97,
"pull_requests": 0
},
"file_meta": {
"content_id": "73a8... |
0c0f6018-43d6-41dc-931c-8faefda77d01 | purfreak/OOP_3 | 2nd_module/A.cpp | #include <iostream>
#include <vector>
#include <string>
using std::string;
using std::vector;
using std::max;
using std::cout;
using std::cin;
class SuffixArrayWithLCP {
public:
SuffixArrayWithLCP() = default;
explicit SuffixArrayWithLCP(string line);
size_t GetSize() const;
size_t GetSuffix(size_... | ALGO | 0.999144 | 4.365197 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-10-12T21:24: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": "9e6df6720... |
a1f414ab-3ffd-4cdf-b962-ecb7acdcd014 | GoGradually/PS-Saved-Repository | Div.2 #789/1678A.cpp | #include <bits/stdc++.h>
#define ll long long
#define INF (int)1e9 + 10
#define lINF (ll)1e18 + 10LL
const ll MOD = 1000000007LL;
// #include <atcoder/modint.hpp>
// using mint = atcoder::modint998244353;
using namespace std;
void Solve() {
int n;
cin >> n;
vector<int> arr(n);
vector<int> check(101);
... | ALGO | 0.999869 | 4.563572 | {
"github_metadata": {
"branch": "main",
"commit_count": 457,
"repo_created_at": "2023-08-11T17:26: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": "dd32b8cb64... |
2cdf33ae-5484-4c11-8f50-417ed8188438 | adityabisoi/ds-algo-solutions | Linked Lists/Delete duplicate values/solution.cpp | #include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList {
public:
S... | ALGO | 0.999874 | 5.05568 | {
"github_metadata": {
"branch": "main",
"commit_count": 2422,
"repo_created_at": "2020-10-19T01:51:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 50,
"forks": 111,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f565d... |
3082eaa5-8c1e-4403-b1e1-746b78942a64 | sudiptarathi2020/Problem-Solves | cses/Tree_Algorithms/Path_Queries_ii.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
struct seg{
ll N;
vector<ll>tree;
seg(){}
seg(ll _N){
N=_N;
tree.resize(N<<2);
}
void upd(ll node,ll start,ll end,ll pos,ll val){
if(start==end){
tree[node]=val;
return;
}
... | ALGO | 0.999965 | 4.684865 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2024-05-06T16:58:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8aed388128... |
b9425403-0c7b-4a55-a4f2-ec278f1f930f | UdaySharmaGitHub/DSA-CPP | GFG/Basic Problems/Reverse_sub_array.cpp | /*
Reverse sub array
Provided an array Arr of N integers, you need to reverse a subarray of that array. The range of this subarray is given by indices L and R.
Example 1:
Input:
N = 7
Arr[] = {1, 2, 3, 4, 5, 6, 7}
L = 2, R = 4
Output:
1 4 3 2 5 6 7
Explanation: After reversing the elements
in range 2 to 4 (2, 3, 4),... | ALGO | 0.999972 | 5.865104 | {
"github_metadata": {
"branch": "main",
"commit_count": 292,
"repo_created_at": "2023-11-19T16:25:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d5894cea5... |
88fced02-0c57-4e56-9552-0167f0e3aecc | BritoAlv/cs | competitive_programming/edu166/C.cpp | // Problem: C. Job Interview
// Contest: Codeforces - Educational Codeforces Round 166 (Rated for Div. 2)
// URL: https://codeforces.com/contest/1976/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// Math Proof:
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/stdc++.h>
#define endl '\n'
#def... | ALGO | 0.999969 | 3.986454 | {
"github_metadata": {
"branch": "main",
"commit_count": 202,
"repo_created_at": "2022-06-16T15:43:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89aa274266... |
9856ec57-4a6a-42b5-b33c-588aeead6231 | nolan0801/Competitive-Programming | CSES/2206.cpp | /*
Author : vidut_206_CNH
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define fi first
#define se second
#define pb push_back
#define gcd(a,b) (__gcd(a,b))
#define lcm(a,b) (a/gcd(a,b)*b)
#define sz(x) (int)(x.size())
#define fast_cin() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#... | ALGO | 0.99973 | 4.55115 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2021-12-21T06:10:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d30fa7c252... |
cd3bbf2c-1882-4234-9838-c9be728f7297 | skdlsco/webserv | srcs/config/ConfigParser.cpp | #include "ConfigParser.hpp"
std::string const ConfigParser::TAG = "ConfigParser";
ConfigParser::ConfigParser(std::string filePath)
: mFilePath(filePath)
{
readConfigFileByLine();
}
ConfigParser::ConfigParser(ConfigParser const & copy)
{
*this = copy;
}
ConfigParser &ConfigParser::operator=(ConfigParser const & rh... | TOOL | 0.992081 | 5.829014 | {
"github_metadata": {
"branch": "master",
"commit_count": 471,
"repo_created_at": "2021-04-23T07:46:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "f43b22b9... |
62c4a8fe-956b-44d8-a04f-df3b82177b5d | EssieYiu/Simple_Circut | circuitControl.cpp | #include<iostream>
#include"circuitControl.hpp"
circuitControl* circuitControl::instance_ = NULL;
circuitControl::circuitControl(){
for(int i = 0; i < size; i++){
for(int j = 0; j < size; j++){
adjMatrix[i][j] = 0;
}
}
for(int j = 0; j < size; j++)
vertex[j] = NULL;
head_ = NULL;
tail_ = NULL;
doorNumber... | ALGO | 0.998789 | 3.384548 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-06-07T03:59: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": "db82de5797... |
b242ce16-0627-409b-bcf2-20511c4c73f0 | lakshayvirmani/data-structures-and-algorithms | backtracking/word_search.cpp | class Solution {
vector<vector<int>> moves = {{0,1}, {1,0}, {-1,0}, {0,-1}};
public:
bool exist(vector<vector<char>>& board, string word) {
bool result = false;
for(int i = 0; i < board.size() && !result; i++)
{
for(int j = 0; j < board[0].size() && !result; j++)
... | ALGO | 0.999858 | 6.357904 | {
"github_metadata": {
"branch": "main",
"commit_count": 166,
"repo_created_at": "2022-05-14T11:27:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da15d40860... |
1b63d43b-5c02-4f3d-b6d6-954a735f99fa | Kynn274/BaitapUPCODER | Dynamic Programming /Nhom7-Bai3.cpp | #include <bits/stdc++.h>
#define ll long long
#define fmax 1003
using namespace std;
ll n(1), w, x;
ll a[fmax];
ll f[fmax][fmax]; // Kết quả
ll s[fmax][fmax]; // Lưu vết
int main() {
ios_base::sync_with_s... | ALGO | 0.999988 | 3.279032 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2024-02-18T10:03: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": "60ddeb9a99... |
683edd95-9ac9-422a-9ba7-22aa68e3f379 | egefeyzioglu/egefeyzioglu.github.io | ctf/lo-server/src/minecraftscan.cpp | #include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <fcntl.h>
#include <errno.h>
#include <poll.h>
#include <unistd.h>
#include <fstream>
#include <sstream>
#include <signal.h>
#include <algorithm>
#include <execution>
/... | TOOL | 0.934192 | 3.800096 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-06T02:42: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": "de34a0e7e636... |
cfaac2f8-0eb0-44f3-bf0b-4acbae74da94 | MathiasJoly/IN203_Mathias_Joly | Diffusion_hypercube.cpp | # include <iostream>
# include <cstdlib>
# include <mpi.h>
# include <sstream>
# include <fstream>
# include <stdio.h>
// pour récupérer la dimension (d) du plus grand hypercube possible :
int logarithme2 (int nbp)
{
int d = 0;
int n = 1; //n = 2^d
while (n<nbp)
{
d += 1;
n *= 2;
};
if (n>nbp)
{
d = d-1;
... | ALGO | 0.999626 | 3.428578 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2020-11-12T09:10:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0da6273d444... |
8ca6aa4b-7c8a-4286-9125-69bcf396cd54 | yhhshb/biolib | include/elias_fano.hpp | #ifndef ELIAS_FANO_HPP
#define ELIAS_FANO_HPP
#include "bit_vector.hpp"
#include "packed_vector.hpp"
#include "rank_select.hpp"
namespace bit {
namespace ef {
class array
{
protected:
using bv_t = bit::vector<max_width_native_type>;
using rs_t = rs::array<bv_t, 8 * sizeof(max_width_native_type), ... | ALGO | 0.957786 | 6.428067 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2023-04-13T12:18:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbf6aa4033... |
315bdd3b-3744-4ebc-96b3-14c0c18eb079 | gsy3761/Pile | ProblemSet/LuoGu/P1048采药(01背包)/P1048采药(01背包)/源.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <math.h>
#include <stdio.h>
#include <string.h>
// t秒内采药,药要花费不同时间,有不同价值。
//对于第i株药,剩余j的时间,有d(i,j)=max(d(i-1,j),d(i-1,j-Vi)+Ci)
//记忆化搜索。
int t, m;
const int MAX_M = 107;
const int MAX_T = 1007;
int mem_DP[MAX_M][MAX_T];
int V[MAX_M]; //体积
int C[MAX_M... | ALGO | 0.999984 | 3.406166 | {
"github_metadata": {
"branch": "master",
"commit_count": 316,
"repo_created_at": "2020-01-26T11:05:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1f29435... |
8b07c772-fe73-44bd-9036-2600e5ab61e0 | alfredclwong/codeforces | b/609.cpp | #include<algorithm>
#include<iostream>
#include<math.h>
#include<numeric>
#include<set>
#include<tuple>
#include<vector>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define puu pair<ull,ull>
#define eb emplace_back
#define pb push_back
#defi... | ALGO | 0.999987 | 3.542127 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2019-09-18T22:01: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": "5dcdf50c1... |
9033dc7e-8956-4a5b-91f9-825e25b81464 | RikoAppDev/aza-practical-assignment | main2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// Structure to represent a job
struct Job {
int id;
int deadline;
float profit;
};
// Comparison function for sorting jobs by profit in descending order
bool compareJobs(const Job &a, const Job &b) {
return a.profit > b.... | ALGO | 0.999998 | 5.871716 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-24T14:54: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": "97592a19362c... |
5c22b10d-7855-4fbd-8596-4f33c68289c1 | Tus1811/Programming_Techniques | BTH04-732833-Tuan16-TuNM/Bai4_8_TuNM_5502.cpp | // Nguyễn Minh Tú - 5502 - 732833
/* Bài tập 8:
Viết các hàm thực hiện các phép giao và hợp của hai tập hợp mờ được biểu diễn
bằng map.*/
template<class T>
map<T, double> fuzzy_set_union(const map<T, double> &a, const map<T, double> &b) {
/*****************/
// Nguyễn Minh Tú - 5502 - 732833
map<T, double... | ALGO | 0.992569 | 3.730128 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-12-22T09:34:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "caf18382d6a5... |
a13763d8-819b-4f81-9c48-9737e456c2c0 | jeffberube/diclist | dictionary.cpp | /*
* @Author: <NAME>
* @Title: dictionary.cpp
*
* @Description: Contains all functions related to dictionary program
*
*/
#include "dictionary.h"
#include <assert.h>
/*
* InsertWord
*
* Adds word to dictionary. Sorts dictionary in ascending alphabetical order on insertion.
*
* INPUT
* DICT& dict Refer... | ALGO | 0.923069 | 5.172449 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2014-11-03T21:36: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": "c7410ff008... |
4ae27c68-4b88-46fd-8b14-1e3f63cfe4ca | XwanXuanX/abstract-nonsense | random/kiutckiuy67.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n,m,a,b;
cin>>n>>m;
map<int,set<int>> G;
for(int i=0;i<m;++i){
cin>>a>>b;
G[a].insert(b), G[b].insert(a);
}
function<int(int node, int paren... | ALGO | 0.999447 | 3.602621 | {
"github_metadata": {
"branch": "main",
"commit_count": 542,
"repo_created_at": "2024-10-08T00:01: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": "fa5d41f219... |
3ab3ef9e-1d9f-4398-a0f9-678a12d14e33 | sreasgop/TIU-BCA-Programming-in-Data-structure-through-Cpp-Lab- | Practical-Assignment/08_InsertionSort.c++ | #include <iostream>
#define MAXSIZE 100
using namespace std;
void insertionSort(int arr[], int size) {
int key;
int j = 0;
for (int i = 1; i < size; i++) {
key = arr[i];
j = i - 1;
while (j >= 0 && arr[j] > key) {
arr[j + 1] = arr[j];
j = j - 1;
}
... | ALGO | 0.999856 | 5.186961 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2024-03-06T20:24:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da76200bd8c... |
9476ea09-15a9-40fb-b9fa-9a7cb355fab4 | anupam8nith/Leetcode | 0539-minimum-time-difference/0539-minimum-time-difference.cpp | class Solution {
public:
int findMinDifference(vector<string>& timePoints) {
set<int> timeSet; // To store time in minutes
int diff = INT_MAX;
// Convert each time point to minutes and store in the set
for (string s : timePoints)
{
int temp_time = 60 * stoi(s.s... | ALGO | 0.999679 | 6.163976 | {
"github_metadata": {
"branch": "main",
"commit_count": 2991,
"repo_created_at": "2022-06-15T09:01: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": "926a99ac7... |
b82c55b2-9512-47c1-8f8e-66a723fd0cba | Sarthakjain1206/CP | Graphs/new.cpp | #include<bits/stdc++.h>
using namespace std;
class UnweightedGraph {
int V;
vector<int> *adj;
public:
UnweightedGraph(int V) {
this->V = V;
adj = new vector<int>[V];
}
void addEdgeDirected(int u, int v) {
adj[u].push_back(v);
}
voi... | ALGO | 0.99994 | 4.72204 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-03-18T12:08: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": "012b10fd7d... |
22fc7fd4-f171-4a18-b8d7-dec003b1571c | swingxu/PAT | PAT/A1066/A1066.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
struct node {
int data;
node* left;
node* right;
int height;
} ;
node* newnode(int v){
node* Node = new node;
Node->height = 1;
Node->data = v;
Node->left = Node->right = NULL;
return Node;
}
int getHeight(node* Node){
... | ALGO | 0.999988 | 3.997003 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-01-28T09:30: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": "f29dd0e56... |
8abf0766-1e87-4f59-b7a9-63990b515079 | David-5-5/tutorial | cplus/leetcode/202507/algo0160.cpp | #include <bits/stdc++.h>
using namespace std;
// 链表 - 1.7 双指针
/**
* 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) {}
};
class S... | ALGO | 0.999934 | 5.264962 | {
"github_metadata": {
"branch": "main",
"commit_count": 2940,
"repo_created_at": "2022-11-22T17:09:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d9d3b7f0... |
9645c185-dd1a-4000-ade1-02540e2c82b6 | tanmaysrivastava45/Data-Structure-and-Algorithms | Lecture 44/circular_ll.cpp | #include<iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int d)
{
this->data = d;
this->next = NULL;
}
~Node() {
int val = this -> data;
if(this->next != NULL) {
delete next;
next = NULL;
}
cout << "memory free for node with data "<< val... | ALGO | 0.999691 | 4.770304 | {
"github_metadata": {
"branch": "main",
"commit_count": 154,
"repo_created_at": "2025-03-31T09:43:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3268eb3fec... |
7a0de48d-b879-4b38-b35a-6057b95ee1ee | StuMWG/Data-Structure-Assignments | Assignment3/palindromeAssignment/assignment3/Header.h | #pragma once
#include <queue>
#include <stack>
using namespace std;
//function to move front element to rear of queue
void move_to_rear(queue<int>& q) {
int temp = q.front(); //saves first element in temp
q.push(temp); //puts temp at the end of the queue
q.pop();//removes the first element in queue
}
string palind... | ALGO | 0.985584 | 4.992695 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-09-19T15:37: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": "bed70bf9ca3... |
b264a6e0-26c4-478c-be4b-429e82a80c19 | kzhereb/knu-ips-progr2024 | src/lesson_2024_04_04_expression_tree.cpp | /*
* lesson_2024_04_04_expression_tree.cpp
*
* Created on: Apr 4, 2024
* Author: KZ
*/
#include <string>
#include <iostream>
#include <map>
#include <cassert>
namespace lesson_2024_04_04_expression_tree {
enum NodeType {
Constant,
Variable,
Operation
};
NodeType get_type_from_string(std::string va... | ALGO | 0.993719 | 5.80644 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2024-02-01T10:44: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": "edadc1a1345... |
7307b911-7fe3-423d-bac8-3741bfdcc57a | joshualass/CP | Templates/Geometry/line.cpp | template<class F>
struct Line {
Point<F> a, ab;
Line(): a(), ab() {}
Line(const Point<F>& a, const Point<F>& b, bool twoPoints = true)
: a(a), ab(twoPoints? b - a : b) {}
Line(const F& xa, const F& ya, const F& xb, const F& yb)
: a(xa, ya), ab(xb - xa, yb - ya) {}
void swap(Line ... | ALGO | 0.998281 | 5.914876 | {
"github_metadata": {
"branch": "main",
"commit_count": 426,
"repo_created_at": "2023-03-13T21:46: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": "670393506b... |
7d3c8129-d218-4dd6-b919-9a035162bc8a | AIFM-sys/AIFM | shenango/apps/parsec/pkgs/apps/raytrace/src/RTTL/BVH/Builder/Sweep.hxx | #ifndef RTTL__BVH_BUILDER_SWEEP_HXX
#define RTTL__BVH_BUILDER_SWEEP_HXX
#include "Builder.hxx"
namespace RTTL {
class SweepBVHBuilder : public BVHBuilder
{
private:
void recursiveBuild(const int start,
const int end,
const int nodeIndex,
const AABB& bounds,
c... | ALGO | 0.996155 | 6.416502 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-10-12T02:03:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 122,
"forks": 37,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "9380a09... |
ea362398-b1c9-4577-9fc7-98663e3c2858 | AdelleStuuu/CPP-Sample-Codes-Exercises-and-Lessons | c++/lessons/lesson 13 - logical operators.cpp | #include <iostream>
using namespace std;
int main() {
/*
1. && checks if two conditions are true
2. || checks if one of the conditions is true
3. ! checks if the condition is false
(! operator is placed before the condition)
*/
//-----------------------------------------------------------... | TOOL | 0.985371 | 3.630737 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-23T09:46: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": "00c7035fceab... |
d3e6291d-5a06-451d-9834-86d9b5251df8 | hnqiu/algs4-cpp | algs4/ch2/selection.h | /* Created by hnqiu on 27/04/2020.
* Copyright (C) 2020 hnqiu. All Rights Reserved.
* Licensed under the MIT License. See LICENSE for details.
*/
/* @brief: selection sort implementation (P248)
* A program with consistent ~n^2/2 running time that
* sort a sequence in ascending order
*/
#pragma once
#include ... | ALGO | 0.999874 | 6.394392 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-04-08T08:11: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": "df0505ee6... |
979eceea-36ea-443e-bb69-434b201f1463 | mg4603/DSA | leetcode/max_diff_by_remapping_dgt/code.cpp | #include <iostream>
#include <assert.h>
class Solution {
public:
int minMaxDifference(int num)
{
std::string n_str = std::to_string(num);
std::string min_n = n_str;
char first_digit = n_str[0];
std::string max_n = n_str;
char first_non_9_char;
... | ALGO | 0.998557 | 5.563713 | {
"github_metadata": {
"branch": "master",
"commit_count": 2111,
"repo_created_at": "2022-07-09T00:05: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": "d02dfbd... |
0f1ea43f-ceab-4ca4-ad63-73086c2833d6 | Kadrick/PS | BOJ/src/9997.cpp | /**
* @file 9997.cpp
* @author kadrick (<EMAIL>)
* @brief bitmask
* @version 0.1
* @date 2022-02-17 00:48
*
* @copyright Copyright (c) 2022
*
*/
#include <bits/stdc++.h>
using namespace std;
#define fastio \
ios::sync_with_stdio(false); \
cin.tie(0);
#define endl '\n'
int n, ans;
vector<... | ALGO | 0.99985 | 4.276764 | {
"github_metadata": {
"branch": "main",
"commit_count": 316,
"repo_created_at": "2021-05-08T07: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": "773b0ffe13... |
3f2e7bf7-20b4-4f90-a0ba-7ab95762c398 | vishnu45/Algorithms | C++/Others/diagMatrix.cpp | // Printing diagonal elements of a matrix
#include <iostream>
using namespace std;
int main()
{
int ROW = 3, COL = 4;
int a, b;
int array[ROW][COL] = { { 1, 2, 3, 4},{ 5, 6, 7, 8},{ 9, 10, 11, 12}};
for (int i = 0; i < ROW; i++)
{
for (int j= 0; j < COL; j++)
cout << array[i][j] << "\t";
cout << endl;
}... | ALGO | 0.999501 | 3.550241 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2016-06-03T06:33: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": "b5a71ea1... |
74e3af94-ca62-4784-9d19-b6393e383347 | AIxiaodi4Ever/twoFlat | aarect.cpp | #include "aarect.h"
/* xy_rect member function */
// hit
bool xy_rect::hit(const ray &r, float t0, float t1, hit_record &rec) const
{
float t = (k - r.origin().z()) / r.direction().z();
if (t < t0 || t > t1)
return false;
float x = r.origin().x() + t * r.direction().x();
float y = r.origin().y(... | ALGO | 0.963916 | 6.222987 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2021-04-27T08:01: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": "bc5c5a1a9e... |
724da900-9b76-47e4-93a1-9ab5d882ed85 | KevinChao227/CuttingEdgeDev | CrystalBall_Win/Engine_src/common.cpp | #include "common.h"
using namespace cv;
#if DELAY_TEST
TickMeter g_timer;
#endif
int GeneratePadding(const int nInWidth, const int nInHeight, const int nOutWidth, const int nOutHeight, int& nPaddingX, int& nPaddingY)
{
const float input_aspect_ratio = static_cast<float>(nInWidth) / nInHeight;
const float output_aspe... | TOOL | 0.971942 | 3.606501 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-10-27T17:06:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5767260d9354... |
ff740ee9-6173-4002-9086-bdc5e22d781b | UW-COSC-2030-FA-2017/lab6-chaukap | SortedDriver.cpp | // SortedDriver.cpp
// <NAME> 1445 25 mar 2014
// Construct sorted sequences and call functions that
// process the sorted sequences.
// Edited by <NAME> 26 October 2017
#include "RandomUtilities.h"
#include "ContainerPrinting.h"
#include "winTimer.h"
#include <list>
#include <iostream>
#include <vector>
#inc... | ALGO | 0.9965 | 5.670834 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-23T21:10:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43c6db4bc82... |
3a14fa0a-5f3e-4fd7-9504-e9607833c4af | ZeroHzzzz/C-homework | 20231112/c.cpp | #include <iostream>
using namespace std;
void solve(long long n) {
if (n % 2 != 0) {
cout << -1 << endl;
return;
}
long long min = -1, max = -1;
for (long long b = n / 6; b >= 0; b--) {
if ((n - 6 * b) % 4 == 0) {
long long a = (n - 6 * b) / 4;
min = a + b;
break;
}
}
for ... | ALGO | 0.999875 | 4.099216 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-12-02T09:46:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9aaaae20a0d... |
3f670f29-72fa-46cb-9ff0-8c39a6f4fca3 | AmanPrakash35/CDAC | data_structures/class_work/day_05/static_stack/main.cpp | /*
* main.cpp
*
* Created on: 29-Sep-2017
* Author: sunbeam
*/
#include<iostream>
using namespace std;
#include<cstring>
#define SIZE 5
class stack_t
{
private:
int arr[SIZE];
int top;
public:
stack_t(void)
{
memset(this->arr,0,sizeof(this->arr));
this->top = -1;
}
bool is_stack_full(void)
{
... | ALGO | 0.940915 | 4.057734 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-01-19T18:22:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbb2d2a810... |
b377e6b4-d92a-4f91-b842-4a573b770458 | kagaba-etienne/cp_prep | c++/B. The Butcher/the_butcher_inefficient.cpp | # include <iostream>
# include <vector>
# include <map>
using namespace std;
bool check_configuration(multimap<long long, long long>& rects, long long& h, long long& w) {
if (rects.empty()) {
return true;
}
auto it = rects.find(h);
if (it != rects.end()) {
w -= it->second;
rec... | ALGO | 0.999956 | 3.680527 | {
"github_metadata": {
"branch": "develop",
"commit_count": 19,
"repo_created_at": "2024-02-21T12:10:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f943c2c... |
8fb73ce2-d4fb-4340-9742-eb385107663e | Yadnu/DSA-and-Problem-Solving | selection_sort.cpp | #include <iostream>
using namespace std;
void swap(int *x, int *y)
{
int temp = *x;
*x = *y;
*y = temp;
}
void selection_sort(int arr[], int n)
{
int i, j, min_index;
for (i = 0; i < n - 1; i++)
{
min_index = i;
for (j = i + 1; j < n; j++)
if (arr[j] < arr[min_ind... | ALGO | 0.999982 | 5.322971 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-09-24T11:21:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f46a0404046... |
76b2b3ce-6bda-4fe0-b73a-e6e9b463a33e | E869120/kyopro-tessoku | codes/cpp/chap07/answer_A47.cpp | #include <iostream>
#include <cmath>
#include <ctime>
#include <algorithm>
using namespace std;
int N, X[159], Y[159];
int P[159];
// a 以上 b 以下の整数をランダムに返す関数
int RandInt(int a, int b) {
return a + rand() % (b - a + 1);
}
// 都市 p と q の間の距離を求める関数
double GetDistance(int p, int q) {
return sqrt((X[p] - X[q]) * (X[p] - ... | ALGO | 0.999995 | 4.368988 | {
"github_metadata": {
"branch": "main",
"commit_count": 613,
"repo_created_at": "2022-09-10T03:26:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 665,
"forks": 61,
"issues": 12,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1acdd... |
0cfa1b27-e083-4e64-aa59-0b5cc6d774ba | BidoneAndres/1er-a-o | Memoria Dinamica/Punteros/puntero 9.cpp | #include <iostream>
using namespace std;
void MAYUSCULA( char * );
void minuscula( char * );
int main(int argc, char *argv[]) {
char abecedario[25] = {0};
char *puntero = abecedario;
int i = 0 , j = 0;
MAYUSCULA( puntero );
cout<<"Abecedario en MAYUSCULA...\n";
for ( j = 0 ; j < 25 ; j++ )
{
cout<<... | TOOL | 0.910751 | 4.136857 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-03-19T23:28: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": "2d90e07829ea... |
0d5d8784-7086-4fb9-b6ec-f3a83cbc862e | VinayR-GitHub/competitive-programming | src/Codeforces/Rating/1500/traffic_lights.cpp | #include <bits/stdc++.h>
#define MIN std::min
#define MAX std::max
#define MAG std::abs
#define PAIR std::make_pair
#define ACCEL() \
std::ios::sync_with_stdio(NULL); \
std::cin.tie(NULL);
int main() {
int l, d, v, g, r;
std::cin >> l >> d >> v >> g >> r;
int firsttime = d / v;
if (firsttime % (r... | ALGO | 0.99971 | 3.555376 | {
"github_metadata": {
"branch": "main",
"commit_count": 366,
"repo_created_at": "2024-03-25T02:32:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f78490d9d... |
896194b0-e300-4267-9896-4600893e3e50 | ishandutta2007/codeforces-s | stevenkplus/normal/1333/E.cpp | // =========== Template ========== //
#include <bits/stdc++.h>
using namespace std;
int fastio() { ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); cin.tie(nullptr); return 0; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p);
template<typename A, typename B> o... | ALGO | 0.999868 | 3.924064 | {
"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": "992630e2dcf8... |
16ce5cb0-d60e-47b5-a8f4-f3184f62be03 | Utkarsh-123github/DSA-striver-A2Z | Array Problems/03_remove_duplicates.cpp | #include<iostream>
#include<vector>
#include<set>
using namespace std;
// Brute approach
int removeDuplicates(int arr[], int n) {
set < int > set;
for (int i = 0; i < n; i++) {
set.insert(arr[i]);
}
int k = set.size();
int j = 0;
for (int x: set) {
arr[j++] = x;
}
return k;
}
// Optimal Appr... | ALGO | 0.999965 | 5.309775 | {
"github_metadata": {
"branch": "main",
"commit_count": 113,
"repo_created_at": "2024-01-08T03:01:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad2b8aa3ae... |
5dc4f1f9-43a5-43b9-ba04-8fb1b2e91958 | blbesinaiz/UNCF | Num_Reverse.cpp | /**********************************************************
Programmer: <NAME>
Program Title: Reverse Lexical
Program Description: Program generates a list of pseudo-random
numbers and sorts them by reverse order.
***********************************************************/
#include <iostream>
//#include <string... | ALGO | 0.992833 | 4.458113 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-10-04T18:15: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": "e3b1482ba2... |
6716e567-b16d-4880-943d-3a07858ef3f0 | moddaman/Algorithms | INF237/Avansert Graf/FireStationAC.cpp | #include <cstdio>
#include <climits>
#include <cstdlib>
#include <cassert>
#include <cmath>
#include <cctype>
#include <cerrno>
#include <algorithm>
#include <list>
#include <queue>
#include <map>
#include <vector>
#include <cstring>
#include <string>
#include<iostream>
#include<sstream>
#define REP(i,n) for(int ... | ALGO | 0.999701 | 3.601529 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-12-03T12:03:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e268199bd5... |
f385c660-c80a-4ed8-8de7-5af1a4f2f9de | RobotLocomotion/drake | multibody/topology/link_joint_graph_loop_constraint.h | #pragma once
#ifndef DRAKE_MULTIBODY_TOPOLOGY_GRAPH_INCLUDED
#error Do not include this file. Use "drake/multibody/topology/graph.h".
#endif
#include <string>
namespace drake {
namespace multibody {
// TODO(sherm1) Promote from internal once API has stabilized: issue #11307.
namespace internal {
/* A weld constrain... | TOOL | 0.93793 | 7.346771 | {
"github_metadata": {
"branch": "master",
"commit_count": 33726,
"repo_created_at": "2014-01-26T16:11:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3630,
"forks": 1305,
"issues": 690,
"pull_requests": 46
},
"file_meta": {
"content_id":... |
3c0d37f7-81b1-41df-b947-49508e586f6b | Nihhaar/Competitive_Programming | Miscellaneous/jewelrybox.cpp | #define __USE_MINGW_ANSI_STDIO 0
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <deque>
#include <string.h>
#include <sstream>
... | ALGO | 0.999893 | 3.80666 | {
"github_metadata": {
"branch": "master",
"commit_count": 976,
"repo_created_at": "2018-12-03T23:03:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 53,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08ae600... |
7aa1c627-3795-47a0-b319-3b5c5f35a5a0 | ahefnycmu/asvrg | src/SVRGSolver.h | #ifndef _SVRG_SVRG_SOLVER_H_
#define _SVRG_SVRG_SOLVER_H_
#include "Solver.h"
#include "SGDSolver.h"
// For effeciency, the SVRG parameter vector is represented as
// x + avg_gradient_multiple * avg_gradient,
// where avg_gradient is the average gradient for teh last iterate in the
// previous epoch and x accumulates... | ALGO | 0.988045 | 6.751348 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2017-08-13T15:51:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a901f5f3b... |
1274391e-18dc-48d7-b960-ae73c0cba9d8 | ronitchitre/WaterRobo | src/controller/src/controller.cpp | #include <chrono>
#include <functional>
#include <memory>
#include <vector>
#include <cmath>
using namespace std::chrono_literals;
#include "rclcpp/rclcpp.hpp"
#include <geometry_msgs/msg/vector3.hpp>
#include <geometry_msgs/msg/wrench.hpp>
#include <nav_msgs/msg/odometry.hpp>
// #include <tf2/LinearMath/Quaternion.h... | TOOL | 0.934661 | 4.115516 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2023-01-08T16:16: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": "ca0a4423ffc... |
b8b86d1f-61c9-4e9e-8726-20fbb7034f32 | endeavourmonk/DSA | Linked List/234. Palindrome Linked List.cpp | // 234. Palindrome Linked List
// SC: O(1)
// TC: O(N)
bool isPalindrome(ListNode *head) {
// Getting the Mid of the linked list O(N/2) => O(N)
ListNode *fp = head, *sp = head;
while (fp && fp->next) {
fp = fp->next->next;
sp = sp->next;
}
// Reverse the 2nd half of linked list O(N/... | ALGO | 0.999496 | 5.574627 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2022-09-25T15:57:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14abc3486... |
d68774f1-cd67-46c8-afd7-569b66f505fc | lalchand07/CPP-DSA | Arrays/minMax-Efficient.cpp | /*******************************************
Maximum and minimum of an Array
*******************************************/
#include <iostream>
using namespace std;
// class Pair to get min and max number to return from functin...
class Pair{
public:
int min;
int max;
void display(){
cout<<"\nMaximum Number in... | ALGO | 0.999783 | 5.122649 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-06-05T02:21: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": "e6fee465494... |
b1d03d3c-8d4b-4014-bfa3-125499cbb183 | JJJayyyy/Automatic_Test_Pattern_Generation | clog_tmp.cpp |
//#include "circuit.hpp"
//#include "node.hpp"
void circuit::log_sim(string log_file_name){
char tmp;
//set val of all Node to -1 (initial value of each node in circuit is -1)
for (int i = 0; i < Nnodes; i++){
np = Node[i];
np -> val = -1;
}
//read the primary input file, i... | TOOL | 0.901375 | 3.218969 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-03-12T01:56:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40595ebdbf1a... |
eb3443e3-208f-4634-a0e7-32de90095f9f | HEltim7/cpcode | Luogu/P5496.cpp | #include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
#define endl '\n'
using LL=long long;
constexpr int N=5e5+10;
int dep[N];
struct PalindromeAutomaton {
const static int A=26;
const static char B='a';
struct Node {
int len,link;
int cnt;
int ch[A];
... | ALGO | 0.999978 | 4.322898 | {
"github_metadata": {
"branch": "master",
"commit_count": 249,
"repo_created_at": "2022-06-06T13:55: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": "1accd104... |
ff3db375-4785-4ae1-ac41-a9c524b276f3 | grinisrit/noa | src/noa/3rdparty/tnl-noa/src/Examples/flow-sw/UpwindMomentumX.h | #pragma once
#include <TNL/Containers/Vector.h>
#include <TNL/Meshes/Grid.h>
#include "UpwindMomentumBase.h"
namespace TNL {
template< typename Mesh,
typename Real = typename Mesh::RealType,
typename Index = typename Mesh::IndexType >
class UpwindMomentumX
{
};
template< typename MeshReal,
... | ALGO | 0.998246 | 6.574075 | {
"github_metadata": {
"branch": "master",
"commit_count": 1264,
"repo_created_at": "2020-09-16T07:04:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 152,
"forks": 31,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "3c04... |
c3562318-ac15-4912-ab79-20cff62441e3 | human6014/Baekjoon | 1753/최단경로.cpp | #include <iostream>
#include <vector>
#include <queue>
#define INF 987654321
using namespace std;
int V, E;
int dist[20001];
vector<pair<int, int>> node[30001];
void Dijkstra(int start) {
priority_queue <pair<int, int>,
vector<pair<int, int>>,
greater<pair<int, int>>> pq;
dist[start] = 0;
pq.push({ dist[sta... | ALGO | 0.999965 | 4.317591 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2022-04-12T06:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d750981ee6... |
0ddb7921-3210-4cb8-b708-1e69013e4324 | uchile-robotics-graveyard/code_graveyard | complete_pkgs/mp_tracker/include/munkres.h | /*
* Copyright (c) 2007 <NAME>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is... | ALGO | 0.999386 | 5.543324 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2017-05-17T22:34:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e4f7a5ec6... |
5e2003f6-0103-46c6-84a4-f8f21b59e967 | kkrath/PracticeProblems | Arrays/RemoveKthItemFromList.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
struct LinkedNode{
int data;
LinkedNode* next;
LinkedNode(int data):data(data),next(nullptr){}
};
class Items{
LinkedNode* head;
LinkedNode* last;
bool sorted;
int length;
public:
Items(){
head = last =... | ALGO | 0.999923 | 4.669333 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2020-04-09T20:40: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": "453bcbf1b... |
ec4a71ff-b332-4522-a0d3-8bc80b44c186 | kc97ble/Problems | lthterror/statement/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define Fit(i,c) for (__typeof__((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define inf 1000000005
#define all(a) (a).begin(), (a).end()
#define ms(a,x) memset(a, x, sizeof(a))
#define mod ... | ALGO | 0.999959 | 3.656005 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2015-02-06T15:03:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85d29b366... |
8020a24a-f886-4991-8c3a-dcd0ee802cc6 | keineahnung2345/leetcode-cpp-practices | 1079. Letter Tile Possibilities.cpp | //Runtime: 120 ms, faster than 17.63% of C++ online submissions for Letter Tile Possibilities.
//Memory Usage: 31.3 MB, less than 100.00% of C++ online submissions for Letter Tile Possibilities.
class Solution {
public:
set<string> lastCombs, curCombs, allCombs;
map<char, int> charCount;
void genC... | ALGO | 0.999863 | 6.11882 | {
"github_metadata": {
"branch": "master",
"commit_count": 2080,
"repo_created_at": "2018-11-25T06:48:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 284,
"forks": 120,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "372... |
efdb61f5-2698-43ad-95b7-389b11b973ce | Xilinx/Vitis-AI | src/vai_library/xnnpp/src/x_autonomous3d/utils.hpp | /*
* Copyright 2022-2023 Advanced Micro Devices Inc.
*
* 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 applica... | DATA | 0.969405 | 4.408398 | {
"github_metadata": {
"branch": "master",
"commit_count": 1253,
"repo_created_at": "2019-10-16T21:41:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1631,
"forks": 649,
"issues": 340,
"pull_requests": 75
},
"file_meta": {
"content_id": "... |
5d775dd8-3070-4196-9f55-33d321b787d2 | hyeonjin25/problemSolving | 문제해결기법/7-1.cpp | #include <iostream>
#include <vector>
#include <memory.h>
// 양팔 저울 : 어떤 공은 자신보다 가벼운 공들을 가리킴
// 단방향 그래프 문제
// dfs 사용해서 가벼운 공들을 전부 가보기, visit의 개수가 자신보다 가벼운 공들의 개수(자기자신 제외하므로 1 뺴고 출력하기)
// 그래프 초기화 할 떄 전부 초기화하기! n까지 하지 말기
// //// 0번은 없음, 1번 공부터! 기억하기
using namespace std;
vector<int> graph[101];
int visit[101] = { 0, };... | ALGO | 0.999803 | 4.136496 | {
"github_metadata": {
"branch": "master",
"commit_count": 234,
"repo_created_at": "2021-09-03T12:25:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd74fd68... |
45811970-d99c-45a9-8301-8525bee0bc4b | kagan019/competitive-programming | CodeJam/Foregone Solution.cpp | #include <bits/stdc++.h>
using namespace std;
long long subfours(long long n){
long long ret = 0;
long long powof10 = 1;
while(n){
if (n% 10 == 4) {
ret += 3 * powof10;
}
else
ret += (n % 10) * powof10;
n /= 10;
powof10 *= 10;
}
retur... | ALGO | 0.999244 | 4.150823 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2021-02-22T05:36: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": "f481f272645... |
38bd4d69-70d7-46ba-af5b-c8b8e3aa50dc | zzk72/Data_structure | 3/旅行.cpp | /*
7-3 旅行 I
分数 100
作者 谷方明
单位 吉林大学
五一要到了,来一场说走就走的旅行吧。当然,要关注旅行费用。由于从事计算机专业,你很容易就收集到一些城市之间的交通方式及相关费用。将所有城市编号为1到n,你出发的城市编号是s。你想知道,到其它城市的最小费用分别是多少。如果可能,你想途中多旅行一些城市,在最小费用情况下,到各个城市的途中最多能经过多少城市。
输入格式:
第1行,3个整数n、m、s,用空格分隔,分别表示城市数、交通方式总数、出发城市编号, 1≤s≤n≤10000, 1≤m≤100000 。
第2到m+1行,每行三个整数u、v和w,用空格分隔,表示城市u和城市v的一种双向交通方式费用为w , 1≤w≤1... | ALGO | 0.999822 | 3.60453 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-06-09T00:47:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f151a02b616... |
26d84cfd-9655-42f2-bb35-139ff674ef9c | Pankaj-Chouhan10/DataStructures | Linked List/singly_linked_list.cpp | #include "iostream"
using namespace std;
// Class Node to create node in Liked List.
class Node
{
public:
int value;
Node *next;
Node()
{
int value;
cout << "Enter the value : ";
cin >> value;
this->value = value;
next = NULL;
}
};
// Class LinkedList to perf... | ALGO | 0.997764 | 5.511979 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-06-26T15:59: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": "b8b3bbd6e54... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.