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 |
|---|---|---|---|---|---|---|---|
dcb74ac2-44c2-4cb6-ad7e-a5ddd12b79c8 | Sadat-09/Codeforces | A_Arpa_s_hard_exam_and_Mehrdad_s_naive_cheat.cpp |
#include <bits/stdc++.h>
#define IO \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
typedef long long int ll;
typedef long double LD;
#define w(t) \
int t; \
cin >> t; \
while (t--) \
{ \
so... | ALGO | 0.999943 | 4.580287 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-04-16T07:17: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": "8a53f23eff8... |
e58b5425-5c48-4ebf-ac47-c4c6cb65a611 | JoseVitorNobre/Treino-de-CPP | graph_distance/dijkstra.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
void dijkstra(int n, const vector<vector<pair<int, int>>>& adj) {
vector<long long> dist(n + 1, LLONG_MAX);
vector<int> parent(n + 1, -1);
priority_queue<pair<long long, int>, vector<pair<long long, int>>, greate... | ALGO | 0.999987 | 4.659724 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-08-07T14:44: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": "0b98ac1cd82... |
e36637ae-ddea-4b5c-9afc-2e372af7b1d7 | wuyuhang05/My-OI-Code | UOJ/317.cpp | /*
* Author: RainAir
* Time: 2019-10-12 09:06:50
*/
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <bitset>
#include <vector>
#include <cmath>
#include <ctime>
#... | ALGO | 0.999958 | 3.564431 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2018-06-03T12:18:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7aed40b5... |
01787582-e3e0-4fb3-9b97-e9de03ed9c59 | Franco1010/competitive-programming | codeforces/1374/A.cpp | /*
© 2020-06-28 09:35:02 Franco1010 All Rights Reserved
*/
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#define f first
#define s second
#define fore(i,a,b) for(int i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define... | ALGO | 0.999974 | 4.042237 | {
"github_metadata": {
"branch": "master",
"commit_count": 745,
"repo_created_at": "2020-12-23T19:19: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": "e48a4727... |
3ffeb74d-6c7a-427f-b65f-d53a47c7a8c8 | melzhang/6771 | mTutes/lec/w4.cpp | // Problem: Write a program (or function) to find if any value in this vector is in the range 5 to 10.
#include <vector>
#include <iostream>
// function object
class Range{
public:
Range(int l, int u) : lb(l), ub(u) { }
bool operator() (int val) {
return (val >= lb && val <= ub);
};
private:
int lb,... | ALGO | 0.998056 | 6.209013 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2017-11-13T03:26: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": "41e2d643c... |
be74c32e-5cf4-4e7f-89a8-444b1fe06e99 | pravinmote1988/DSCPP | BinaryTree/DiameterOfBinaryTree.cpp | #include <iostream>
#include <stack>
using namespace std;
// output
// 4
struct Node{
int data;
Node *left;
Node *right;
Node() : data(0), left(nullptr), right(nullptr) {}
Node(int _data) : data(_data), left(nullptr), right(nullptr) {}
};
int diameter(Node *node, int &dia)
{
if(node ==... | ALGO | 0.999907 | 4.935212 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-09-05T17:05: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": "4021881aab... |
ae97e12f-5226-4662-ba3d-1967f0c5d912 | alindsharmasimply/CompetitivePractice | sixtySecond.cpp | #include <iostream>
using namespace std;
struct heap {
int *array;
int count;
int capacity;
int heap_type;
};
heap* create(int cap, int type)
{
heap* temp = new heap();
temp->heap_type = type;
temp->count = 0;
temp->capacity = cap;
temp->array = new int[cap];
return temp;
}
heap*... | ALGO | 0.999191 | 3.903156 | {
"github_metadata": {
"branch": "master",
"commit_count": 86,
"repo_created_at": "2017-09-03T08:31: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": "2b1a2255e... |
ff63c04c-2ac3-40c2-8041-e4d70711d81d | LeandroBenitez12/SAMI-SUMO | Software/Codigos Funcionales/SamiVdef/SamiVdef.ino | //librerias
#include <Button.h>
#include <SumoEngineController.h>
#include <Tatami.h>
#include <Sharp.h>
#include "BluetoothSerial.h"
#include <SSD1306.h>
//debug
#define DEBUG_SHARP 1
#define DEBUG_TATAMI 1
#define DEBUG_STATE 1
#define DEBUG_LDR 1
#define TICK_DEBUG 500
#define TICK_DEBUG_STRATEGY 500
#define TICK_D... | TOOL | 0.929395 | 3.996404 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2022-08-26T23:59:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62f63c37f85... |
1d5dfbe5-c207-4f86-865b-ae4263227159 | mistralCeleste/HackerRank | IceCreamParlor/cpp/IceCreamParlor_doubleIteration.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
/*
* Complete the 'icecreamParlor' function below.
*
* The function is expected to return an INTEGER_ARRAY.
* The function accepts following parameters:
* 1. INTEGER m... | ALGO | 0.999957 | 5.421182 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-05-07T22:48: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": "ebb7a099dce... |
04340bb5-9270-4b15-8e38-011eac24d756 | metaphysis/Code | UVa Online Judge/volume006/622 Grammar Evaluation/program.cpp | // Grammar Evaluation
// UVa ID: 622
// Verdict: Accepted
// Submission Date: 2016-08-31
// UVa Run Time: 0.000s
//
// 版权所有(C)2016,邱秋。metaphysis # yeah dot net
#include <bits/stdc++.h>
using namespace std;
// 定义运算符的优先级顺序,值越高,优先级越高。在栈中,括号的优先级最小。
map<char, int> priority = {
{'+', 1}, {'*', 2}, {'(', 0}, {')', 0}
}... | ALGO | 0.999927 | 4.479081 | {
"github_metadata": {
"branch": "master",
"commit_count": 1710,
"repo_created_at": "2016-03-07T13:28:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 229,
"forks": 50,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0212... |
32c09752-fbec-422d-b033-30e90d84de15 | linsallyzhao/earlyobjects-exercises | 2015/chapter_9/answers/13UsingFilesStringSelectionSortModification.cpp | #include <iostream>
#include <string>
#include <fstream>
void selectionSort(std::string [], int);
void showStrings(std::string [], int);
int main()
{
const int SIZE = 20;
std::ifstream inData;
inData.open("names.dat");
std::string name[SIZE];
if (!inData)
std::cout << "Error opening file.... | ALGO | 0.989957 | 4.092757 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-12-10T00:20: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": "9d7540e77d... |
6a9988e3-f036-443f-91f0-c86d737f8188 | MohammadMazrouei/Competitive-Programming | Data_Structures/Segment_Tree.cpp | #include <bits/stdc++.h>
using namespace std;
// Segment Tree, build -> O(n), update & query -> O(log(n))
struct SegmentTree {
struct Node {
int64_t sum = 0;
int mn = 2e9, cnt = 0;
template <typename M>
void init(const M &v) {
sum = mn = v;
cnt = 1;
... | ALGO | 0.999826 | 5.267529 | {
"github_metadata": {
"branch": "main",
"commit_count": 396,
"repo_created_at": "2024-04-09T10:01:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4cc95ecb4e... |
3e47b9d8-78c8-4c3d-834f-62993035f20e | suraj1611/Competitive_Programming | CP-Codes/he_vanyaAndGCD.cpp | /* Code by : Suraj (@suraj1611) */
#include<bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long int
#define rep(i,n) for(int i=0; i<n; i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define mx INT_MAX
#define mn INT_MIN
#define md 1000000007
#define pb push_back
#define mp make_pair
#define maxs... | ALGO | 0.999955 | 3.937842 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2019-02-13T16:34:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "90d038c07... |
ebbf103d-7eb7-4481-9e52-6aa006f93f2d | D-BookeR/Synthese-d-images-avec-OpenGL | common/C++/Mesh/MeshModuleRedux.cpp | /**
* Ce module rajoute des fonctions pour réduire le nombre de sommets d'un maillage
* NB: penser à appeler creerVBO() après cette opération
*
* Biblio : Surface Simplification Using Quadric Error Metrics - Garland 1997
* http://www1.cs.columbia.edu/~cs4162/html05s/garland97.pdf
*/
#include <math.h>
#include ... | ALGO | 0.981693 | 3.338915 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-06-22T14:15:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "07efcf4854f... |
1f0cfd82-7232-4f0f-be49-47086f309357 | masudursourav/LeetCode-Practice | July - week 3rd/Valid Palindrome.cpp | // Link : https://leetcode.com/explore/interview/card/top-interview-questions-easy/127/strings/883/
/*
A phrase is a palindrome if,
after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters,
it reads the same forward and backward. Alphanumeric characters include letters ... | ALGO | 0.946103 | 5.670706 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2022-05-27T17:22: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": "78fa87f2a7... |
ce5776e9-1ce2-45c2-8c59-8a6f8866fdf9 | yzh123qwer/leetcode | 142.找到字符串中所有字母异位词/findAnagrams.cpp | /*
438. 找到字符串中所有字母异位词
给定两个字符串 s 和 p,找到 s 中所有 p 的 异位词 的子串,返回这些子串的起始索引。不考虑答案输出的顺序。
异位词 指由相同字母重排列形成的字符串(包括相同的字符串)。
示例 1:
输入: s = "cbaebabacd", p = "abc"
输出: [0,6]
解释:
起始索引等于 0 的子串是 "cba", 它是 "abc" 的异位词。
起始索引等于 6 的子串是 "bac", 它是 "abc" 的异位词。
示例 2:
输入: s = "abab", p = "ab"
输出: [0,1,2]
解释:
起始索引等于 0 的子串是 "ab", 它是 "ab" 的... | ALGO | 0.999839 | 6.404186 | {
"github_metadata": {
"branch": "main",
"commit_count": 319,
"repo_created_at": "2021-12-05T10:24: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": "4268cff66a... |
89ffe283-a077-4013-97e5-8f0839d53e08 | mattvend/FISTA | matlab/mexnorm1.cpp | // Copyright 2014 <NAME> (http://conradsanderson.id.au)
// Copyright 2014 National ICT Australia (NICTA)
//
// 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... | ALGO | 0.995138 | 5.662487 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2018-02-22T16:22:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45864737e... |
ca4cc506-e044-434d-baa4-38acd2131861 | raincross7/code-similarity | codes/train_code/problem192/problem192_183.cpp | #ifdef LOCAL
#include "libs/debug/print_list.hpp"
#define D(x) (cout << # x ": " << x << endl)
#define dev(v, m, n) for(int i=0;i<n;++i){for(int j=0;j<m;++j){cout<<"|"<<v[j][i];}cout<<"|"<<endl;}
#else
#define D(x) ;
#define dev(v, m, n) ;
#endif
// :----------------------------------------
#include <algorithm>
#incl... | ALGO | 0.999674 | 4.140788 | {
"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": "631009b7e8e3... |
8d8f26a7-c85a-4ab3-b2db-50d60b42f8bb | 220FasyaTriNugroho/CircularQueuesArray_0220 | CircularQueue.cpp | /**
* @mainpage Documentation Circular Queue
*
* @section Introduction
* Projek ini merupakan projek bagaimana struktur data
* dengan menggunakan Queue pendekatan Circular arrays.
*
* @section Operations
* - enQueue for insert element into Queues
* - deQueue for delete elements from Queues
* - show data / d... | ALGO | 0.99652 | 5.546611 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2025-06-10T03:30: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": "aaf148076a9... |
01af0f2a-43d7-48d0-8e39-1c0dde6b3d8e | aslanyan/cosmopp | include/mode_directions.hpp | #ifndef COSMO_PP_MODE_DIRECTIONS_HPP
#define COSMO_PP_MODE_DIRECTIONS_HPP
#include <alm.h>
#include <xcomplex.h>
#include <healpix_map.h>
/// A class for calculating angular momentum dispersion.
class ModeDirections
{
public:
/// Constructor.
/// \param alm The alm-s of the map under consideration.
ModeDi... | ALGO | 0.997595 | 5.929854 | {
"github_metadata": {
"branch": "master",
"commit_count": 371,
"repo_created_at": "2013-12-17T03:22:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 4,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "c14c905... |
096ebab9-eeed-449e-9c3e-a3faab671e48 | JeraKrs/acm | codes/UVA/10001-19999/uva10385.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 30;
int N;
double L, vr[maxn], vk[maxn];
void init () {
for (int i = 1; i <= N; i++) {
vr[i] = 1/vr[i] - 1/vk[i];
vk[i] = L/vk[i];
}
for (int i = 1; i < N; i++) {
vr[i] -= vr[N];
vk[i] -= vk[N];
}
}
double f... | ALGO | 0.999968 | 3.620501 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2016-05-23T06:40:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bf342ce... |
ad2b1680-05a5-46a7-a56e-71064ef12163 | Sushreesatarupa/DSA-cpp | 02. Mathematics/3.Final Destination.cpp | /**
3.Final Destination
Consider a 2d plane and a Robot which is located at (0,0) who can move only one unit step at a time in any direction i.e. if its initial position is (x,y), he can go to positions (x + 1, y), (x - 1, y), (x, y + 1) or (x, y - 1). Now Given three integers a,b (denoting the final position where th... | ALGO | 0.999789 | 5.150509 | {
"github_metadata": {
"branch": "main",
"commit_count": 870,
"repo_created_at": "2021-07-09T19:41:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 276,
"forks": 330,
"issues": 1,
"pull_requests": 5
},
"file_meta": {
"content_id": "0d788c... |
2a0d4799-3902-473b-8bcd-1cb313669fce | vgslavov/Problems | exposed/telephone-num-iter_ie.cc | // TODO: test manually and understand
// O(3^(n+1))
using namespace std;
// recursive
class TelephoneNumber {
public:
TelephoneNumber(vector<int> n);
void printWords();
private:
char getCharKey(int telephoneKey, int place);
const int PHONE_NUM_LEN = 7;
vector<int> phoneNum;
vector<char> result;
};
Tele... | ALGO | 0.99921 | 4.663659 | {
"github_metadata": {
"branch": "main",
"commit_count": 549,
"repo_created_at": "2014-12-02T05:33: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": "d3581e7998... |
b98cb7ca-4c26-4769-a63c-6ddee28b168b | DIE4Rmk/C_plus_plus_Algorithms_tasks | Cont2_Poisk/taskC.cpp | #include <iostream>
#include <algorithm>
#include <vector>
struct Drone {
unsigned int id;
unsigned int weight;
};
/*
* Radix sort descending
*/
void countSort(std::vector<Drone> &vec, int64_t e, int64_t n) {
std::vector<int> cnt(10);
for (int64_t i = 0; i < n; ++i) {
cnt[(vec[i].weight / e)... | ALGO | 0.99987 | 4.650166 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-02-07T15:46: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": "6bff59ad1160... |
15059b23-2f65-4e82-bb0e-3f20182b027c | UtkarshGupta12/InterviewBit | Strings/Integer-To-Roman.cpp | #include <iostream>
#include <string>
#include <bits/stdc++.h>
using namespace std;
int val(char c)
{
if(c == 'I') return 1;
if(c == 'V') return 5;
if(c == 'X') return 10;
if(c == 'L') return 50;
if(c == 'C') return 100;
if(c == 'D') return 500;
if(c == 'M') return 1000;
return -1;... | ALGO | 0.99915 | 4.32869 | {
"github_metadata": {
"branch": "main",
"commit_count": 287,
"repo_created_at": "2021-04-29T22:34: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": "b2a594469a... |
10dd3630-b6c0-4c86-9f0e-97f24576d8d3 | RuhaW/TradingSystem | FinalProject/ieorhomework7/TradingSystem/TradingStrategy.cpp | //
// Created by sebastiend on 06/10/2018.
//
#include "TradingStrategy.h"
#include <iomanip>
bool Execution::insert_order(long timestamp_,
bool is_buy_,
double price_,
unsigned int quantity_,
const char * venue_,
const char * s... | ALGO | 0.966403 | 4.094565 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-12-26T19:22: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": "df51c75406... |
b3db78b3-118e-440e-83d6-418c007d9e5f | ImtiazAhmedAkash/Problem-Solving | lightoj/1389.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// 1389 - Scarecrow
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define deb(x) cerr << #x << " = " << x << nl
const int inf = 1e9;
const ll INF = 1e18;
const int mod = 998244353;
const int N = 2e5 + 5;
void so... | ALGO | 0.997659 | 3.930652 | {
"github_metadata": {
"branch": "main",
"commit_count": 475,
"repo_created_at": "2022-11-19T14:05: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": "ae832d3380... |
084dd2fe-ce49-41ad-ae0b-6726213eb2b3 | wafiqpuyol/DSA-C- | ARRAY/Move All Negative Numbers.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int arr[] = {-12, 11, -5, 0, -7, -3, 6, -21, -8};
int size = (sizeof(arr) / sizeof(arr[0]));
int l = 0, r = size - 1;
while (l < r)
{
if (arr[l] < 0 && arr[r] < 0)
{
l++;
}
if (arr[l]... | ALGO | 0.999996 | 4.601118 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2024-05-11T05:36: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": "e87b46af1... |
83097d08-9195-4a70-8896-a3fc81dd06c9 | forests0/2nd_grade_study | C++/특정수.cpp | #include <iostream>
using namespace std;
int arr[1000000];
int N, x;
int first(int start, int end) {
if(start > end) return -1;
int mid = (start + end) / 2;
if(arr[mid]==x && (mid==0 || arr[mid-1]<x))
return mid;
else if(arr[mid]>=x)
return first(start, mid-1);
else
return first(mid+1, end);
}
int last(in... | ALGO | 0.999971 | 4.660622 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2022-03-06T11:45: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": "fa668888... |
51c5da92-59f6-4278-8387-e2ce6c9e77eb | Andreas-Ley/appcvrobot_software | executables/KazeTest/source/Fast.h | #pragma once
#include "Keypoint.h"
#include "Image.h"
#include "simd.h"
#include <vector>
void fast(const Image &img, Image &dst);
template<unsigned i>
void emitCoords(unsigned x, unsigned y, const Vuint8x16 ¢ralPixel, std::vector<Keypoint> &coords)
{
auto fourPixels = centralPixel.extract32B<i>();
if ... | ALGO | 0.998056 | 6.135727 | {
"github_metadata": {
"branch": "new_board_test",
"commit_count": 94,
"repo_created_at": "2022-11-09T11:15: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": "2... |
38716057-687c-49c0-822d-99a8ac4a64f2 | raspberrypi/windows-drivers | drivers/pwm/bcm2836/dmaInterrupt.cpp | /*++
Copyright (c) Microsoft Corporation All Rights Reserved
Abstract:
This file contains functions for DMA interrupt processing.
--*/
#include "driver.h"
#include "dmainterrupt.tmh"
//
// Define ISRDPC_DEBUG to enable additional ETW debug output in ISR and DPC functions.
//
//#define ISRDPC_DEBUG
#pragma c... | TOOL | 0.939556 | 5.273918 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2020-11-23T07:47:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 137,
"forks": 36,
"issues": 17,
"pull_requests": 1
},
"file_meta": {
"content_id": "9c67a... |
66ed089d-f18d-40c8-8f15-7f0aa119a7ae | zhhehao/zhhehao | uvaoj/uva1149.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const int maxn = 100000 + 10;
int items[maxn];
int main() {
int T, n, l, kase = 0; scanf("%d", &T);
while (T--) {
scanf("%d%d", &n, &l);
for (int i = 0; i < n; i++) scanf("%d", &items[i]);
sort(items, items+n);
int ans = 0;
if (items[n-1]*2 <= l)... | ALGO | 0.999931 | 3.718783 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2016-02-26T12:54:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b18c3fb... |
384a5029-b2a1-4594-9150-7464ff284d7f | rudramahajan25/DSA | Queue_Reversal/Queue_Reversal.cpp | //{ Driver Code Starts
//Initial Template for C++
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//function Template for C++
//Function to reverse the queue.
class Solution
{
public:
queue<int> rev(queue<int> q)
{
stack<int> s;
// add code here.
while... | ALGO | 0.99984 | 5.389919 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-12-29T09:20:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2529559e3a1... |
680919b3-060c-40c9-a038-ccf8c9e38b1c | ryanpsloan/cnm | C++/C++ I/SloanE13/Driver.cpp | //Arrays_SearchIt
//This program will read in an array of up to
//300 ints and then sort it. It will also ask
//the user for two ints, and search for them
//in the sorted array. It will return true or
//false for each int searched for.
//Make a folder using your name and the exercise number
//such as GhanbariE13. ... | ALGO | 0.998569 | 3.7767 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-11-21T20:02:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d6cd4328ab... |
786e9bd5-58ef-48e6-8cbd-c13f1b706629 | thisiskyle/advent-of-code | 2019/day11.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include "../headers/aoc.h"
#include "../headers/Intcode_Computer.h"
struct Robot {
Intcode_Computer brain{"./inputs/day11.txt"};
std::vector<util::Point> white;
std::vector<util::Point> black;
std::vector<util::Point> painted;
util::Point ... | ALGO | 0.999649 | 5.335335 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2019-12-04T03:09:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0c632570... |
216412f2-df34-49c1-8209-13f76d7fc146 | yandaboa/Competitive-Programming-Prep | 2023 January/milkVisits.cpp | #include <iostream>
#include <vector>
#include <limits>
#include <map>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
#include <climits>
#include <string.h>
#include <fstream>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vb = vector<bool>;
using vvi= vector<vector<int... | ALGO | 0.999991 | 3.972805 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2021-05-27T01:20: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": "ca46f6efeb8... |
5f9dfcd1-1a72-467f-a167-573dad1b3285 | CLDP/ACM-ICPC | Regional-2011/North-America-ECNA/E.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main() {
int n, mm, m, a, b, nn = 0;
long long ans;
bool flag;
int x[100];
long long f[100];
cin >> n >> mm;
while (n != 0 || mm != 0) {
++nn;
cout << "Case " << nn << ": ";
m = 0;
for (int i = ... | ALGO | 0.999323 | 3.285792 | {
"github_metadata": {
"branch": "master",
"commit_count": 486,
"repo_created_at": "2013-09-24T19:04:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b5b0634... |
aff50073-7a04-460d-802d-9a4cd75ec449 | jjunseoki/baekjoon | 백준/Silver/16967. 배열 복원하기/배열 복원하기.cc | #include <iostream>
#include <string>
using namespace std;
int H, W, X, Y;
int B[601][601] = { 0 };
void solve() {
for (int i = X; i < H; i++) {
for (int j = Y; j < W; j++) {
B[i][j] -= B[i-X][j-Y];
}
}
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
... | ALGO | 0.999612 | 3.415376 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2023-02-12T05: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": "10924488d... |
f5a12b7c-1f70-4567-ad72-6c3d4b0251c4 | wait4pumpkin/pat-advanced | Q1059/Q1059/main.cpp | //
// main.cpp
// Q1059
//
// Created by <NAME> on 1/29/14.
// Copyright (c) 2014 <NAME>. All rights reserved.
//
#include <iostream>
bool isPrime(long num) {
for (int i = 2; i < num; ++i) {
if (num % i == 0) {
return false;
}
}
return true;
}
int main(int argc, const char... | ALGO | 0.999953 | 4.231902 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-02-14T07:15: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": "5cfc2fbc46... |
9650be7f-925f-4ce9-aa72-b3a28bf9011f | ChangminYi/Baekjoon_code | 1572_중앙값/소스.cpp | #include <iostream>
using namespace std;
const int MAX_ARG = 250'000;
const int MAX_RANGE = (1 << 16) + 1;
const int MAX_SEG = 4 * MAX_RANGE + 1;
int n, k;
int arg[MAX_ARG], segtree[MAX_SEG];
long long sum = 0;
void update_seg(int idx, int lo, int hi, int new_idx, int new_val) {
if (lo == hi) {
segtree[idx] += n... | ALGO | 0.999956 | 4.456618 | {
"github_metadata": {
"branch": "master",
"commit_count": 725,
"repo_created_at": "2021-05-13T06:59: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": "97ee98f7... |
1318e3e8-2149-4e52-be05-76ccf7b514eb | 1rcxe/CodeForces-Solutions | A - Noldbach problem.cpp | #include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define db double
using namespace std;
vector<int> s(int n){
vector<int> sieve(n+1,0);
for (int x = 2; x <= n; x++) {
if (sieve[x]) cont... | ALGO | 0.999968 | 4.388919 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2022-12-25T17:20: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": "1a12449e0ad... |
985089c5-c1ee-48c2-8e1a-5dd577d5985f | Chirayu31/dsa-solutions | DP/unique-paths-ii.cpp | class Solution
{
private:
int solve(int i, int j, vector<vector<int>> &obstacleGrid, vector<vector<int>> &dp)
{
if (i < 0 || j < 0 || obstacleGrid[i][j] == 1)
return 0;
if (i == 0 && j == 0)
return 1;
if (dp[i][j] != -1)
return dp[i][j];
int ... | ALGO | 0.999955 | 5.501729 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-01-13T15:30: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": "317716c6ca3... |
7ad34ca1-673a-4dd5-8e26-1d4798611cad | cparkhi16/Swabhav-Training | coding/extras/heap/min_cost_join_ropes.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int getMinimumCost(vector<int>& nums) {
priority_queue<int, vector<int>, greater<int>> minHeap; // Min-heap
// Insert all ropes into the min heap
for (int i : nums) {
minHeap.push(i);
}
int cost = 0;
// Pro... | ALGO | 0.999988 | 5.29455 | {
"github_metadata": {
"branch": "main",
"commit_count": 387,
"repo_created_at": "2021-11-10T04:21:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "9e9424e879... |
88d1a760-efbc-49d6-b7fd-4742c3ac1ca3 | yajiedesign/mxnet | src/common/cuda/rtc.cc | /*
* 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 you under the Apache License, Version 2.0 (the
* "License"); you ... | TOOL | 0.918456 | 7.488499 | {
"github_metadata": {
"branch": "master",
"commit_count": 11377,
"repo_created_at": "2015-10-06T16:36:40.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "apache/mxnet",
"stars": 177,
"forks": 45,
"issues": 24,
"pull_requests": 0
},
"file_meta": {
"content... |
6b7811b8-af32-41fc-b07e-2cb0596f3ecb | lshtar13/PS | boj.1701.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef const ll cll;
typedef queue<ll> qll;
typedef queue<pll> qpll;
typedef priority_queue<ll> pqll;
typedef priority_queue<pll> pqpll;
typedef vector<ll> vll;
ty... | ALGO | 0.999969 | 4.069478 | {
"github_metadata": {
"branch": "main",
"commit_count": 330,
"repo_created_at": "2023-12-19T12: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": "dc9dec7e89... |
8c1a8f22-1210-4d94-8076-3689edd2c9bd | betteryjs/DS | NK/链表/src/cpp/CopyListWithRandom.cpp | //
// Created by yjs on 23-3-15.
// 复制含有随机指针节点的链表
//
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode *rand;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(in... | ALGO | 0.979207 | 4.396348 | {
"github_metadata": {
"branch": "master",
"commit_count": 60,
"repo_created_at": "2022-10-29T02:54: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": "3a2cd1941... |
1f9832ba-0938-4e68-8b22-cec349b5c142 | songjihu/UnrealEngine-5.0.3-release | Engine/Source/Runtime/Core/Private/Misc/ConfigCacheIni.cpp | // Copyright Epic Games, Inc. All Rights Reserved.
#include "Misc/ConfigCacheIni.h"
#include "Containers/StringView.h"
#include "Misc/DateTime.h"
#include "Misc/MessageDialog.h"
#include "HAL/FileManager.h"
#include "Misc/FileHelper.h"
#include "Misc/CommandLine.h"
#include "Math/Vector4.h"
#include "Stats/Stats.h"
#... | TOOL | 0.901694 | 3.695509 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2022-11-08T10:00:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c989e59a85... |
b5d5a807-7ee4-4613-963f-d4a1ddfe5696 | Maheeenasad/Daily-LeetCode-Sync | 2067-maximum-number-of-points-with-cost/maximum-number-of-points-with-cost.cpp | class Solution {
public:
long long maxPoints(vector<vector<int>>& points) {
int m = points.size();
int n = points[0].size();
vector<long long> prev(n, 0);
// Initialize with the first row
for (int c = 0; c < n; ++c) {
prev[c] = points[0][c];
... | ALGO | 0.999919 | 6.145233 | {
"github_metadata": {
"branch": "main",
"commit_count": 278,
"repo_created_at": "2024-05-24T09:37: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": "171d180c52... |
af21fa45-ef39-46dd-a69f-f31e9f4e25b2 | EstruturaDeDadosII/controleDeCaixa | main.cpp | #include <iostream>
#include <deque>
using namespace std;
#define MAX_CLIENT 10
//Item b, número 1
typedef struct Cart {
int id;
string clientName;
int numberOfProducts;
double purchaseValue;
} Cart;
//ITEM B: QUESTÃO 2 E 3
deque<Cart> CAIXA_1;
deque<Cart> CAIXA_2;
deque<Cart> CAIXA_3;
int ID_COU... | TOOL | 0.938084 | 4.113665 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-10-15T14:20:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e40dca04d61... |
8fa94766-8001-4633-b28b-a83152353eeb | show981111/algorithms | backTracking_recursion/genCombSum(39).cpp | /**
* @brief
* BackTracking
* => decide where to stop(push to the res array)
* and how to proceed!(recursive part)
*
* Pattern :
* For(choices I have in current step)
* do something -> call recursive(go to next step) -> roll back
*/
class Solution
{
public:
void genComb(vector<int> &candidates, vect... | ALGO | 0.99999 | 6.191387 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2022-01-30T21:13:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1852d11f003... |
372ae4bb-84ae-43ec-a2f4-55381f607263 | CBepler/learncpp | 19/19.2/quiz.cpp | #include <iostream>
#include <string>
#include <limits>
#include <algorithm>
#include <cstddef>
int getArrSize() {
std::cout << "How many names do you wish to enter? ";
std::size_t size {};
while(true) {
std::cin >> size;
if(!std::cin || size < 0) {
std::cin.clear();
... | TOOL | 0.996728 | 4.880007 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-06-22T15:50: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": "a0408b08be2... |
77aff60b-ebbb-49f2-bfba-624968276f09 | ishandutta2007/codeforces-m | maximumshot/normal/1628/E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
const int inf = 1e9;
const ll inf64 = 1e18;
struct output {
vector<int> res;
void print() ... | ALGO | 0.999748 | 4.46362 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9ccc59fa4c6... |
bd0b571e-ee96-4353-8aa7-2c4d800c6939 | xanarry/ACM-ICPC | CodeForces 292A SMSC.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int n, t, c;
cin >> n;
int maxsc = -1;
int pret, prec;
cin >> pret >> prec;
maxsc = prec;
for (int i = 1; i < n; i++)
{
cin >> t >> c;
int dift = t - pret;
dift = dift >= prec ? pre... | ALGO | 0.999872 | 3.530049 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2015-03-09T10:43:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76b57e9eb... |
cd927f75-b5e8-4760-86b9-11d39dce5dde | AkashSingh3031/The-Complete-FAANG-Preparation | 1]. DSA + CP/1]. DSA/2]. Algorithms/03]. Bitwise Algorithms/C++/_002)_Replace_Bits.cpp | /* We are given two 32 bit numbers M And N and two bit positions i and j.
We have to set all bits between i and j in N equal to M.
Example: N = 10000000000, M = 10101, i = 2, j = 6
Output: N = 10001010100
*/
#include <bits/stdc++.h>
using namespace std;
int ClearRangeItoJ(int n, int i, int j)
{... | ALGO | 0.999928 | 4.455279 | {
"github_metadata": {
"branch": "master",
"commit_count": 1827,
"repo_created_at": "2021-05-29T04:41:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11343,
"forks": 2526,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
99c2a6ba-d491-49c3-9bb1-21c1661b1428 | SameerDiwakar/Data-Structures | Strings/3_count_vowels_etc.cpp | #include <bits/stdc++.h>
using namespace std;
void count(string s){
int v=0,c=0;
for (int i = 0; i<s.length() ; i++){
if(s[i] == 'a' || s[i] == 'A' || s[i] == 'e' || s[i] == 'E' ||
s[i] == 'i' || s[i] == 'I' || s[i] == 'o' || s[i] == 'O' ||
s[i] == 'u' || s[i] == 'U') {
... | ALGO | 0.998731 | 4.188364 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2025-01-01T06:29:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9dab5207758... |
fcf88be9-ac89-441f-aa59-f63863e63549 | Sanketrajnor/GFG_Problem_Of_The_Day_In_C- | ValidateIPAddress.cpp | class Solution {
public:
int isValid(string str) {
int dots = 0; // Counter for dots in the string
string num = ""; // To build each segment
for (int i = 0; i < str.size(); i++) {
if (str[i] == '.') {
// When we find a dot, validate the current segmen... | ALGO | 0.994615 | 5.722422 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-06-12T05:14: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": "8eaa97d9f35... |
7b709a51-bd4c-4da3-9d46-f67316bdfc20 | Bthcorn/cpp-lab | Final/lab10-q1.cpp | #include <iostream>
#include <string>
class Fraction {
public:
int num;
int den;
Fraction(int n = 0, int d = 1) : num(n), den(d) {}
static int gcd(int a, int b) {
if (b == 0) {
return a;
} else if (a == 0) {
return b; }
return gcd(b, a % b);
}
F... | TOOL | 0.987842 | 5.880494 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2023-11-29T09:58: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": "4bcc6172cee... |
46dbb848-2105-4720-a4be-57d4fcfe5392 | luigifusco/GEM-XOHW-2021 | metrics/mutual_information/testbench/hls_prz_testbench.cpp | #include <iostream>
#include <cmath>
#include <random>
#include <stdio.h>
#include "parzen.hpp"
#include "mi_luigi.hpp"
#include <time.h>
typedef ap_uint<8> MY_PIXEL;
#define MAX_RANGE 255
#define PADDING 1
const double kernel_host[KERNEL_SIZE] = { 1./6., 2./3., 1./6. };
int main(){
MY_PIXEL ref[DIMENSION * DIM... | ALGO | 0.999503 | 4.889227 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-07-01T09:20:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfcde7e372... |
147c6529-b21a-473f-acc7-8a1e9079d002 | philronan/stackoverflow | maxpathsum.cpp | #include <iostream>
#include <vector>
using namespace std;
/**************************************************************************************
https://stackoverflow.com/q/64258707/1679849
Given two integer arrays a and b of lengths n and m, generate an n×m matrix where the
value in row i and column j is equal to... | ALGO | 0.999988 | 3.945524 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-07-11T12:15: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": "d025506f7a... |
89717509-daa5-4506-b94d-d67844fbcee1 | dohui-son/Algorithms-Cplusplus | samsung/B16234.cpp | #include <bits/stdc++.h> //시간 80ms
using namespace std;
int visited[54][54];
int a[54][54];
int dy[] = {-1, 0, 1, 0};
int dx[] = {0, 1, 0, -1};
int n, l, r, sum, cnt;
vector<pair<int, int> > v;
void dfs(int y, int x, vector<pair<int, int> > &v)
{
for (int i = 0; i < 4; i++)
{
int ny = y + dy[i];
... | ALGO | 0.999883 | 4.514276 | {
"github_metadata": {
"branch": "master",
"commit_count": 186,
"repo_created_at": "2021-03-01T10:52:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66aae0fd... |
8616bdab-56e8-4898-ab3c-ac46c823bfcb | GentleMadness/TUB-WS16-17 | Compiler Design/Compiler_lab4/lab4_testing_files/lab_4.cpp | #include <llvm/Pass.h>
#include <llvm/IR/LLVMContext.h>
#include <llvm/IR/Function.h>
#include <llvm/IR/Instruction.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/InstVisitor.h>
#include <llvm/IR/CFG.h>
#include <llvm/IR/InstIterator.h>
#include <llvm/IR/Constants.h>
#include <llvm/ADT/SmallVector.h>
#include <... | TOOL | 0.998924 | 7.152053 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2017-03-12T18:07: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": "4adf41242... |
f9ab5e0f-1c92-4213-ab33-7a34c0078908 | matumoto1234/ALDS1 | 01/ALDS1_1_A.cpp | #include <bits/stdc++.h>
using namespace std;
#define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1)
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) { a = (a > b ? a : b); }
template <typename T1, typename T2> in... | ALGO | 0.999984 | 5.297358 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-09-19T14:58:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "d95f49279... |
717c0981-4fc2-4fcd-bfbc-3ca3f5c5fe3f | voy49er/voyager | src/coloring.cpp | #include "core.hpp"
static int cmax;
static vector<int> seq;
static unordered_map<int, Color> opt;
static void CountDegrees(SwitchGraphAlpha &alpha, set<pair<int, int>> °rees);
static void dfs(SwitchGraphAlpha &alpha, SwitchGraphBeta &beta, unordered_map<int, Color> &color, int ith, int c);
void BruteForceCompact... | ALGO | 0.999513 | 5.000976 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-04-19T12:39:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15df4a43122f... |
62eca5d8-d291-4512-9de7-c92a3170628e | MtTsai/Codeforces | 1119/1119C.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> A(n, vector<int>(m, 0));
vector<vector<int>> B(n, vector<int>(m, 0));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> A[i][j];
}
... | ALGO | 0.999993 | 5.416383 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-02-09T15:27: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": "de4ab5fc6a... |
6e466700-9471-4717-9be8-f91e6663a30f | ShadowUnderMoon/miniserver | include/heaptimer.h | #pragma once
#include <chrono>
#include <cstddef>
#include <functional>
#include <unordered_map>
#include <vector>
using TimeOutCallBack = std::function<void()>;
using Clock = std::chrono::system_clock;
using TimeStamp = Clock::time_point;
struct TimerNode {
int id;
TimeStamp expire_time;
TimeOutCallBack... | ALGO | 0.927686 | 5.621444 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2024-04-13T09:57:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4d909dfb7f7... |
8663896a-5ab2-48d9-a279-97c64e8954c8 | inuyashaw/sort_algorithm | ShellSort.cpp | /*** 希尔排序实质就是分组插入排序,是插入排序法的一种改进,希尔排序是非稳定的排序方法。***/
/*** 基本思想:先将整个待排序序列分割成若干子序列(由相隔某个“增量”的元素组成)分别进行直接插入排序,然后依次缩减增量再进行排序,待整个序列中的元素基本有序(增量足够小)时,再对全体元素进行一次直接插入排序。开始时,gap取值较大,子序列中的元素较少,排序速度快,克服了直接插入排序的缺点;其次,当gap值逐渐减小后,虽然子序列的元素变多,但大多基本有序,所以继承了直接插入排序的有点 ***/
/*** 平均时间复杂度:O(nlog2(n));空间复杂度:O(1) ***/
/*** 希尔排序的效率取决于增量gap的选取,时间... | ALGO | 0.999971 | 4.152262 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-03-24T03: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": "d7d4164a6... |
bd669775-1e5f-412f-9a11-958d4ef5902f | Abhinav7076/My-Codes | Company Coding Questions/Amazon/Find the level of the tree which has the maximum number of nodes.cpp | int maxNodeLevel(Node *root)
{
// Add your code here
if(root == NULL)
return 0;
queue<Node*> q;
q.push(root);
int ma = 0, level = 0, ans = 0;
while(!q.empty()){
int size = q.size();
if(size>ma){
ma = size;
ans = level;
}
while(size--){... | ALGO | 0.999843 | 4.502532 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-06-25T04:14:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e0d655d284... |
a24bbcbc-cd3e-4cfc-8b94-32fcaac822b7 | Loks-/competitions | common/factorization/utils/primes_count.h | #pragma once
#include "common/base.h"
#include "common/data_structures/binary_indexed_tree/bit.h"
#include "common/factorization/table/mobius.h"
#include "common/factorization/table/pi.h"
#include "common/numeric/bits/ulog2.h"
#include "common/numeric/utils/pow.h"
#include "common/numeric/utils/ucbrt.h"
#include "comm... | ALGO | 0.999881 | 6.170055 | {
"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": "8b8bda7... |
f6739283-8cc7-4962-a247-556c6e7b77d2 | ravigod22/CompetitiveProgrammingUNI | Training/SubiendoLevel/S2/c.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<int> d;
set<string> ans;
string s;
void backtracking(int pos, int k) {
if (pos > k / 2) {
string tmp = s;
set<int> correctitud;
for (char e : tmp) correctitud.insert(e - '0');
if (correctitud.size() != n) return;
... | ALGO | 0.999631 | 4.180802 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-10-17T02:27: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": "3ac8f9ff356... |
03eafb1d-05c4-4199-887b-a7b1962232a2 | AshleyFitness/RandomLinearAlgebraLib | MatrixSpace.h | #pragma once
#ifndef MATRIX_SPACE_H
#define MATRIX_SPACE_H
#include <vector>
template <typename T>
struct DimensionalSolution {
int col;
std::vector<T> vector_solution;
};
template <typename T>
struct MatrixSpace {
std::vector<DimensionalSolution<T>> solutions;
int rank;
};
template <typename T>
std::o... | TOOL | 0.984055 | 4.167547 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-02-20T22:36: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": "fd7c085e843b... |
16436580-78f1-46fd-9738-27354152770b | 2019331099-Rabbi/Online-Judges-Problems-Solution | LeetCode/Random/863.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define PI acos(-1)
#define sz 100010
#define inf 1000000009
#define mod 100000000
#define RUN_FAST ios::sync_with_stdio(false);
using namespace std;
// int row[] = {0, 0, -1, 1, -1, 1, -1, 1};
// int col[] = {1, -1, 0, 0, -1, 1, 1, -1};
struct TreeNode {
int val;
Tr... | ALGO | 0.999998 | 5.115109 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-06-29T17:28: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": "b414eb0ad34... |
cf48644c-6115-4a08-8ec7-da561460bb08 | ishandutta2007/codeforces-l | ljc00118/normal/1240/A.cpp | #pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define Fast_cin ios::sync_with_stdio(false), cin.tie(0);
#define rep(i, a, b) for(register int i = a; i <= b; i++)
#define per(i, a, b) for(register int i = a; i >= b; i--)
using namespace std;
typedef unsigned long long ull;
typedef pair <int, ... | ALGO | 0.999786 | 3.598428 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17: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": "0d484345e613... |
a7ae5bff-6ca6-45d5-8d3f-2244d43b9a16 | GipnoMops/Algorithms-and-data-structures-cpp | kontest 7/1/main.cpp | #include <iostream>
class BST {
private:
int dips_;
int value_;
BST* left_;
BST* right_;
public:
BST(int value = 0, BST* left = nullptr, BST* right = nullptr): value_(value), left_(left), right_(right) {};
void insert(int key) {
BST* curr = this;
while (curr && curr->value_ !=... | ALGO | 0.999908 | 4.681299 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-07-05T12:07: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": "1461a5e59f62... |
9a2f1afc-fb21-4af2-9e10-5c988c8a72ed | alexandraback/datacollection | solutions_5766201229705216_0/C++/igerasim/b.cpp | #include <iostream>
#include <vector>
#include <array>
#include <algorithm>
#include <hash_map>
#include <string>
#include <map>
#include <set>
#include <queue>
#if 0
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
typedef int256_t lll;
typedef uint256_t ulll;
#endif
using namespace... | ALGO | 0.999719 | 4.417542 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e961c46d... |
c9f01920-aa2a-4cc1-bb7c-dced8667492f | bward-cherrier/neuromorphic-data-gathering | source_code/dv-processing-rel_1.7/benchmarks/containers/kd_tree.cpp | #include "../../include/dv-processing/containers/kd_tree.hpp"
#include <Eigen/Dense>
#include <benchmark/benchmark.h>
#include <random>
#include <unordered_set>
using namespace dv::containers::kd_tree;
std::unordered_set<uint64_t> generateRandomButUniqueIndices(const uint64_t numValues, const uint64_t maxIndex) {
... | TEST | 0.973132 | 6.944244 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-05-24T11:30:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5be32f038e4... |
c18d5058-0aa7-4643-b784-9f2941b250e2 | zhaoweicai/hwgq | src/caffe/layers/binary_inner_product_layer.cpp | #include <vector>
#include "caffe/filler.hpp"
#include "caffe/layers/binary_inner_product_layer.hpp"
#include "caffe/util/math_functions.hpp"
namespace caffe {
template <typename Dtype>
void BinaryInnerProductLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {
cons... | DATA | 0.947669 | 7.889492 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2017-02-06T21:22:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 117,
"forks": 33,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c71de... |
d4bd2920-87f2-49bb-8ba1-2803c437c710 | renzov/Red_Crown | Live Archive/5741.cpp | #include<cstdio>
#include<vector>
#include<algorithm>
#include<climits>
using namespace std;
const int MAXN = 150001;
int W[MAXN];
vector<int> T[MAXN];
int N,K;
void dfs(int u,int *best){
int best_son[ K + 1 ];
for (int i=0; i <= K; ++i) best_son[i] = best[i];
for (int i=0; i < T[u].size(); ++i){
dfs( T[u][i] ... | ALGO | 0.999849 | 3.702975 | {
"github_metadata": {
"branch": "master",
"commit_count": 166,
"repo_created_at": "2012-06-03T15:15:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e28c959... |
efc62289-4737-4f61-be0b-470567fc283e | mcjuneho/CVC4_opt | src/smt/preprocessor.cpp | /********************* */
/*! \file preprocessor.cpp
** \verbatim
** Top contributors (to current version):
** <NAME>
** This file is part of the CVC4 project.
** Copyright (c) 2009-2020 by the authors listed in the file AUTHORS
** in the top-level source d... | ALGO | 0.933547 | 7.638886 | {
"github_metadata": {
"branch": "master",
"commit_count": 7900,
"repo_created_at": "2020-09-21T06:17: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": "d1f5204... |
270e3da0-0575-47a5-93b7-3185bc5a75e1 | jeffry1829/ojcode | template/KMP.cpp | // LC. 3455
// KMP 0-based 模板
int len = pstrs[i].size(); // pattern的length
string& curpatt = pstrs[i]; // 目前要製造next陣列的pattern
vector<int> nxt(len);
nxt[0] = 0;
int prefix_len = 0; // 目前共同前後綴的長度
int j = 1; // 目前看pattern的idx
while (j < len) {
if (curpatt[j] == curpatt[prefix_len]) {
nxt[j] = ++prefix_... | ALGO | 0.999224 | 4.008482 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2020-08-09T08:41: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": "efa07883c... |
706d14c3-33cb-4830-adb6-5f9c3b3cbd67 | ellenpry/Projeto-EDOO | src/Alice.cpp | #include "Alice.h"
#include "EventosAlice.h"
#include <iostream>
// Implementação da classe Alice
Alice::Alice() {
// Inicializa os atributos específicos da Alice
nome = "Alice";
carisma = 3;
carismaInicial = 3;
resistencia = 2;
resistenciaInicial = 2;
inteligencia = 5;
inteligenciaIn... | TOOL | 0.949689 | 6.092279 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2025-06-17T14:30:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "dc91677bba2... |
a101b564-d6eb-4d51-8c79-af422cf3bb90 | alpha74/iGFG | L/Lowest_Common_Ancestor_in_BT.cpp | // Find lowest common ancestor node in binary tree having unique nodes
// https://practice.geeksforgeeks.org/problems/lowest-common-ancestor-in-a-binary-tree/1/
// <NAME>
Node* lca(Node* root ,int n1 ,int n2 )
{
if( root == NULL )
return NULL ;
// If one of the keys matches numbers
if( root -> dat... | ALGO | 0.999902 | 4.955322 | {
"github_metadata": {
"branch": "master",
"commit_count": 172,
"repo_created_at": "2020-08-03T15:55:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa1880a9... |
38453c80-3ac3-4cb9-bc34-b14a131d34df | uiamn/typical90 | 81.cpp | #include <bits/stdc++.h>
#include <algorithm>
int main(){
int N, K;
std::cin >> N >> K;
int d = K / 2;
int size = 5002;
std::vector<std::vector<int>> imos = {};
for(int i=0; i<size; i++) {
std::vector<int> row(size, 0);
imos.push_back(row);
}
for(int i=0; i<N; i++) {
... | ALGO | 0.999924 | 4.307621 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2021-08-07T02: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": "f7d312085... |
d7bce1e1-78d7-4692-b7cb-ba952701d4ed | tomasz-kapela/DMapProblem | include/capd/map/Map.h | /// @addtogroup map
/// @{
/////////////////////////////////////////////////////////////////////////////
/// @file Map.h
///
/// @author <NAME>
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2000-2012 by the CAPD Group.
//
// This file constitutes a part of the CAPD lib... | ALGO | 0.936843 | 6.480045 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-02-22T08:19: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": "c1938243ffbf... |
55dd43f6-6533-4417-9845-e400e0baac1f | lifecycles1/competitive-programming | codesignal/arcade/2.core/13.waterfall of integration/1.sudoku.cpp | // Sudoku is a number-placement puzzle. The objective is to fill a 9 × 9 grid with digits so that
// each column, each row, and each of the nine 3 × 3 sub-grids that compose the grid contains all of
// the digits from 1 to 9.
// This algorithm should check if the given grid of numbers represents a correct solution t... | ALGO | 0.999834 | 6.730678 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2023-02-12T13:28: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": "6f40efcb869... |
c9b336e1-1f53-4f74-ab3f-404c8de0c036 | Piyushmittal50/DSA-BY-LOVE | Linked_list/LL/ll10.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int data){
this->data = data;
this->next = NULL;
}
};
node* removeDuplicate(node* &head){
if(head==NULL || head->next==NULL){
return head;
}
node* curr = head;
while(curr->next!=NULL){
if(curr-... | ALGO | 0.999738 | 3.636765 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-11-28T20:40: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": "9d027acb575... |
b9093adf-fd93-4655-99d9-2077212252e7 | satyamahinsa/codeforces-solution | 1367B - Even Array/even_array.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);cin.tie(0);
int t;
cin >> t;
while(t--) {
int n;
cin >> n;
int a[n];
for(int i = 0; i < n; i++) {
cin >> a[i];
}
int odd = 0, even = 0, same = 0;
for(int i = 0; i < n; i++) {
... | ALGO | 0.999877 | 3.979515 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2022-11-30T04:24: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": "353fe018f95... |
b139b66f-9799-4356-bede-ce116910d948 | RikoOphorst/blowbox-2015 | Blowbox/d3d11/d3d11_vertex_buffer.h | #pragma once
#include "../../blowbox/d3d11/d3d11.h"
#include <vector>
#include <Windows.h>
#include <xnamath.h>
namespace blowbox
{
/**
* @struct blowbox::Vertex
* @brief A structure that holds vertex information
*/
struct Vertex
{
Vertex() :
position(XMFLOAT4(0.0f, 0.0f, 0.0f, 1.0f)),
color(XMFLOAT4(1... | TOOL | 0.928528 | 6.560203 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2014-11-26T08:48: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": "aefa137d... |
4474b8df-1c50-47c7-bd50-1a7445576eb1 | Jeshika311/DSA-CPP | binary_search/first_occurance.cpp | #include <iostream>
#include <vector>
using namespace std;
int first(vector<int> nums, int target)
{
int st = 0, end = nums.size() - 1;
int first = -1;
while (st <= end)
{
int mid = st + (end - st) / 2;
if (nums[mid] == target)
{
first = mid;
end = mid ... | ALGO | 0.999943 | 5.554908 | {
"github_metadata": {
"branch": "main",
"commit_count": 349,
"repo_created_at": "2024-10-02T07:54: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": "f14fb9b668... |
48000d10-4fc8-4b1c-9c08-b52e9b13a5da | joseppujadas/cudoku | src/sudoku_omp.cpp | #include <chrono>
#include <cmath>
#include <vector>
#include <omp.h>
#include "util.h"
std::vector<char> solveOMP(std::vector<char> board, int depth=1){
int board_size = sqrt(board.size());
int inner_board_size = sqrt(board_size);
bool progress = true;
bool done = false;
bool error = false;
... | ALGO | 0.999734 | 4.392144 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-11-12T04:03:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44405d87333... |
fa29be4e-e0bf-444e-8b2f-a71dae557a01 | ye-htut-maung/CSCI-Lab | Labs/Lab_20/lab_20_3.cpp | #include <iostream>
using namespace std;
int main() {
int n;
int numbers[100];
cout << "Enter a positive integer (at most 100): ";
cin >> n;
numbers[n];
cout << "Enter " << n << " integers: ";
for (int i = 0; i < n; i++) {
cin >> numbers[i];
}
for (int i = 0; i < n; i++... | ALGO | 0.999561 | 3.673883 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2022-11-07T16:42: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": "ed4e9d98d73... |
8284b334-c2b0-4a5c-8bb1-3d2dd5a936fe | vTech2019/OpenCL-OpenGL-WinAPI-master | glDevice.h | #pragma once
#include "WinApi.h"
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include "Structures.h"
#include <immintrin.h>
#include "glad/include/glad/glad.h"
#pragma comment(lib, "opengl32")
struct gl_texture_list {
unsigned int type_memory;
unsigned int memory_data;
gl_texture_list* previous;
gl_t... | TOOL | 0.939469 | 4.651066 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-06-09T13:14: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": "a862907627... |
49a717cf-e791-4890-88da-1a0b51728870 | py100/University | template/Codes/Dinic.cpp | #include <stdio.h>
#include <iostream>
#include <map>
#include <string.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <math.h>
#include <algorithm>
#include <string.h>
#define ll long long
#define maxn 320
using namespace std;
int G[maxn][maxn], layer[maxn];
int m, n;
bool vis[maxn];
bool countLayer... | ALGO | 0.999975 | 4.061494 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2016-03-10T05:13:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9973fe67... |
cfcc6ee0-5ca2-4b1a-8310-3d880271ceba | Shivsharma779/Leetcode_solutions | 394. Decode String/shiv_sol.cpp | class Solution {
public:
string decodeString(string s) {
int n = s.size();
string previous, current = "";
int num = 0;
vector<int> no;
vector<string> str;
for( int i = 0 ; i < n ; i++ ){
if(s[i] == '['){
str.push_back(curre... | ALGO | 0.999922 | 5.936908 | {
"github_metadata": {
"branch": "master",
"commit_count": 364,
"repo_created_at": "2021-06-16T10:44:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "18b31df9... |
2adaef10-1c70-4c9c-ae43-1430afa0f2a9 | giuspen/cherrytree | src/7za/CPP/7zip/Compress/HuffmanDecoder.h | // Compress/HuffmanDecoder.h
#ifndef __COMPRESS_HUFFMAN_DECODER_H
#define __COMPRESS_HUFFMAN_DECODER_H
#include "../../Common/MyTypes.h"
namespace NCompress {
namespace NHuffman {
template <unsigned kNumBitsMax, UInt32 m_NumSymbols, unsigned kNumTableBits = 9>
class CDecoder
{
UInt32 _limits[kNumBitsMax + 2];
U... | ALGO | 0.987965 | 5.237416 | {
"github_metadata": {
"branch": "master",
"commit_count": 4269,
"repo_created_at": "2015-03-22T22:18:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3652,
"forks": 481,
"issues": 865,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
da85e5ac-482c-49af-9f70-73e6135af503 | okpyo12/Algorithm | Algolab-Algorithm(2022)/Sort/ShellSort/ShellSort.cpp | #include <stdio.h>
#define MAX_SIZE 1000
void ShellSort(int a[], int n);
int main()
{
int numTestCases;
scanf("%d", &numTestCases);
for (int i = 0; i < numTestCases; ++i)
{
int num;
int a[MAX_SIZE];
scanf("%d", &num);
for (int j = 0; j < num; j++)
scanf("%d", ... | ALGO | 0.999639 | 3.978532 | {
"github_metadata": {
"branch": "master",
"commit_count": 821,
"repo_created_at": "2021-08-06T11:23: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": "5d15ba2b... |
78c9c89e-f18c-49e7-a505-e847a085661e | TechSculptorx/DSA | 15.Vectors/squaresorted.cpp | #include <iostream>
#include<fstream>
#include <vector>
#include<string>
#include<cstring>
using namespace std;
#include <bits/stdc++.h>
vector < int > sqsorted(vector < int > & arr) {
int n = arr.size();
vector < int > ans(n);
for (int i = 0; i < n; i++) {
ans[i] = arr[i] * arr[i];
}
sor... | ALGO | 0.999835 | 4.866434 | {
"github_metadata": {
"branch": "master",
"commit_count": 115,
"repo_created_at": "2024-01-11T13:07:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df7e1b5d... |
6a4aa6ef-2a00-4655-9a4a-ab7827f3463f | protarie125/BOJ_1937 | main.cpp | #include <algorithm>
#include <bit>
#include <chrono>
#include <cmath>
#include <cstdint>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <ranges>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#... | ALGO | 0.999971 | 4.912814 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-01T13:50: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": "1a82ee14dd... |
f5bad5b8-cd02-4d74-b13c-319f2a0d1c5b | 192211838/CSA0610-DAA | EXP-9.cpp | #include <stdio.h>
void multiplyMatrices(int a[][10], int b[][10], int result[][10], int n, int *operations) {
int i, j, k;
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
result[i][j] = 0;
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
for (... | ALGO | 0.999978 | 5.392382 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-11-20T06:53: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": "d0d77b3f67a5... |
52219bef-4b83-4575-a381-a28bca71b050 | pontuscode/vector_field_histogram | obstacle_avoidance.cpp | #include "air_lab2/occ.h"
#include "air_lab2/histogram_grid.h"
#include "air_lab2/histogram_polar.h"
#include "air_lab2/vector_field_histogram.h"
#include <ros/node_handle.h>
#include <ros/service.h>
#include <ros/subscriber.h>
#include <nav_msgs/GetMap.h>
#include <nav_msgs/OccupancyGrid.h>
#include <nav_msgs/Path.h>... | TOOL | 0.962416 | 5.001884 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-05-10T19:52: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": "646d45981639... |
ed564e2c-0395-4b90-ae1d-60e6b5db9920 | jjbiggins/cie | jjbiggins/homework/hw4/Movie.cpp | /*------------------------------------------------------------------------------
* Programmer: Your name here
* Name:
* Description:
-------------------------------------------------------------------------------*/
#include "Movie.h"
#include <stdlib.h>
#include "helperfunctions.h"
#include <iostream>
using namesp... | ALGO | 0.986469 | 4.585672 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-12-04T00:13: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": "9bb0aecebc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.