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 |
|---|---|---|---|---|---|---|---|
e1e01d5a-0630-45ec-b3e0-f7512bb3ddb3 | ishandutta2007/codeforces-h | hongzy/normal/712/B.cpp | #include <algorithm>
#include <cstring>
#include <cstdio>
using namespace std;
const int N = 4e5 + 10;
char s[N];
int main() {
scanf("%s", s + 1);
int n = strlen(s + 1);
if(n & 1) {
puts("-1");
return 0;
}
int a = 0, b = 0, c = 0, d = 0, ans = 1e9;
for(int i = 1; i <= n; i ++) {
if(s[i] == 'R') a ++;
i... | ALGO | 0.999882 | 3.377937 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "d12768346779... |
2cb3fb75-c6f5-4c0d-bc88-0455eec15c0f | doyaGu/Ballanced | Source/BuildingBlocks/Logics/Behaviors/ArrayGetHighest.cpp | /////////////////////////////////////////////////////
/////////////////////////////////////////////////////
//
// Get Highest
//
/////////////////////////////////////////////////////
/////////////////////////////////////////////////////
#include "CKAll.h"
#include "ArrayGeneralFunctions.h"
CKObjectDecla... | ALGO | 0.998357 | 3.79469 | {
"github_metadata": {
"branch": "main",
"commit_count": 385,
"repo_created_at": "2022-04-30T06:06:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c90b73f1... |
2793b690-85ba-4a85-a81b-3e9660d69bac | luigisdeveloper/39-clasificacionDeValores | main.cpp | /*
Programa_39 almacenar 10 elementos en un vector, cuantos ceros, cuantos negativos, cuantos positivos y sumarlos.
Estructura for y arreglos
Autor: <NAME>
N° lista 11
Fecha: 11 de marzo de 2015
*/
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
system ("color f0");
int x, vec[10], ... | ALGO | 0.998585 | 3.852201 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-04-23T01:17: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": "ea35765bfe... |
1382f56d-abd8-45b0-964f-7744c60cd5b8 | JoseLopez36/FlyChams-ROS2-v1.3.1 | ros2_ws/src/flychams_perception/include/flychams_perception/clustering/k_means_mod.hpp | #pragma once
// Standard includes
#include <vector>
#include <algorithm>
/* Hungarian algorithm: https://github.com/mcximing/hungarian-algorithm-cpp */
#include "Hungarian.h"
// Core includes
#include "flychams_core/types/core_types.hpp"
#include "flychams_core/utils/math_utils.hpp"
namespace flychams::perception
{... | ALGO | 0.999132 | 7.157506 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2025-05-20T10:02: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": "c98a91bee5... |
8396ef88-8784-4c18-906f-1033c881e8b6 | S-Popy/XPSC_phitron | week-4/fedor_and_new_game.cpp | // problem Link: https://codeforces.com/problemset/problem/467/B
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, m, k; cin >> n >> m >> k;
ll ans = 0;
vector<ll>v(m);
for (int i = 0; i < m; i++) {
c... | ALGO | 0.999931 | 4.577693 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2023-09-30T08:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4bbdc6a1fc... |
94d42225-08cb-4cf6-ad37-cfd86b70c169 | atharvamarathe/Final450-Solutions | Backtracking/280.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
bool isSafe(int node, bool graph[101][101], int m, int V, int color[], int col) {
for (int i = 0; i < V; i++) {
if (i != node && graph[i][node] == 1 && color[i] == col)
return false;
}
return true;
}
bool m_coloring(int no... | ALGO | 0.999833 | 5.838025 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-07-29T09:15:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "43aed020f6ef... |
74c1a96f-ef39-4a4e-9091-661b74b92e56 | Superbestron/CP-Journey | Codeforces/1800s/1862/F.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
int t, n, w, f;
void solve() {
cin >> w >> f >> n;
vi a(n);
int sum = 0;
for (int &i : a) {
cin >> i;
sum += i;
}
bitset<10000 * 10... | ALGO | 0.999964 | 3.608328 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2022-10-28T13:51:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00fd8622486... |
49bf93b4-48d2-4504-907d-bb39f4ef5e54 | OperDoc/Problems | ITMO/#6/C.cpp | / 2018, <NAME>.
#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::cerr;
using std::vector;
using std::map;
using std::array;
using std::set;
using std::string;
using std::pair;
using std::make_pair;
using std::tuple;
using std::make_tuple;
using std::get;
using std::min;
using std::abs;
using s... | ALGO | 0.999964 | 3.530143 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-01-05T12:25:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5aaeb78d8... |
cc5e33c0-d61e-45ac-99c8-12d11162a707 | TedXpro/Leetcode | 0230-kth-smallest-element-in-a-bst/0230-kth-smallest-element-in-a-bst.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999998 | 5.972461 | {
"github_metadata": {
"branch": "main",
"commit_count": 1466,
"repo_created_at": "2023-12-08T09:09: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": "b5b622540... |
09da9958-b990-4ba8-a420-e245fc959c4d | MohdAnas007/cp-level-one | Week2/O.cpp | /* Problem: https://codeforces.com/group/MWSDmqGsZm/contest/219774/problem/O
Time complexity O(2^N), which is inefficient, especially for larger values of
N. This inefficiency causes your program to exceed time limits for larger test cases,
such as 𝑁=44.
Memoization:
To optimize the Fibonacci calculation, especiall... | ALGO | 0.999991 | 5.703273 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-04-06T13:07: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": "5da56cf1997d... |
6c0f719e-faaf-47da-894c-5a08ca002d62 | Hazrat-Ali9/Data-Structure-Algorithms | count-number-of-teams/count-number-of-teams.cpp | class Solution {
public:
int numTeams(vector<int>& rating) {
int n = rating.size();
int teams = 0;
vector<vector<int>> increasingCache(n, vector<int>(4, -1));
vector<vector<int>> decreasingCache(n, vector<int>(4, -1));
// Calculate total teams by considering each soldier as ... | ALGO | 0.999989 | 6.342338 | {
"github_metadata": {
"branch": "main",
"commit_count": 828,
"repo_created_at": "2024-11-13T04:56:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0111b2eb03... |
67b41c95-2c56-4420-800e-e28101ed9e8d | Arazm1/CPP | 10-Vectors/8-Conus1.cpp | #include <iostream>
#include <vector>
int main() {
/*Remember to make sure youre defining both variables and how much they are at the beginning already coz otherwise it made them string*/
int even_numbers = 0;
int odd_numbers = 1;
std::vector<int> vector = {2, 4, 3, 6, 1, 9};
for (int i = 0; i < vector.s... | ALGO | 0.999858 | 4.482939 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-01-09T19:02: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": "53dfa9d652df... |
c9276796-c323-48ca-a51e-3c8f7a5a6611 | surrealtm/Foundation | src/math/v4.h | #pragma once
template<typename T>
struct v4 {
union {
struct { T x, y, z, w; };
T values[4];
};
v4<T>() : x(0), y(0), z(0), w(0) {};
v4<T>(T v) : x(v), y(v), z(v), w(v) {};
v4<T>(T x, T y, T z, T w) : x(x), y(y), z(z), w(w) {};
};
typedef v4<float> v4f;
typedef v4<double> v4d;
typedef v4<s... | TOOL | 0.921848 | 5.270816 | {
"github_metadata": {
"branch": "main",
"commit_count": 251,
"repo_created_at": "2023-10-26T20:42: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": "2bd76bb2e6... |
8249d3b3-b028-40d9-8973-c3b4d1a7823e | organizedmess/DSA | Binary Search/BookAllocation.cpp | #include<iostream>
using namespace std;
bool isPossible(int arr[],int n,int m,int mid){
int studentcount = 1;
int sum = 0 ;
for (int i = 0; i <n; i++)
{
if(sum + arr[i]<=mid)
{
sum=+arr[i];
}
else
{
studentcount++;
if(st... | ALGO | 0.999997 | 4.590205 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-09T09:27: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": "096d00bcfff5... |
18b247a5-0d31-4e6c-9cb2-346dded96a9b | bansalshaleen/C- | CODEFORCES/1379/1379B.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <numeric>
#include <iomanip>
using namespace std;
typedef long long int ll;
typedef unsigned long long int sll;
typedef long double ld;
#define A 100000000ll
#define B 998244353ll
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#... | ALGO | 0.999975 | 4.746452 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-05-16T15:45:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "147c5fa92... |
c37734ca-41f7-478c-be96-2ebff87d473f | touyou/CompetitiveProgramming | pku/3264.cpp | #include <cstdio>
#include <climits>
#include <algorithm>
using namespace std;
const int MAX_N = 1 << 17;
int n, dat[2*MAX_N-1], dat2[2*MAX_N-1];
void init(int n_) {
n=1;
while (n<n_) n*=2;
for (int i=0; i<2*n-1; i++) {
dat[i]=INT_MAX;
dat2[i]=INT_MIN;
}
}
void update(int k, int a) {
... | ALGO | 0.999918 | 4.173253 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2017-05-03T06:57:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "8a329892a... |
b8b7d476-7793-473d-a259-804bb06f7b51 | eliemichel/MesoGen | src/libwfc/Ruleset.h | /**
* This file is part of MesoGen, the reference implementation of:
*
* <NAME> and <NAME> (2023).
* MesoGen: Designing Procedural On-Surface Stranded Mesostructures,
* ACM Transaction on Graphics (SIGGRAPH '23 Conference Proceedings),
* https://doi.org/10.1145/3588432.3591496
*
* Copyright (c) 2020 - 2... | TOOL | 0.983628 | 7.223271 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-05-02T10:04:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9148d8e43... |
b735d2c8-4408-43b4-b230-658c8208a7e1 | miguelfreitas/twister-core | libtorrent/tools/parse_request_log.cpp | /*
Copyright (c) 2012, <NAME>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the followin... | TOOL | 0.919545 | 4.584979 | {
"github_metadata": {
"branch": "master",
"commit_count": 5092,
"repo_created_at": "2013-12-30T14:28:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1417,
"forks": 254,
"issues": 162,
"pull_requests": 9
},
"file_meta": {
"content_id": "... |
a3501592-3935-4eaf-a139-fd810984827e | AgrefenaPerova/my_solution | march/2.2.h | #pragma once
#include <iostream>
#include <stack>
#include <string>
bool Its_Operator(char c) {
return c == '!' || c == '&' || c == '|' ;
}
int Priority(char op) {
if (op == '!') {
return 3;
}
else if (op == '&') {
return 2;
}
else if (op == '|')
{
return 1;
}
... | ALGO | 0.994691 | 5.452629 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-16T17:03: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": "bcab89f929fe... |
58a55ede-8641-4d58-b93a-13a21a5ca62e | takashi247/webserv | srcs/server/stub/config.hpp | #ifndef CONFIG_HPP
#define CONFIG_HPP
#include <string>
#include <vector>
class LocationConfig {
public:
LocationConfig(){};
~LocationConfig(){};
// LocationConfig(const LocationConfig& rhs){};
// LocationConfig& operator=(const LocationConfig& rhs);
void PrintVal();
std::string location_path_;
std... | CONFIG | 0.989904 | 5.253481 | {
"github_metadata": {
"branch": "master",
"commit_count": 341,
"repo_created_at": "2022-06-07T02:33:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8a253db... |
b65faa94-c4ee-4c9b-8dff-d894c7d04fcb | RichPerspective007/dsaAss | Q7-8SLL.cpp | /*
7. Write a menu driven program in C or C++ to perform the following operations on single linked
list.
(a) insert a node at the beginning of the list.
(b) insert a node at the end of the list.
(c) delete a node from the beginning of the list.
(d) delete a node at the end of the list.
(e) display t... | ALGO | 0.999375 | 5.573296 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-02-03T12:50: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": "16415ca726d1... |
d1e52e32-c6f4-450d-a655-454c8a34959a | bkyileo/algorithm-practice | codechef/Square in numbers.cpp | #include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define mod 100000007
vector<ll>prime ;
vector<ll> sq ;
bool mark[1000009] ;
void make()
{
mark[0] = mark[1] = 1 ;
for(int i = 2;i< 10009;i++)
{
if(!mark[i])
{
for(int j = i*i;j<1000009;j+=i)
mark[j] = 1 ;
}
}
for(int i = 2;i<1000009;... | ALGO | 0.999992 | 4.237495 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-05-24T13:54:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aac5d5b6f... |
f1d50946-7139-4663-b304-159b5de3f2e2 | mgloveslife/Mason-s-hw | day 4/day4_6.cpp | //
// Created by 10373 on 2022/12/23.
//
#include <iostream>
int average(int x, int y);
float average(float x1, float y1);
long average(long x2, long y2);
int main()
{
int x;
int y;
std :: cout<< "please input two value to get the average:";
std :: cin>> x ;
std :: cin>> y;
std :: cout<< "the... | ALGO | 0.977433 | 4.551218 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-12-23T02:40: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": "4d4f2b2be9e... |
ddf92473-fad0-4f41-b3d8-80df9befde95 | apolloliu/Algorithm-Competition | Dynamic_Programming/背包/有依赖的背包问题.cpp | //#pragma GCC optimize(2)
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define endl '\n'
#define ms(s) ... | ALGO | 0.999915 | 4.10092 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2015-01-02T08:24: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": "e50adfd73... |
8c2da3a0-3bd7-470d-a492-ab951f1fd527 | gaojs/algorithm | leetcode/clang/79. 单词搜索.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 200
int visit[N][N] = { 0 };
bool dfs(char** a, int n, int* col, char *word, int r, int c)
{
if (a == NULL || n == 0 || col == NULL || word == NULL) {
return false; // 参数错误
} else if (r < 0 || r >= n || c < 0 || c >= *col) {
return f... | ALGO | 0.999952 | 4.096902 | {
"github_metadata": {
"branch": "master",
"commit_count": 262,
"repo_created_at": "2019-11-05T00:14:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49ef47e8... |
bad952b3-0a4e-446a-b11d-42d97efe9166 | Leapense/problems | 28115번: 등차수열의 합/등차수열의 합.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
cin.tie(0) -> sync_with_stdio(0);
cin.exceptions(ios::badbit | ios::failbit);
int N;
cin >> N;
vector<ll> A(N);
for (int i = 0; i < N; ++i) {
cin >> A[i];
}
if (N ==... | ALGO | 0.999962 | 3.416089 | {
"github_metadata": {
"branch": "master",
"commit_count": 2661,
"repo_created_at": "2024-10-12T10:53: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": "c02190e... |
ccaaf30e-5e08-48aa-994a-b694b3f2498b | ZhaoxingNiu/LeetCode | 6ZigZagConversion/solution.cpp | class Solution {
public:
string convert(string s, int numRows) {
if (numRows <=1) return s; //special case
string news = s;
vector<vector<char>> vs;
for (int i = 0; i < numRows; i++) {
vector<char> v;
vs.push_back(v);
}
int rows = 0,step = 1;
for (int i = 0; i < s.length(); i++) {
if (rows =... | ALGO | 0.999987 | 5.642782 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2017-06-19T13:32: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": "fded216fc... |
7df9ede3-f6ee-4413-be4e-61784b51abe6 | utkarsh4033/Data-Structures-and-Algo | 0054-spiral-matrix/0054-spiral-matrix.cpp | class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
vector<int> ans;
int row = matrix.size();
int col = matrix[0].size();
int count = 0;
int total = row*col;
// indexes
int startingRow = 0;
int startingCol ... | ALGO | 0.999997 | 6.607113 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2023-08-02T05:55: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": "d3ebcb1758... |
a2dd1f41-6a9f-4f70-9cf6-a81ef27b383a | jiho7407/PS | BaekJoon/Gold/트리.cpp | #include <bits/stdc++.h>
#define ll long long
#define lll __int128
#define ld long double
#define rep(i,l,r)for(int i=(l);i<(r);i++)
using namespace std;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
void fastio(){
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(false);
}
struct UnionFind{
... | ALGO | 0.999956 | 4.46057 | {
"github_metadata": {
"branch": "main",
"commit_count": 134,
"repo_created_at": "2024-02-02T15:13: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": "0139a61222... |
82784c04-b16e-463c-9e0c-ae063dfaf95f | ganeshsankaran/ctci | 04-trees-and-graphs/09.cpp | // Given a BST with distinct elements, print all possible insertion orders that could have led to this tree
#include <list>
#include <iostream>
#include <vector>
#include "BinarySearchTree.h"
void weave(list<int>& a, list<int>& b, list<int>& prefix, vector<list<int>>& weaved) {
if(a.size() == 0 || b.size() == 0) ... | ALGO | 0.999912 | 5.862445 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-10-01T14:09: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": "affbd8ad8... |
6f861362-a683-47a9-965b-f13680e6539d | junkim100/Analysis-of-Algorithms-Course-Projects | Project3/main.cpp | #include "helper.cpp"
// To run the program, type the following in the command line
// alias g++="g++ -std=c++17"
// g++ main.cpp
// ./a.out
int main() {
string filename = "tarzan.txt";
string temp;
int mazeY, mazeX, posY, posX, numVertices;
vector< vector<string> > maze;
readFile(filename, &maz... | ALGO | 0.999365 | 4.233209 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-06-03T03:23: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": "ae2e114bc62d... |
aff9372f-8fbe-445a-8c29-6167052d681f | ayushhsinghh/DSASolutions | BinarySearchTree/check_BST_BetterWay.cpp | #include <iostream>
#include <queue>
#include<algorithm>
#include<climits>
using namespace std;
template<typename T>
class BinaryTreeNode{
public:
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data){
this->data = data;
left = NULL;
right = NUL... | ALGO | 0.999935 | 4.547194 | {
"github_metadata": {
"branch": "main",
"commit_count": 87,
"repo_created_at": "2021-06-20T16:09: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": "3db8d9c34fc... |
22fc292d-db72-4ec3-aa45-d13e88fbff14 | Pradeepburla2003/leetcode | 2217-step-by-step-directions-from-a-binary-tree-node-to-another/step-by-step-directions-from-a-binary-tree-node-to-another.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999997 | 6.019843 | {
"github_metadata": {
"branch": "main",
"commit_count": 928,
"repo_created_at": "2024-01-08T18:01: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": "5d23ccb15e... |
691f19d6-2454-43e4-b4bb-fc0234c4dceb | nirajchittodiya/codes_DSA | Queue/circularQueue.cpp | #include <bits/stdc++.h>
class CircularQueue{
int size;
int *arr;
int f;
int r;
public:
// Initialize your data structure.
CircularQueue(int n){
size = n;
arr = new int[size];
f = r = -1;
}
// Enqueues 'X' into the queue. Returns true if it gets pushed into ... | ALGO | 0.999797 | 5.068695 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-10-31T01: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": "d2f0accd9f... |
d864bc43-ce12-4ac1-b525-7dc6a615f061 | Halksel/Competition | AOJ/V5/546.cpp | #include <bits/stdc++.h>
using namespace std ;
#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<end... | ALGO | 0.99979 | 3.908363 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2016-05-23T14:03: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": "cc514f217... |
20714866-6c9b-4c10-8057-2563caa5cb70 | ishandutta2007/codeforces-m | mateusz/normal/1366/B.cpp | #include <bits/stdc++.h>
using namespace std;
template <class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";}
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
while(*sdbg!=',')
cerr<<*sdbg++;
cerr<<"="<<h<<",";
_dbg(sdbg+1, a...);
}
template<class T> ostream & ... | ALGO | 0.999908 | 3.8572 | {
"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": "bd6d94bb9321... |
55f5d3c8-7e2f-4a6f-aabd-45a8ee07812a | DeepanshuJha/interview_prep | Longest_palindromic_string_1.cpp | /*
Link - https://practice.geeksforgeeks.org/problems/longest-palindrome-in-a-string/0/?track=sp-strings&batchId=152
Problem - Longest Palindrome in a string (find substring)
Complexity - O(n2)
*/
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 1e5 + 2;
const int M = 1e9 ... | ALGO | 0.999967 | 5.485845 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2019-12-29T19:10: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": "5fa0025b4... |
a95128ce-9d52-4a0f-b427-0d6689baa6c2 | zackluckyf/wikibooks | exercise12.cpp | //
// main.cpp
// exercise12
//
// Created by <NAME> on 12/3/15.
// Copyright © 2015 Zackluckyf. All rights reserved.
//
/*
Write a program that asks the user to type an integer N and compute u(N) defined with:
u(0)=3
u(1)=2
u(n)=n*u(n-1)+(n+1)*u(n-2)+n
*/
#include <iostream>
using namespace std;
long double... | ALGO | 0.999957 | 5.169927 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-12-03T20:37: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": "7edcfce298... |
a1f405c7-e256-4705-bc3c-6eb7bce25b9c | dvyn01/Codeforces_Submissions_dvyn01 | 987/987-C-Three_displays.cpp | /*
* AUTHOR : Divyanshu *
*/
#include<bits/stdc++.h>
/* #include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds; */
using namespace std;
#define ll long long
#define ull unsigned long long
#define f(a,b) for(ll i=a; i<b; i++)
#define mod... | ALGO | 0.999992 | 3.327897 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-08-09T17:42: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": "46bce456e6... |
6be700f7-e4c0-4feb-87ee-45a8a75f2efa | TianleJin/competitive-programming | CSES/maths/binomial_coefficients.cpp | #include <iostream>
#include <string>
#include <array>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <functional>
... | ALGO | 0.999964 | 4.621528 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2020-03-26T09:08: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": "c82c5ed1... |
ec184395-40a6-40b2-8381-6d233a85bf84 | doomsday861/Allofit | 1706c.cpp | /**
* 1706C
**/
#include<bits/stdc++.h>
#define ll long long
#define testcase ll t;cin>>t;while(t--)
#define pb push_back
#define fi first
#define se second
#define vll vector<ll>
#define for0(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define run ios_base::sync_with_st... | ALGO | 0.999956 | 3.94683 | {
"github_metadata": {
"branch": "master",
"commit_count": 542,
"repo_created_at": "2020-03-25T22:59: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": "6a950399... |
2a5a9ee5-df75-4e7e-96a8-292ab6f574bc | nxphuc/GoogleCodingCompetitions | 2021/KickStart/Round F/Star Trappers.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ii = pair<int, int>;
using vi = vector<int>;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ep emplace_back
const int MAX = 1e6 + 10;
const int MOD = 1e9 + 7;
const double I... | ALGO | 0.999953 | 5.339451 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-01-12T02:39: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": "87ac0d88047... |
b7657547-2dd3-4d68-b4f4-b0f39ab861f2 | Cs-2410/sde-sheet-question | 518-coin-change-2/518-coin-change-2.cpp | // class Solution {
// private:
// int solve(int amount, vector<int>& coins ,map<int , int>& mp){
// if(amount < 0)
// return 0;
// if(amount == 0)
// return 1;
// if (mp.find(amount) != mp.end())
// ... | ALGO | 0.999987 | 5.423865 | {
"github_metadata": {
"branch": "main",
"commit_count": 951,
"repo_created_at": "2022-06-09T18:37:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "42091b909e... |
7f531c36-b520-4d15-850b-adf315beb0a1 | ishandutta2007/codeforces-a | arturgo/normal/442/A.cpp | #include <iostream>
#include <vector>
#include <bitset>
using namespace std;
string couleurs = "RGBYW";
string nombres = "12345";
int invCouleur[256];
int invNombre[256];
vector<string> cartes;
bool separe(string a, string b, bitset<10> config) {
if(a[0] != b[0] && (config[invCouleur[(int)a[0]]] || config[invCoule... | ALGO | 0.997111 | 3.816367 | {
"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": "dfd21938808c... |
3572cd21-e8c4-4137-a80c-0118872dd8ff | VagueLove/MFC_DRAW_LAB2 | 2021112880_Drawing/2021112880_Drawing/CSlist.cpp | #include "pch.h"
#include "CSlist.h"
#include<iostream>
#include<stdlib.h>
using namespace std;
CSlist::CSlist()
{
head = nullptr;
}
void CSlist::InputTail(Node* Pelem)
{
if (Pelem == nullptr) return;
if (head == nullptr)
{
head = Pelem;
return;
}
Node* temp = head;
while (temp->next)
{
temp = temp->... | ALGO | 0.987306 | 3.304868 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-10-25T02:38: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": "9f7ce7918128... |
e5249444-f29f-4b84-be40-59d0a7dd2e60 | Mindev27/Solving-BOJ | 백준/Silver/31409. 착신 전환 소동/착신 전환 소동.cc | #include <algorithm>
#include <cstring>
#include <climits>
#include <iostream>
#include <vector>
#define ll long long
#define X first
#define Y second
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
int N;
int p[100005];
int find(int x) {
if(p[x] == x) return x;
return p[x] = find(p[x])... | ALGO | 0.999973 | 4.376116 | {
"github_metadata": {
"branch": "main",
"commit_count": 1133,
"repo_created_at": "2024-01-02T11:14: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": "6d52e3641... |
d2fdaecf-db74-401e-881a-13d9785555f3 | adyradu/Algorithms-and-Data-Structures | algorithms/graphs/EnclosedRegions/EnclosedRegions.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<vector<int>> dirs = { {-1, 0}, {1, 0}, {0, -1}, {0, 1} };
/// <summary>
/// DFS traversals from a particular cell.
/// </summary>
/// <param name="board"></param>
/// <param name="x"></param>
/// <param name="y"></param>
void TraverseFrom(vector<vector<... | ALGO | 0.995216 | 5.59362 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2018-10-23T18:20:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88783dc9... |
0a0cb5a3-8d17-4776-bb27-194465ac5b2d | bhoomikaseth001/PSIT | SEMESTER4/merge_K_SortedLists.cpp | #include<iostream>
#include<vector>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
ListNode* mergeKLis... | ALGO | 0.99998 | 6.324176 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2024-05-02T13:55: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": "e3d1f6475f5... |
226a1565-50c9-4f5e-91d5-400a850ea99b | DreamLife-Jianwei/Qt-Vtk | 12_Vtk9ReadDicomDemoQmake/Vtk9/include/vtk-9.0/vtkHyperTreeGridDepthLimiter.h | /*=========================================================================
Program: Visualization Toolkit
Module: vtkHyperTreeGridDepthLimiter.h
Copyright (c) <NAME>, <NAME>, <NAME>
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distr... | ALGO | 0.991622 | 6.261556 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2021-06-22T02:34:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 174,
"forks": 45,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b54e4c... |
491ffc26-b769-42f0-b69a-56b15aa3b350 | Ritwik33/cpp_projects | binarySearch/weakestRows.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int m, n;
cin >> m >> n;
vector<vector<int>> mat(m, vector<int>(n));
for(int i = 0;i<m;i++) {
for(int j = 0;j<n;j++) cin >> mat[i][j];
}
vector<int> vec(m);
for(int i = 0;i<mat.size();i++) {
int low = 0;
int h... | ALGO | 0.999966 | 3.420526 | {
"github_metadata": {
"branch": "main",
"commit_count": 296,
"repo_created_at": "2021-08-22T10:07:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "002f4c99b7... |
f62c4453-31e4-4b0f-b88d-685703017e00 | littlecaca/algorithms | daily/March/design-graph-with-shortest-path-calculator.cpp | #include <memory>
#include <vector>
using namespace std;
#define UNREACH 1e8 + 100
class Graph {
public:
shared_ptr<vector<vector<int>>> gp;
Graph(int n, vector<vector<int>>& edges) {
gp.reset(new vector<vector<int>>(n, vector<int>(n, UNREACH)));
for (auto &e: edges)
(*gp)[e[0]][... | ALGO | 0.99986 | 5.060248 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2024-04-24T09:13:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e471dfd0e... |
0b4663c6-6651-4b38-a6f1-7ff63c06bdc7 | FranciscoDavidMunozArmas/Semester-III | Queens/Queen.cpp | /*
* Universidad la Fuerzas Armadas ESPE
*
* @autor <NAME> & <NAME>
* @date Jueves, 7 de julio de 2020 17:16:14
* @function Implementation of Queen
*/
#include "Queen.h"
#include "Libraries/Matrix.cpp"
/**
* @brief Queen
* @return
*/
Queen::Queen() {
this->_size = 8;
this->_queens = _size;
_table... | ALGO | 0.997018 | 3.511186 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2020-05-31T20:35: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": "7eeb71ff9... |
be8eaae2-27f9-42b6-ab64-00dfe4458bc4 | wenyi1994/Wissenschaftliches-Programmieren | Uebung7/lambda_func.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <time.h>
using namespace std;
struct data{
unsigned int val1;
int val2;
};
int main(){
srand(time(NULL));
vector <data> Contain;
data m_data[10];
for(int i=0;i<10;i++){
m_data[i].val1 = i;
... | ALGO | 0.987549 | 4.323373 | {
"github_metadata": {
"branch": "master",
"commit_count": 197,
"repo_created_at": "2017-11-22T08:59: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": "60895d19... |
a4f02e7e-7798-4973-b737-6523b61a02c9 | DariusCorneciu/Structuri-de-Date | tema8/stivaex2.cpp | #include <iostream>
using namespace std;
struct Nod {
int valoare;
Nod* urmator;
Nod(int val) : valoare(val), urmator(nullptr) {}
};
class Stiva {
private:
Nod* varf;
public:
Stiva() : varf(nullptr) {}
bool empty() {
return varf == nullptr;
}
void push(int element) {
... | ALGO | 0.999176 | 4.070638 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-03-10T06:55: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": "873e9e3edda7... |
d68f7724-34ee-4117-963e-6b462dd0f153 | onehalfatsquared/hpc | hw3/omp-scan.cpp | #include <algorithm>
#include <stdio.h>
#include <math.h>
#include <omp.h>
// Scan A array and write result into prefix_sum array;
// use long data type to avoid overflow
void scan_seq(long* prefix_sum, const long* A, long n) {
if (n == 0) return;
prefix_sum[0] = 0;
for (long i = 1; i < n; i++) {
prefix_sum[... | ALGO | 0.999584 | 4.24586 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2019-02-21T01:12: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": "a6fe2d399... |
e68a0efd-19d2-4c40-9df3-2aca8e8c4fa3 | ishandutta2007/codeforces-s | s2speed/normal/1481/D.cpp | #include<bits/stdc++.h>
#include<fstream>
using namespace std;
#pragma GCC optimize ("Ofast")
#define all(x) x.begin() , x.end()
#define mp make_pair
#define gcd __gcd
typedef long long int ll;
typedef pair<ll , ll> pll;
typedef pair<int , int> pii;
typedef long double db;
typedef pair<ll , pll> plll;
typedef pair<... | ALGO | 0.999944 | 3.51573 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f91457fb388e... |
2c0ff0fd-8520-4ff6-abe8-17582f1a2d5f | yatharth811/Ray-Tracer | examples/e1.cpp | #include <bits/stdc++.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <glm/glm.hpp>
#include "../headers/col781.h"
#include <omp.h>
using namespace std;
inline std::ostream& operator<<(std::ostream &out, const vec3 &v) {
return out << v.x << ' ' << v.y << ' ' << v.z;
}
// Before Chapter 3
color ray_co... | ALGO | 0.987048 | 5.501595 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-04-06T07:30: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": "e3f9a6b5877... |
2a3313fc-3852-4bfd-bd53-c58c88725386 | kirillvelyugo/School | Informatics/Cycle IF/Theme 1. Yslovniy operator/H. Slon.cpp | #include <iostream>
using namespace std;
int main() {
int sln1,sln2,x,y;
cin >> sln1 >> sln2 >> x >> y;
/*
if (sln1 < 1 || sln1 > 8) {
return 0;
} else if (sln2 < 1 || sln2 > 8) {
return 0;
} else if (x < 1 || x > 8) {
return 0;
} else if (y < 1 || y > 8) {
... | ALGO | 0.999885 | 3.620043 | {
"github_metadata": {
"branch": "master",
"commit_count": 79,
"repo_created_at": "2020-09-25T09:15:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1fe4fe213... |
3ce5ab05-6483-4ba0-b4d3-3689d1ed111c | Jantopthegreat/StackArray_068 | StackUsingArray/StackUsingArray.cpp | #include <iostream>
#include <string>
using namespace std;
class StackArray {
private:
int stack_array[5];
int top;
public:
//constructor
StackArray() {
top = -1;
}
int push(int element) {
if (top == 4) {
cout << "Number of Data exceed the list" << endl;
return 0;
}
top++;
stack_array[top] ... | ALGO | 0.968273 | 3.889647 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2023-06-16T08:48: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": "f6da78ee8... |
2cc5c0ef-9fc7-43cb-ac53-4bcb3467d23e | kaloronahuang/KaloronaCodebase | Practices/Luogu/P3952.cpp | // P3952.cpp
#include <bits/stdc++.h>
using namespace std;
char content[1010], opt[20];
int T, L, complexity, vis[300];
struct instruction
{
char typ, var_name[3];
bool tag, tag2;
int x, y;
instruction()
{
typ = 0, memset(var_name, 0, sizeof(var_name));
tag = tag2 = false;
... | ALGO | 0.999094 | 3.868325 | {
"github_metadata": {
"branch": "master",
"commit_count": 554,
"repo_created_at": "2018-11-02T01:32:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "845ef65... |
21b31c07-8d06-4a26-9299-5af3393ffb5e | kumorikarasu/KylTek | KylTek/LinkedList.h | #pragma once
#ifndef LINKEDLIST_H_
#define LINKEDLIST_H_
/* - Linked Lists -
- Functions -
Constructor - creates the first node for the system
Destructor - Clears the list (deleting everything inside), then deletes itself
first (void) - returns the first node* in the list
add (object) - Adds a new object to th... | ALGO | 0.911583 | 3.61181 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-04-11T05:01: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": "114ce8f570... |
dae37fba-e7ef-4cfc-a287-dbfe0d34d4ea | xuqing-ict/BackupCode | temp/tree_sum.cpp | //在二元树中找出和为某一值的所有路径,并打印出这些路径
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
struct BSTreeNode
{
int m_nValue; // value of node
BSTreeNode *m_pLeft; // left child of node
BSTreeNode *m_pRight; // right child of node
};
int sum = 0;
void add_node(BSTreeNode * &parent,int value1, int valu... | ALGO | 0.99997 | 3.893038 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2014-09-24T02:28: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": "3407e094b... |
d6ed525b-a6e5-411d-9cc9-162e9f995dbb | MateoCondor/Grupo_5_Repository | AlgoritmosBusqueda/CODIGO/ListaSimpleTemplates/ListaSimple.h | #pragma once
#include <iostream>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include "Nodo.h"
template <typename T>
class ListaSimple{
private:
Nodo<T>* inicio = nullptr;
Nodo<T>* fin = nullptr;
int tam = 0;
public:
int obtenerTamanio() {
return tam;
}
void insertar... | ALGO | 0.998154 | 5.046566 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-12-17T22:31: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": "3c678b79cc6... |
9979589a-8cf5-47be-a856-00dbe792c53f | pezy/DesignPatterns | Composite/main.cpp | #include <iostream>
#include <string>
#include <vector>
class Employee {
public:
Employee(const std::string& name, float salary): name_(name), salary_(salary) {}
virtual std::string GetName() { return name_; }
virtual float GetSalary() { return salary_; }
protected:
float salary_;
std::string name... | TOOL | 0.91828 | 6.049777 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2017-08-01T09:33:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 151,
"forks": 43,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "19156b... |
15ba22ae-27fe-40bc-958e-1c65be67678a | Mehebub-Hasan/Data_Stracture | queue_class.cpp | #include <bits/stdc++.h>
using namespace std;
class Queue {
int *arr;
int front;
int rear;
int size;
public:
Queue(int _size) {
this->size = _size;
arr = new int[size];
front = -1;
rear = -1;
}
void enqueue(int x) {
if(rear == size-1) {
c... | ALGO | 0.996384 | 3.841405 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-12T19:46: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": "945ae14e3def... |
f934ac40-3be5-4b42-a1f6-fa17da63b3a9 | bishakhne0gi/3rdSemSolution | BinarySearchTreeImplmentation.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int key;
Node * left;
Node * right;
Node(int d):key(d),left(NULL),right(NULL){}
};
class BinaryTree{
// Node * root;
public:
// BinaryTree(): root(NULL){}
Node * buildNode(int data)
{
... | ALGO | 0.999985 | 4.264855 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-01-11T16:39: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": "df82b5326f56... |
25673c67-150d-4c1d-b527-356c982681c2 | fcostin/hangman_cpp | alpha_beta.cpp | #include "alpha_beta.h"
inline string make_key_for_game_state(const state_t & h) {
// return string key for game state structure
// (for caching ...)
vector<char> guesses = vector<char>(h.guesses);
sort(guesses.begin(), guesses.end());
string key;
if (h.last_guess != (char)0) {
key.pus... | ALGO | 0.999896 | 5.655056 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2012-04-09T05:52:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70c534987... |
ba25c48d-806c-421d-967d-72fdd9796c41 | GopherTeen/OJ_Code | Problems/Leetcode/2001-3000/2801-2900/2844.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int minimumOperations(string num) {
int n = num.size();
int ans = n;
for (int i = n - 1; i >= 0; --i) {
if (num[i] == '0') {
ans = min(ans, n - 1);
for (int j = i - 1; j >= 0... | ALGO | 0.997632 | 5.052197 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2024-11-01T07:27: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": "0a6c6d572... |
9ae79bd8-0798-47dd-ace1-a21f21d3bc14 | vasinwr/Enigma | Main.cpp | // skeleton C++ file, you will need to edit this and other files to implement your enigma machine
#include <stdexcept>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <assert.h>
#include "Machine.h"
using namespace std;
int main(int argc, char **argv)
{
/*testing for machine cre... | ALGO | 0.966524 | 4.161097 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-10-16T11:25: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": "6171002aa4... |
170bf1ac-ea7c-4c76-9351-ae95d4549a95 | stbaker517/PS | BACKJOON/14268/bj 14268.cpp | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
#define ll long long
vector<int> td[100001];
int par[100001];
ll lazy[1<<20];
ll tree[1<<20];
int ii[100001];
int oo[100001];
int n,m;
int boss;
int cnt=0;
void dfs(int node){
cnt++;
ii[node]=cnt;
for(int d: td[node]){
dfs(d)... | ALGO | 0.999898 | 4.304423 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-04-19T10:16:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5777f8d76aa... |
2271ab4c-0897-45ce-bdbb-03282d79c933 | danielsaad/AA-IFB-CC | estruturas-de-dados/exemplo-fila-de-prioridades.cpp | #include <iostream>
#include <queue> //necessário para utilizar fila de prioridades
using namespace std;
/**
* A fila de prioridades é uma Estrutura de Dados que permite que elementos com maior prioridade
* sejam retirados primeiro.
*
* A complexidade de inserção/remoção é O(lg n).
* Normalmente a fila é impleme... | ALGO | 0.999695 | 5.20672 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2016-02-29T19:06:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92268d52f... |
5bef05e2-42b3-4f9e-9737-2dfaa2f5d6df | huytm2k3/cmu-learning | lec01/convert-3d-to-2d.cpp | #include <iostream>
std::vector<std::vector<float>> convert3DTo2DCoordinates(std::vector<float> &camera, std::vector<std::vector<float>> &coords);
int main()
{
std::vector<float> camera(3);
std::cout << "Enter coordinate for camera: ";
std::cin >> camera[0] >> camera[1] >> camera[2];
int numberOfPoin... | ALGO | 0.935039 | 5.437976 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-10-28T10: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": "1e4d721d6126... |
205964d0-7020-4ff3-8f7d-ae030eaaddfc | alensomaxx/JustPrivSam | C++/Regular/InventorySet.cpp | /* You will perform the following operations:
1. Traversal: Go through the list of inventory quantities to verify the stock levels.
2. Insertion: Add a new item to the inventory, updating the quantity.
3. Deletion: Remove an item from the inventory when it is out of stock.
Input format :
The first line of input contain... | ALGO | 0.999844 | 5.562945 | {
"github_metadata": {
"branch": "main",
"commit_count": 214,
"repo_created_at": "2024-08-30T13:45: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": "1c4c467fd8... |
3c8f0528-f7ef-4484-aa47-8e4cd0130565 | CGAL/cgal | Shape_regularization/include/CGAL/Shape_regularization/Segments/Angle_regularization_2.h | // Copyright (c) 2020 GeometryFactory SARL (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : <NAME>, <NAME>, <NAME>, <NAME>
//
#ifndef CGAL_SHAPE_REGULARIZATION_ANGLE_REGUL... | TOOL | 0.996338 | 7.587851 | {
"github_metadata": {
"branch": "master",
"commit_count": 113659,
"repo_created_at": "2014-10-01T12:22:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5443,
"forks": 1475,
"issues": 511,
"pull_requests": 136
},
"file_meta": {
"content_id... |
af0e16eb-905c-43e5-abab-228ae6b98d40 | AmandeepSinghBisht/dsa-cpp | peparation/linkedlist.cpp | #include <stdio.h>
#include <iostream>
using namespace std;
class node
{
public:
int data;
node *next = NULL;
node(int val)
{
data = val;
next = NULL;
}
};
void insertathead(node* &head,int val){
node* n=new node(val);
n->next=head;
head=n;
}
void insertattail(node *&hea... | ALGO | 0.999915 | 3.943554 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-08-23T16:40:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "098448e801... |
29ef5cc7-0d2d-4b45-9c16-f01e83bc656a | ttm02/aoc | 2022/21.cpp | //
// Created by tim on 02.12.22.
//
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <map>
#include <iterator>
#include <stdexcept>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <set>
#include <memory>
#include <limits>
std::vector<std::string> read_input_f... | ALGO | 0.998216 | 5.200677 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-12-04T10:06: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": "0b9aa6d91ec8... |
b6929829-14d6-47ec-8d5f-f248ea4e9fa7 | WindKnight/IndexBench | src/index_btree_sort_mt/index_btree_reader_sort_mt.cpp | /*
* index_btree_reader_sort_mt.cpp
*
* Created on: Aug 12, 2018
* Author: wangyida
*/
#include "index_btree_sort_mt/index_btree_reader_sort_mt.h"
#include <sys/sysinfo.h>
#include <sched.h>
#include <time.h>
#include "util/util_log.h"
ResultNodeSort::ResultNodeSort() {
children_ = NULL;
children_num_= ... | ALGO | 0.998506 | 4.522488 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-08-15T16:25: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": "897120c90c... |
a59958b8-9815-4fd6-9bb0-6f07c5437d71 | ValdemarLange/6sem | NM/6ex/main.cpp | #include <iostream>
#include "nr3.h"
#include <math.h>
#include <vector>
using namespace std;
double f(double x)
{
return x - cos(x);
}
void bisection(double x_i, double y_i, double threshold){
int k = 0;
double x_ip1, y_ip1, x_im1;
double dk, dk_m1;
// Print table header
std::cout << std::s... | ALGO | 0.999993 | 5.250812 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-04-22T12:35: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": "7af0dd34853a... |
362aba56-d9d5-45b5-ad2f-a85fa910e7df | authuir/leetcode | algorithm/cpp/486.cpp | #include <vector>
#include <iostream>
#include <cstring>
using namespace std;
class Solution {
private:
int** dp = NULL;
int** sum = NULL;
int getDp(int i, int j, vector<int>& nums)
{
if (i > j || i<0 || j<0)
return 0;
else if (i == j)
return nums[i];
if... | ALGO | 0.999993 | 5.567976 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2017-05-08T12:10:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e5d9a28... |
f65f09d6-7659-4eff-b935-e8cc16f4e765 | Ewenwan/MVision | PCL_APP/Basic/Features/PFH_features.cpp | /*
计算法线---计算临近点对角度差值-----直方图--
点特征直方图(PFH)描述子
点特征直方图(Point Feature Histograms)
正如点特征表示法所示,表面法线和曲率估计是某个点周围的几何特征基本表示法。
虽然计算非常快速容易,但是无法获得太多信息,因为它们只使用很少的
几个参数值来近似表示一个点的k邻域的几何特征。然而大部分场景中包含许多特征点,
这些特征点有相同的或者非常相近的特征值,因此采用点特征表示法,
其直接结果就减少了全局的特征信息。
http://www.pclcn.org/study/shownews.php?lang=cn&id=101
通过参数化查询点与邻域点之间的空间差异,并形成... | ALGO | 0.98019 | 5.706763 | {
"github_metadata": {
"branch": "master",
"commit_count": 3396,
"repo_created_at": "2017-09-24T06:25:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8384,
"forks": 2800,
"issues": 17,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
0ef0173c-2ab6-4b70-a35d-ef5f7ea82683 | nguyencongvan10022002/CTDL_GTH | codeptit/day_con_chung_dai_nhat_cua_ba_xau.cpp | #include<bits/stdc++.h>
using namespace std;
main(){
int t; cin >> t;
while(t--){
int len1, len2, len3; cin >> len1 >> len2 >> len3;
string s1, s2, s3; cin >> s1 >> s2 >> s3;
int dp[len1 + 5][len2 + 5][len3 + 5];
memset(dp, 0, sizeof(dp));
for(int i = 1; i <= len1; i++){... | ALGO | 0.999985 | 4.529169 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-08-23T03:23: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": "276ca617619a... |
066ab9bc-be0d-4b70-92f8-f72603217aa6 | darkknightt1/MoveIt-6DOF-Robot-Controller | moveit_robot_arm/src/KEEP HERE/pos_control3.cpp |
#include <ros/ros.h>
#include <moveit/move_group_interface/move_group_interface.h>
#include <moveit/planning_scene_interface/planning_scene_interface.h>
#include <moveit_msgs/DisplayTrajectory.h>
#include <geometry_msgs/Pose.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <moveit/planning_scene/planning_s... | TOOL | 0.965297 | 6.437674 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-05-14T20:30: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": "4b1ae7e1bb... |
7f34091a-e9aa-49b8-9fe0-c6e2557f91ea | FoF312/HomeWorks | Work6/№3.cpp | #include <iostream>
const int MAX_SIZE = 100;
int main() {
int minRowIndex = 0;
int minRowSum = INT_MAX;
int n, m;
int A[MAX_SIZE][MAX_SIZE];
// Ввод размеров матрицы
std::cout << "Введите количество строк (n <= 100): ";
std::cin >> n;
if (n < 1 || n > 100)
{
std::cout <<... | ALGO | 0.999739 | 4.790124 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2024-09-21T10:35: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": "53aa1cd11e1... |
69f214f4-6ffa-473f-9ded-107777681a2b | ZERRY-000/2110327-ALGORITHM-DESIGN | 01KnapsackProblem/0.cpp | #include <iostream>
#include <vector>
#include <algorithm>
std::vector<int> collected;
int check(std::vector<std::vector<int>>& t, std::vector<int>& v, std::vector<int>& w, int i, int j){
if(i <= 0 || j <= 0) return 0;
int l = j - w[i - 1];
// std::cout << l << " :l\n";
if(t[i][j] == t[i - 1][j]){
... | ALGO | 0.999987 | 3.259783 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-07T16:53: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": "b321e05dfc0b... |
4a8f746e-7cb0-4dc5-bf06-17d6198468ca | sotanishy/cp-library-cpp | flow/min_cost_flow.hpp | #pragma once
#include <algorithm>
#include <functional>
#include <limits>
#include <queue>
#include <utility>
#include <vector>
template <typename Cap, typename Cost>
class MinCostFlow {
public:
MinCostFlow() = default;
explicit MinCostFlow(int V) : V(V), G(V), add(0) {}
void add_edge(int u, int v, Cap... | ALGO | 0.997679 | 6.368244 | {
"github_metadata": {
"branch": "main",
"commit_count": 857,
"repo_created_at": "2020-08-31T00:54:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "59567429b... |
dd420d38-e492-4866-9442-7fea0efc0088 | AnandSaminathan/verification-algorithms | include/verification-algorithms/common/matrix.hpp | #pragma once
#include "z3-solver.hpp"
namespace verifier {
class matrix {
public:
matrix(std::vector<std::vector<std::string>> mat) {
for(auto x: mat) {
std::vector<z3::expr> row;
for(auto y: x) {
row.push_back(stringToZ3(y).simplify());
}
(th... | ALGO | 0.983366 | 5.710882 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2020-03-07T15:53:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6aedefee0... |
75c143e0-f92c-4299-9891-1843cb1bf9d2 | Scarlettyan6/parallel_program | openMp/ARM/test1.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <omp.h>
#define MAX_N 2048
#define STEP 256
#define NUM_THREADS 4
float A[MAX_N][MAX_N]; // 原始矩阵(用于列并行)
float A_row[MAX_N][MAX_N]; // 行划分版本
float A_serial[MAX_N][MAX_N]; // 串行版本
void init_matrix(int n) {
srand(0); // 固定随机种子
for... | ALGO | 0.999921 | 4.404747 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-03-30T15:28: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": "b1e161d1b371... |
d51e83b5-928b-4b84-a563-0d95a2c4804a | heldercostaa/ProgrammingLabCourse | pattern-search/search.cpp | //
// search.cpp
// pattern-search
//
// Created by <NAME> on 12/05/19.
// Copyright © 2019 UFC. All rights reserved.
//
#include "search.hpp"
#include "array_helper.hpp"
#include <iostream>
#include <cstring>
Search::Search(enum_search t_search_type, Instance t_instance) {
search_type = t_search_type;
instanc... | ALGO | 0.995862 | 5.201653 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2019-04-08T23: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": "71de2b89b... |
d3ca9c40-2799-4712-9477-c6487d760ed6 | ivan-bezyazychnyy/courses | stepic/multithreaded-c-cpp/containers/polynom.cpp | #include <iostream>
#include <map>
#include <sstream>
#include <algorithm>
std::map<int, int> powerToCoef;
void add_term_to_map(std::string term) {
//std::cout << "Analysing term: " << term << std::endl;
size_t power_pos = term.find('^');
size_t symbol_pos = term.find('x');
int power = 0;
if (power_pos != std:... | ALGO | 0.999838 | 4.78487 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-02-14T10:46: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": "69a55720ef... |
b9edf1c4-771d-4753-b96b-0e6a96c1d63e | andersonxv98/AprendizadoCPLUSPLUS | ORINNHOSPLUSPLUS/agamenon.cpp | #include <iostream>
#include <vector>
#include <sstream>
#include <string>
#include <list>
using namespace std;
class Ilha
{
private:
int idie;
public:
Ilha(int id);
~Ilha();
};
Ilha::Ilha(int idie)
{
this->idie= idie;
}
Ilha::~Ilha()
{
delete thi... | ALGO | 0.998562 | 3.454571 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-04-28T21:02: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": "e40e74421440... |
b9e5ef55-e363-4e6e-b5bb-f4864504db9a | intellijh/algorithm-study | 8주차/17612_1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, k, a, b;
struct Cacher {
int id, max_time, cacher_id;
bool operator< (const Cacher& other) const {
if (max_time == other.max_time) {
return cacher_id > other.cacher_id;
}
return max_time > other... | ALGO | 0.999925 | 4.089533 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2024-07-20T13:15: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": "18eb3b605b0... |
721248ca-354e-41e6-a74b-a6d73250d272 | djh1995555/VehicleControl | control/src/Controller/MPCController.cpp | #include<control/Controller/MPCController.h>
Status MPCController::Init(const ControlConf &control_conf)
{
name = "MPC controller";
prediction_length=control_conf.conf_param.MPC_predict_length;
control_length=control_conf.conf_param.MPC_control_length;
preview_length = control_conf.conf_param.preview_l... | ALGO | 0.98912 | 4.91573 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-10-17T07:00:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "187fc0cd... |
d783f234-db8f-412f-aa98-17c7f26a677d | NazarDurybaba/LB_13.1 | TaylorSeries.cpp |
#include "TaylorSeries.h"
#include <iostream>
#include <iomanip>
#include <cmath>
namespace TaylorSeries {
double x_start = 0.0;
double x_end = 0.0;
double dx = 0.0;
double epsilon = 0.0;
double calculateTerm(double x, int n) {
static double term = x;
if (n == 0) {
ter... | ALGO | 0.987668 | 4.348501 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-05-22T19:38: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": "eb8021ae7b... |
fb7e858b-30f9-4043-b9e3-f58f1f733df0 | phatcvo/adas | common/numerics/fast_atan2.cpp | /////////////////////////////////////////////////////////////////////////
/// @file atan2_approximation.cpp
/// @brief a faster approximation of std::atan2
/// @author
/// @date 6/4/2018
/// @version 1.0.1
/////////////////////////////////////////////////////////////////////////
#include "adas/common/numerics/fast_... | ALGO | 0.989067 | 6.177333 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2025-06-01T15:08:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ead2526c0c... |
75f30b45-7373-4a2c-94d8-0d73a5c6c640 | Sorakrit05/LAB10 | lab10_1.cpp | #include<iostream>
using namespace std;
int main(){
int count[5] = {0,0,0,0,0};
char grade = '1';
int i = 1;
int T = 0;
cout << "Please input grade of each student (A-F) or input 0 to exit." << endl;
do{
cout << "Student [" << i << "]: ";
cin >> grade;
if(grade == 'A'){
count [0] = count[0] + 1;
i++;... | ALGO | 0.978712 | 3.306056 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2024-12-17T08:10: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": "c6f54725e... |
bac5d68b-1a0f-43aa-bf51-58f24eb0a8a4 | Shahraaz/Old_CPlusPlus | Compete1/p113a.cpp | //Optimise
#pragma comment(linker, "/stack:227420978")
#pragma GCC optimize("Ofast")
//~#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
//setbase - cout << setbase (16); co... | ALGO | 0.999941 | 3.575973 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-04-11T17:59:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec07ec30fd... |
08e88a13-c056-4698-b7cd-5cc6b3c17bc6 | AlexisRodriguezCS/GridWord | DoublyLinkedList.h | #ifndef DOUBLYLINKEDLIST_H
#define DOUBLYLINKEDLIST_H
#include <iostream>
#include <vector>
using namespace std;
class Node {
public:
int data;
Node *next;
Node *prev;
Node() {
this->next = nullptr;
this->prev = nullptr;
}
Node(int data) {
this->data = data;
this->next = nullptr;
thi... | ALGO | 0.952596 | 5.288728 | {
"github_metadata": {
"branch": "main",
"commit_count": 120,
"repo_created_at": "2023-04-30T21:25:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eacba6e65e... |
7f90e82a-7ae9-462f-af59-a96ecff4eaac | arash-ha/Cpp | Linked List Random Node.cpp | /*
Linked List Random Node
Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen.
Follow up:
What if the linked list is extremely large and its length is unknown to you? Could you solve this efficiently without using extra space?
Examp... | ALGO | 0.999293 | 5.933685 | {
"github_metadata": {
"branch": "master",
"commit_count": 982,
"repo_created_at": "2019-10-02T15:30: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": "845e6fc1... |
d6191f9b-8161-4995-b1c1-23952262924d | MuhammadAryaNS/Lab.DesainDanAnalisisAlgoritma | Pertemuan 10/Tugas/Tugas 2 (Graf Tidak Berarah).cpp | #include <iostream>
#include <vector>
using namespace std;
class Graph {
private :
vector<vector<int> > adjList;
public :
Graph(int n) {
adjList.resize(n);
}
void addEdge(int u, int v) {
adjList[u].push_back(v);
adjList[v].push_back(u);
}
void printGraph() {
for... | ALGO | 0.980891 | 5.211079 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-03-18T07:22:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b245e58d59a... |
1dec8c6a-fab6-402e-85c2-1334d9c610e1 | Mann-Chandarana/Leetcode_Challenges | Arrays/LTC5_VII.cpp | //////// Question number 1470.
/* New Learning :-
---> How to store 2 number on the same index
*/
#include <bits/stdc++.h>
using namespace std;
/* Using bit manipulation */
vector<int> shuffle(vector<int> &nums, int n)
{
int tenBitNum = pow(2, 10) - 1;
for (int i = 0; i < n; i++)
{
int secNum = ... | ALGO | 0.999702 | 4.022953 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-10-14T18:31: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": "b2e73bcfa71... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.