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 |
|---|---|---|---|---|---|---|---|
9572c21c-fba1-407e-b3c8-68a9a76ae235 | kss418/Codeforces | Div.2/800/837/B.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <set>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <string>
#include <map>
using namespace std; typedef long long ll;
typedef pair <int, int> pi; typedef pair <ll, ll> pll;
ll n, m, k, t; string s;
c... | ALGO | 0.99993 | 3.716045 | {
"github_metadata": {
"branch": "main",
"commit_count": 805,
"repo_created_at": "2024-09-16T15:54: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": "b3e243ddbc... |
23f0a8c9-1dd1-4ed4-9b51-4bb488f5c073 | Yash-Desh/CPP-Practice | 2_cpp_DSA/7_Linked_List/1_Linked_List_AB/1_Singly_LL/1e_LL_max_min.cpp | // Author : <NAME>
// Date : 28-06-2022
// Tutor : <NAME>
#include <iostream>
using namespace std;
// structure to define a Node
struct Node
{
int data; // node data
struct Node *next; // pointer to next node
}*first = NULL; // "first" is a global pointer of the "Node type" , initialized to point at ... | ALGO | 0.999865 | 4.560338 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-12-28T00:00:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c07ac38149f6... |
1fcd4178-9290-4892-b01d-eb9c2841d5a2 | raincross7/code-similarity | codes/train_code/problem357/problem357_8.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<ll, ll>;
const vector<ii> xs {
{ 0, 0 },
{ 20, 18 },
{ 11, 9 },
{ 4, 3 },
{ 13, 9 },
{ 14, 9 },
{ 5, 3 },
{ 16, 9 },
{ 17, 9 },
{ 2, 1 },
};
ll solve(const vector<ii>& ds)
{
ll ans = 0;
... | ALGO | 0.999942 | 4.394158 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b653b792ef96... |
444af401-ea74-425e-9ef0-9227fc017000 | akhilkammila/leetcode-screenshotter | editorial_code/1000-1999/1125. Smallest Sufficient Team/cpp-0.cpp | class Solution {
public:
vector<int> smallestSufficientTeam(vector<string>& req_skills, vector<vector<string>>& people) {
int n = people.size(), m = req_skills.size();
unordered_map<string, int> skillId;
for (int i = 0; i < m; i++) {
skillId[req_skills[i]] = i;
}
... | ALGO | 0.999976 | 5.991536 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-06-02T16:24:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 912,
"forks": 294,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "e2874d2... |
c8990190-7b4f-4803-9e10-b0fa466a80ab | TirilaPatricGabriel/DFA-NFA- | main.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
#include <fstream>
using namespace std;
vector<vector<int>> toatePosibilitatile = {};
string automat;
bool accepted_word = 0;
void dfs(unordered_map<int, unordered_map<char, vector<int>>> Map, int node, vector<int> res, string targetString, int lettersDone... | ALGO | 0.999926 | 5.212947 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-03-20T19:58: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": "e90b0e763a... |
e42f3552-432c-4845-bb88-bf94e8d9a33e | RolosRCR/trasladar | trasladar/main.cpp | #include <GL/glew.h>
#include <GL/freeglut.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstring>
#include <sstream>
using namespace std;
int width = 2000;
int height = 1000;
std::vector<float> vertices;
std::vector<int> faces;
std::vecto... | TOOL | 0.984663 | 4.49208 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-19T22:50:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "889be4ed0222... |
af15a2ad-00c5-43b3-a039-d97604612dbe | rubcv/INGENIERIA-INFORMATICA-ETSIIT-UGR | 1 PRIMERO/1 Cuatrimestre/Fundamentos de Programación - FP/EXAMENES/FP2-grupoF1.cpp | /***************************************************************************/
// FUNDAMENTOS DE PROGRAMACIÓN
// GRADO EN INGENIERÍA INFORMÁTICA
//
// CURSO 2015-2016
// DEPARTAMENTO DE CIENCIAS DE LA COMPUTACIÓN E INTELIGENCIA ARTIFICIAL
//
// EXAMEN PRÁCTICO - ENERO 2016
// solución al problema : diferencia
//
/*****... | ALGO | 0.996833 | 4.600343 | {
"github_metadata": {
"branch": "master",
"commit_count": 176,
"repo_created_at": "2019-06-18T12:49:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee21411... |
64ea57a5-1d0f-42bd-a86e-6823315bd640 | ishandutta2007/codeforces-k | kostya_by/normal/69/B.cpp | //
// main.cpp
// bids
//
// Created by <NAME> on 09.05.11.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <... | ALGO | 0.998859 | 3.774173 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "81bc3fea5317... |
a27f38ab-7129-44b9-8dc5-c724b30ea946 | ishandutta2007/codeforces-c | cookiedoth/normal/1375/G.cpp | /*
Code for problem G by cookiedoth
Generated 05 Jul 2020 at 04.07 PM
(@)(@)(@)(@)(@)
^_^
~_^
z_z
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <functional>
#inc... | ALGO | 0.999333 | 4.171624 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08076311f555... |
ba8bf4b4-c6c2-4115-b7ab-212cac3089cb | caando/Competitive-Programming-Archive | CSES/Graph Algorithms/Teleporters Path/solution.cpp | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
#define fi first
#define se second
#define sz(c) ((int)(c).size())
#define all(c) (c).begin(), (c).en... | ALGO | 0.999995 | 3.676651 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2021-05-28T12:03:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07a732d0e5... |
385f91f5-71fb-40a0-ada7-ecb456fda404 | ThreadDao/milvus | core/src/index/knowhere/knowhere/index/vector_index/IndexBinaryIVF.h | // Copyright (C) 2019-2020 Zilliz. 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 l... | ALGO | 0.957117 | 7.189989 | {
"github_metadata": {
"branch": "master",
"commit_count": 5742,
"repo_created_at": "2020-08-10T03:53:37.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "milvus-io/milvus",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_... |
c8bacda0-ea0f-498d-bb90-a13b38b2bd91 | ana-GT/Tester | Planners/RRT/RRT.cpp | /*
* Copyright (c) 2011, Georgia Tech Research Corporation
* All rights reserved.
* @file RRT.cpp
*
* Authors: <NAME> <<EMAIL>>, <NAME> <<EMAIL>>
* Date: 10/2011
*
* Humanoid Robotics Lab Georgia Institute of Technology
* Director: <NAME> http://www.golems.org
*
*/
#include <kinematics/BodyNode.h>
... | ALGO | 0.999383 | 5.425262 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2012-05-29T09:24: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": "f0b981eb6... |
a945cf10-d66c-4696-a467-7dcedf1c8019 | JJungwoo/algorithm | baekjoon/string/16916.cpp | /*
[boj] 16916. 부분 문자열
*/
#include <iostream>
#include <string>
#include <vector>
#include <cstdio>
using namespace std;
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
vector<int> getPi(string p) {
int m = (int)p.size(), j = 0;
vector<int> pi(m, 0);
for (int i = 1; i < m; i++) {
while (... | ALGO | 0.999977 | 4.674198 | {
"github_metadata": {
"branch": "master",
"commit_count": 527,
"repo_created_at": "2019-11-17T16:30:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7bb4e96f... |
05d692c3-1315-41d3-9c27-57b113000f88 | wgevaert/AOC | 2017/6.cpp | #include <iostream>
#include <fstream>
#include <vector>
bool has_occurred(const std::vector<std::vector<unsigned short>>& b,const unsigned& index) {
for(unsigned long i=index-1;i<index;i--) {
bool equal = true;
for (unsigned j=0;j<b[0].size();j++) {
if (b[i][j]!=b[index][j]) {
... | ALGO | 0.999893 | 3.4282 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2019-12-03T21:03:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ac8353cc... |
666de54b-b877-461c-860a-506aee6e5f12 | priyavrat-misra/leetcode-solutions | solutions/binary-tree-paths.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.999973 | 6.007699 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2022-06-10T07:47:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0062c207... |
25e6e11d-3402-4b4d-8ab9-00ea8d5bad76 | lishuwei0424/xmind_for_cs_basics | 10.刷题经验/C++_剑指Offer分类练习/数组相关/45.cpp |
// 面试题45:把数组排成最小的数
// 题目:输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼
// 接出的所有数字中最小的一个。例如输入数组{3, 32, 321},则打印出这3个数
// 字能排成的最小数字321323。
#include <iostream>
using namespace std;
#include <cstring>
#include <algorithm>
//比较两个数,不是大小,而是m和n哪一个应该放在前面
//mn<nm则 m放前面,反之
//考虑可能出现大数问题,因此将数字转成字符串处理
// int型整数用十进制表示最多只有10位
const int g_MaxNu... | ALGO | 0.999726 | 4.475226 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-03-25T07:44:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "250e6e3d07... |
631e0acf-ead7-4d0d-ab60-8a8ab5cc85ec | reymon4/cuda | main.cpp | //
// Created by fing.labcom on 21/01/2025.
//
#include <iostream>
#include <cuda_runtime.h>
const size_t VECTOR_SIZE =1024*1024;
void suma_serial(float* x, float* y, float* z, int size)
{
for(int i=0; i<size; i++)
{
z[i] = x[i] + y[i];
}
}
extern "C"
void suma_paralela(float* a, float* b, float... | ALGO | 0.989289 | 4.840472 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-21T13:50:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff42a957fa28... |
76fee941-b35b-425d-a034-2411e86030df | baohueih/TBMTJ | src/core/lib.cpp | #include "lib.h"
mat22 toSpinSpace(double up, double dn, double gamma)
{
mat22 T = {up, 0, 0, dn};
return unitaryTransform(T,gamma);
}
double fermiD(double E, double T)
{
double kB = 8.6173324E-5;
return 1.0 / (exp(E / (kB * T)) + 1.0);
}
OnsiteEnergy::OnsiteEnergy(double e_up, double e_dn, dou... | ALGO | 0.999307 | 4.833836 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2015-10-20T14:26: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": "419b316ef... |
a95d8933-263a-46c1-a5d7-01b9040f19a3 | blender/blender | source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines.cc | /* SPDX-FileCopyrightText: 2021 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup draw
*/
#include "BLI_array_utils.hh"
#include "GPU_index_buffer.hh"
#include "extract_mesh.hh"
#include "draw_cache_inline.hh"
#include "draw_subdivision.hh"
namespace blender::draw {
static... | ALGO | 0.905853 | 5.974788 | {
"github_metadata": {
"branch": "main",
"commit_count": 152123,
"repo_created_at": "2019-10-09T12:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15670,
"forks": 2395,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4... |
7906f4fc-67b7-49e4-b7e1-684520a3d755 | leostd/Competitive-Programming | Codeforces/Rounds/EducationalRound2/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
char ch;
int n = 0;
map<char, int> c;
ch = getchar();
while(ch >= 'a' && ch <= 'z'){
c[ch]++;
ch = getchar();
n++;
}
bool palindrome = true, first = true;
int odds = 0;
for(auto it = c.begin(); it !=... | ALGO | 0.999994 | 3.196148 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2017-04-09T05:24:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6070207e... |
2c03003b-c0de-41a3-863c-7e2df678a211 | JoBoCl/advent-of-code-2019 | 14/fourteen.cc | #include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <regex>
#include <string>
#include <string_view>
#include <vector>
#include "../common/parser.h"
using std::literals::operator""sv;
std::regex component("([0-9]+) ([A-Z]+)[, ]*");
using Chemicals = std::map<std::string, long>;
using Che... | ALGO | 0.998158 | 5.641719 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2019-11-30T13:02: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": "2fdd1406e... |
3ae9a9b8-26a9-4b3f-add6-9986d279260b | shahzebshafi/School-Projects | ShafiA2/src/LLnode.h | /*
* LLnode.h
*
* Created on: Aug 30, 2020
* Author: shahzebshafi
*/
#include <iostream>
#include <string>
#include "Student.h"
using namespace std;
#ifndef LLNODE_H_
#define LLNODE_H_
template <class T>
class LL
{
private:
struct LLnode
{
LLnode *fwdPtr;
T theData;
};
LLnode* head;
public:
LL (){head... | TOOL | 0.971316 | 4.527517 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-10-19T03:39: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": "45a01b7a194d... |
ea3f4128-d725-4593-a64c-7d711c8e0c4d | Narotam-Mishra/problem_solving | Basic_problems/PlusOne.cpp |
// Problem link - https://leetcode.com/problems/plus-one/
#include<bits/stdc++.h>
using namespace std;
vector<int> plusOne(vector<int>& digits) {
// Start from the end of the array (least significant digit)
for (int i = digits.size() - 1; i >= 0; i--) {
// If the current digit is less than 9, we can ... | ALGO | 0.999895 | 6.258859 | {
"github_metadata": {
"branch": "main",
"commit_count": 716,
"repo_created_at": "2023-12-06T18:31:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d51944e47a... |
32db5bce-bfa4-4228-9335-620ac7209ca8 | Akash21Thakur/DSA-AND-CPP-PRACTICE-PROBLEMS | data_structure/DP/ladders_prob.cpp | #include <iostream>
using namespace std;
int laddersTopDown(int n, int k, int *dp)
{
// base case
if (n == 0)
return 1;
// look-up
if (dp[n] != 0)
return dp[n];
// rec case
int ways = 0;
for (int i = 1; i <= k; i++)
{
if (n - i >= 0)
ways += ladders... | ALGO | 0.999961 | 4.235115 | {
"github_metadata": {
"branch": "main",
"commit_count": 128,
"repo_created_at": "2022-01-31T11:19:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d63af4fa3... |
a174c964-a2f6-4033-8ca4-bcfd23395b77 | aadil-srivastava01/ds-algo24 | problems/expTree.cpp | /* Problem Statement:
You're given a binary expression tree. Write a function to evaluate this tree mathematically and return a single resulting integer.
All leaf nodes in the tree represent operands, which will always be positive Integers. All of the other nodes represent operators. There are 4 operators supported, e... | ALGO | 0.999993 | 6.788704 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2024-01-03T01:01:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53ddfa5c97d... |
aab8dd43-7f98-4e0e-84e0-abe2d6b1cca7 | C0derTang/mixed-cp-solutions | CF/CF 1992A Only Pluses.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long
#define vi vector<int>
#de... | ALGO | 0.999815 | 5.029789 | {
"github_metadata": {
"branch": "main",
"commit_count": 381,
"repo_created_at": "2022-12-25T05:08:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5cd204eb78... |
a182913f-d6e7-408e-8c05-154490eb34f9 | Ujala-2110/DSA_Cpp | Linked_List/Detect_loop.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
int flag;
Node *next;
Node(int x)
{
data = x;
next = NULL;
}
};
void push(Node **head, int x)
{
Node *new_node = new Node(x);
new_node->next = (*head);
(*head) = new_node;
}
// bool detec... | ALGO | 0.999949 | 3.986716 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-14T13:16: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": "ac0e0aca0009... |
f5ec8f2c-1b12-4904-87ed-25e8ff86f00d | KENEW/Algorithm | 1707_이분_그래프_DFS.cpp | #include<iostream>
#include<vector>
#include<queue>
#include<memory.h>
#define MAX 20001
using namespace std;
int visited[MAX];
vector<int> map[MAX];
int T, V, E;
void DFS(int start)
{
if (visited[start] == false)
{
visited[start] = 1;
}
for (int i = 0; i < map[start].size(); i++)
{
int next = map[start][i]... | ALGO | 0.999956 | 5.371467 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2020-04-17T16:03: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": "00bc78664... |
8ca6c7b4-bbec-45b8-8dd7-9e6822d6534f | 5an7y/CPProblemGenerator | Problems/NumerosGrandes/AMasB/solution/solution.cpp | #include <bits/stdc++.h>
using namespace std;
struct BigInteger {
string str;
BigInteger(string s) { str = s; }
BigInteger operator+(const BigInteger& b)
{
string a = str;
string c = b.str;
int alen = a.length(), clen = c.length();
int n = max(alen, clen);
if... | ALGO | 0.999948 | 4.540785 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2023-05-07T15:15: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": "93b67c81000... |
0545851e-def8-49b6-b66e-ded869271f66 | HustDsy/LeetCode | 632-最小区间/632-最小区间/main.cpp | //
// main.cpp
// 632-最小区间
//
// Created by 董深育 on 2020/8/1.
// Copyright © 2020 董深育. All rights reserved.
//
#include <iostream>
#include<vector>
#include<unordered_map>
using namespace std;
class Solution {
public:
//将数组排序 返回flag
vector<vector<int>>sort(vector<int>nums1,vector<int>flag1,vector<int... | ALGO | 0.999734 | 5.292274 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2020-06-08T09:56: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": "113f3612... |
291734cc-6aae-4e70-85f8-ca5c9d4c3236 | arimnrg16/CP | Contest & Online Judge/UVa & Live Archive/12724.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
#include <cassert>
#define makmu using
#define ndasmu namespace
#define gundulmu std
ma... | ALGO | 0.999897 | 3.546857 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2019-03-13T13:45:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2357ffd... |
9bd76d51-fbc5-4d8a-8bf7-bd51bcadc411 | benggee/data-structure | c++/graph/lazy_prim_mst.h | //
// Created by HEADS on 2021/2/17.
// 最小生成树,prim算法实现
//
#ifndef C___LAZY_PRIM_MST_H
#define C___LAZY_PRIM_MST_H
#include <iostream>
#include <vector>
#include <cassert>
#include "minheap.h"
#include "edge.h"
using namespace std;
template<typename Graph, typename Weight>
class LazyPrimMST {
private:
Graph &G; ... | ALGO | 0.999966 | 5.365214 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2019-03-24T04:20:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 71,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd1725... |
fb1170e2-2e65-48aa-86b2-529dd5f10f66 | ejvelasco/interview-algorithms | ARQ-Capital-Management/computePower.cc | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
/*
* You are given two integers, p and q. Complete the function calculatePower which takes two integers
* as arguments and returns p to the power of q, without using the built-in power function.
* We expect you to do better than O(q). A same... | ALGO | 0.999922 | 6.749074 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2017-10-31T17:38:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f5d09e319... |
ff44b9a3-6a1e-4c38-9fea-d51cfa6e9b06 | gudlad/Cpp | STL/Containers/sequence_containers/vector_exercise.cpp | #include <iostream>
#include <vector>
#include "Person.hpp"
using std::cin;
using std::cout;
using std::endl;
/*
! NOTE:
- When we are using our own user defined types with STL always overload the < and == operators.
*/
std::ostream &operator<<(std::ostream &os, const Person &rhs)
{
os << rhs.name << " " << rhs.... | TOOL | 0.967549 | 5.30101 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-12-16T07:33: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": "e6c17713327... |
90f7cc9a-08d4-4798-a564-3aaa8c861a08 | userlandkernel/baseband-research | okl4_kernel/okl4_2.1.1-patch.9/pistachio/include/smp.h | /*
* Copyright (c) 2002-2003, Karlsruhe University
*
* 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 conditions and th... | TOOL | 0.933899 | 6.871949 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-12-04T22:21:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 116,
"forks": 25,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65000a... |
d7064c66-3a61-4caf-9627-2d873e2ded2b | kumawatvinit/Strivers-SDE-Sheet-60DayChallenge | Day5-Linked-List/4-remove-nth-node-from-back.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
ListNode *remove(ListNode *head, int n)
{
ListNode *slow = head, ... | ALGO | 0.999976 | 5.444732 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-06-04T15:02:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ef252244e8... |
5f3380a5-bfbb-4620-9c37-a01ae58dfa1e | ishandutta2007/codeforces-w | will_dearborn/normal/1190/D.cpp | #include <stdio.h>
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <set>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <complex>
#include <map>
#include <unordered_map>
#include <queue>
#include <array>
#include <bitset>
#incl... | ALGO | 0.999757 | 3.973598 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34: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": "0a984fa8d9b9... |
426bd2f0-f4ff-4f09-9a89-d9cd4e7dd41e | kamrulashraf/Lightoj | 1141.cpp | #include <bits/stdc++.h>
using namespace std;
#define NN 1005
bool vis[NN];
int level[NN];
std::vector< int > prime[NN];
void factor(int n){
for(int i = 2 ; i<= n ; i++){
if(vis[i] == 0){
for(int j = i*2 ; j<= n ; j+= i){
prime[j].push_back(i);
vis[j] = 1;
... | ALGO | 0.999973 | 4.243875 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-10-03T10:14: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": "772c1193fb... |
fc940a5d-e237-4ae9-8cb1-ec4c71465638 | NikitaGupta-17/DSA- | C++/linkList/DeleteAlternateNodes.cpp | #include<iostream>
using namespace std;
class node
{
public:
int data;
node *next;
};
node* head;
void insert(int x)
{
node *new_node = new node();
new_node->data = x;
new_node->next = NULL;
if(head==NULL)
head = new_node;
else
{
node *ptr=head;
while(ptr->next!... | ALGO | 0.999707 | 4.350055 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2022-07-03T15:28:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bf63cc9945... |
71a21c52-06a5-4245-946c-3a74c9cfa72c | yisongbetter/Computer_Graphics | hw1_raytracing/ray/ray/ray.cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include "udray.h"
#include "glm.h"
using namespace std;
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
extern Camera *ray_cam; // camera inf... | ALGO | 0.976861 | 5.141327 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-03-08T12:25: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": "3f4b0a8151... |
30c4211a-68f3-4b11-b21d-5814f8f4c0ab | LaurOp/Binary-Search-Tree | Arbore.cpp | #include "Arbore.h"
#include<iostream>
#include <stdlib.h>
using namespace std;
ArboreBinarCautare::ArboreBinarCautare():contor(0)
{
}
ArboreBinarCautare::~ArboreBinarCautare()
{
}
ostream& operator<<(ostream& out, ArboreBinarCautare::nod n)
{
out<<n.info;
return out;
}
long long int ArboreBinarCautare::min(... | ALGO | 0.999576 | 3.19804 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-12-20T22:27: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": "30a8da96d01c... |
f3f408f4-771e-4dc4-8eae-391cafbb725c | ashishgopalhattimare/LeetCode | Medium/trie.cpp | //============================================================================
// Name : template.cpp
// Author : <NAME>
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#in... | ALGO | 0.999714 | 4.841371 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2018-08-17T11:47:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdeb31c5c... |
01d3b22c-b06d-4723-acee-1152aabeadd4 | fparaggio/BoneClamp | xi-bone/plugins/include/DSP/dif_niso.cpp | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// File = dif_niso.cpp
//
// Decimation-In-Frequency FFT
//
// Naturally-ordered Input / Scrambled Output
//
#include <math.h>
#include "complex.h"
#include "log2.h"
#include "misdefs.h"
#include "cbitrev.h"
#include "dif_niso.h"
void FftDifNiso( ... | ALGO | 0.999806 | 5.790871 | {
"github_metadata": {
"branch": "master",
"commit_count": 227,
"repo_created_at": "2013-05-26T22:03:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf8b9a22... |
98d4379a-b50c-4bc7-b74c-a2970763a41d | Dinesh-RDY/DailyCoding | DailyPractice/Week11/knapsack1.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
long n;
cin >> n;
long w;
cin >> w;
long W[n];
int P[n];
for (int i = 0; i < n; i++)
{
cin >> W[i];
cin >> P[i];
}
long long dp[n + 1][w + 1];
for (int i = 0; i <= n; i++)
{
for (int j = 0;... | ALGO | 0.999979 | 3.924333 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2022-05-15T14:10:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c3ca9fdc... |
4c7e2dd2-15fe-4a0d-a98a-28e50f6261c5 | drewtu2/myUtils | project_stubs/cpp/project3gtest/include/heap.hpp | #ifndef Heap_h
#define Heap_h
//#define LargeValue 999999999
//#define SmallValue -999999999
#include <iostream>
#include "d_except.h"
#include <vector>
#include <cstdlib>
#include <algorithm>
template <typename T, typename U>
class heapV
{
public:
heapV();
void initializeMaxHeap(vector<T> list2);
void initi... | ALGO | 0.995318 | 3.953631 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2017-10-20T04:26:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 11
},
"file_meta": {
"content_id": "de86857... |
1fbbf950-a868-48a7-a576-28ec93dcb591 | Dradux-dev/b-mi-cpp-2020 | exercise-03/main.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <functional>
#include <map>
#include "assert.h"
#include "treemap.h"
#include "payload.h"
using namespace std;
using my::treemap;
/// @todo Write test, that proves non-owning pointer behavior of iterator
/// - Get iterator of a certain element... | TEST | 0.90044 | 5.987798 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-04-21T08:05: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": "76063de67... |
9c8ee1ec-7390-445f-8458-42c3be7ae046 | SooinPark1019/PS | 백준/Platinum/17559. Paris by Night/Paris by Night.cc | #include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(v) (v).begin(), (v).end()
#define zip(v) sort(all(v)); v.erase(unique(all(v)), v.end());
#define int long long
#define ll long long
using namespace std;
const int INF = 0x3f3f3f3f;
const double EPS = 1e-9;
const ll LNF = 1e18;
cons... | ALGO | 0.999927 | 4.390793 | {
"github_metadata": {
"branch": "main",
"commit_count": 483,
"repo_created_at": "2024-09-01T15:38: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": "55d6ee45a8... |
2724d224-dbd9-41d2-ab17-03b1390ec8c8 | schreiberx/sph_swe | src/SWERexiSPHRobert.hpp | /*
* SWE_REXI_SPH.hpp
*
* Created on: 30 Aug 2016
* Author: martin
*/
#ifndef SRC_SWEREXISPHROBERT_HPP_
#define SRC_SWEREXISPHROBERT_HPP_
#include <sph/SPHSolverComplex.hpp>
#include <sph/SPHOperatorsComplex.hpp>
#include <sph/SPHConfig.hpp>
/**
* REXI solver for SWE based on Robert function formulatio... | ALGO | 0.998259 | 6.617222 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2016-08-24T20:35: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": "3a2ad60d1... |
68009084-e47b-498d-94ed-40eafaecffec | huanghua1994/HiGP | cpp-src/h2mat/octree.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <algorithm>
#include "octree.h"
#include "../common.h"
#include "../utils.h"
#define OCTREE_MAX_DIM 3
#define OCTREE_MAX_CHILDREN (1 << OCTREE_MAX_DIM)
// Extend the enclosing box a little bit to avoid numerical... | ALGO | 0.999578 | 5.699423 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-10-25T05:24:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c27d039b24... |
2545ea54-9c50-4917-ba84-21f8745579ce | dspinoz/7Seg | NumCounter4Dig/NumCounter4Dig.ino |
//NumCounter4Dig
//Use a 4 digit 7 segment display to count a series of numbers
//Because its a common cathode display, HIGH = ON and LOW = OFF.
//Digit pins must be multiplexed!
//<EMAIL>
//PINS for the 7-segments
#define pA 2
#define pB 1
#define pC 10
#define pD 11
#define pE 7
#define pF 4
#define pG 5
#define pD... | ALGO | 0.919902 | 5.517883 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2012-09-14T01:54:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "74105bf42... |
daebe54e-3733-4971-ab9f-04f5031042a2 | tahsinozden/MyDevelopmentEnv | DevProject_C++/TicTacToeImplement/TicTacToeImplement.cpp | #include <iostream>
#include <vector>
#include "TicTacToeLib.h"
#include "Global.h"
using namespace std;
// TODO: there are some wrong moves to be fixed.
//int maxX = 0, maxY = 0;
static int dizi[10];
void IAPlays(Players me, int board[3][3], int deeper,TicTacToe newGame);
static int counter = 0;
int Call2(int n);
in... | ALGO | 0.996026 | 4.126421 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2014-12-07T18:31: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": "4e8bf7ed3... |
2a56b4fb-6120-4b1e-a320-307849b2bb2c | chanhou/parallel_2015 | hw4/libIDASOAp.cpp | #include <iostream>
#include "IDALib.h"
#include "math.h"
#include <omp.h>
using namespace std;
// read/write to known coordinates
double read(const int DIM, const int nPoints, const int whichPt,
const int whichDim, const double *coords){
return coords[ whichPt + whichDim * nPoints ];
};
void write(const int ... | ALGO | 0.999319 | 4.502184 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2015-04-14T06:20:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e51e6c364... |
b69d4c75-f01d-4b87-a938-2209afc55385 | ishandutta2007/codeforces-d | dreamoon_love_aa/normal/1198/C.cpp | /*{{{*/
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) s... | ALGO | 0.999719 | 3.203581 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "bbe26d5e249f... |
aec69c2e-3770-41c4-9dde-cfb5e6d36c5c | marvins/ProjectEuler | cpp/euler041/euler041.cpp | /**
* @file euler041.cpp
* @author <NAME>
* @date 5/3/2015
*/
// C++ Standard Libraries
#include <cinttypes>
#include <iostream>
// Common Libraries
#include "../common/Math_Utilities.hpp"
#include "../common/Primesieve.hpp"
#include "../common/StringUtilities.hpp"
using namespace std;
/**
* @brief Main ... | ALGO | 0.999759 | 5.5852 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2015-04-25T20:58:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c65fa0ef5... |
8a63f6c5-3c46-48de-b9ee-86079425ad70 | abc8805/DL | HPC1B.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <omp.h>
#include <chrono>
using namespace std::chrono;
using namespace std;
const int MAX = 100000;
vector<int> graph[MAX];
bool visited[MAX];
void dfs(int node)
{
stack<int> s;
s.push(node);
while (!s.empty())
{
int curr_node = s.top();
... | ALGO | 0.999496 | 5.17559 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-29T00:46: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": "f81d1e12df26... |
86f092d5-3161-4abb-8c9f-eecd735b9157 | tier4/AutowareArchitectureProposal.iv | planning/planning_diagnostics/planning_evaluator/include/planning_evaluator/metrics/stability_metrics.hpp | // Copyright 2021 <NAME>, 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 applicable law or agreed to in... | ALGO | 0.962283 | 7.089981 | {
"github_metadata": {
"branch": "use-autoware-auto-msgs",
"commit_count": 1394,
"repo_created_at": "2020-09-18T05:13:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 142,
"forks": 111,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"co... |
f94d634a-4fd1-4a5f-b494-77a83757ac53 | stan-dev/math | stan/math/opencl/rev/squared_distance.hpp | #ifndef STAN_MATH_OPENCL_REV_SQUARED_DISTANCE_HPP
#define STAN_MATH_OPENCL_REV_SQUARED_DISTANCE_HPP
#ifdef STAN_OPENCL
#include <stan/math/opencl/rev/adjoint_results.hpp>
#include <stan/math/opencl/matrix_cl.hpp>
#include <stan/math/opencl/kernel_generator.hpp>
#include <stan/math/opencl/prim/sum.hpp>
#include <stan/m... | ALGO | 0.944553 | 6.814523 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28933,
"repo_created_at": "2015-07-01T18:40:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 195,
"issues": 298,
"pull_requests": 19
},
"file_meta": {
"content_id": ... |
1cb210d0-d5e3-4f34-9fdc-347a61dddd5c | tempure/algorithm-advance | misc/赛题/2021不咕不孤程序设计竞赛基础组/std/d.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n, k, q;
int ans[5010][5010];
bool p[5010];
pair<int, int> b[20010];
int main()
{
cin >> n >> k >> q;
for (int i = 1; i <= k; i++)
{
int l, r, id;
cin >> id >> l >> r;
b[i * 2 - 1].first = l;
b[i * 2].first ... | ALGO | 0.999921 | 3.532041 | {
"github_metadata": {
"branch": "master",
"commit_count": 1297,
"repo_created_at": "2020-11-16T08:58:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4de9b4f... |
c7813578-8a4e-4dd1-b1ef-41845c77f0a0 | InsightSoftwareConsortium/ITK | Modules/Registration/PDEDeformable/include/itkDiffeomorphicDemonsRegistrationFilter.h | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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.o... | ALGO | 0.969786 | 7.141496 | {
"github_metadata": {
"branch": "main",
"commit_count": 57165,
"repo_created_at": "2010-07-27T15:48:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1517,
"forks": 701,
"issues": 268,
"pull_requests": 49
},
"file_meta": {
"content_id": "d... |
358843a4-0535-4e6b-9ac6-5d2fff79ecd8 | HyejuSeon/algorithm_study | SS/2357.cpp | #include <iostream>
#define MAXN 300000
#define INF 1000000001
using namespace std;
struct Data {
int min, max;
Data() {};
Data(int min, int max): min(min), max(max) {};
};
Data IDT[MAXN];
int N, M, S = 1;
void get(int l, int r) {
l += S - 1;
r += S - 1;
int Min = INF, Max = 0;
while (l <=... | ALGO | 0.999981 | 4.233228 | {
"github_metadata": {
"branch": "main",
"commit_count": 261,
"repo_created_at": "2021-11-13T17:54: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": "01e1cacb24... |
3508501b-caaa-43ba-abe3-ae30adea060f | megablazikenabhishek/CPP-DSA | Maps/try.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll ans;
bool check(int mid, int array[], int n, int K)
{
int count = 0;
int sum = 0;
for (int i = 0; i < n; i++)
{
// If individual element is greater
// maximum possible sum
if (array[i] > mid)
retu... | ALGO | 0.999983 | 5.30592 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-03-18T06:50:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "488b6f422f0c... |
efd9781a-9d1d-47e7-9d55-5e567b5de4b9 | amithasan16Hstu/OOP_cpp | compound.cpp | #include <iostream>
#include <fstream>
using namespace std;
class Prime
{
int num;
public:
Prime(int a)
{
num = a;
}
bool operator==(Prime obj)
{
if (num <= 1)
{
return false;
}
else if (num <= 3)
{
return true;
}
else if (num % 2 == ... | ALGO | 0.9981 | 4.622384 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-16T05:20: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": "f68902254725... |
3944f7cd-871a-45bf-96e9-22fd7db9f94d | Drishti814/DSA | Basics/Cpp Basics/functions.cpp | #include<iostream>
using namespace std;
//void function and non parameterized
void print(){
cout << "heyy" << endl;
}
//void parameterized
void printname(string s){
cout << "hey " << s << endl;
}
//return
int sum(int x, int y){
int z = x + y;
return z;
}
//call by value
void doPrint(string s){
... | TOOL | 0.99621 | 3.393011 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2025-07-02T13:14: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": "4ec98366a4... |
4c7bc5a2-2c4b-4039-95e1-183a1069355f | CheeXueyi/cses_notes | dp/editDist.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int INF = 1e9 + 7;
int n, m;
string s1, s2;
const int N = 5100;
const int M = 5100;
ll dp[N][M];
int main() {
cin >> s1 >> s2;
n = s1.length();
m = s2.length();
// dp[i][j] = edit distance between prefix i or s1, prefix j of s2
... | ALGO | 0.999997 | 4.42429 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-06T05:20: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": "62d6b4fe684f... |
4da7bbdf-180e-4543-8aea-271e9f21b705 | shekharpandey10/Leetcode | linkedList/rotateListKTime.cpp | #include<bits/stdc++.h>
using namespace std;
/**
* 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... | ALGO | 0.999992 | 5.569981 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2025-02-28T17:45:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c44024e40c0... |
21bbdd60-45a9-4ed5-91f9-cf1f767267e5 | cyber-robot1/Algorithmic-Problem-Solving | Codeforces/A part 2/373A.cpp | /*
Author: <NAME>
Problem name: Collecting Beats is Fun
Problem link: https://codeforces.com/problemset/problem/373/A
Date: 17/3/2024
*/
#include <bits/stdc++.h>
using namespace std;
char arr[4][4];
int main()
{
int k;
cin >> k;
map<int, int> mp;
for (int i = 0; i < 4; i++)
{
for (int j =... | ALGO | 0.999798 | 4.942711 | {
"github_metadata": {
"branch": "main",
"commit_count": 1001,
"repo_created_at": "2021-01-09T14:56:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6759d1070... |
179231df-6d5f-494c-9a5e-72422d200530 | 1197730304/c | 源.cpp |
//组合问题
#include<iostream>
#include<vector>
using namespace std;
class Solution {
private:
vector<vector<int>> result;
vector<int> tmp;
void pathback(int n, int k, int startindex)
{
//判出条件
if (tmp.size() == k)
{
result.push_back(tmp);
return;
}
... | ALGO | 0.99958 | 5.365651 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2020-01-09T05:53: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": "421457114... |
958dda52-e92d-4059-88c5-71ec01d9f52c | abufarhad/Programming | RUET_Lab_Code/Algoritham lab 4th semister/Binary search algoritham.cpp | #include<bits/stdc++.h>
using namespace std;
vector<long long int >a;
int main(){
long long i,j,b,n,num;
srand(time(NULL));
for(i=0;i<5000;i++){
int m=rand();
a.push_back(m);
}
//freopen("output_Binary.txt","w",stdout);
sort(a.begin(),a.end());
for(i=0;i<5000;i++){
cout<<a[i]<<" ";
//// freopen("... | ALGO | 0.999743 | 3.180276 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-04-09T18:30:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ce637d326... |
8c23819b-cb79-4ee7-b851-47bb85b103ad | Chulesean/DS-A2 | M.cpp | #include <iostream>
#include <vector>
const int kMaxNodes = 1e5; // Maximum number of nodes
const int kMaxDepth = 20; // Maximum depth for binary lifting
class BinaryTree {
private:
std::vector<std::vector<int>> connections_; // Stores the tree structure
std::vector<int> time_in_, time_out_; ... | ALGO | 0.999989 | 5.912767 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-17T15:07:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "748a877868b8... |
524f4c1a-d61e-49d5-9530-ad375dbe9a0b | n3wzd/BOJ | gold/5427 - 불.cpp | #include <iostream>
#include <memory.h>
#include <queue>
#define SIZE 1002
using namespace std;
int Q, W, H;
int dist[SIZE][SIZE];
int field[SIZE][SIZE];
int dy[] = { 0, 1, 0, -1 };
int dx[] = { 1, 0, -1, 0 };
struct Point { int x, y; };
queue<Point> startFire;
int BFS(int sx, int sy) {
memset(dist, 0, sizeof(dist));... | ALGO | 0.999923 | 3.959889 | {
"github_metadata": {
"branch": "main",
"commit_count": 422,
"repo_created_at": "2022-03-10T06:07:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd61ee61b1... |
e0fd7dcb-d16a-4cc5-9f3c-5cfef542a2a2 | hyc4841/Alogorithm | tree/find_way_tree.cpp | #include <vector>
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
class Node {
public:
int val;
Node *left, *right;
Node(int key) : val(key), left(nullptr), right(nullptr) {}
};
class BST {
private:
Node* root;
Node* insertNode(Node* node, int key... | ALGO | 0.999971 | 5.457988 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2024-05-28T14:38: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": "1221a46f9f9... |
d9335fd6-c613-4f69-a08c-4a8649f5bde9 | bobzhw/question | question/word-search.cpp | #include<vector>
#include<unordered_set>
#include<iostream>
using namespace std;
class Solution {
public:
bool exist(vector<vector<char> > &board, string word) {
for (int i = 0; i < board.size(); i++)
{
vector<vector<bool>> flags(board.size(), vector<bool>(board[0].size()));
for (int j = 0; j < board[0].s... | ALGO | 0.999804 | 5.696492 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-05-16T03:15:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "da5da8a5bb... |
3a4dc5f7-4686-4442-9fe5-1129048d2294 | deepam20050/IOI-training-archive | solutions/877D.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1234, oo = 1 << 30;
int dx[4], dy[4], d[N][N], r[N][N], c[N][N];
priority_queue < pair <int, pair<int, int>> > pq;
int n, m, k;
int main() {
for (int i = 0; i < N; ++i) {
fill(d[i], d[i] + N, oo);
}
scanf("%d %d %d", &n, &m, &k);
dx[0] = dy[2]... | ALGO | 0.999886 | 3.673805 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-10-31T10:44:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b58e065e02e0... |
300f01f3-aeeb-4814-a30f-9f192e984467 | avast/retdec | src/llvmir2hll/support/struct_types_sorter.cpp | /**
* @file src/llvmir2hll/support/struct_types_sorter.cpp
* @brief Implementation of StructTypesSorter.
* @copyright (c) 2017 Avast Software, licensed under the MIT license
*/
#include <algorithm>
#include "retdec/llvmir2hll/ir/array_type.h"
#include "retdec/llvmir2hll/ir/struct_type.h"
#include "retdec/llvmir2hll/s... | CONFIG | 0.950717 | 5.580365 | {
"github_metadata": {
"branch": "master",
"commit_count": 2172,
"repo_created_at": "2017-12-12T09:04:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8297,
"forks": 970,
"issues": 429,
"pull_requests": 7
},
"file_meta": {
"content_id": "9... |
31e84ff9-bba9-4293-b5ab-f17147e24a43 | brunosmarsaro/UriOnlineJudge-Problems | 1128.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <algorithm>
#include <queue>
using namespace std;
int n, m;
bool dfs(vector <int> v[], int ini){
stack <int> s;
vector <int> hist;
s.push(ini);
hist.push_back(ini);
while(!s.empty()){
int atual = s.top();
s.pop();
... | ALGO | 0.999923 | 3.825941 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2015-10-16T00:56:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64fe7a847... |
c4ab2f67-df1f-4cc1-bc6e-9440b36dc8f9 | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/1_5025_104.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
struct RMQ {
int h, n;
vector<vector<T>> rmq;
RMQ() {}
RMQ(int n) : n(n) {
h = 32 - __builtin_clz(n);
rmq = vector<vector<T>>(n, vector<T>(h));
}
T& operator[](const int i) { return rmq[i][0]; }
void build() {
for (int l = 0; ... | ALGO | 0.999991 | 4.899503 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "17f211d3aaf... |
4c589c4d-950a-445e-b2e9-8978c7c6f5bf | cou929/topcoder | MinimalDifference.cpp | #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
using namespace std;
class MinimalDifference {
public:
int getDigit... | ALGO | 0.999726 | 4.317318 | {
"github_metadata": {
"branch": "master",
"commit_count": 71,
"repo_created_at": "2010-01-17T10:59:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 10,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "602d46b... |
0ec6d773-7cd9-4ea5-8374-7ec8f991ceb7 | ahmetasfour/Level_2_CPP | Cource 5 Project Stone_Paper_Scissor/Cource 5 Project Stone_Paper_Scissor.cpp | // Cource 5 Project Stone_Paper_Scissor.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <string>
#include<cstdlib>
using namespace std;
enum enWinner { Player1 = 1 ,Computer = 2 ,Draw = 3};
enum enGameChoice { Stone = 1 , Paper = 2 , Scissors = ... | TOOL | 0.920726 | 3.523391 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-08-22T17:34: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": "466c102d98... |
3d6003f1-faa4-4edf-b523-e1d60dce50c6 | pranitmodi/Learning_CPP | #Practice/Striver Sheet/Binary Search/Practice/Hindex2.cpp | // 275
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool check(int m, vector<int>& citations)
{
int s = 0;
int e = citations.size()-1;
while(s<=e)
{
int mid = s + (e-s)/2;
if(citations[mid] < m)
s = mid+1;
... | ALGO | 0.999979 | 5.136631 | {
"github_metadata": {
"branch": "main",
"commit_count": 447,
"repo_created_at": "2023-02-01T10:22:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f4e16fcfb... |
abf10c26-13a1-47b0-a7e7-2b7ee7fb4e3d | EndWish/Baekjoon | 백준/Gold/18405. 경쟁적 전염/경쟁적 전염.cc | #include <iostream>
#include <vector>
#include <array>
#include <queue>
#include <algorithm>
#include <ranges>
#include <numeric>
using namespace std;
#define pii pair<int,int>
#define piii pair<pii, int>
struct Vertex {
int r, c, s;
Vertex(int r, int c, int s) : r{ r }, c{ c }, s{ s }{
}
};
int dr[] = { 0,0,-... | ALGO | 0.999933 | 4.833946 | {
"github_metadata": {
"branch": "main",
"commit_count": 470,
"repo_created_at": "2022-05-11T16:50:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "612de68f30... |
c49cf549-b841-471c-85d3-d2b643d6c4d9 | littlejiumi/PAT | Advanced Level/1087.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
#include<map>
using namespace std;
const int maxn = 205;
const int INF = 1000000000;
int n, k;
int G[maxn][maxn];
int d[maxn], w[maxn],weight[maxn], num[maxn],pre[maxn],pren[maxn];
bool vis[maxn] = { false };
map<string, int> str... | ALGO | 0.999969 | 3.59728 | {
"github_metadata": {
"branch": "master",
"commit_count": 315,
"repo_created_at": "2018-08-22T03:06:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "546fa514... |
21ae42a3-ec3d-4dc1-a0a3-eaacceab13c5 | kamilszewc/cusph | cuSPH3d/sph.cpp | /*
* sph.c
*
* Author: <NAME> (<EMAIL>)
* Modified on: 10-01-2015
*
*/
#if !defined(__SPH__)
#define __SPH__
#include <iostream>
#include <iomanip>
#include <sstream>
#include <ctime>
#include <vector>
#include <thrust/device_vector.h>
#include <thrust/copy.h>
#include "sph.h"
#include "hlp.h"
#include "terminal.h... | TOOL | 0.976698 | 3.924952 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-02-04T13:01:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "269540e0db... |
af97d0fb-0f84-4d6c-ba6f-c318b9b21bdf | axelu/leetcode | cpp/03000-03499/maximumpossiblenumberbybinaryconcatenation.cpp |
// 3309. Maximum Possible Number by Binary Concatenation
// https://leetcode.com/problems/maximum-possible-number-by-binary-concatenation/
class Solution {
private:
string binary2string(int n) {
string s = "";
while( n ) {
if( n & 1 )
s += "1";
else
... | ALGO | 0.999974 | 5.632178 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2021-04-08T21:22:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50405c0a946... |
bc2876b1-12aa-4841-be7e-e48a7961c6b5 | AlgorithmStudyClass/SWExpertAcademy | hyunho/samsung/SDS_Algorithm_Lecture/#7_Dynamic programming2/5626_altar.cpp | /*
5626. 제단
https://www.acmicpc.net/problem/5626
DP
어렵
*/
#include<iostream>
using namespace std ;
int N ;
long long int D[2][5003] ; // [2]는 [10001] 로 하면 메모리 문제 있어서 공유 사용 , [5002] 는 가장 높이 나올 수 있는 h 는 n / 2 이다 여유있게 5002
int list[10001] ;
int main() {
scanf("%d" , &N ) ;
for( int i = 1 ; i <= N ; i++ )... | ALGO | 0.999978 | 4.110867 | {
"github_metadata": {
"branch": "master",
"commit_count": 221,
"repo_created_at": "2018-11-14T06:17:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d00c98971... |
29cb04bf-17e5-4403-b283-dd09e60d0687 | khyathi-29/Leetcode | 230-kth-smallest-element-in-a-bst/kth-smallest-element-in-a-bst.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999994 | 6.16623 | {
"github_metadata": {
"branch": "main",
"commit_count": 1519,
"repo_created_at": "2024-02-12T23:48: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": "3a56d1924... |
1904b487-61a3-48f8-8e69-5bf800c4b7e2 | Loks-/competitions | common/graph/tree/lcte/info/max.h | #pragma once
#include "common/graph/tree/lcte/info/none.h"
#include <algorithm>
namespace graph {
namespace lcte {
namespace info {
template <class TMaxType, class TPInfo = PNone>
class PMax : public TPInfo {
public:
using TBase = TPInfo;
using TSelf = PMax<TMaxType, TPInfo>;
bool cmax_set;
bool vmax_set;
... | ALGO | 0.999837 | 7.333011 | {
"github_metadata": {
"branch": "master",
"commit_count": 3122,
"repo_created_at": "2018-06-04T04:19:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7236b14... |
9325512c-8a52-413a-8113-3825133b1662 | iamsaquib2508/BUET_CSE_codes | CSE 204 DS Algo 1/2 Linked List/1505018_2.cpp | #include<stdio.h>
#include<stdlib.h>
#define create (struct listNode*) malloc (sizeof(struct listNode))
#define NULL_VALUE -99999
#define SUCCESS_VALUE 99999
struct listNode
{
int item;
struct listNode * next;
};
struct listNode * list;
struct listNode * tail;
void initializeList()
{
list = 0;
tail ... | ALGO | 0.999783 | 3.484684 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-06T23:02:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a146759615... |
f902cb9f-7b74-404f-a482-7fe0c148440d | wcysai/CodeLibrary | Atcoder/Beginner/264/E.cpp | #pragma GCC optimize(3)
#include<bits/stdc++.h>
#define MAXN 500005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n,m,e,q,cur;
int u[MAXN],v[MAXN],ans[MAXN],cnt[MAXN];
int p[MAXN],r[MAXN],res[MAXN];
bool good[MAXN],... | ALGO | 0.999985 | 3.907633 | {
"github_metadata": {
"branch": "master",
"commit_count": 1109,
"repo_created_at": "2018-05-21T06:39:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8bab5a7... |
ee6ccc0c-4172-4984-abf9-6f715ac32784 | milanow/LeetCodePractice | 400+/495_Teemo_Attacking.cpp | /* 495. Teemo Attacking
* Two pointer problem, pre represents previous time where Ashes is not poisoned,
* now represents current poison will end at "now"
* total represents the total poisoned time.
*/
class Solution {
public:
int findPoisonedDuration(vector<int>& timeSeries, int duration) {
if(time... | ALGO | 0.999946 | 6.317057 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2017-09-26T00:16: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": "1f2cdc3d0... |
3ea05570-288b-4b3a-bb9a-9cc934e30e49 | kiwibrowser/src | third_party/openh264/src/codec/common/src/expand_pic.cpp | /*!
* \copy
* Copyright (c) 2013, Cisco Systems
* 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 co... | ALGO | 0.969707 | 5.903488 | {
"github_metadata": {
"branch": "master",
"commit_count": 672,
"repo_created_at": "2020-04-18T07:16:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2888,
"forks": 414,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "5bb... |
ec6872f6-6c46-4210-8b72-49a5c4daa498 | chengxu-ml/adventofcode | level_1/solution.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <unordered_map>
#define INPUT_PATH "../../rec/day_1.txt"
// Calculate the distence for puzzle 1
int distance(std::vector<int> &left, std::vector<int> &right)
{
std::sort(left.begin(), left.en... | ALGO | 0.998914 | 4.951104 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-24T09:02:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7eacf7ff298f... |
9c840e51-8448-4d59-886a-1f0f8449fffa | andyzhu23/Competitive-Programming | CCC/2012/12S4.cpp | /*
* Author: <NAME>
*/
// include
#include <iostream>
#include <fstream>
#include <cmath>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <memory>
#include <memory.h>
#include <string>
#include <algorithm>... | ALGO | 0.999988 | 4.038539 | {
"github_metadata": {
"branch": "main",
"commit_count": 2404,
"repo_created_at": "2021-02-13T17:40:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "423c1531... |
4da5273a-10d7-4114-b11b-f2fd90ae07e4 | ipc2023-classical/planner17 | planners/symk/src/search/pdbs/pattern_collection_generator_multiple.h | #ifndef PDBS_PATTERN_COLLECTION_GENERATOR_MULTIPLE_H
#define PDBS_PATTERN_COLLECTION_GENERATOR_MULTIPLE_H
#include "pattern_generator.h"
#include <set>
#include <unordered_set>
namespace options {
class OptionParser;
}
namespace utils {
class CountdownTimer;
class RandomNumberGenerator;
}
namespace pdbs {
/*
Thi... | TOOL | 0.966325 | 7.65834 | {
"github_metadata": {
"branch": "latest",
"commit_count": 149,
"repo_created_at": "2023-02-07T11:08:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8e09710f... |
33082bf0-67d0-4c3c-aa7b-9a5463816895 | David-5-5/tutorial | cplus/leetcode/202501/algo0517.cpp | #include <bits/stdc++.h>
using namespace std;
// 贪心专题 - 思维题 - 从特殊到一般
class Solution {
public:
int findMinMoves(vector<int>& machines) {
// 2025.1 复习 自行解答
int ans = 0, n = machines.size();
// 计算前缀和 模板
vector<int> presum(n+1);
for (int i=0; i<n; i++) {
pre... | ALGO | 0.999953 | 4.6691 | {
"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": "a29628db8... |
fbdad66a-6401-4db6-a117-eb66578627b9 | mahimaarora2208/Leetcode_150_Challenge | Q42_TrappingWater.cpp | #include <iostream>
#include<vector>
using namespace std;
int trap(vector<int> height) {
int n = height.size();
int trapped = 0;
int temp;
vector<int> maxLeft(n,0);
vector<int> maxRight(n,0);
// Max Left array
maxLeft[0] = 0;
for(int i = 1; i < n; i++){
maxLeft[i] = max(maxL... | ALGO | 0.999978 | 5.78705 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-07-13T17:04:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f2b81f2dce3... |
7e56aaa9-7713-4d6d-b0f2-1af79cc97e36 | kmore01/PRO2 | Repaso/Punteros/TREE/X09609/program.hh | /* Pre: p.i. = A, asub es buit */
/* Post: si A conte x, asub es el subarbre d'A resultat de la cerca;
si A no conte x, asub es buit */
void sub_arrel(Arbre& asub, const T& x) {
int altura;
node_arbre* m;
sub_arrel_aux(primer_node, m, x, altura);
asub.primer_node = copia_node_arbre(m);
}
static v... | ALGO | 0.999827 | 4.250488 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-06-07T21:21:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "289f1b02f02... |
f4a76551-832b-48b4-978d-4fa88588aebd | genericSpecimen/problem-solving | dsa/strings/string-matching.cpp | #include <iostream>
#include <string>
#include <vector>
#include <cmath>
/*
* Naive string matching algorithm to find all matches.
* Takes O((n-m+1)m) time, O(1) space.
*/
std::vector<int> findAllMatches(const std::string &text, const std::string &pattern) {
int n = text.size(), m = pattern.size();
if... | ALGO | 0.999956 | 6.373125 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-06-26T12:43:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ace80857d... |
b21d7d1e-17fc-47a2-a692-90e00dffb4b0 | Ahmed-Arafat10/LeetCode | Linked List/Easy/61. Rotate List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
int cnt(ListNode *p)
... | ALGO | 0.999963 | 5.214691 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-07-25T22:16:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c843c2c1... |
c89504dd-d702-4f83-a6b0-9e1818b7bf1c | mayank-bhardwa/CodingLibrary | DynamicProgramming/unboundedknapsack/unboundedknap/unboundknapsack.cpp | /*
Recursive solution to the unbounded knapsack problem where repetition of items is allowed
Only difference in this problem from 0-1 knapsack is that we were changing the n(index)
whenever we encounter a value to mark it as processed but in this case an item is marked
procesed only if it is rejected if it is accepted ... | ALGO | 0.999996 | 5.053001 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2020-08-26T12:41:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70e3c2ad1... |
5a3be2ab-f95e-4a86-a431-de766e9bcc6f | sency90/allCode | swfc/add/b-2808.cc | #include <iostream>
#include <queue>
#include <algorithm>
#include <cstring>
using namespace std;
typedef pair<int,int> pii;
int n,m;
char s[701][701],chk[701][701];
int lv[701][701],tm[701][701];
pii na,viking,treasure;
queue<pii> q;
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};
const int inf = 0x3f3f3f3f;
int main() {
//f... | ALGO | 0.999943 | 4.082643 | {
"github_metadata": {
"branch": "master",
"commit_count": 254,
"repo_created_at": "2015-09-27T17:33:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f70ae9fd... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.