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 |
|---|---|---|---|---|---|---|---|
0b3c6d24-ace3-4eaf-aed6-eedfc18be28e | polykernel/competitive-programming | LeetCode/1662.cc | /*
Problem: 1662. Check If Two String Arrays are Equivalent
Difficulty: Easy
*/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool arrayStringsAreEqual(vector<string>& word1, vector<string>& word2) {
int lp = 0;
int rp = 0;
int i = 0;
int j = 0;
... | ALGO | 0.999937 | 6.377404 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-11-19T23:26: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": "1bd4679eca8... |
040e3be2-03a3-436f-a114-44d83fb86e2d | H1Do/UGATU-Latipov-Niyaz | sem 2/sem 2 - task 3 - 1.cpp | // https://contest.yandex.ru/contest/37787/problems/1/
// 68217255
#include <iostream>
#include <vector>
void Z(const std::string& str, std::vector<int>& z) {
for (int i = 1, left = 0, right = 0; i < str.length(); i++) {
if (i <= right)
z[i] = std::min(right - i + 1, z[i - left]);
while (i + z[i] < str... | ALGO | 0.999594 | 5.016733 | {
"github_metadata": {
"branch": "main",
"commit_count": 159,
"repo_created_at": "2021-09-13T15:02: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": "3e5853b61b... |
296f1ae9-cb7d-4234-87c6-5b92274afdce | toiratcui12345/DSA | C23.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class UnionFind {
vector<int> parent, rank;
public:
UnionFind(int n) : parent(n), rank(n, 0) {
for (int i = 0; i < n; ++i)
parent[i] = i;
}
int find(int i) {
if (parent[i] != i)
par... | ALGO | 0.999934 | 5.28251 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-09-06T06:31: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": "d0ed324305e9... |
a5cfc34e-9bcd-4001-8aeb-cfccf7e542da | singhsanket143/CppCompetitiveRepository | UN/STL-PLus/Vector/Vector_Intro.cpp | // Problem Link -
/* By <NAME> */
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define mod 1000000007
#define inf 1e18
#define endl "\n"
#define pb emplace_back
#... | TOOL | 0.98347 | 3.989146 | {
"github_metadata": {
"branch": "master",
"commit_count": 304,
"repo_created_at": "2018-06-26T07:06:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 348,
"forks": 160,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "1f01... |
04be6a27-ba29-43ee-8bf1-c7a1a99b9385 | 1804054Miraz/Atcoder-problem-solution | C - IPFL.cpp | //<NAME>
//<NAME>
///A lot of mistakes is happened without understanding questions clearly.\
Please,make sure that understand question clearly.Think from every possible output.\
Make different algorithm to answer the question.Don't think that you have tried all possible ways.\
There is always simple and tricky way to s... | ALGO | 0.999989 | 3.436397 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-08-20T11:40: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": "cf33ad07c954... |
d3876b4c-c04a-493f-a5e6-63826473806b | ishandutta2007/codeforces-s | saketh/normal/1096/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i =... | ALGO | 0.998954 | 5.086076 | {
"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": "bf2d1c327280... |
b3f761db-a937-4508-a95f-b8a0d5a349fa | SR-Sunny-Raj/Hacktoberfest2021-DSA | 15. Binary Search Tree/delete_in_BST.cpp | #include<iostream>
using namespace std;
struct Node{
int data;
Node* right;
Node* left;
Node(int val){
data=val;
left=NULL;
right=NULL;
}
};
/*
4
/ \
2 5
/ \ \
1 3 6
*/
Node* inordersucc(Node* root){
Node* curr=root;
... | ALGO | 0.999987 | 4.675269 | {
"github_metadata": {
"branch": "master",
"commit_count": 2783,
"repo_created_at": "2020-05-08T05:36:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 236,
"forks": 982,
"issues": 3,
"pull_requests": 161
},
"file_meta": {
"content_id": "7... |
1dd5c288-07ff-47ff-bf09-12376388a6a2 | shivam-72/C-basics | C++ BASICS/insert.cpp | #include <iostream>
using namespace std;
int main()
{
int n, length, index, i, x;
int A[n];
cout << "enter the size of array" << endl;
cin >> n;
cout << "no. of element you want to insert:" << endl;
cin >> length;
if (length <= n)
{
cout << "elements of array" << endl;
fo... | ALGO | 0.985395 | 3.468434 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-06-26T10:13: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": "61a7d39eed8c... |
0db380d7-0b68-4c30-9421-e9102e5f3fda | OpenFOAM/OpenFOAM-dev | src/polyTopoChange/meshCut/directions/directionInfo/directionInfo.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\... | TOOL | 0.95403 | 6.037519 | {
"github_metadata": {
"branch": "master",
"commit_count": 8589,
"repo_created_at": "2014-12-10T15:47:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1770,
"forks": 642,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "cd... |
17a0e481-b2cf-479f-ba82-6e7a7eaf635d | huang46u/VMAS-code | cgogn/geometry/algos/angle.h | /*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* Copyright (C), IGG Group, ICube, University of Strasbourg, France *
* ... | ALGO | 0.990899 | 7.030426 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2025-03-07T22:15:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "d150cbcb2... |
03c7b0a8-d638-4ac7-88d0-239e7e4c0795 | and0390/morph_sort | include/morph_sort/detail/sorters/quick_sort.hpp | #ifndef MORPH_QUICK_SORT
#define MORPH_QUICK_SORT
#include <iterator>
#include <functional>
#include "../utils/resolve_projection.hpp"
#include "../adapters.hpp"
#include "../utils/identity.hpp"
#include "default_sort.hpp"
#include "../sort_interface.hpp"
namespace morph
{
template<>
struct sort<morph::adapt... | ALGO | 0.999871 | 6.712088 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-05-19T02:23: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": "779e638e46e... |
61f34b08-37ea-4e68-bb5d-f2cbc278d47b | Paramee0598/15_11 | 15_11/Source.cpp | #include <stdio.h>
void printArr(int* arr, int size);
int main()
{
int arr[100];
int size;
int* left = arr;
int* right;
printf("Enter size of array: ");
scanf_s("%d", &size);
if (!(size <=100)||(size <1 )) {
printf("\nSIZE ERROR!!!\n");
return 0;
}
right = &arr... | ALGO | 0.999422 | 4.73639 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-11-06T19:43: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": "61eb7a33b6... |
f80289ea-5c97-4914-9df9-74099661b903 | sun2snow/Source-Code | AcWing/1135/Std.cpp | #include <bits/stdc++.h>
using pii = std::pair<int, int>;
const int N = 5e4 + 10;
bool vis[N];
int dis[7][N];
std::vector<pii> g[N];
int n, m, ans = 2e9, a[7], mp[N];
void Dijkstra(int id, int *dis) {
memset(vis, 0, sizeof(vis));
memset(dis, 0x3f, N << 2);
std::priority_queue<pii, std::vector<pii>, std::greate... | ALGO | 0.999968 | 3.840787 | {
"github_metadata": {
"branch": "main",
"commit_count": 92,
"repo_created_at": "2025-03-24T10: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": "a0422114874... |
bb562406-7e2e-40f8-a72e-32f76c9ede53 | sreesadineni/DSA | BFS of graph - GFG/bfs-of-graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
vector<int> bfsOfGraph(int V, vector<int> adj[]) {
vector<int> ans;
int vis[10001]={0};
queue<int>q;
q.push(0);
vis[0]=1;
while(!q.empty()){
i... | ALGO | 0.999926 | 6.529151 | {
"github_metadata": {
"branch": "main",
"commit_count": 825,
"repo_created_at": "2022-07-12T17:26: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": "5f1f57c96f... |
7b581130-f2ab-4815-ad3e-580f3a3556a1 | nlok5923/DataStructureAndAlgorithm | code/MinStepsTo!.cpp | // min steps to reduce a number to 1 via this three steps
// find no of steps needed to do this
// decrement the no by 1
// divide by 2 if n%2 == 0
// divide by 3 if n%3 == 0
//simple recursive technique
#include<bits/stdc++.h>
using namespace std;
//
//int dhundkela(int n){
// //base case
// if(n<=1)
// return 0;... | ALGO | 0.999981 | 5.058397 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2020-07-13T05:23:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "083f0be59... |
5717c6f0-f4c8-4e81-8a6a-1949be7a35fe | CoconutOnPalm/AiSD | Lista1/ex2/main.cpp | #include <random>
#include <array>
#include "../print.h"
#include "cyclic_list.hpp"
int main()
{
CyclicList<int> mlist1;
CyclicList<int> mlist2;
for (int i = 10; i < 30; i += 2)
mlist1.insert(i);
for (int i = 11; i < 31; i += 2)
mlist2.insert(i);
std::print("merged: ");
... | ALGO | 0.939359 | 4.201458 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2025-03-16T18:33: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": "7f5e2d5810... |
357d4355-b538-420b-8a2e-d32efaf6b318 | pkhemka12/CME-211-Project | matvecops.hpp | #ifndef MATVECOPS_HPP
#define MATVECOPS_HPP
#include <vector>
/* Calculates the matrix vector product under the assumption that the
dimensions match
Arguments:
val: Values of matrix (vector of doubles)
row_ptr: CSR row pointers (vector of ints)
col_idx: Col indices (vector of ints)
x : vector for multiplication (v... | TOOL | 0.976671 | 6.502141 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-03-22T02:09: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": "dcbc938293ae... |
27e0a790-86b2-4aa1-aad3-54612c8fe4a5 | morix1500/atcoder | atcoder/ABC030/C/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n, m, x, y;
cin >> n >> m >> x >> y;
vector<ll> a(n), b(m);
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < m; i++)
cin >> b[i];
int i = 0;
int j = 0;
int cnt = 0;
int t = 0;
while (i < n... | ALGO | 0.999968 | 3.572107 | {
"github_metadata": {
"branch": "master",
"commit_count": 260,
"repo_created_at": "2019-04-06T07:24: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": "064d4bea... |
1c3681a3-d545-412e-b2a7-da7cbfca3f33 | huskyncu/DATA-STRUCTURE | Week_3/week_3.cpp | #include<iostream>
# include<vector>
using namespace std;
typedef struct polynomial
{
long double coef;
long long int exp;
};
int compare(int a,int b)
{
if(a>b)
return 1;
else if(a==b)
return 0;
else
return -1;
}
int main()
{
polynomial poly;
vector<polynomial> pol... | ALGO | 0.998692 | 3.027837 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-10-06T15:04: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": "dffa9afc8a3... |
9ebc4e4a-65ba-4d42-a382-32ed0e2469f2 | signetlabdei/DESERT_Underwater | DESERT_Framework/DESERT/network/uwsun/sun-ipr-node-pathest-answer.cpp | //
// Copyright (c) 2021 Regents of the SIGNET lab, University of Padova.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of source code must retain the above copyrigh... | ALGO | 0.999509 | 4.69399 | {
"github_metadata": {
"branch": "master",
"commit_count": 176,
"repo_created_at": "2020-04-14T17:19:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 34,
"forks": 26,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "3be20ef... |
837de0e3-f0c3-43de-a3ed-c67861214311 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0823/personal_submission/cf1184a2_tsreaper.cpp | #include <bits/stdc++.h>
#define MAXN ((int) 2e5)
using namespace std;
int n, ans;
char s[MAXN + 10];
int f[MAXN + 10];
bool vis[MAXN + 10];
int main() {
scanf("%d%s", &n, s);
for (int k = 1; k <= n; k++) {
int g = gcd(k, n);
if (g < k) { ans += f[g]; continue; }
memset(vis, 0, sizeof... | ALGO | 0.999922 | 3.698432 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "cf07... |
8bac48ff-7fd7-41d5-96a4-d5eb936761c7 | dougnobrega/Marathon-Training | UVA/12455.cpp | #include <bits/stdc++.h>
using namespace std;
// Typedef's start //
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii > vpi;
// Typedef's end //
// Define's start //
#define F first
#define S second
#define PB push_back
#define ... | ALGO | 0.999956 | 4.444682 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2018-08-07T15:43:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2deb88581... |
7c1549c6-d4ab-422a-be52-322c0f5db454 | geekpradd/IOITC-2017 | 2013/preordertree.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[25];
bool correct = 1;
vector<int> ans(int n, int dist){
vector<int> ret(n);
if (dist > dp[n]) {
correct = 0;
return ret;
}
int acum = 0;
for (int i = 1; i<= n; ++i){
acum += dp[i-1]*dp[n-i];
if (acum >= dist){
acum -= dp[i-1]*dp[n-i];
ret[0] = i... | ALGO | 0.999967 | 3.47766 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-02-24T06:03: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": "e3bc9046a9... |
1e4489eb-ad00-45ec-a835-b535ea761add | CaDe27/Coding | ICPC/SEERC19/i.cpp | #include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string>
#include <vector>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <stack>
#include <utility>
#include <queue>
#include <set>
#include <iomanip>
using namespace std;
typedef int64_t ll;
typedef pair<int,ll> pil... | ALGO | 0.999968 | 3.778538 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-02-23T17:53:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94f8d2cd821... |
7250ad0c-96ed-4045-b92f-aacb25cddde8 | nupam/Support-Vector-Regression | Math.h | /*
contains a bunch of static routines to manipulate numerical data, espicially Matrices
mean(double* , double* )--
return the mean of array between [b,e)
mean(const Matrix&)--
returns a row matrix containing mean of each column
scale(matrix& )--
scales the matrix around mean
sigmod(const double... | TOOL | 0.974573 | 4.504992 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-08-08T23:30:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5627cb4ae... |
b62fe7a1-df27-4d76-9f2d-7d908ded6a95 | truonghoangthuan/algorithm | c++/Devide_Conquer/SortArrayMergeSort/SortArrayMergeSort.cpp | #include <iostream>
using namespace std;
//MergeSort
void merge(int a[], int low, int mid, int high) {
int firstHalve = mid - low + 1;
int secondHalve = high - mid;
int *L = (int*)malloc(firstHalve*sizeof(int));
int *R = (int*)malloc(secondHalve*sizeof(int));
for (int i = 0; i < firstHalve; i++)
L[i] = a[lo... | ALGO | 0.999975 | 5.057102 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2020-12-01T17:21:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d3d54ddc0... |
10d3ccfa-aa86-43e0-b052-412e4bb472fb | makixi/PAT | top/1005. Programming Pattern (35).cpp | //---------------------后缀数组解法-------------------------------
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
const int maxn = 1e6 + 1e5;
int N;
int n, m, w, k; //n串长度 m等级阶数 w当前子串长度
string s;
char str[maxn];
int rak[maxn]; //i位置的等级
int second[maxn]; //按第二关键字排序,第i名的位置
int tmp[maxn]; //基排用
... | ALGO | 0.999991 | 3.789136 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2017-04-30T05: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": "6f01ec9c3... |
5ffa6f9d-b3a6-482f-8e33-3511739bbfdd | ishandutta2007/codeforces-w | wrong/normal/175/B.cpp | #include<iostream>
#include<string>
#include<map>
#include<algorithm>
using namespace std;
int n, m;
string name[1024];
int score[1024];
int main()
{
map<string, int> nn;
ios::sync_with_stdio(false);
cin >> n;
m = 0;
for(int i=0; i<n; ++i) {
string k;
int p;
cin >> k >> p;
if(nn.find(k) == ... | ALGO | 0.997736 | 3.572793 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13ecdc5b5dcb... |
003b8ce6-09d9-41ce-9f95-706206bd102c | Minipoloalex/comp_prog | codeforces/edu/segment_tree_pt_1/step4/problemA/problemA.cpp | #include <bits/stdc++.h>
using namespace std;
#define lc(i) ((i) * 2)
#define rc(i) ((i) * 2 + 1)
// #define p(i) ((i) / 2)
typedef int64_t ll;
typedef ll item;
// struct item {
// ll seg, pref, suf, sum;
// };
/**
* @brief By convention, l and r mean the interval of the current node, while i and j mean the
*... | ALGO | 0.99997 | 5.964423 | {
"github_metadata": {
"branch": "main",
"commit_count": 529,
"repo_created_at": "2023-08-01T10:35: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": "5b67708f57... |
728fd7fc-bdb1-484f-bc6f-8116ff2eb839 | Anshnrag02/aglo-and-problem-solving | ccaug4.cpp | #include<bits/stdc++.h>
using namespace std;
int dp[]={0};
int factors(int x) {
int count=0;
int i = 1;
// This will loop from 1 to int(sqrt(x))
while(i*i <= x) {
// Check if i divides x without leaving a remainder
if(x % i == 0) {
count++;
// Handle the case ex... | ALGO | 0.999916 | 5.238859 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2020-12-10T16:47:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a652e171f46... |
8b006794-9ac1-48cb-a092-4153e90ff507 | alex-yang21/cs9f | proj3/exercise2/CLLNode.cpp | #include "CLLNode.h"
#include <iostream>
#include <cassert>
using namespace std;
/**
* Return the successor of the given node.
* Precondition: this != 0.
*/
CLLNode* CLLNode::next()
{
assert(this != 0);
assert(myPrevious != 0); // Consistency checks on circular list
assert(myNext != 0);
return myNex... | ALGO | 0.94341 | 5.308478 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2022-06-03T01:04: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": "51e1c50f6ff... |
09db1721-2a87-4fdc-9a03-c59bddd59a00 | Brais380/Practica14 | Codigo.ino | /*
Esta practica consistia en aprobechar un circuto ya hecho
anteriormente y condicionar la secuencia de encendido de sus
pilotos en este caso mediante un pulsador cuando dicho pulsador
este desactivado el sistema funcionara con normalidade haciendo
la secuencia programada, en caso de que este pulsado este
presion... | TOOL | 0.919405 | 5.442623 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-13T16:51: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": "9a85ebe46cc4... |
ce9d4712-b552-4394-a7a3-a0973778f988 | asimba/axis | src/packer.h | /***********************************************************************************************************/
//Базовая реализация упаковки/распаковки файла по упрощённому алгоритму LZSS+RLE+RC32
/***********************************************************************************************************/
#ifndef _PACKE... | TOOL | 0.905171 | 5.262354 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-07-07T12:58: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": "5f31c8c33... |
4083b71d-0920-4d10-8c9a-dc4d8ccaa436 | nikhraj/Leetcode | minimum-adjacent-swaps-to-reach-the-kth-smallest-number/minimum-adjacent-swaps-to-reach-the-kth-smallest-number.cpp | class Solution {
public:
int CountSteps(string s1, string s2, int size)
{
int i = 0, j = 0;
int result = 0;
// Iterate over the first string and convert
// every element equal to the second string
while (i < size) {
j = i;
// Find index element of first string which
... | ALGO | 0.999993 | 5.479204 | {
"github_metadata": {
"branch": "main",
"commit_count": 481,
"repo_created_at": "2021-03-14T11:05: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": "68bb2e6d1e... |
11034365-41a1-48e2-a874-dd6f132728cc | PurreCoder/competitive-programming | Yandex Trainings 5.0/Contest 3/A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <string>
#include <stack>
#include <iomanip>
#include "inttypes.h"
#include <sstream>
#include <climits>
using namespace std;
#define pb push_ba... | ALGO | 0.999949 | 3.581714 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2023-03-06T07:11: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": "98cda26212b... |
7e4eb381-7d42-48d0-b3f7-135c26297cc4 | mantle2048/leetcode-Weekly-competition- | 21_double_weekly/3二叉树中的最长交错路径.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 Solution {
public:
int ans = 0;
//dp[x][left/right] 当前节点x向左走和向右走的结点数
//f->left -> dp[x][right] 如果f向左走到达x则... | ALGO | 0.999753 | 4.500354 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2019-12-16T11:40:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "445835ccf... |
0ee2e004-232f-4464-9b91-0350fc82b74b | TheKillerAboy/programming-olympiad | C++_Solutions/Codeforces/Codeforces_Round/688/b-suffix-operations.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i_,a_) for(long long i_=0;i_<a_;++i_)
#define FORS(s_,i_,a_) for(long long i_=s_;i_<a_;++i_)
#define FORR(i_,a_) for(long long i_=a_-1;i_>=0;--i_)
#define FORI(i_,a_) for(long long i_=1;i_<=a_;++i_)
#define FORA(i_,a_) for(auto i_:a_)
#define FOR1(i_,a_) for(l... | ALGO | 0.999976 | 4.235154 | {
"github_metadata": {
"branch": "master",
"commit_count": 132,
"repo_created_at": "2019-04-28T12:13: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": "9753eaee... |
86933091-a887-4f50-a199-255f757c36a0 | giovanne05/empirico | Codes/main.cpp | #include "funcoes.h"
#include "tempo.h"
using namespace std;
int main()
{
long int size, numero;
int i, t;
ofstream f1,f2,f3,f4,f5,f6;
double m1 = 0 , x;
t = 100000000;
size = 4000000;
std::vector<long int> v;
v.reserve(t);
for( i = 0; i < t; i++)
{
v.push_back(i);
}
auto first = &(*v.begin())... | ALGO | 0.997304 | 3.623122 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2018-03-10T00:09:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75cd71d9a... |
5842f800-e300-4165-a13d-80f5a14e1865 | wnd-charm/wnd-charm | src/transforms/wavelet/wt.cpp | /*
Copyright (c) 2006 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute... | ALGO | 0.993219 | 4.310097 | {
"github_metadata": {
"branch": "master",
"commit_count": 480,
"repo_created_at": "2013-09-23T17:16:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 96,
"forks": 43,
"issues": 40,
"pull_requests": 1
},
"file_meta": {
"content_id": "4a9325... |
8d1a0b24-cdfc-4adb-a84e-bcda5d4fc1d2 | sunny-sk/leetcodesolutions | leetcode/easy/125-valid-palindrome.cpp | /*
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.
Given a string s, return true if it is a palindrome, or false otherwise.
Example ... | ALGO | 0.997847 | 5.808632 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-11-23T17:21: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": "96051d81e7e... |
df2908fb-cc6a-414a-b88f-5ca4cae64f54 | PhHerholz/CholUp | SupernodalCholesky.h | #pragma once
#include "SupernodalCholesky.h"
#include "SparseMatrix.h"
#include "Matrix.hpp"
#include "EliminationTreeMethods.h"
#include "SparseSupernodal.h"
#include "Ordering.h"
#include "Timer.hpp"
#include <vector>
#include <algorithm>
#include <array>
#include <thread>
#include <cstring>
//#define USE_EIGEN_FO... | ALGO | 0.999395 | 5.222283 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2019-01-31T12:24:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04a98d0d5... |
872deb42-c94a-4b5b-831e-4c9d39fcd3ba | webaverse-studios/webaverse | packages/engine-wasm/flod.cc | #include "flod.h"
#include "util.h"
#include <memory>
// #include <iostream>
inline void _floodFill(int x, int y, int z, int startFace, float *ether, int minX, int maxX, int minY, int maxY, int minZ, int maxZ, unsigned char *peeks, unsigned char *seenPeeks) {
std::unique_ptr<int[]> queue(new int[NUM_CELLS_OVERSCAN *... | ALGO | 0.980735 | 4.587646 | {
"github_metadata": {
"branch": "stable",
"commit_count": 18730,
"repo_created_at": "2023-01-16T15:04:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 64,
"forks": 24,
"issues": 55,
"pull_requests": 3
},
"file_meta": {
"content_id": "41cc... |
760327f5-de3b-4b01-98e3-1bb2156999ef | syedtanveer/DSA-Solutions | Dynamic-Programming/TILE.cpp | /*
* Problem URL: https://www.codechef.com/problems/TILE
*/
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define REP(i,n) FOR(i,0,(n)-1)
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
... | ALGO | 0.999955 | 4.6342 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-08-01T16:27:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01d668b3af... |
1e7bf14c-ead0-4d30-81f3-2930c18c341d | akmullane/GAIIN | monkey.cpp | /*Monkey Business
A local zoo wants to keep track of how many pounds of food each of
its three monkeys eats each day during a typical week. Write a program
that stores this information in a two-dimensional 3 × 5 array, wher
each row represents a different monkey, and each column represents
a different day of the ... | ALGO | 0.999435 | 4.338858 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2020-02-04T19:15: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": "2a344ac91003... |
da50461e-2711-4efd-9bfb-be5164e7059d | tokuma09/algorithm_problems | problems/chapter13/miiitomi/006.cpp | // https://qiita.com/drken/items/996d80bcae64649a6580#3-5-%E3%82%B5%E3%82%A4%E3%82%AF%E3%83%AB%E6%A4%9C%E5%87%BA
// https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_4_A&lang=jp
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
vector<bool> seen;
vector<bool> finished;
stack<int>... | ALGO | 0.999997 | 5.05576 | {
"github_metadata": {
"branch": "main",
"commit_count": 477,
"repo_created_at": "2021-06-05T10:22:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "a323b4936d... |
880cf908-29ad-4ccc-87fd-0115030b40e5 | marczakdaniel/Cpp-Course-University | zadanie2/f_glob.cpp | #include "f_glob.hpp"
#include <cmath>
#include <iostream>
bool double_equal(double w1, double w2) {
const double EPSILON = 0.000001;
if (std::abs(w1 - w2) < EPSILON) {
return true;
}
return false;
}
double odleglosc(Punkt p, Punkt q) {
return sqrt(pow(p.wsp_x() - q.wsp_x(), 2.0) + pow(p.w... | ALGO | 0.984285 | 5.035048 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-04-09T15:48: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": "bb3f9b07de36... |
03f0f4e1-a0b9-4677-8cf3-1556bd496c1f | chsjwarrior/Graph | Graph/FloydWarshall.cpp | #include "FloydWarshall.h"
//Constructor
FloydWarshall::FloydWarshall(const Graph& graph) noexcept(false) : graph(graph) {
costMatrix = new int* [graph.AMOUNT_VERTEXES];
predecessor = new unsigned int* [graph.AMOUNT_VERTEXES];
for (unsigned int i = 0; i < graph.AMOUNT_VERTEXES; ++i) {
costMatrix[i] = new int[gra... | ALGO | 0.999055 | 4.312837 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2022-03-13T22:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "76de78adc6... |
4b73f792-5bf2-4666-bc5d-ebf62a47c7a6 | Sanchit-100/DSA | Practice/rat_in_maze.cpp | #include <iostream>
using namespace std;
/*
Aim: Find a possible solution for the maze, if exists
*/
// arr is the given square matrix of safe and blcked positions
// soln is the answer matrix specifiying the path traversed with 1's
// x,y are the current coordinates
// n is the dimension of matrix
bool isSafe(int a... | ALGO | 0.999977 | 4.609659 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2023-12-21T15:53:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e26dddabf5... |
d010d567-9851-4cf7-9032-50dbf992baa9 | bajajvinamr/HacktoberFest2020 | Data Structures and Algorithms/Algorithms/Kadane.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int maxSubArraySum(int a[], int size)
{
int msf = INT_MIN, meh = 0;
for (int i = 0; i < size; i++)
{
meh = meh + a[i];
if (msf < meh)
msf = meh;
if (meh < 0)
meh = 0;
}
... | ALGO | 0.99998 | 4.943467 | {
"github_metadata": {
"branch": "master",
"commit_count": 1219,
"repo_created_at": "2020-09-30T23:47:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 156,
"forks": 682,
"issues": 10,
"pull_requests": 519
},
"file_meta": {
"content_id": "... |
48e89c15-cc64-4c87-819e-7b50b50518d8 | AnilVadthyavath/dsa-daily-log | Mathematics/007-Check-for-Prime/Check-for-Prime.cpp | // naive
class Solution {
public:
bool isPrime(int n) {
if (n <= 1) return false;
for (int i = 2; i < n; i++) {
if (n % i == 0)
return false;
}
return true;
}
};
//Efficient Prime Check Code:
class Solution {
public:
bool isPrime(int n) {
... | ALGO | 0.999869 | 5.175285 | {
"github_metadata": {
"branch": "main",
"commit_count": 146,
"repo_created_at": "2025-06-09T19:17: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": "d368c69b2c... |
72e3f7e6-7d50-4045-8a31-ba8e6aadf58c | joejq/IoTJ-EHCS-TSRA-LSNSGA | ls_nsga/core.hpp | /**
* author: <NAME>
* date: 2025.01.02
*
* Specific functions for NSGA-II
**/
#ifndef CORE_H
#define CORE_H
#include <memory.h>
#include <time.h>
#include <float.h>
#include <algorithm>
#include <vector>
#include <map>
#include <stack>
#include "../model.hpp"
#include "../iofile.hpp"
#include "utility.hpp"
#inc... | ALGO | 0.999993 | 5.260203 | {
"github_metadata": {
"branch": "main",
"commit_count": 71,
"repo_created_at": "2025-05-01T07:17: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": "c3ecd0475fb... |
9a413d1e-1ead-4779-8bdd-d7bf0c85d311 | dougnobrega/CodeForces | gym/2019 ICPC Malaysia National/C.cpp | #include <bits/stdc++.h>
using namespace std;
// Prioridade
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpi;
typedef vector<pll> vpll;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define RE... | ALGO | 0.999805 | 3.429343 | {
"github_metadata": {
"branch": "master",
"commit_count": 193,
"repo_created_at": "2020-03-06T22:18: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": "ad91a158... |
9fa8ae4c-34e5-4c2b-b941-0967b48d7e3c | vnovakov/contest-solution | archive/539.cpp | /* @JUDGE_ID: 3207EZ 539 C++ */
#include <iostream.h>
int e, v;
int matrix[25][25];
int curr, visit[25];
int longest(int u)
{
int max = 0, back, pmax, i;
for (i = 0; i < v; i++)
if (matrix[i][u])
{
back = matrix[i][u];
matrix[i][u] = 0;
matrix[u][i] = 0;
curr++;
visit[curr] = i;
pmax = longes... | ALGO | 0.999878 | 4.56681 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2015-07-08T01:46: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": "de7d19630... |
a9aab124-5535-4591-b36f-e3226db5494b | gfg-course/dsa-hyd-1 | class-8/combinationSum.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* T(n, target) = T(n - 1, target) + T(n, target - X) where X is the avg of input elements.
* AS: O(2^d) where d = max(N, target).
* */
void getCombinationsWithSumUtil(vector<int> &arr, int index, int target, vector<int> ¤t,
vect... | ALGO | 0.999912 | 5.298372 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2025-02-02T05:00:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85d9eb9ce0a... |
e29f87d7-7d7e-4f89-b902-fb5c969a28dc | agatha197/3-1 | C++/scoville.cpp | #include <string>
#include <vector>
#include <iostream>
#define MAX_ELEMENTS 1000000
using namespace std;
class element {
private:
int key;
public:
element() { key = -1; };
element(int val) { key = val; };
int getKey () const { return key; };
};
class minHeap {
private:
int n = 0;
element he... | ALGO | 0.99991 | 4.701635 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-10T12:07: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": "9977690e17... |
44bbc3a1-58f4-4194-84b8-e5ddaef8acc6 | jocagos/competitive | ACM-ICPC/training/H.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int a, b, tc, ans = 0;
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> tc;
long double c2(log10( 2 )), c5(log10(5)); // 2^a * 5^b = log10( 2^a * 5^b ) = log10( 2^a ) + log10( 5^b ) = a * log10( 2 ) + b * log10( 5 )
while( tc -- ... | ALGO | 0.999442 | 4.922991 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2017-03-07T15:42: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": "49c6cd52... |
ebff4d35-7ddd-436e-8176-107f9ca10180 | yasmeendao18/CS3520Spring2023-CPP | exercises/pa7_debug/3dmatrix.cpp | // Program to read 3-dimensional matrix and display the elements as 1x3N matrix
// TODO
// initize matrix using update_3d method (see comments below)
// display method must not be able to modify array elements (update the code as needed)
// display method must use a single loop/iterator to print the entire array with a... | ALGO | 0.991922 | 3.018677 | {
"github_metadata": {
"branch": "main",
"commit_count": 160,
"repo_created_at": "2025-04-28T03:18: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": "c5c28f0aeb... |
2e2eb6d6-361f-458e-a39e-751ec1d043ad | cosmicray001/academic | problem_solving/Gym/102254G/21239743_AC_139ms_5100kB.cpp | #include <bits/stdc++.h>
#define le 100005
using namespace std;
int n[le];
struct eg{
int sum, maxx, minn;
};
eg arr[4 * le];
eg com(eg a, eg b){
eg temp;
temp.sum = a.sum + b.sum;
temp.maxx = max(a.maxx, b.maxx);
temp.minn = min(a.minn, b.minn);
return temp;
}
void init(int nd, int b, int e){
if(b == e){... | ALGO | 0.999882 | 4.760086 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-04-11T01:01:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2163fb6ba... |
c71c48d0-bc21-49cc-ad18-c26785d34301 | onkar2405/DSA | Strings/AnagramCheck.cpp | #include <iostream>
#include <unordered_map>
using namespace std;
bool checkIsAnagramWithMap(string str1, string str2)
{
if (str1.length() != str2.length())
{
return false;
}
unordered_map<char, int> map1;
unordered_map<char, int> map2;
for (int i = 0; i < str1.size(); i++)
{
map1[str1[i]]++;
... | ALGO | 0.999935 | 5.687063 | {
"github_metadata": {
"branch": "master",
"commit_count": 98,
"repo_created_at": "2024-09-25T18:18: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": "a4f84692c... |
68cf2463-bdb8-4c37-b943-420943e4b663 | ICraZZyBoY/Algorithms-Trainings | UNIVERSITY (ICPC, codeforces, contests, etc.)/11.03.2024div3/D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n, m, x;
cin >> n >> m >> x;
set <int> indexes;
indexes.insert(x);
for (int i = 0; i < m; ++i)
... | ALGO | 0.999835 | 3.735202 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-13T11:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4736252a388b... |
169100ad-6cd8-4766-9d3b-668075acf5d9 | bansilal-dot/010101 | N Queens.cpp | #include <iostream>
#include <vector>
using namespace std;
bool isSafe(vector<vector<int>> &board, int row, int col, int n) {
for (int i = 0; i < row; i++)
if (board[i][col])
return false;
for (int i = row, j = col; i >= 0 && j >= 0; i--, j--)
if (board[i][j])
return fa... | ALGO | 0.999982 | 5.772265 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-11-26T15:46: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": "1ea2049f3f9... |
7b16e60f-8346-4297-8b95-d84e3b067145 | VittalT/USACO-Solutions | Gold/February 2020, Gold/February 2020, Gold P1/February 2020, Gold P1/main.cpp | /*
NAME: <NAME>
TASK: timeline
LANG: C++11
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include <cstring>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <climits>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include... | ALGO | 0.99999 | 4.443035 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2021-02-02T05:27:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f7d2b0c2ddc... |
e02d20ea-101a-47e8-9eb3-f8714cc52b12 | yzcmf/Lintcode_Classify | Linkedlist/166_nth-to-last-node-in-list/nth-to-last-node-in-list.cpp | /*
@Copyright:LintCode
@Author: yzcmf
@Problem: http://www.lintcode.com/problem/nth-to-last-node-in-list
@Language: C++
@Datetime: 16-06-20 05:32
*/
/**
* Definition of ListNode
* class ListNode {
* public:
* int val;
* ListNode *next;
* ListNode(int val) {
* this->val = val;
* t... | ALGO | 0.999847 | 6.090397 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2016-09-10T09:27:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d86a2a6c6... |
2c1604e2-ce01-4578-a758-10631ac65e36 | Syntact1cSugar/DSA-Trees | InfixToExpressionTree.cpp | #include<iostream>
#include<stack>
//Declaration of expression tree node
class Node
{
public:
Node *left,*right;
char symbol;
Node(char symbol=' ',Node* left=NULL,Node* right=NULL)
{
this->symbol = symbol;
this->left = left;
this->right = right;
}
};
//Tree Traversal
void preorder(Node* root)
{
if... | ALGO | 0.999982 | 4.404097 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-12-21T13:53: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": "ccc892d53742... |
7908fb93-08d4-4461-892d-65ab3c447d5e | guoyingxx/Data-Structure-Homework | 520021911235_2_6/520021911235_2_6/Linklist.h | #include <iostream>
#ifndef _Linklist_h
#define _Linklist_h
using namespace std;
template<class T>
class list
{
public:
virtual void clear()=0;
virtual void insert(int i,const T&x)=0;
virtual void inverse()=0;
virtual T visit(int i)const=0;
virtual void tranverse()const=0;
virtual ~list() {}
};... | ALGO | 0.997615 | 3.915539 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-01-16T15:34: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": "c320026c3caf... |
7cb00cbf-196e-4ebe-88a9-2dade72e5b50 | ldx027/competition | luogu/p2058海港.cpp | #include <iostream>
#include <queue>
#include <utility>
using namespace std;
int nations[1000000] = { 0 };
int main()
{
ios::sync_with_stdio(0);
int N;
cin >> N;
int ans = 0;
queue<pair<int, long long>> que;
for (int i = 0; i < N; i++)
{
int t, k, x;
cin >> t >> k;
w... | ALGO | 0.999613 | 3.467156 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2024-03-15T12:52:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81e6175d54... |
7c2a497d-e617-46d0-8d4b-1d0a0bca02e4 | earthkc/MiniCamelot_AB-Prune | MiniCamelot_AB-Prune/main.cpp | //
// main.cpp
//
// Mini Camelot
//
//
#include <iostream>
#include <string>
#include <vector>
#include "moveValid.hpp"
#include "BoardClass.hpp"
#include "PlayerClass.hpp"
#include "precaptureCheck.hpp"
#include "commitMove.hpp"
#include "winCon.hpp"
#include "compAction.hpp"
using namespace std;
bool xInputCheck... | ALGO | 0.998092 | 4.847845 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-04-08T20:42: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": "d41b008d3b... |
bc243ff0-9e82-424f-8b68-bac88fc1ef68 | Nikloudy11/Nba-simple-database | main.cpp | #include <iostream>
#include <map>
#include <string>
using namespace std;
// Function to get the player for a specific position and team
string getPlayer(const map<string, map<string, string>>& nbaTeams, const string& team, const string& position) {
if (nbaTeams.find(team) != nbaTeams.end()) { // Check if the spe... | TOOL | 0.914532 | 5.480335 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-24T00:41: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": "a4c6ed18081b... |
c59c9646-2f2e-46d0-846c-aea78a7bd8af | psj01/PersonalProjects | NixonsProject/LetsDoDis/LetsDoDis/chap1.cpp | #include <iostream>
#include <conio.h>
using namespace std;
void fillTable(int table[4][25]);
void displayTable(int table[4][25]);
int selection_sort(int numbers[], int size);
int main()
{
int mins[4][25]; //creates a 4*25 matrix which will store the mins it will take for each job.
fillTable(mins); // f... | ALGO | 0.99951 | 3.3261 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2014-08-26T00:51: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": "8fe7db1a3... |
a35cfd6c-b983-4a02-91c8-1c403f06250d | Sebastian33/hashes | sha3.cpp | #include"sha3.h"
#include<stdlib.h>
#include<cstring>
#include<iostream>
const int l(6);
const int rnds(12 + 2 * l);
#define THETA {\
tmpbuf[0] = vectorState[0] ^ vectorState[5] ^ vectorState[10] ^ vectorState[15] ^ vectorState[20]; \
tmpbuf[1] = vectorState[1] ^ vectorState[6] ^ vectorState[11] ^ vectorState[16] ^... | ALGO | 0.984626 | 4.277729 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-12-01T15:37: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": "c978fbf4fb... |
12e3077d-26ec-44cf-b038-987eee311470 | ethz-asl/ethzasl_sensor_fusion | ssf_core/include/ssf_core/eigen_utils.h | /*
Copyright (c) 2010, <NAME>, ASL, ETH Zurich, Switzerland
You can contact the author at <stephan dot weiss at ieee dot org>
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... | TOOL | 0.974747 | 6.480531 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2012-05-09T21:05:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 334,
"forks": 162,
"issues": 30,
"pull_requests": 0
},
"file_meta": {
"content_id": "4afa8... |
d1c84ab8-7297-4567-bc2d-b5686f93598a | detectivemark7/aprg | AprgAlgebra/AprgAlgebra/src/Algebra/Solution/Solver/NewtonMethod.cpp | // In numerical analysis, Newton's method, also known as the Newton–Raphson method, named after <NAME> and Joseph
// Raphson, is a root-finding algorithm which produces successively better approximations to the roots (or zeroes) of a
// real-valued function.
#include "NewtonMethod.hpp"
#include <Common/Math/Helpers/S... | ALGO | 0.99998 | 6.292554 | {
"github_metadata": {
"branch": "main",
"commit_count": 687,
"repo_created_at": "2021-08-07T08:34: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": "ffd45d324c... |
3e6a9a32-bd9d-4305-a255-2913a09d84d5 | ANTsX/ANTs | Temporary/itkMeanSquaresPointSetToPointSetIntensityMetricv4.hxx | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* h... | ALGO | 0.92202 | 6.37454 | {
"github_metadata": {
"branch": "master",
"commit_count": 5130,
"repo_created_at": "2013-01-23T15:43:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1332,
"forks": 389,
"issues": 88,
"pull_requests": 3
},
"file_meta": {
"content_id": "b2... |
06379aba-225b-4fa2-bc28-251ae317b4d4 | ddyj/LearingCoding | leetcode热题100/热题100/链表/27-34_归并排序.cpp | /*
21. 合并两个有序链表
将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。
输入:l1 = [1,2,4], l2 = [1,3,4]
输出:[1,1,2,3,4,4]
*/
/*
穿针法解释
从两个链表中元素出发 res依次指向两个list中的小数
如果list1中数小 则res->next = list1 同时 list1 = list1->next 交叉式的将两个链表串起来
1 2 4 2 4
res --> res - 1
1 2 3 ... | ALGO | 0.999559 | 5.249866 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-07-22T13:49:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9db1d388c8e... |
9ebfdc8b-e679-476d-b891-80484fe14ca5 | bglima/PAA | 13_UVA908_ComputerSites/uva908.cpp | #include<bits/stdc++.h>
using namespace std;
struct edge {
int from, to;
int cost;
};
struct compareEdge {
bool operator()(edge const & e1, edge const & e2) {
// check if "e1" has smaller dist than "e2"
return e1.cost > e2.cost;
}
};
vector<int> sets;
int n, // Number of computer sit... | ALGO | 0.999659 | 3.916427 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2017-01-18T01:08: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": "e99f835ad... |
b8ab31ea-37b9-4df6-95f3-ced56700de9b | binpash/aggregators | cpp/common/main.cpp | #include "main.h"
#include "agg.h"
#include <algorithm>
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include <unistd.h>
#include <tuple>
[[noreturn]] void nyi_error(const char* message) noexcept
{
std::cerr << "Not yet implemented error: " << message << '\n';
exit(EXIT_FAILURE);
}
s... | TOOL | 0.986106 | 4.894783 | {
"github_metadata": {
"branch": "main",
"commit_count": 226,
"repo_created_at": "2023-02-18T23:21:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 2,
"pull_requests": 2
},
"file_meta": {
"content_id": "009b0236e0b... |
6dccfaa6-4280-4526-a29f-81a802685a84 | ishandutta2007/codeforces-nonalphabetic | 353cerega/normal/1326/D2.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define X first
#define Y second
ll mod = 1000000007;
ll gcd(ll a, ll b)
{
if (a==0 or b==0) return a+b;
return gcd(b,a%b);
}
ll sum(ll a, ll b)
{
a += b;
a %= mod;
//if (a >= mod) a -= mod;
return ... | ALGO | 0.999997 | 4.213545 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c88b3d18374d... |
0f33aaf4-648e-4a33-892a-3b61fad22ac1 | ishandutta2007/codeforces-m | merkurev/normal/541/C.cpp | #include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <set>
#include <map>
#include <cassert>
#include <numeric>
#include <string>
#include <cstring>
using namespace std;
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif
typedef long ... | ALGO | 0.999961 | 3.497339 | {
"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": "d1e21115af5e... |
3ed36a51-42df-4bee-8ef3-fa36ef9f866d | liugaolian/gordon_cnn | include/armadillo_bits/spop_diagmat_meat.hpp | // Copyright 2008-2016 <NAME> (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.or... | ALGO | 0.962538 | 6.339898 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-02-25T15:21:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 244,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59626a2... |
6e0dd596-85e7-4005-83e8-6ecbb90dd3ac | hadiuzzaman83/C_Plus_Plus_Practice | Array_2D_array_addition_subtraction.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int r,c;
cout<<"Enter the number of row and column of Matrix: ";
cin>>r>>c;
int M[r][c];
int N[r][c];
int A[r][c];
int S[r][c];
cout<<"Enter the value of M Matrix"<<endl;
for(int i=0;i<r;i++){
if(i==0){
cout... | ALGO | 0.999635 | 4.489334 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2021-02-07T22:14: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": "313f533c9b9... |
f1b8108c-c3c1-4870-8398-f35238eaf1b7 | Iris-Lien/109-2-Algorithm | week4 The closest pair problem/Untitled1.cpp | #include<iostream>
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
using namespace std;
class point
{
public:
double x,y;
};
point P[10004];
bool cmp( point a, point b )
{
return a.x < b.x;
}
double dist( point a, point b )
{
return sqrt((a.x-b.x)*(a.x-b.x)... | ALGO | 0.998865 | 3.566853 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-03-29T16:41: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": "e069f27f16... |
d78a7754-17b1-4701-aef0-0b3bfe7c8938 | luckoo1/algorithm | CPP/BOJ/BOJ_3_1.미세먼지안녕.cpp | /*
동시사건을 잘알자
1.미세먼지가 확산된다. ★확산은 미세먼지가 있는 모든 칸에서 동시에 일어난다.
(r, c)에 있는 미세먼지는 인접한 네 방향으로 확산된다.
인접한 방향에 공기청정기가 있거나, 칸이 없으면 그 방향으로는 확산이 일어나지 않는다.
확산되는 양은 Ar,c/5이고 소수점은 버린다.
(r, c)에 남은 미세먼지의 양은 Ar,c - (Ar,c/5)×(확산된 방향의 개수) 이다.
2. 공기청정기가 작동한다.
공기청정기에서는 바람이 나온다.
위쪽 공기청정기의 바람은 반시계방향으로 순환하고, 아래쪽 공기청정기의 바람은 시계방향으로 순환한다.
바람이 불면 ... | ALGO | 0.999898 | 4.289179 | {
"github_metadata": {
"branch": "master",
"commit_count": 333,
"repo_created_at": "2021-08-28T05:10: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": "ce4e472f... |
4bcb0350-70bb-4ca0-8dd3-afe86d9e01da | geeteshydv/PlacementPreparationModule | Tower Of Hanoi - GFG/tower-of-hanoi.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// You need to complete this function
// avoid space at the starting of the string in "move disk....."
long long toh(int n, int A, int B, int C) {
// Your code here
... | ALGO | 0.999884 | 5.121639 | {
"github_metadata": {
"branch": "main",
"commit_count": 621,
"repo_created_at": "2022-09-29T10:51:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3003cd007f... |
2ff64856-b318-43b4-9a8b-7294f3717117 | dillonwu-97/competitive_programming | codeforces/codeforces-round-701/replace-and-keep-sorted.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <queue>
#define ul unsigned long long
#define sl signed long long
# define pii pair<int, int>
#define f first
#define s second
#define aloop(b, a) for (auto &a: b)
#define rloop(a, b, i) for (int i = a; i < b... | ALGO | 0.999904 | 4.338855 | {
"github_metadata": {
"branch": "master",
"commit_count": 239,
"repo_created_at": "2020-05-13T22:20: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": "4d34224f... |
af1c5b09-c0fa-4ed5-8832-9fd2f2cbddfb | martin-carrasco/online-judge-solutions | codechef/COOK124B/HIRINGWO.cpp | #include "bits/stdc++.h"
using namespace std;
const int MAXN = 1e6;
const int MAXV = 1e3;
long long k, x;
deque<long long> trial_division1(long long n) {
deque<long long> factorization;
for (long long d = 2; d * d <= n; d++) {
while (n % d == 0) {
factorization.push_back(d);
n ... | ALGO | 0.999951 | 4.575641 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-08-15T16:13: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": "bccc094d62... |
554beaf6-9c07-4fb4-a20c-92d7fec209bf | ksushant881/Data-Structures-and-Algorithms | LEETCODE/next_permutation.cpp | #include <bits/stdc++.h>
using namespace std;
#define pi 3.1415926536
#define ll long long int
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// Find the largest index k such that nums[k] < nums[k + 1]. If no such index exists, just reverse nums and done.
// Find the large... | ALGO | 0.999989 | 4.655841 | {
"github_metadata": {
"branch": "main",
"commit_count": 407,
"repo_created_at": "2021-04-16T19:43:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b83a670c8e... |
1ff2a165-8e3d-477b-aa12-c4441e756064 | gustavotoyota/competitive | URI 1066 - Even_ Odd_ Positive and Negative.cpp | /*---------------------------------------------*\
| <NAME> - 02/11/2016 |
| URI 1066 - Even, Odd, Positive and Negative |
\*---------------------------------------------*/
#include <iostream>
#include <vector>
using namespace std;
int main() {
int value;
int evens = 0;
int odds = 0;
... | ALGO | 0.999737 | 4.840353 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2016-10-27T19:05:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "214afe805... |
82b126e8-4f02-49ce-93af-4e9dcf101a71 | alexandraback/datacollection | solutions_2449486_0/C++/AlexLin/B.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;
//{{{Commonly used macro
//-----------------------By cylixstar-----------------------//
#define REP(i, n) for (int n_##__LINE__= (n), ... | ALGO | 0.999913 | 3.743952 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88811153f... |
98f94607-0871-41ed-a63d-5bb757036963 | DiffeoInvariant/Data-Assimilation | enkf/include/enkf.hpp | #ifndef ENKF_HPP
#define ENKF_HPP
#include <Eigen/Core>
#include <Eigen/Dense>
#include <Eigen/Cholesky>
#include <vector>
#include <functional>
#include <utility>
#include <cassert>
#include <random>
#include <cmath>
#include <iostream>
namespace fastmath
{
using Vec = Eigen::VectorXd;
using Mat = Eigen::MatrixX... | ALGO | 0.980477 | 6.776564 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-08-28T17:31: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": "892ef01153... |
9ecbb9db-05ee-4034-9b68-f726e28ff440 | stanleyshen2003/NYCU-CS-HW | 人工智慧總整與實作/hw2/code/game_2/team32_agent2.cpp | /*
teamID: 32
team name: 廢羊羊
group members:
109350008 張詠哲
110705013 沈昱宏
*/
#include "./STcpClient.h"
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include "./mcts_yz.h"
// Create MCTS agent
MCTS_agent game2_agent;
/*
選擇起始位置
選擇範圍僅限場地邊緣(至少一個方向為牆)
return: init_pos
i... | ALGO | 0.997219 | 3.359992 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-06-12T03:25:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b71e78f09d... |
c197b172-1791-4077-a40f-a76f8194a2aa | bradyz/sandbox | codeforces/455/bordeommap.cpp | #include <map>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main () {
int a;
int tmp;
int x = 0;
int max = 0;
map<int, int> my_map;
cin >> a;
for(int x = 0; x < a; x++) {
cin >> tmp;
my_map[tmp] += 1;
}
map<int, int>::iterator it;
map<int, int>::it... | ALGO | 0.999956 | 3.62543 | {
"github_metadata": {
"branch": "master",
"commit_count": 1569,
"repo_created_at": "2014-06-28T00:29:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d2a2d6... |
848bdb1f-0438-4122-aa65-ce7cb5c68211 | alibaba/x-deeplearning | blaze/blaze/graph/pattern/in_parallel/parallel_split_unary_fusion_pattern_impl.cc | /*
* \file parallel_split_unary_fusion_pattern_impl.cc
* \brief The parallel split unary fusion pattern.
* Such as: Split->Softmax/Softmax/Softmax/... -> Softmax/Split
*/
#include "blaze/graph/pattern/in_parallel/parallel_split_unary_fusion_pattern_impl.h"
#include <sstream>
namespace blaze {
void ParallelSplit... | ALGO | 0.937127 | 7.10641 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2018-12-12T08:18:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4292,
"forks": 1029,
"issues": 112,
"pull_requests": 15
},
"file_meta": {
"content_id": "a... |
179d11f4-542d-4c89-a669-2625a376f8ea | okovtun/BD_122 | Functions/Arrays/main.cpp | #include<iostream>
#include<ctime>
using namespace std;
const int ROWS = 8;
const int COLS = 5;
void FillRand(int arr[], const int n);
void FillRand(double arr[], const int n);
void FillRand(int arr[ROWS][COLS], const int ROWS, const int COLS);
void Print(int arr[], const int n);
void Print(double arr[], const int n... | ALGO | 0.999142 | 4.463674 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2021-05-11T14:10:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9da1493cc... |
fc79b5db-3aa5-47d5-b1f6-9189d33d1c36 | engerlab/OpenTPS-brachyutils | opentps_core/opentps/core/processing/doseCalculation/photons/CCC_DoseEngine/raytrace.cpp | /* C_RAYTRACE.C ***************************************************************/
#include "defs.h"
extern char errstr[200]; // error string that all routines have access to
int raytrace(FLOAT_GRID *electron_density_grid,FLOAT_GRID *radiological_depth_grid,
POINT point1,POINT point2)
/*
-----------------... | ALGO | 0.999873 | 4.494565 | {
"github_metadata": {
"branch": "master",
"commit_count": 2705,
"repo_created_at": "2024-12-11T18:42:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8de0051... |
b4299611-1859-45cd-b5a8-bc72faafd25d | DanLip02/HPC_HSE | Cuda/gemm_unified_mem.cpp | #include <cuda_runtime.h>
#include <iostream>
const int N = 1024;
const int TILE_SIZE = 32;
__global__ void matrixMultiply(const double *A, const double *B, double *C, int N) {
int row = blockIdx.y * blockDim.y + threadIdx.y;
int col = blockIdx.x * blockDim.x + threadIdx.x;
double sum = 0.0;
if (row... | ALGO | 0.999042 | 5.350423 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-10-07T14:34:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "377e2a72dbf... |
12dcccda-73cc-46ec-aa62-ad0844285c46 | FAU-LMS/vvc-extension-mpa | source/Lib/CommonLib/InterPrediction.cpp | /* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2021, ITU/ISO/IEC
* All rights reserve... | ALGO | 0.941812 | 6.054932 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-06-22T09:23:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bef68d1e1447d... |
867fc454-7782-4e46-845d-cb99c36aa06c | XabierFernandez/MyCppProjects | Edit_Distance/edit_distance.cpp | #include <iostream>
#include <string>
#include <bits/stdc++.h>
using namespace std;
int min(int x, int y, int z) { return min(min(x, y), z);}
int edit_distance(const string &str1, const string &str2) {
//write your code here
if(str1.empty()) return str2.size();
if(str2.empty()) return str1.size();
/* If las... | ALGO | 0.999991 | 4.649311 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2021-12-18T10:58: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": "7e3b198b8a4... |
61390226-f84e-458f-9e21-ee2710cceaee | 2010727302/Algorithm-Experiment2020 | 实验1/01backpack.cpp | #include<bits/stdc++.h>
#define debug(a) cout<<#a<<"="<<a<<endl
using namespace std;
const int N=110;
int n;//物品总个数
int b;//背包承重
int nos;//最优子集的物品数量
int t[50];
int sum_v = 0, sum_w = 0;
vector<int>ans;//记录该子集的物品编号及重量
int w[N],v[N],flag[N];
int res;
//记录当前子集
int record(int sum_v)
{
int i;
int count = 0;
res = sum_v;
... | ALGO | 0.999987 | 3.456555 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-07-01T10:37: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": "45a62176d137... |
35ad32c2-c260-4073-900d-5d7ce1c6881e | JJJackZhen/leetcode-workspace | 30.substring-with-concatenation-of-all-words.cpp | /*
* @lc app=leetcode id=30 lang=cpp
*
* [30] Substring with Concatenation of All Words
*/
class Solution {
public:
vector<int> findSubstring(string s, vector<string>& words) {
vector<int> res;
if(s.length() == 0 || words.size() == 0) return res;
unordered_map<string, i... | ALGO | 0.998828 | 6.100756 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-07-04T14:45: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": "d4eed21af3... |
ab4ea5f6-e0e0-441b-a9a7-1c92594ef9f8 | mdmahafuzur47/youKnowWho-Problems | PH/Algorithm/Graph/BFS/bfs.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
vector<int> adj[N];
bool visited[N];
int level[N];
void bfs(int s)
{
queue<int> q;
q.push(s);
visited[s] = true;
level[s] = 0;
while (!q.empty())
{
int u = q.front();
q.pop();
cout << u << " ";
... | ALGO | 0.999952 | 3.833669 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2024-08-01T15:45: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": "e143c6ebdf5... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.