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 |
|---|---|---|---|---|---|---|---|
84f5a5c0-a48e-44bf-84fd-49a251f4b1f2 | juruo-c/ACM | 22.05/Acwing_244.cpp | //https://www.acwing.com/problem/content/245/
#include <iostream>
using namespace std;
const int N = 100005;
int n;
int a[N], c[N];
int ans[N];
void add(int x, int k)
{
for (int i = x; i <= n; i += (i & -i))
c[i] += k;
}
int query(int x)
{
int res = 0;
for (int i = x; i; i -= (i & -i))
... | ALGO | 0.999989 | 3.408854 | {
"github_metadata": {
"branch": "main",
"commit_count": 197,
"repo_created_at": "2022-03-05T23:56:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff2c75cdcc... |
41439122-af85-428e-8cc0-88fcc368c78e | GFG-CLUB-KIIT/100-Days-of-Code | Ashish/main.cpp | #include <bits/stdc++.h>
using namespace std;
int compare (const void *a, const void * b)
{ return ( *(char *)a - *(char *)b ); }
void swap (char* a, char* b)
{
char t = *a;
*a = *b;
*b = t;
}
int head (char str[], char first, int l, int h)
{
int headIndex = l;
for (int i = l+1; i <= h; i++)
if (str[i] >... | ALGO | 0.999997 | 4.527746 | {
"github_metadata": {
"branch": "main",
"commit_count": 819,
"repo_created_at": "2021-06-16T05:25:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13,
"forks": 20,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "5c3696b44... |
eadbb33a-5c8c-4d5f-a6b8-238c7164f8b8 | lydrainbowcat/tedukuri | 配套光盘/例题/0x30 数学知识/0x37 容斥原理与Möbius函数/Zap/BZOJ1101 Zap.cpp | //Author:XuHt
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
const int N = 50001;
int miu[N];
bool v[N];
void Zap() {
int a, b, k, ans = 0;
scanf("%d %d %d", &a, &b, &k);
a /= k;
b /= k;
if (a > b) swap(a, b);
for (int x = 1, gx; x <= a; x = gx + 1) {
gx = min(a / (a / x), b / ... | ALGO | 0.999865 | 3.364005 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2018-03-18T01:24:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2487,
"forks": 607,
"issues": 15,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c... |
7c450ed1-6ec4-43dc-8f44-fd34aa2b6f62 | si-yuan-zhou/Data-Structure | DataStructure/Search/StaticSearch.h | #ifndef __STATICSEARCH__
#define __STATICSEARCH__
template <class T>
struct Node{
T key;
/*other data can be added*/
};
template <class T>
class StaticSearch {
private:
Node<T> *ST; //chart first address
int len; //length of chart
bool storted;
public:
StaticSearch();
~StaticSearch();
void Create(int... | ALGO | 0.999777 | 3.752224 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2017-11-16T13:22:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72a152d37... |
b24de2d2-eca7-4e06-9328-a29253d59996 | JacobBudda/advanced-algorithm | sha256.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
const uint32_t K[] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc... | ALGO | 0.999827 | 5.05728 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-01-22T08:09: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": "84b316a3764... |
82c32015-879b-4179-9be8-ba7dd983bf70 | yjl9903/XCPC | Luogu/3389.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <utility>
#define ms(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int mod = 998244353;
const int inf = 1 << 30;
const int maxn = 100 + 5;
n... | ALGO | 0.999963 | 3.764514 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-03-25T19:33:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12dc751031fb... |
ceafe591-6cd0-4b1f-97ea-95f09a33856f | hszhao/PSPNet | include/caffe/layers/densecrf_layer.hpp | #ifndef CAFFE_DENSE_CRF_LAYER_HPP_
#define CAFFE_DENSE_CRF_LAYER_HPP_
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/common.hpp"
#include "caffe/layer.hpp"
#include "caffe/util/densecrf_pairwise.hpp"
#include "caffe/proto/caffe.pb.h"
namespace caffe {
/**
* @brief The DenseCRF layer performs mean-fiel... | DATA | 0.985068 | 7.685693 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2016-12-04T12:49:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1621,
"forks": 550,
"issues": 78,
"pull_requests": 0
},
"file_meta": {
"content_id": "2d4... |
27b012e5-8997-4cc4-a981-8c4c2dfe0a2b | bhushan23/compiler | reachingDef/client1.cpp | //#include "irclass.h"
#include <iostream>
#include "program.h"
#include "basicblock.h"
#include "reachingdef.h"
using namespace std;
int main(){
BasicBlock* entryBB = new BasicBlock();
Program* program= new Program(entryBB);
// operand* a,b,c;
// operand* b2,b3,b4,b5;
operand* a = new operand(... | ALGO | 0.992409 | 3.051501 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2014-08-28T13:53:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9caced7e... |
0418fc38-1f5e-461a-884b-e27fc9be3025 | AnuragChouhanDEV/LeetCode | roman-to-integer/Accepted/5-1-2023, 6_54_47 PM/Solution.cpp | // https://leetcode.com/problems/roman-to-integer
class Solution {
public:
int I = 1;
int V = 5;
int X = 10;
int L = 50;
int C = 100;
int D = 500;
int M = 1000;
int char_to_int(char c) {
switch (c) {
case 'I':
return 1;
case 'V':
... | ALGO | 0.99994 | 5.865149 | {
"github_metadata": {
"branch": "main",
"commit_count": 422,
"repo_created_at": "2023-06-09T15:16: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": "9b9f78ad08... |
f1347803-4fd4-42bf-af13-421ea4270ea0 | zhijiefei/my_vo | src/Optimizer.cc | #include "Optimizer.h"
#include "Thirdparty/g2o/g2o/core/block_solver.h"
#include "Thirdparty/g2o/g2o/core/optimization_algorithm_levenberg.h"
#include "Thirdparty/g2o/g2o/core/robust_kernel_impl.h"
#include "Thirdparty/g2o/g2o/solvers/linear_solver_eigen.h"
#include "Thirdparty/g2o/g2o/solvers/linear_solver_dense.h"
#... | ALGO | 0.996853 | 3.669156 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-02-25T06:22: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": "d7f0b55e6c... |
7b37191f-64ac-44e4-af7f-f11a4e907289 | dodolalorc/Comparator | main.cpp | #include <bits/stdc++.h>
#include <cstdio>
using namespace std;
typedef double ld;
typedef unsigned long ul;
typedef long long ll;
typedef unsigned long long ull;
const int maxn = 1050;
const int inf = 0x3f3f3f;
char mp[maxn][maxn];
void solve() {
int n, m;
cin >> n >> m;
int cntk = 0, cntd = 0;
for (int i ... | ALGO | 0.999899 | 4.184062 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-07-27T09:10: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": "cf5312f63112... |
831108f9-2262-4f05-a401-6a1eb07c8991 | 18ivan18/IntroductionToProgramming2023 | week10 - recursion/exam2/2.cpp | #include <iostream>
#include <cstring>
#include <cassert>
int createNumber(const char *str, int &i)
{
int sign = 1;
if (str[i] == '-')
{
sign *= 1;
i++;
}
int num = 0;
while (isdigit(str[i]))
{
num = num * 10 + str[i] - '0';
i++;
}
i--;
return num... | ALGO | 0.999107 | 3.876673 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-10-03T17:11: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": "665c2aaa40a... |
668ec47f-7f65-4766-9814-fdb9b9ebdf08 | RIBTAS007/Pepcoding-CPP | 1. Basics of Programming/1. Getting Started/03. Is A Number Prime.cpp | /*
Question
1. You've to check whether a given number is prime or not.
2. Take a number "t" as input representing count of input numbers to be tested.
3. Take a number "n" as input "t" number of times.
4. For each input value of n, print "prime" if the number is prime and "not prime" otherwise.
*/
#include <iostream... | ALGO | 0.999614 | 4.964689 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2020-10-27T09: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": "fad9b0c2505... |
0b60f335-630c-475c-ad3a-3a74b25a7998 | rahulnagurtha/Mycode | codeforces/vk-2.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define FF first
#define SS second
#define pb push_back
#define fill(a,v) memset(a,v,sizeof a)
#define box(a,b) ((a*b>=0)?((a/b)):((a%b==0)?(a/b... | ALGO | 0.999993 | 3.670331 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2015-10-06T14:14:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "632b6ec1c... |
1a2af0e4-12ff-4cdf-afd9-9863ec3c1204 | vladbot2/OOP.-Exception | OOP. Exception.cpp | using namespace std;
#include <iostream>
//struct Node {
// int data;
// Node* next;
// Node* prev;
// Node(int value) : data(value), next(nullptr), prev(nullptr) {}
//};
//
//class DoublyLLList {
// Node* head = nullptr;
// Node* tail = nullptr;
//
//public:
// void Append(int value) {
// ... | ALGO | 0.999012 | 5.125748 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-11-28T19:59:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65818391f5... |
2073d8ab-9064-4d3b-a297-2abf1bb35ca9 | kiddos/notes | codeforces/1600~1699/1691/c.cc | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve() {
int n = 0, k = 0;
cin >> n >> k;
string s;
cin >> s;
auto compute_cost = [](const string& S) -> int {
int ans = 0;
for (int i = 1; i < S.length(); ++i) {
ans += (S[i-1]-'0') * 10 + S[i] - '0';
}
retu... | ALGO | 0.999896 | 4.987444 | {
"github_metadata": {
"branch": "master",
"commit_count": 398,
"repo_created_at": "2017-01-31T13:49:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98f7a9a1... |
b6499c1d-91dc-4a07-9725-c13e066c7ebd | ishandutta2007/codeforces-v | vercingetorix/normal/1292/A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <cstring>
#include <set>
#include <bitset>
#include <map>
#include <chrono>
#include <random>
#include <unordered_map>
#include <stdio.h>
using namespace std;
typedef long long ll;
typedef long do... | ALGO | 0.999703 | 3.59889 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "d5ac0cd6a0a6... |
8ce6d4ee-7a8a-4183-9a47-4a613948585b | yangzebin001/OJ | pat/天梯赛练习集/L2-030B.cpp | /*
* @Date: 2019-11-18 14:41:55
* @LastEditors: BeckoninGshy
* @LastEditTime: 2019-11-18 17:01:10
*/
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<vector>
#include<string>
using namespace std;
map<string,string> F;
map<string,int> pos;
map<string,bool> sex;
int N,M... | ALGO | 0.999948 | 3.975039 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2019-08-17T03:54: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": "2867bf3a7... |
1ce4d801-7648-461e-b2d8-d543ac2a567c | inder128/CompetitiveProgramming | CodeChef/LONG-SEP20/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define rng(x) x.begin(), x.end()
#define pb push_back
#define F first
#define S second
#define el '\n'
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
return os << "(" << P.F << "," << P.F << ")"; }
template<class T> ostream& operator<<(ost... | ALGO | 0.999554 | 3.500224 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-08-09T00:35:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adbfb2528... |
96bf4f9e-53ce-4378-be3b-516d6c6f9cab | andyyhchen/cp-codes | misc/linkedlist.cpp | #include<stdio.h>
#include<stdlib.h>
struct data{
int num;
struct data *next;
struct data *prev;
};
typedef struct data NODE;
NODE* creat(int in)
{
NODE *ptr = NULL;
ptr = (NODE *)malloc(sizeof(NODE));
ptr -> num = in;
return ptr;
}
void ins(NODE *ptr, NODE *head)
{
(ptr -> next) = head -> next;
if((head -> ... | ALGO | 0.999929 | 3.228346 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-07-19T08:21: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": "d7cd753a70... |
9a861499-c0f6-42b4-9954-7da67a0fc792 | ishandutta2007/codeforces-a | alexluchianov/normal/16/E.cpp | #include <iostream>
#include <iomanip>
using namespace std;
using ld = long double;
int const nmax = 18;
ld v[1 + nmax][1 + nmax];
ld dp[1 + (1 << nmax)];
int main()
{
int n;
cin >> n;
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
cin >> v[i][j];
dp[(1 << n) - 1] = 1;
for(int mask = (1 << ... | ALGO | 0.999574 | 4.441124 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0be6b570c40d... |
a9a95d9c-c783-429a-a645-273976501930 | ishandutta2007/codeforces-y | yyt16384/normal/464/B.cpp | #include <cstdio>
#include <cstring>
#ifdef _WIN32
#define LLFORMAT "%I64"
#else
#define LLFORMAT "%ll"
#endif
const long long INFLL=0x3f3f3f3f3f3f3f3fLL;
int a[8][3];
int b[8][3];
void init()
{
for (int i=0;i<8;++i)
for (int j=0;j<3;++j)
scanf("%d",&a[i][j]);
}
inline long long dist(int x,int y)
{
long long s=0... | ALGO | 0.999889 | 3.062016 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16: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": "3dba67a30f07... |
c7b6e3db-375e-48a3-902a-cd160a0ba7b7 | kirrishima/4-sem | MatProg/4/4_Lab/5 task/LCS.cpp | #include "LCS.h"
#include <cstring>
#include <algorithm>
// ------------------------------
// Рекурсивное решение LCS
// ------------------------------
int lcs(int lenx, const char x[], int leny, const char y[])
{
int rc = 0;
if (lenx > 0 && leny > 0)
{
if (x[lenx - 1] == y[leny - 1])
rc = 1 + lcs(lenx - 1, x,... | ALGO | 0.999574 | 4.811467 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-15T20:25: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": "3746e24aa2c6... |
2d4e16df-a434-4d16-8d99-b9ebbad7f84b | TanveerSingh31/DSA | Queues/Queue using LL.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
class Node{
public:
T data;
Node<T> *next;
Node(T el){
data = el;
next = NULL;
}
};
template <typename T>
class Queue_custom{
private:
Node<T> *front;
Node<T> *tail;
int size;
public:
Queue_cu... | ALGO | 0.992587 | 3.434119 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2024-03-16T11:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbacce88f... |
7d1aa6df-71b9-457d-b957-54cb976b074a | sthsuyash/CSIT_Labs | 5th_Semester/Cryptography/8_Extended_Euclidean.cpp | #include <iostream>
#include <vector>
#include <iomanip>
#include "./returnName.h"
using namespace std;
vector<vector<long long>> extendedEuclideanTable(long long a, long long b);
int main()
{
generateHeader("Program to perform the Extended Euclidean Algorithm");
long long a, b;
cout << "Enter two posit... | ALGO | 0.999656 | 5.479098 | {
"github_metadata": {
"branch": "main",
"commit_count": 705,
"repo_created_at": "2022-08-13T12:11:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 37,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f954b30... |
0b13cbcb-d70a-4ca2-bb57-5d02a041cad1 | AhmedGharseldin/Coach-Academy_PST-LEVEL-2- | Week 8/Practice Contest - 2/20C - Dijkstra.cpp | //https://codeforces.com/problemset/problem/20/C
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 1e5 + 5;
vector<int> ans(N);
void printR(int x)
{
if (x != 1)
printR(ans[x]);
cout << x << ' ';
}
int main()
{
priority_queue<pair<int, int>> q;
ll dist[N];
in... | ALGO | 0.99999 | 4.279039 | {
"github_metadata": {
"branch": "main",
"commit_count": 163,
"repo_created_at": "2021-01-17T12:56: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": "9fcb134629... |
f07f93c8-9570-437e-ae0f-5bf2ce958e43 | Mehedi-Hasan-Rabbi/Online-Judge-Solution | Dimik OJ (Part of LightOJ)/Problem 18-Vowel Consonant.cpp | #include<bits/stdc++.h>
using namespace std;
void solve()
{
char s[10001];
scanf(" %[^\n]", s);
for(int i=0; s[i]!='\0'; i++)
{
if (s[i] == 'a' || s[i] == 'e' || s[i] == 'i' || s[i] == 'o' || s[i] == 'u' ||
s[i] == 'A' || s[i] == 'E' || s[i] == 'I' || s[i] == 'O' || s[i] == 'U'... | ALGO | 0.999706 | 3.610167 | {
"github_metadata": {
"branch": "main",
"commit_count": 572,
"repo_created_at": "2023-06-30T10:35:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2563368b... |
27129ed4-649c-4930-9d4b-1083b7f2e0fa | qingcheng9137/MATH_PHY | NuAlysis/LinearEqua/Equation4.0.cpp | /*************************************************************************************/
/*************************************** 2018.3.27 ***********************************/
/***************************** <NAME> ************************/
/**************************** Beijing Insititute of Technolog... | ALGO | 0.999912 | 3.798378 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-06-19T13:02: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": "7b4c4f875... |
26ae50dd-794d-4775-87da-6a4c2cfba27b | zchee/cuda-sample | 7_CUDALibraries/simpleDevLibCUBLAS/simpleDevLibCUBLAS.cpp | /*
* Copyright 1993-2015 NVIDIA Corporation. All rights reserved.
*
* Please refer to the NVIDIA end user license agreement (EULA) associated
* with this source code for terms and conditions that govern your use of
* this software. Any use, reproduction, disclosure, or distribution of
* this software and related... | ALGO | 0.967071 | 6.303551 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-10-06T22:31:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 371,
"forks": 179,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d2fab... |
d3e14154-4e4b-4823-aa4a-8db44a24c7ce | DingXuefeng/sandbox | cuda/link/main.cc | #include <iostream>
#include <stdio.h>
#include <cuda_runtime.h>
#include "lib1.h"
#include "for_cc.h"
#ifdef __CUDACC__
#else
#include <string.h> // for memcpy
T threadIdx {10}, blockIdx { 20 }, blockDim { 30 };
#endif
__global__ void call(double *x) {
lib1::call();
int index = blockIdx.x*blockDim.x + threadIdx.x;... | TOOL | 0.91493 | 3.310417 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-03-19T13:36: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": "3aaf38d8f... |
9f71da37-4451-42a3-ba28-8a2c76a9dcd3 | afsanamim04/Graph-theory | Cycle detection in a undirect graph using DFS.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define nl endl
#define pb push_back
vector<ll>v[1000000];
ll vis[10000];
bool DFS(int node , int par )
{
vis [node] = 1;
for( auto child : v [node] )
{
if( vis[child] == 0 )
{
if( DFS (child , node) == ... | ALGO | 0.999905 | 4.329639 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-13T00:14: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": "8ed024b2fb00... |
f01c20d1-e0f0-496a-a502-b407d9dfc72f | arghac14/DataStructure-and-Algorithms | Algorithms/Dynamic programming on Graphs /Dijkstra-Algorithm/run.cpp | /* Dijkstra Algorithm - Shortest path between two single points algorithm
Time complexity Worst case = O(n*n)
Created by: <NAME>
21.08.2019
*/
#include<bits/stdc++.h>
using namespace std;
int edgelist[10000][3];
map<int,int> nodevalues;
map<int,int> finalresult;
//function to print the result
vo... | ALGO | 0.999911 | 4.736376 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2018-10-09T11:23:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 18,
"issues": 2,
"pull_requests": 3
},
"file_meta": {
"content_id": "d94fbd6f... |
2b41a36e-d10d-47d9-bf86-04f7648acaf9 | surzoprovakar/Graphics-Sessional | 2/curve/main.cpp | #include<stdio.h>
using namespace std;
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include <windows.h>
#include <glut.h>
#define pi (2*acos(0.0))
typedef struct point2d
{
double x, y;
};
point2d cp[200];
point2d cpa[200];
point2d hermit[110];
point2d trackhermit[5000];
int cpidx;
int cpaidx;
int dot... | ALGO | 0.998684 | 3.624167 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-09-27T07:01:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3af042eb69... |
6e9b8def-754e-4481-9c75-ff5f868cdd99 | aisha1021/CSCI_235_Software_Analysis_and_Design_ll | project7-aisha1021/SkillTree.cpp | /*
<NAME>
<EMAIL>
<NAME>
CSCI235 Spring 2024
Project 7 - Binary Skill Tree
*/
#include "SkillTree.hpp"
/**
* Default Constructor
*/
SkillTree::SkillTree() : BinarySearchTree<Skill>() {}
/**
* @param: A const reference to string: the name of a csv file
* @post: The SkillTree is populated with Skills from the csv ... | TOOL | 0.984386 | 5.987808 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2024-06-20T23:12:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4acdd1f6f8... |
c55881b0-574d-4aba-b0a9-da6ac33fd872 | easchimidt/AoC18 | day2-1.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <string.h>
#define ALPHABET_SIZE 26
using namespace std;
void check_repetition(string line, int *letters);
int main()
{
fstream file;
string line;
int num_2 = 0, num_3 = 0, i;
int letters[ALPHABET_SIZE] = {0};
bool found_2, found_... | ALGO | 0.999674 | 4.383868 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-12-04T16:20: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": "66c6a5f17b... |
308be47b-85de-4bf3-ba92-2b6546b30bcc | wheezydeeeb/Code-Only-CPP-with-DSA | STRIVER SDE SHEET/DYNAMIC_PROGRAMMING/INTRODUCTION.cpp | // "Those who cannot remember the past are condemned to repeat it..." - Famous Dynamic Programming Quote.
/*
* RESOURCES:
- https://takeuforward.org/data-structure/dynamic-programming-introduction/
*/
/*
* Prerequisites: Recusion.
* Solving Problems: 1. Tabulation Method 2. Memoization Method
... | ALGO | 0.999965 | 5.876804 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-02-03T17:06:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34bac38c13d... |
d4f72e08-4f55-4af0-b2ee-80c85dad7160 | mrklein/mousse | 0.1.0/src/turbulence_models/incompressible/turbulent_transport_models/derived_fv_patch_fields/wall_functions/alphat_jayatilleke_wall_function_fv_patch_scalar_field.cpp | // mousse: CFD toolbox
// Copyright (C) 2011-2015 OpenFOAM Foundation
// Copyright (C) 2016 mousse project
#include "alphat_jayatilleke_wall_function_fv_patch_scalar_field.hpp"
#include "turbulence_model.hpp"
#include "fv_patch_field_mapper.hpp"
#include "vol_fields.hpp"
#include "wall_fv_patch.hpp"
#include "add_to_r... | TOOL | 0.985251 | 5.537158 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2015-12-31T10:07:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1ecc05f... |
95292879-8f88-4d0f-9230-b9e322672700 | FoxMoss/terminaldoom | src/m_fixed.c | // Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// publis... | ALGO | 0.98482 | 6.382599 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2025-06-12T17:25: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": "578daef8d... |
0f8cfe8e-e97f-4a81-a6e4-ff0807f7d2c1 | ishandutta2007/codeforces-e | eecs/normal/949/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n, m, h, id, tot, t[maxn], sz[maxn], bel[maxn];
bool out[maxn], vis[maxn];
vector<int> V, G[maxn], H[maxn];
void add(int u, int v) {
G[u].push_back(v), H[v].push_back(u);
}
void dfs1(int v) {
if (vis[v]) return; vis[v] = 1;
for (i... | ALGO | 0.999986 | 3.380999 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "798a1316ce98... |
6f98e27e-2ec4-4b6e-a02c-e3fe421ba4d4 | ValveSoftware/source-sdk-2013 | src/public/mathlib/vector.h | //========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#ifndef VECTOR_H
#define VECTOR_H
#ifdef _WIN32
#pragma once
#endif
#include <math.h>
#include <float.h>
// For vec_t... | TOOL | 0.929846 | 6.932188 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2013-06-26T22:21:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9165,
"forks": 2667,
"issues": 352,
"pull_requests": 507
},
"file_meta": {
"content_id": ... |
d629cbda-cba7-4f88-b4d4-7634971ba56a | MehtaAum/KUNJ-DSA-WEB-03-00-PM | Digit manipulation/complementBase10Integer.cpp | //question from : (leetcode)
// Complement of Base 10 Integer
//The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binary representation.
//For example, The integer 5 is "101" in binary and its complement is "010" which is the integer 2.
#include <iostre... | ALGO | 0.999967 | 5.282437 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-01-02T19:17:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2562557eb25... |
96945054-0cbe-4c44-96d6-9ca6b7eaf48c | Sugar-27/Data-structure-and-algorithm-learning | 9_树/6_LC297.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Codec {
public:
// Encodes a tree to a single string.
string serialize(TreeNode* root) {
build(root);... | ALGO | 0.999815 | 6.109593 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2021-09-17T12:38:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28ac8d95... |
2ef52368-9632-450e-a855-d3eb44c00104 | mr-jestin-roy/LeetCode-TaskList | LeetCode/Arrays & Vectors/Next Permutation.cpp | // // Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
// // If such an arrangement is not possible, it must rearrange it as the lowest possible order (i.e., sorted in ascending order).
// // The replacement must be in place and use only constant ext... | ALGO | 0.99999 | 6.046224 | {
"github_metadata": {
"branch": "master",
"commit_count": 926,
"repo_created_at": "2020-09-30T16:24:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3641738... |
aaccecf1-f13e-4742-8877-af7f210dfa32 | zukun/rcc | vxl/vxl-1.13.0/contrib/brl/bseg/bvxm/bvxm_edge_ray_processor.cxx | #include "bvxm_edge_ray_processor.h"
//:
// \file
#include <bvxm/bvxm_voxel_world.h>
#include <bvxm/bvxm_voxel_traits.h>
#include <bvxm/bvxm_world_params.h>
#include <bvxm/grid/bvxm_voxel_grid.h>
#include <bvxm/grid/bvxm_voxel_slab.h>
#include <bvxm/bvxm_image_metadata.h>
#include <bvxm/bvxm_util.h>
#include <bvxm/bvxm... | ALGO | 0.948407 | 6.159836 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2013-02-21T15:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf2dce3... |
bbd12d8b-9d5b-457d-b70c-0cb0dc08cbbe | Vinay2812/DSA | Graphs/G10_MST_Kruskal.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define... | ALGO | 0.999979 | 4.912003 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2022-05-07T13:06: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": "b2e59ae71... |
a20b465d-24dd-481a-9a0d-3c38f2124431 | brandonvl/artificial_intelligence | artificial_intelligence/assignment5/SteeringBehaviors.cpp | #include "SteeringBehaviors.h"
#include "2D\Transformations.h"
#include "Vehicle.h"
#include <iostream>
SteeringBehaviors::SteeringBehaviors(Vehicle *owner) : _owner(owner), _steeringForce(0,0)
{
_wanderRadius = 6.0;
_wanderDistance = 3.0;
_wanderJitter = 1000;
_fleeDistance = 200;
double theta = RandFloat() * ... | ALGO | 0.940712 | 5.494176 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2014-11-09T07:38: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": "c34af9f69... |
c28700c1-9186-4952-9a6d-661ccf84d528 | JovinRyan/OpenLAMMPSToolbox | src/calculations/ddc_bulk_selection.cpp | #include "calculations/ddc_bulk_selection.h"
std::pair<std::vector<int>, std::vector<int>> ddc_bulk_selection_explicit(dump_data_container &in_dump, std::vector<double> min_max_vec)
{
std::vector<int> count_vec(size(in_dump.frame_atoms_vec), 0);
std::vector<int> atoms_id_vec{0, 0}; // Initializing ro prevent free ... | ALGO | 0.993484 | 5.312288 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2024-07-27T17:15:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c154e6b23... |
d5290423-652d-4c82-932c-ac9cc5b749cc | chocono2230/competitive-programming | AtCoder/Problems/abc310/f/abc310_f.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--)
#define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri, x, n) for (int ri = (int)(n - 1); ri >= (int)(x); ri--)
#define repit(itr, x) for (auto itr = x.b... | ALGO | 0.998284 | 5.217184 | {
"github_metadata": {
"branch": "main",
"commit_count": 231,
"repo_created_at": "2022-10-09T09: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": "a583f3af4b... |
d5ff0f50-9184-4b7f-b744-b4ccac7d0646 | dwinkelman0/Stl2LaserCut | src/RingVector.h | // Copyright 2022 by <NAME>. All rights reserved.
#pragma once
#include <iostream>
#include <optional>
#include <vector>
template <typename T>
class RingVector {
public:
RingVector(const std::vector<T> &vec) : vec_(vec) {}
uint32_t getSize() const { return vec_.size(); }
T &operator[](const uint32_t index) ... | TOOL | 0.948026 | 7.285033 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2022-03-31T15:51: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": "4979f8743... |
a7908bc2-6131-4450-b7da-377f6b314883 | victoriatascau/CS-Problems | UVA Online Judge/796 - Critical Links/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
const int NMAX=10000;
vector<int> g[NMAX];
vector< pair<int, int> > critical;
int n, counter, seen[NMAX], low[NMAX];
void dfs(int x, int parent)
{
low[x]=seen[x]=++counter;
for(int i=0; i<g[x].size(); i++)
{
... | ALGO | 0.999915 | 3.557382 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-09-27T13:51: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": "bcfe66a45d... |
fe4ab208-0034-45db-a174-a61507bebeff | anzaika/guidance | libs/phylogeny/wYangModel.cpp | #include "wYangModel.h"
#include "codon.h"
#include "readDatMatrix.h" // for the normalizeQ function.
wYangModel::wYangModel(const MDOUBLE inW, const MDOUBLE inK,bool globalW, codon * coAlph):
_w(inW),_k(inK),_globalW(globalW),_coAlpha(NULL){
_coAlpha = (codon*)(coAlph->clone());
codonUtility::initSubMatrices(*_co... | ALGO | 0.994056 | 5.084938 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-08-28T12:48:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 3,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "c007d0a7... |
48154d84-1afb-43f4-8084-f6dde6118130 | civinx/ACM_Code | Practice/ZUCCACM/Saving Beans (Lucas定理)/Saving Beans (Lucas定理)/main.cpp | //
// main.cpp
// Saving Beans (Lucas定理)
//
// Created by czf on 16/4/5.
// Copyright © 2016年 czf. All rights reserved.
//
#include <cstdio>
typedef long long ll;
const int maxn = 100000 + 10;
ll inv[maxn];
ll getinv(ll a, ll p) {
ll n = p-2, ret = 1, base = a;
while(n) {
if (n & 1) ret = (ret % ... | ALGO | 0.999965 | 5.090983 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-02T14:34:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71670ef069... |
f9db41f6-4e3d-4c96-824c-8dff5b97d2e6 | nicolas0p/GerenciaDeArquivosEmDisco | AvlTree.cpp | //============================================================================
// Name : AvlTree.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <... | ALGO | 0.991495 | 4.935172 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2014-06-27T18:52: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": "956ca96ed... |
10530e9c-01d1-424f-b065-daa22efab16d | Pb9513git/DSA-OOP-CPP-Tasks | pointer/sq.cpp | #include <iostream>
using namespace std;
main()
{
int size;
cout << "Enter Array size : ";
cin >> size;
int a[size];
for (int i = 0; i < size; i++)
{
cout << "enter element " << i << ": ";
cin >> a[i];
}
int *ptr[size];
for (int i = 0; i < size; i++)
{
ptr... | ALGO | 0.981779 | 3.393984 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-20T11:16: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": "672070096ed1... |
65afa981-9b4a-4921-a138-ccc6ae51a48d | muhammadhasan01/cp | Online Judge/Codeforces/Contests/DIV2/DIV2-601/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n;
vector<int> a[N];
map<pair<int, int>, int> m;
vector<int> g[N];
int f[N];
bool vis[N];
void dfs(int u, int p) {
for (auto v : g[u]) {
if (v == p) continue;
for (auto e : a[v]) {
if (vis[e]) continue;
... | ALGO | 0.999985 | 3.707324 | {
"github_metadata": {
"branch": "master",
"commit_count": 1187,
"repo_created_at": "2019-07-13T15:49:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d569a1d... |
3b43d99b-370d-49eb-b34a-f93eb7c8dcc4 | augustgreer/CS32 | HW3/tree.cpp | //
// tree.cpp
// HW3
//
// Created by <NAME> on 2/11/18.
// Copyright © 2018 CS32. All rights reserved.
//
// Return the number of ways that all n2 elements of a2 appear
// in the n1 element array a1 in the same order (though not
// necessarily consecutively). The empty sequence appears in a
// sequence of lengt... | ALGO | 0.996769 | 4.112378 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-05-08T02:26: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": "5353871c45... |
befc5d70-2585-4375-b87b-6b79958cb794 | nevil9/code | VirtualFun.cpp | #include<iostream>
#include<stdio.h>
using namespace std;
class Person{
public:
char *name;
int age;
virtual void getdata(){
}
virtual void putdata(){
}
};
class Professor: public Person{
int publications,cur_id;
static int seq_id;
public:
Professor(){
inc();
... | ALGO | 0.96087 | 3.166252 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-01-30T17:34: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": "665e36d44c... |
67dd9845-4e60-4273-abf4-9a81105140ab | eunice-chen/Data-Structure | 108006262_Project2/main.cpp | #include <iostream>
#include <fstream>
#include <list>
#include <vector>
#include <stack>
#include <algorithm>
#include <limits>
#include <climits>
#include <string>
using namespace std;
class Coordinate
{
public:
int x;
int y;
};
//set the celltype for every cell
enum CellType
{
dirty = 0,
clean,
... | ALGO | 0.992487 | 3.440455 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2023-10-07T09:09:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3be71695c... |
17126edc-f3d5-44c2-9c1d-88a47cc5cd4d | sanket2501/Data-Structure-and-Algorithm-Problem-Solving | Array/MinimizeTheHeight.cpp | /*
Given an array arr[] denoting heights of N towers and a positive integer K, you have to modify the height of each tower either by increasing or decreasing them by K only once.
Find out what could be the possible minimum difference of the height of shortest and longest towers after you have modified each tower.
Note:... | ALGO | 0.99991 | 4.568194 | {
"github_metadata": {
"branch": "main",
"commit_count": 142,
"repo_created_at": "2022-02-13T17:31:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bcf311b3d2... |
81a9b063-eb24-4892-a54f-2b96d92f3825 | zackyrafian/cpp-cf | almostperfect.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
while (cin >> n) {
int sum = 0;
for (int i = 1; i * i <= n; i++) {
if (n % i == 0) {
sum += i;
if (i != 1 && i * i != n) {
... | ALGO | 0.999465 | 4.148977 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-02-03T18:25: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": "ca86601596... |
5f739dfc-ea38-4d53-9ec6-0fdd86429e36 | pterodragon/programming | C++/leetcode/Predict_the_Winner/solution.hpp | #ifndef SOLUTION_HPP
#define SOLUTION_HPP
#include <vector>
using namespace std;
// class Solution {
// public:
// bool PredictTheWinner(vector<int>& nums) {
// if (nums.empty()) return true;
// const size_t L = nums.size();
// vector<vector<int>> dp(L, vector<int>(L));
// for (si... | ALGO | 0.999969 | 6.511811 | {
"github_metadata": {
"branch": "master",
"commit_count": 148,
"repo_created_at": "2017-05-27T11:12:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d55cd96... |
ebbeea82-6fee-4628-bff3-75732861769b | abraojr/C-and-Cpp-Examples | Cpp/Cpp14/Classes--Functions-and-Object-oriented-Programming/01-Operator-Overloading/Source Files/01-operator-overloading.cpp | #include <iostream>
using std::cout;
class Circle
{
double radius;
double x, y;
public:
Circle(double a, double b, double r) : x(a), y(b), radius(r) {}
// overload +: adds the radius of another circle
Circle operator+(const Circle &b)
{
return Circle(x, y, radius + b.radius);
}
... | ALGO | 0.98027 | 5.797841 | {
"github_metadata": {
"branch": "main",
"commit_count": 499,
"repo_created_at": "2022-07-07T03:05:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f792918e1... |
8f020a76-53e8-46c0-9abb-aa9025d32ac9 | cms-sw/cmssw | DQMOffline/JetMET/interface/SusyDQM/alpha_T.h | #ifndef ALPHA_T_H
#define ALPHA_T_H
#include <cmath>
#include <vector>
#include <numeric>
#include <functional>
#include <algorithm>
struct alpha_T {
template <class LVs>
double operator()(const LVs& p4s) const {
typedef typename LVs::value_type LorentzV;
if (p4s.size() < 2)
return 0;
std::vect... | ALGO | 0.961618 | 4.949426 | {
"github_metadata": {
"branch": "master",
"commit_count": 251237,
"repo_created_at": "2013-06-26T14:09:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1144,
"forks": 4480,
"issues": 947,
"pull_requests": 108
},
"file_meta": {
"content_id... |
2ccaf564-c018-446c-a422-d7c612506e04 | harsh6754/DSA-Problems | linkedlist/DeleteAtTailInSinglyLinkedList.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
void InsertAtHead(Node *&head, int data)
{
Node *temp = new Node(data);
temp->next = head;
head = temp;
}
void InsertAtTail(... | ALGO | 0.999667 | 5.418869 | {
"github_metadata": {
"branch": "master",
"commit_count": 500,
"repo_created_at": "2023-09-17T03:03:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f633746... |
7459e480-f3b1-4a56-8ddf-85a828275660 | yxxshin/Yeonsang_Study | Baekjoon/Baekjoon_2981.cpp | #include <stdio.h>
#include <math.h>
#define SWAP(a,b,type)do{\
type temp;\
temp = a;\
a = b;\
b = temp;\
}while(0)
int N, arr[101], answer[101];
// 최대공약수 구하기
int GCD(int a, int b){
if(a%b==0) return b;
return GCD(b,a%b);
}
// 오름차순 정렬
void sort(int* arr,int N){
for(int i=0; i<N; i++){
for(int... | ALGO | 0.999997 | 3.857955 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2020-10-28T16:45: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": "6191cafd2... |
3dcc128a-648b-4adb-a0af-bcc64c48019d | avept/Programming | LAB_2-5/LAB_2/tree.hpp | #pragma once
#include <iostream>
#include <algorithm>
#include "node.hpp"
// relation: type Node is at agregtion with Tree.
template<typename T>
class Tree
{
private:
Node<T>* _root;
size_t _size;
public:
using size_type = size_t;
Tree(size_t size = 0, Node<T>* root = nullptr) : _size(size),... | TOOL | 0.931841 | 4.734712 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-07-02T21:45: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": "fb82f9183d... |
6fa2751e-adf3-45db-9d6d-0ddbc5ee0511 | unity3d-jp/NormalPainter | .NormalPainter/Plugin/NormalPainter/NormalPainter.cpp | #include "pch.h"
#include "NormalPainter.h"
#define npEpsilon 0.0000001f
struct npMeshData
{
int *indices = nullptr;
float3 *vertices = nullptr;
float3 *normals = nullptr;
float4 *tangents = nullptr;
float2 *uv = nullptr;
float *selection = nullptr;
int ... | ALGO | 0.965524 | 5.556099 | {
"github_metadata": {
"branch": "master",
"commit_count": 537,
"repo_created_at": "2017-06-14T20:38:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 740,
"forks": 121,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "d095c... |
295e6b5d-ff22-4e71-8a33-72b4fbefd85f | Deltams/dm-tasks | task8/task8.cpp | #include <bits/stdc++.h>
using namespace std;
int degree_two(long long n){ // В какую степень 2 возведено число
int t = 1, ans = 0;
while (t != n){
t *= 2;
ans++;
}
return ans;
}
bool str_prov(string &s){ // Проверка на то, что вектор введен правильно
int chek_size = 0;
for (i... | ALGO | 0.999792 | 4.47013 | {
"github_metadata": {
"branch": "main",
"commit_count": 150,
"repo_created_at": "2022-02-11T07:28:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c5f32ea1a... |
f412f154-e39e-4151-a98a-24fea66af35f | imhdx/My-all-code-of-Vjudge-Judge | HDU/6447/18349829_AC_811ms_8148kB.cpp | #include<bits/stdc++.h>
using namespace std;
struct ac
{
int x,y,w;
bool operator<(const ac &b)const
{
if (x==b.x) return y>b.y;
return x<b.x;
}
}que[100005];
vector<int> v;
unordered_map<int,int> m;
int t[200005];
void add(int i,int x)
{
while (i<200005)
{
t[i]=max(t[i],... | ALGO | 0.999982 | 4.072074 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-03-16T14:21: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": "4699d8a98... |
fd1739cd-a7f3-46fb-8084-9e92eb8bcaf1 | ZehuaZhang/cs-fundamentals | data-structure-and-algorithm/cpp/sequence-reconstruction.cpp | // 444. Sequence Reconstruction
// Difficulty: Medium
// Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs.
// The org sequence is a permutation of the integers from 1 to n, with 1 ≤ n ≤ 104.
// Reconstruction means building a shortest common supersequence of the sequence... | ALGO | 0.998905 | 5.979237 | {
"github_metadata": {
"branch": "master",
"commit_count": 347,
"repo_created_at": "2015-11-08T19:11:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 31
},
"file_meta": {
"content_id": "97d5959... |
1fb90366-35b4-4ce8-a3e0-82b1d6e32c69 | geshtng/competitive-programming | Data Structures/Own code/Binary Search Tree.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node* left;
struct Node* right;
};
struct Node* create_node(int data) {
struct Node* new_node = new Node();
new_node->data = data;
new_node->left = NULL;
new_node->right = NULL;
return new_node;
}
// Inorder... | ALGO | 0.999982 | 5.991169 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2020-05-11T03:45: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": "8123e6def... |
4672ef3a-ee75-49b8-87ca-1c8396cc2e98 | nrqu/answersprimer | chapter 1/chap1_1.14/main.cpp | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: main.cpp
* Author: Enigmatic
*
* Created on November 23, 2018, 8:21 PM
* 1.14: Compare and contrast the loops that ... | TOOL | 0.965294 | 3.836052 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2018-11-30T01:14: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": "74e912c5... |
844ccc64-3094-40d6-9b75-6321f61967c5 | heyshb/Competitive-Programming | CodeForces/PastContest/1320/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int MAXN = 1000010;
int N, M, P;
pii a[MAXN], b[MAXN];
struct monster {
int x,y,z;
}m[4 * MAXN];
vector<pii>e[MAXN];
LL mx[4 * MAXN], tag[4 * MAXN];
void maintain(int x) {
mx[x] = max(mx[x * 2], mx[x * 2 +... | ALGO | 0.999959 | 4.225612 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2018-02-21T09:20: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": "260f36670... |
c1a82ff4-aee1-4965-9676-35074f3622e2 | ChrisCGH/factorpoly | crt.h | #ifndef __CRT_H
#define __CRT_H
#include <vector>
#include <iostream>
// Algorithm 1.3.12 (Inductive Chinese)
template <class Z>
Z crt(const std::vector<Z>& xx, const std::vector<Z>& mm)
{
int k = xx.size();
if (k != (int)mm.size())
{
std::cout << "Problem: xx.size() = " << xx.size() << ", mm.size ... | ALGO | 0.999939 | 5.958576 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-12-17T09:21: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": "ecbbfdf70... |
4d5ef1a6-00ad-4145-8ef3-bf2db7e6ca06 | AngryBird3/gotta_code | leetcode_oj/bfs_dfs_graph/alienOrder.cpp | /*
There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of words from the dictionary, where words are sorted lexicographically by the rules of this new language. Derive the order of letters in this language.
For example,
Given the followin... | ALGO | 0.999998 | 6.253716 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2016-03-05T03:02: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": "dc0a7499f... |
629459db-6a64-4a55-9e49-091190fd077d | ousrr/Laboratorios-Programaci-n-I | 2. Funciones.cpp | #include <iostream>
#include <cmath> // Biblioteca para la función pow()
using namespace std;
//--------------------------------------------------------------------------------------------------------------
// Funcion para calcular la potencia
double calcularPotencia(float base, int exponente) {
// Condicion en d... | ALGO | 0.993093 | 5.431158 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-31T14:51: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": "6295b6dec72a... |
754cd457-7c7a-4f8b-a7cb-e93f67de6137 | includeos/IncludeOS | src/plugins/vfs.cpp | // This file is a part of the IncludeOS unikernel - www.includeos.org
//
// Copyright 2018 Oslo and Akershus University College of Applied Sciences
// and <NAME>
//
// 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 ... | TOOL | 0.905593 | 7.115687 | {
"github_metadata": {
"branch": "main",
"commit_count": 11020,
"repo_created_at": "2014-07-07T08:15:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5142,
"forks": 378,
"issues": 87,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e8... |
dc5f2417-c17e-4f98-9968-d94f0e8eeccd | akhil14shukla/CP-Files | Sort_heap.cpp | #include <iostream>
using namespace std;
int Insert(int A[], int n)
{
int temp, i = n;
temp = A[n];
while (i > 1 && temp > A[i / 2])
{
if (A[i] > A[i / 2])
{
A[i] = A[i / 2];
i = i / 2;
A[i] = temp;
}
}
return i;
}
void Heapify(int A[... | ALGO | 0.999764 | 4.182487 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-07-15T20:13:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1186249267... |
912814cb-354e-48c0-92df-dad9a94e1949 | Danipiza/SynchSols | 2_exercises/producer_consummer/C++/prod_cons.cpp | #include <iostream>
#include <vector>
// threads libraries
#include <thread>
#include <mutex>
#include <condition_variable>
// library used for the sleep function
#include <chrono>
using namespace std;
/*
COMPILE:
g++ -thread -std=c++11 prod_cons.cpp
EXECUTE:
./a.out
*/
struct ThreadArgs {
int id; /... | ALGO | 0.995609 | 5.600225 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-10-07T21:49:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "522802bf290... |
0de5fac5-c60a-4fda-8d91-9b47bc8501db | JanKianicka/var_study | c_plus_julich/my_excercises/tbbreduce0.cc | #include <iostream>
#include <vector>
#include <chrono>
#include <cmath>
#include <tbb/tbb.h>
inline double f(double x)
{
return tanh(x)*cos(x)*sin(x);
}
int main()
{
constexpr const double llim=10.;
constexpr const double ulim=120.;
constexpr const double dx=1.0e-6;
size_t N=(size_t) (ulim-llim)/... | ALGO | 0.999563 | 6.035781 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2017-12-06T11:02:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ded784f0f... |
b00f7615-9129-42df-825a-ad0d8d163dab | Yashshh1002/CSES | B_Segment_Tree_for_the_Minimum.cpp | #include <bits/stdc++.h>
using namespace std;
#define ar array
#define int long long
#define ld long double
#define sza(x) ((int)x.size())
#define all(a) (a).begin(), (a).end()
#define PI 3.1415926535897932384626433832795l
const int MAX_N = 1e5 + 5;
const int MOD = 1e9 + 7;
/*
*/
vector<int> mn;
void setmin(int i,... | ALGO | 0.999978 | 5.286201 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-29T19:15:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5eea814fb07... |
cdbda652-0138-41cd-a201-895730f85c30 | Chi-you/ECC_training | hw2/hw2-1.cpp | #include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <fstream>
#include <vector>
using namespace std;
#define LEN 4000000 // the length of bit
#define EBN0 12
typedef struct convdata{
int state[6] = {0, 0, 0, 0, 0, 0};
int input;
int out... | ALGO | 0.999019 | 3.470412 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-01-26T14:05: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": "91ed4454deae... |
999bb7d1-a502-4b1b-8401-3d069e1db70c | TengFeiyang01/Algorithm | casual/Training/dmy515.cpp | #include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
using i64 = long long;
i64 exgcd(i64 a, i64 b, i64& x, i64& y) {
if (!b) {
x = 1;
y = 0;
return a;
}
i64 d = exgcd(b, a % b, y, x);
y -= (a / b) * x;
return d;
}
i64 EXCRT(std::vector<i64> &m, std::vector<i64> &r) {
i64 m1, m2, r1, r2, p, q;
... | ALGO | 0.999972 | 4.892024 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2024-07-12T15:01: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": "1750bd93c... |
2fd29c6d-70fa-4a45-9c34-b95023718457 | LiAuthor/CourseNotes | C⁄C++/861/2014.cpp | #include"iostream"
#include <cstddef>
using namespace std;
typedef struct LNode{
int data;
struct LNode *next;
}LNode,*LinkList;
//头插法
LinkList List_HeadInsert(LinkList &L){
LNode *s;
int x;
/* Linklist==LNode* */
L=(LinkList)malloc(sizeof(LNode));//L指向新申请的头节点
//L=(LNode*)malloc(sizeof(L... | ALGO | 0.99984 | 3.111543 | {
"github_metadata": {
"branch": "dev",
"commit_count": 36,
"repo_created_at": "2018-10-25T11:48: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": "e20274f8f46a... |
5513cb42-56fa-4b2a-9918-d324cdd68ea8 | pepborrell/AP2 | grafs/mst.cc | #include <iostream>
#include <vector>
#include <utility>
#include <queue>
using namespace std;
using Edge = pair<int, int>; // weight and end vertex
using Graph = vector< vector<Edge> >;
int weight_mst(const Graph& G) {
int totWeight = 0, n = G.size(), nMST = 0;
vector<bool> visited(n, false);
// Picking the initi... | ALGO | 0.99998 | 4.994505 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2019-02-12T08:37: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": "744cb0835... |
c935efbf-1cfc-43bf-9b40-44e55c31a224 | hitesh19426/Leetcode | 37-sudoku-solver/37-sudoku-solver.cpp | #include<bits/stdc++.h>
class Solution {
bool solve(vector<vector<char>>& board, vector<pair<int, int>>& spaces, int pos, bool row[9][9], bool col[9][9], bool box[3][3][9]){
if(pos == spaces.size())
return true;
int i = spaces[pos].first, j = spaces[pos].second;
for(int ... | ALGO | 0.999805 | 6.210877 | {
"github_metadata": {
"branch": "main",
"commit_count": 2333,
"repo_created_at": "2021-12-18T05:59: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": "7ce95da23... |
71a64c35-f597-4ab5-84c7-a74841a38781 | elsudano/Universidad | 02Segundo/Sistemas_Concurrentes_Distribuidos_SCD/Practica_1/src/pclifo.cpp | #include <iostream>
#include <pthread.h>
#include <semaphore.h>
#include <vector>
using namespace std;
const int num_items = 1000000; // Cantidad de Datos que vamos a Producir
const unsigned int tam_buff = 10; // tamaño del buffer en memoria para pasar datos entre hebras
vector<int> buffer (tam_buff,0); // buffer... | ALGO | 0.992923 | 4.55617 | {
"github_metadata": {
"branch": "FACULTAD",
"commit_count": 245,
"repo_created_at": "2014-01-20T18:10:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98e074... |
a11c0104-952e-4b73-83cd-1f16ff8faaf4 | broduer/SP2-CPT | security.cpp | // Copyright <NAME>. All rights reserved.
#include <cmath>
#include <limits>
#include "covert.h"
#include "security.h"
double Security::calculateNumberOfCellsForDesiredSecurity( double desiredSecurityLevel,
double population,
... | ALGO | 0.999699 | 6.433729 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-12-14T22:15:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8146371a8... |
18ca81fb-dfb1-4bfa-824e-8685bc9a2bfb | CyrilSicard/SCAE | common/FiniteFieldElement.cpp | /*
Example implementation of an Elliptic Curve over a Finite Field
By <NAME>, December 2007
<EMAIL>
I wrote this because I wanted to understand more about Elliptic Curves and how they are
used in cryoptography. There's plenty of sources and articles out there but I didn't find anything that
... | ALGO | 0.999376 | 6.734443 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-14T10:49: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": "fa21c69873... |
c846eaaf-aa4f-48ca-8413-9cfef7deab4b | gitcmhan98/ExamCPlus | FastCampus_C++/062_Class02/Class02.cpp | /*-----------------------------------------------------------------------------
* Name: 구조체(struct)
* DESC: struct & 함수 & 포인터 & 배열
-----------------------------------------------------------------------------*/
#include <iostream>
using namespace std;
struct MyAA
{
int num1;
int num2;
float fNum;
};
... | TOOL | 0.940969 | 3.379904 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-08-25T08:22:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d312c22... |
72548cea-1586-4ddc-b332-6597b9efdffb | dailinsubjam/Metis | Templates/最大密度子图.cpp | double value(){
double maxflow = 0.00;
while(dist[S] <= T) maxflow += sap(S, inf);
return -0.50 * (maxflow - d * n);
}
void build(double g){
for(int i = 1; i <= n; ++i) add_edge(S, i, d); // s -> v : INF
for(int i = 1; i <= n; ++i) add_edge(i, T, d + 2.00 * g - deg[i]);
for(int i = 1; i <= n; ++i)
for(int j = 1... | ALGO | 0.99997 | 3.343934 | {
"github_metadata": {
"branch": "master",
"commit_count": 263,
"repo_created_at": "2016-07-22T15:14:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "27609157... |
07291477-97a4-4238-8007-9cef26268d50 | root-project/root | tmva/tmva/src/DNN/Architectures/Reference/Propagation.hxx | // @(#)root/tmva/tmva/dnn:$Id$ // Author: <NAME> 10/07/16
/*************************************************************************
* Copyright (C) 2016, <NAME> *
* All rights reserved. *
* ... | ALGO | 0.998393 | 4.095005 | {
"github_metadata": {
"branch": "master",
"commit_count": 93033,
"repo_created_at": "2013-06-27T10:46:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2899,
"forks": 1363,
"issues": 467,
"pull_requests": 269
},
"file_meta": {
"content_id"... |
9201677b-cc71-43e1-91ea-d0ebd30ee920 | AlimyBreak/LeetCodeStudy | 算法/647_回文子串/Solution01.cpp | class Solution
{
/* [ left , right ]*/
private:
bool isloopstr(string& s , int left , int right)
{
bool ret_val = true;
while(left < right)
{
if(s[left] == s[right])
{
left++;
right--;
... | ALGO | 0.999992 | 5.395943 | {
"github_metadata": {
"branch": "master",
"commit_count": 287,
"repo_created_at": "2019-04-01T07:57:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1fc1fb... |
a0f15890-676c-4337-9477-c74d72cabc5f | DanilishinArtem/neetcode | trees/cppRealizations/lowestCommonAncestorofaBinarySearchTree.cpp | #include "btf.h"
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
TreeNode* cur = root;
while(cur != nullptr){
if(p->val < cur->val && q->val < cur->val){
cur = cur->left;
}
else if(p->val > cur-... | ALGO | 0.999994 | 6.203138 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-05-26T17:42:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97ff7af09c1... |
95de0d6e-698d-430a-89a0-1fd3ee239220 | mikaelfun/Leetcode | 279_Perfect_Squares.cpp | /*
Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.
Example 1:
Input: n = 12
Output: 3
Explanation: 12 = 4 + 4 + 4.
Example 2:
Input: n = 13
Output: 2
Explanation: 13 = 4 + 9.
*/
#include <unordered_map>
#include <iostream>
#include <vector>... | ALGO | 0.999874 | 5.35581 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-03-08T16:01:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c163e7d204... |
5fe49284-2120-4de9-82cf-5fe7ee3ec1ef | Anand-Varma-838/opensorce | graph.cpp | #include "stdafx.h"
void designGraph(char functionF[DIM]) {
char function[DIM] = "";
if (isContained("x", functionF)) {
replace("x", "res", functionF);
sprintf(function, expressionF);
}
FILE *graph = NULL;
char toOpen[DIM] = "";
double Xmin, Xmax, Xscale, Ymin, Ymax, Yscale, auto_y_axis;
sprintf(toOpen, "%s... | ALGO | 0.958131 | 3.369745 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-07-31T16:36: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": "93074a91ab... |
a5f8f12f-83ab-4953-92bb-86ced644ddad | swatiinigam/gfg_coding | Difficulty: Medium/Minimum cost to connect all houses in a city/minimum-cost-to-connect-all-houses-in-a-city.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int minCost(vector<vector<int>>& houses) {
int V = houses.size();
vector<vector<pair<int,int>>> adj(V);
for(int i=0; i<V; i+... | ALGO | 0.999241 | 5.851411 | {
"github_metadata": {
"branch": "main",
"commit_count": 958,
"repo_created_at": "2024-05-03T17:48:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb64dd1cfe... |
13c7a6fa-cdb7-45f0-9794-f245fcb7b9dd | monman53/online_judge | AtCoder/soundhound2018/b.cpp | // header {{{
#include <bits/stdc++.h>
using namespace std;
// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define INF INT_MAX/3
#define LLINF LLONG_MAX/3
#define MOD (1000000007LL)
#define MODA(a, b) a=((a)+(b))%MOD
#define MODP(a, b) a=((a)*(b))%MOD
#define inc(i, l, r) for(long long i=(l);i<(r);i++)
#de... | ALGO | 0.999985 | 3.608238 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2014-10-24T08:33:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1845d52... |
e89404ac-d544-4df9-a3db-ed8ad4f2b48a | KevinPizarro/gt12-elo329-tarea3 | Extra/Comuna.cpp | #include "Comuna.h"
#include <QtMath>
#include <string>
#include <iostream>
using namespace std;
/**
* @brief Construct a new Comuna::Comuna object
* @param width: Ancho de la comuna.
* @param length: Alto de la comuna.
* @param speed: Velocidad base de movimiento de los individuos.
* @param deltaAngle: Variacion... | ALGO | 0.992996 | 5.117285 | {
"github_metadata": {
"branch": "master",
"commit_count": 99,
"repo_created_at": "2023-02-06T17:10: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": "516b80c85... |
309671de-fe08-472e-9a78-22c117d8d9f0 | anand873/CP_Codes | Codechef/CHFTNS.cpp | //Author: <NAME>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
#define f... | ALGO | 0.999946 | 3.259779 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2019-08-26T13:11:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ae4730e2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.