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 |
|---|---|---|---|---|---|---|---|
0629ef3e-619a-432f-ac71-2d21e0459840 | muhammadhasan01/cp | Online Judge/Codeforces/Contests/DIV1/DIV1-633/A.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int tc;
int n;
long long a[N], b[N];
bool can(int x) {
for (int i = 1; i <= n; i++) {
b[i] = a[i];
}
long long addz = (1LL << x) - 1;
b[n] += addz;
for (int i = n - 1; i >= 1; i--) {
if (b[i] > b[i + 1]) return ... | ALGO | 0.999774 | 4.882928 | {
"github_metadata": {
"branch": "master",
"commit_count": 1187,
"repo_created_at": "2019-07-13T15:49:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "335bdcd... |
83f3f7e1-80a5-455b-ad1a-e54c06dc2873 | pduta/aads | bellmonford.cpp | // Question 4. Write a program to implement the Bellman-Ford algorithm to find the shortest paths
from a given source node to all other nodes in a graph.
#include <iostream>
#include <climits>
using namespace std;
struct Node {
int data;
int weight;
Node* next;
Node(int ele, int Weight) {
... | ALGO | 0.999987 | 4.899039 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-11-28T18:26: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": "4e929bedc12d... |
d337c164-055d-45ae-9e40-1d58cf2e05e6 | chouchoudiudiu/LeetCode | src/605.Can_Place_Flowers.cpp | class Solution {
public:
bool canPlaceFlowers(vector<int>& flowerbed, int n) {
int cnt = 0;
for(int i = 0; i < flowerbed.size() && cnt < n; ++i) {
if(flowerbed[i] == 0) {
int prev = i == 0 ? 0 : flowerbed[i - 1];
int next = i == flowerbed.size() - 1 ? 0 :... | ALGO | 0.999996 | 6.137161 | {
"github_metadata": {
"branch": "master",
"commit_count": 1202,
"repo_created_at": "2016-11-02T19:56: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": "fa65990... |
a947b2c2-c2af-4210-8370-c969ada607d6 | zzlcoding/vcpkg | toolsrc/include/vcpkg/base/system.h | #pragma once
#include <unordered_map>
#include <vcpkg/base/files.h>
#include <vcpkg/base/optional.h>
#include <vcpkg/base/strings.h>
namespace vcpkg::System
{
fs::path get_exe_path_of_current_process();
struct CMakeVariable
{
CMakeVariable(const CStringView varname, const char* varvalue);
... | TOOL | 0.965879 | 6.992709 | {
"github_metadata": {
"branch": "master",
"commit_count": 7069,
"repo_created_at": "2019-01-15T01:30:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb4f2cf... |
3ff8e54d-217b-415f-b688-8e5fa7ffbec9 | ardRiriy/cp-libs | atcoder/abc365/src/bin/c.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i, s, n) for (int i = (s); i < (n); i++)
#define P pair<int, int>
#define V vector<int>
#define M map<int, int>
#define S set<int>
#define mp(a, b) make_pair(a, b)
const int INF = 1e9;
int ma... | ALGO | 0.999967 | 3.523266 | {
"github_metadata": {
"branch": "main",
"commit_count": 699,
"repo_created_at": "2024-02-03T20:19:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "965fb6d58a... |
5115e6dc-577c-42bd-8c40-843128a7116e | xarray/osgverse | 3rdparty/imgui/implot_items.cpp | // MIT License
// Copyright (c) 2020 <NAME>
// 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, p... | TOOL | 0.945697 | 5.32913 | {
"github_metadata": {
"branch": "master",
"commit_count": 733,
"repo_created_at": "2022-12-21T11:43:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 197,
"forks": 37,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "6080c... |
e55659cb-7008-4358-a03d-476287bee25a | catlover018/cpp | vnoi/nkracing.cpp | // cre: <NAME> - Train VOI 2024
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define debug(x) { cerr <... | ALGO | 0.999986 | 5.222802 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-11-30T02:27: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": "0c091b5e59e... |
0fd221db-e052-409d-a25c-765e37d17431 | always0108/ACM | 2020-SE/6/E.cpp | /*************************************************************************
> File Name: EE.cpp
> Author:<NAME>
> Mail:<EMAIL>
> Created Time: 六 10/17 16:49:54 2020
************************************************************************/
#include <iostream>
#include <queue>
using namespace std;
int used[654322]... | ALGO | 0.999951 | 3.348408 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2017-07-31T02:37:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5476ca90... |
4cc95beb-ed6e-4c6f-9ad3-860ce25c5816 | Anupam-USP/CP | Challenges/Divide and conquer/roses.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define fo(i, n) for (int i = 0; i < n; i++)
#define fok(i, k, n) for (i = k; i < n; i++)
#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define MOD 1000000007
#define endl "\n... | ALGO | 0.999972 | 4.02442 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-05-11T05:38: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": "25991b1512a... |
81573e78-e2cd-48d0-bea2-62da4f3cc976 | huyl1502/AssignmentTTKT | Assignment1/Bai4/Bai4/Bai4.cpp | #include <iostream>
#include <algorithm>
using namespace std;
bool checkCondition(int n, int m, int n1, int m1) {
if (n < 1 || n > 1000 || m < 1 || m > 1000 || n1 < 1 || n1 > 1000 || m1 < 1 || m1 > 1000)
return false;
}
int main()
{
int n, m, n1, m1;
do {
cout << "Nhap n: ";
cin ... | ALGO | 0.998606 | 3.536911 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-11-09T06:01: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": "fa304e9d3... |
5d12e6ce-9784-4186-b456-19b99f18da43 | uofuseismo/uLocator | testing/halfSpaceUtilities.hpp | #ifndef HALF_SPACE_UTILITIES_HPP
#define HALF_SPACE_UTILITIES_HPP
#include <map>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <limits>
#include "uLocator/arrival.hpp"
#include "uLocator/station.hpp"
#include "uLocator/position/wgs84.hpp"
#incl... | ALGO | 0.991051 | 5.310298 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2023-10-11T19:17:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4daead0d6c4... |
b0880e68-d783-4ee0-88b2-63864d54ab89 | kakanghosh/algorithms | STL/stack.cpp | #include <iostream>
#include <stack>
#include <queue>
using namespace std;
int main()
{
stack<int> *myStack = new stack<int>;
queue<int> *myQueue = new queue<int>;
int n = 6;
/*
for(int i = 1; i < n; i++){
cout << i << " pushed into the stack!" << endl;
myStack->push(i);
}
... | ALGO | 0.973916 | 3.847765 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-11-08T19:38: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": "72d56cb021... |
cbd915fc-2c8d-46de-8889-770a25e5810f | claytonjwong/competitive-programming | 2_correctness_first/4_expression_evaluation/main.cpp | #include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>
using namespace std;
int main() {
string s; cin >> s;
auto getNums = [&](string t = {}, vector<int> nums = {}) {
transform(s.begin(), s.end(), back_inserter(t), [](auto c) {
... | ALGO | 0.999926 | 4.465392 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2020-03-19T22:52:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 14,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91086884... |
474bf96f-7a99-439b-9576-1d398319fb7e | zhiwei1988/LeetCode | 870-advantage-shuffle/solution.cpp | class Solution {
public:
vector<int> advantageCount(vector<int>& nums1, vector<int>& nums2) {
std::sort(begin(nums1), end(nums1)); // 从小到大排序
auto func = [](vector<int> &left, vector<int> &right) {
return left[1] < right[1];
};
priority_queue<vector<int>, vector<v... | ALGO | 0.999999 | 5.858976 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2020-02-08T11:57: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": "90ac4761... |
cf583c92-1d11-47e4-9b11-55a963115716 | lums658/sieve_exec_comparison | sieve/sieve_unifex_fun.cpp | /**
* @file sieve_unifex_fun.cpp
*
* @section LICENSE
*
* The MIT License
*
* @copyright Copyright (c) 2022 TileDB, Inc.
*
* 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 r... | ALGO | 0.937802 | 7.284884 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2022-04-05T00:22:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f52347ca558... |
e7434f06-d906-4976-8be4-85ba70189626 | Tazri/Problem-Solving-By-C-and-C-Plus-Plus | codeforce/1000/before-2025-3-mar-27/2002.B.RemovalsGame.cpp | // link : https://codeforces.com/problemset/problem/2002/B
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dl;
#define optimize() \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define fraction() \
cout.un... | ALGO | 0.999972 | 4.416487 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2024-11-25T23:59:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "98ca935be... |
bc9c79c4-665b-4f23-95b2-0ca654dc22ab | phuong-dinhmai/Cpp | Graph/UVA 168.cpp | #include <bits/stdc++.h>
#define maxN 27
#define vi vector <int>
using namespace std;
int k;
vi a[maxN];
bool candle[maxN];
int step;
void init()
{
for (int i = 0; i < maxN; i++)
{
a[i].clear();
candle[i] = false;
}
step = 0;
}
int dfs(int u, int m)
{
step++;
if (step % k == 0) candle[u] = true;
for ... | ALGO | 0.998742 | 3.168485 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-08T04:54: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": "cfbb588041... |
239b1084-262a-44ed-b7d5-cfb3a35b639b | user-of-github/BSUIR_Labs_Algorithmization-and-programming | 1_semester/2020.10.24 - Lab5/numberOfUnitSquares/main.cpp | #include <iostream>
#include<vector>
using std::cin,
std::cout,
std::vector,
std::min,
std::ios_base;
bool checkIfFits(vector<vector<int>> sums, int i0, int j0, int i1, int j1)
{
int neededSum = (i1 - i0 + 1)*(j1 - j0 + 1);
int big = sums[i1][j1],
up = (((i0 - 1) >= 0) ? sums[i0... | ALGO | 0.999971 | 4.223328 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2021-03-01T13:10: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": "1f7a9a662... |
413d07b0-0987-417f-9ee6-3c984dc2bc10 | Minerest/DiazEric_48102-master | HomeWork/Assignment6/CH6Sav/CH6SavP1/main.cpp | //p400
#include <iostream>
#include <fstream>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
cout<<"Hi!"<<endl;
cout<<"I'm going to search a file named 'search.dat' and find the biggest and smallest";
cout<<" number in by throwing all the numbers into an array."<<endl;
cout<<"I'l... | ALGO | 0.902875 | 3.155144 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-12-02T11:35: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": "968d58057e... |
9b2e7a2c-5326-4cc9-9927-0c935f889a87 | Altynbek38/lab | final/19.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector <string> v;
for(int i = 0; i < n; i++){
string s;
cin >> s;
v.push_back(s);
}
int m;
cin >> m;
vector <pair <string, string> > w;
for(int i = 0; i < m; i++){
string s, t;... | ALGO | 0.999996 | 3.398397 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-11-15T06:11: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": "b5466fb90e80... |
53fa290a-7054-4f5d-bbfe-0ccd73c1d3bf | tahsinkose/Data-Structures-and-Algorithms | Finite-Automata-Matcher/FAM.cpp | /* Finite Automaton Matcher */
#include <iostream>
#include <vector>
#include <map>
#include <sstream>
#include <fstream>
#include <algorithm>
#include "colormod.h"
using namespace std;
vector<int> occurences; // global variable to hold all occurences of the world.
ostream& operator << (ostream& os, string& s)
{
... | ALGO | 0.998211 | 4.016299 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2017-03-21T21:23: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": "40216e9d3... |
3aee8cd7-0dbf-4442-b067-072aeff9adc4 | jk6005/make_some_easy | Git/Education/Beat_Operation.cpp | #include <iostream>
using namespace std;
int main()
{ // 2진수
const int iAttack = 0x00000001; // 1
const int iArmor = 0x00000002; // 10
const int iHP = 0x00000004; // 100
const int iMP = 0x00000008; // 1000
const int iCritical = 0x00000010; // 10000
// 1 | 100 = 101 | 10000 = 10101
int... | ALGO | 0.993636 | 3.926841 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2019-08-24T14:01: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": "01d6a1aafc... |
7b4031c1-27c2-4e9b-9374-1546dfa11282 | pku-liang/AMOS | src/support/parallel_for.cc | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | ALGO | 0.998977 | 7.023893 | {
"github_metadata": {
"branch": "amos-opensource",
"commit_count": 5468,
"repo_created_at": "2020-11-02T12:40:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 113,
"forks": 12,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id... |
823a5a2d-0a93-4c49-9fc6-8ad4ba2fe6e1 | cayek/Thesis | ThesisRpackage/src/Helpers_models.cpp | #include <RcppEigen.h>
using namespace Eigen;
//' Y ~ X_j + CoVar for all j
// [[Rcpp::export]]
Rcpp::List phenotypeWayReg_lm(const Eigen::Map<Eigen::MatrixXd> & Y,
const Eigen::Map<Eigen::MatrixXd> & X,
const Eigen::Map<Eigen::MatrixXd> & CoVar) {
//param... | ALGO | 0.994396 | 5.543678 | {
"github_metadata": {
"branch": "master",
"commit_count": 515,
"repo_created_at": "2017-03-10T14:25:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71d7e822... |
b40860fd-6145-497c-94a4-4468d288ba93 | MKrupa-hub/SDiZO | Code/list.cpp | #include <fstream>
#include "list.h"
using namespace std;
ifstream file2;
List::List() {
List::head = nullptr;
List::tail = nullptr;
List::size = 0;
}
List::~List() {
}
void List::loaddata() {
int tmp;
file2.open("input.txt");
if (file2.fail()) {
cout << "Nie udalo wczytac sie dany... | ALGO | 0.986216 | 3.102185 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-03-24T12:29: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": "05bff9dda73f... |
1c8b8fa6-d103-4306-87d7-664f43a87f05 | CyFI-Lab-Public/RetroScope | external/openfst/src/include/fst/push.h | // push.h
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// d... | ALGO | 0.982451 | 7.285471 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2016-05-15T23:49:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 120,
"forks": 43,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "5e6326... |
c331fe7b-bb88-492f-a085-4f0400c5fdd0 | negibokken/sandbox | algorithm-and-data-structure-for-programming-contest/part3/parallel_orthogonal/main.cc | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int d... | ALGO | 0.999606 | 4.276514 | {
"github_metadata": {
"branch": "main",
"commit_count": 1459,
"repo_created_at": "2017-04-18T11:53:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 37
},
"file_meta": {
"content_id": "267e2f74... |
bad5ed32-4ca1-447a-9cfb-eeef631f15ba | VuNA2k2/DataStructAndAlgorithm | DSA01021.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define faster() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int n, k;
vector<int> a;
int res;
bool stop = false;
vector<int> f;
void process() {
int i = k;
while (i > 0 && a[i] == n - k + i) i --;
if(i == 0) stop = true;... | ALGO | 0.999976 | 3.794532 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2022-02-07T14:12:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9666335b30d... |
f03cb433-2996-4d71-b264-6ff15b79a4f7 | matrix2131/Data-Structures-and-Algorithms | DP/Count_sorted_vowel_strings.cpp | /* Given an integer n, return the number of strings of length n that consist only of vowels (a, e, i, o, u) and are lexicographically sorted.
A string s is lexicographically sorted if for all valid i, s[i] is the same as or comes before s[i+1] in the alphabet.
*/
#include<bits/stdc++.h>
using namespace std;
int coun... | ALGO | 0.999866 | 4.624399 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2021-01-03T14:55:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b856c154272... |
e0019418-1a3b-4ff6-a564-34d0bdbd5e7a | itos3d/GRAPHOS | libs/libCC/cc/CC/src/DistanceComputationTools.cpp | //##########################################################################
//# #
//# CCLIB #
//# #
//# This pr... | ALGO | 0.99935 | 6.737609 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-12-19T10:40:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 90,
"forks": 26,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "fce021c7... |
851045b6-cb80-443d-aa36-6962aa6dffbc | thanhhungg/CTDL_PTIT | CTDL_PTIT/DSA06011.cpp | #include <bits/stdc++.h>
using namespace std;
void quickSort(int *, int, int);
/* Function to print pair of elements
having minimum sum */
void minAbsSumPair(int arr[], int n)
{
// Variables to keep track
// of current sum and minimum sum
int sum, min_sum = INT_MAX;
// left and ri... | ALGO | 0.999983 | 4.375037 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2022-02-06T14:18: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": "24508c4396d... |
3614bea7-2afa-411c-9c25-fd60e4a736dd | AfnanBinIslamNahin/Data-structure-and-algorithm | 01 Knapsack.cpp | #include <iostream>
using namespace std;
int knapsack(int W, int weights[], int profit[], int n) {
int B[n + 1][W + 1];
for (int i = 0; i <= n; ++i) {
for (int w = 0; w <= W; ++w) {
if (i == 0 || w == 0) {
B[i][w] = 0;
} else if (weights[i] <= w) {
... | ALGO | 0.99999 | 5.25257 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-10-10T17:52:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cda546474157... |
990fa212-ce1d-4141-8cf5-66451d61922b | anuragsingh7827/Leetcode-Problems | 1008-construct-binary-search-tree-from-preorder-traversal/1008-construct-binary-search-tree-from-preorder-traversal.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.082192 | {
"github_metadata": {
"branch": "main",
"commit_count": 795,
"repo_created_at": "2022-04-11T16:09: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": "e12297e09b... |
49d36f5d-9192-47e4-921a-910543f7aa47 | ALKESHSHARMA24/leetcode_problems | 0943-sum-of-subarray-minimums/0943-sum-of-subarray-minimums.cpp | class Solution {
public:
/* Function to find the indices of
next smaller elements */
vector<int> findNSE(vector<int> &arr) {
// Size of array
int n = arr.size();
// To store the answer
vector<int> ans(n);
// Stack
stack<int> st;
... | ALGO | 0.999965 | 5.805466 | {
"github_metadata": {
"branch": "main",
"commit_count": 348,
"repo_created_at": "2023-09-06T17:28: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": "1ceb4c491b... |
43c94f28-d6fa-4288-a78c-d85466525f36 | Michaelzlzlz/Michaelzlzlz | Проекты в т.ч. СПбГУТ/С++ задачи_рекурсии/сочетание.cpp | /*Разработать алгоритм и программу вычисления числа сочетаний из N элементов по M с помощью рекурсивного алгоритма*/
#include <iostream>
#include <stdio.h>
#include <Windows.h>
using namespace std;
long long int SOCHI_N(long long int N,long long int M,long long int K){
if (N == M) { return 1; }
long long int ... | ALGO | 0.999957 | 4.458657 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2020-03-21T14:25: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": "e5f89659a... |
aa3908e5-938b-4afc-9846-2baa1e47da67 | PiperBetle/MyCode | CF1166F Vicky's Delivery Service.cpp | //不向焦虑与抑郁投降,这个世界终会有我们存在的地方。
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cassert>
#include<tuple>
#include<ctime>
#include<random>
#include<map>
#include<set>
#if __cplusplus>=202002L
#include<ranges>
namespace vw=std::views;
#endif
struct _time{~_time(){std::cerr<<"\n\033[33;40m"<... | ALGO | 0.999988 | 4.608265 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-03-19T11:11:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73b3cd84a4... |
444d32b7-edae-4340-890a-7d4e619d3756 | PrathamAsrani/Striver-DSA | MinimumJumps.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// Function to return minimum number of jumps to end of array
class Solution{
public:
int minJumps(int arr[], int n){
// Your code here
int minJumps = 0;
for(int i= 0; i < n; i = i){
if... | ALGO | 0.999911 | 5.150871 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2024-01-02T11:01: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": "0f1dd68f6... |
3fd0108e-9a18-4e5f-ad42-fef2b5f570cf | Yeasiin/DS-Algo | ALGO/module 19/subset_bottom_up.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int s;
cin >> s;
bool dp[n + 1][s + 1];
dp[0][0] = true;
for (int i = 1; i <= s; i++)
{
dp[0][i] = false;
}
... | ALGO | 0.999967 | 4.005868 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-02-15T10:50: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": "6842d6112048... |
5eec0ba6-e398-4a7f-bc76-1a1a2a278fe8 | deqiangwang123/CarND-Extended-Kalman-Filter | src/kalman_filter.cpp | #include "kalman_filter.h"
using Eigen::MatrixXd;
using Eigen::VectorXd;
/*
* Please note that the Eigen library does not initialize
* VectorXd or MatrixXd objects with zeros upon creation.
*/
KalmanFilter::KalmanFilter() {}
KalmanFilter::~KalmanFilter() {}
void KalmanFilter::Init(VectorXd &x_in, MatrixXd &... | ALGO | 0.90317 | 6.403153 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-08-24T23:31: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": "0f8c469e1750... |
f957e62f-f427-405d-a4bb-a7dd62f42099 | mobenh/cpp_bootcamp | caeser_cipher.cpp | #include <vector>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
string ltrim(const string&);
string rtrim(const string&);
vector<string> split(const string&);
string caesarCipher(string s, int k) {
k = k % 26;
for (int i = 0; i < s.length(); i++)
{
if (s[i] >= 65... | ALGO | 0.999741 | 5.197817 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2021-12-16T06:48: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": "2d39b1f5fdec... |
4a072d49-d1a9-408b-95c6-7d93e7ee3c1c | OktarianTB/raytracer | src/SceneObjects/Hyperboloid.cpp | #include <cmath>
#include <vector>
#include "quartic.h"
#include "Hyperboloid.h"
bool Hyperboloid::intersectLocal(const ray& r, isect& i) const
{
vec3f origin = r.getPosition();
vec3f direction = r.getDirection();
double ox = origin[0];
double oy = origin[1];
double oz = origin[2];
double dx = direction[0];
d... | ALGO | 0.988293 | 3.628335 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-03-29T03:18: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": "873522a72fe... |
9ac25190-6345-4e2b-bba7-fab8095ee950 | choudhary-pratham/Striver-SDE-Sheet | Day_14/rotting_orange.cpp | #include<queue>
int minTimeToRot(vector<vector<int>>& grid, int n, int m)
{
// Write your code here.
queue<pair<int,int>>q;
int count = 0;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
if(grid[i][j] == 1)
count++;
else if(grid[i][j] == 2)
... | ALGO | 0.999966 | 4.710793 | {
"github_metadata": {
"branch": "main",
"commit_count": 216,
"repo_created_at": "2022-06-04T17:13: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": "2332503c21... |
24b3faf2-6f9e-4219-99cd-75d8d4510379 | njwardhan/DS-Algo | LeetCode/Linked List/24. SwapNodesInPairs.cpp | // 1. Recursive approach: O(number of nodes) time and O(number of nodes) space as well?!
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *... | ALGO | 0.999996 | 6.084221 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2021-11-02T10:39:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e9223fa520... |
eae0c103-93ef-4f80-8821-55cc6887c0f1 | scottmcguire/libra-code | src/qchem/qobjects/PrimitiveG.cpp | /*********************************************************************************
* Copyright (C) 2015 <NAME>
*
* This file is distributed under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
* See th... | ALGO | 0.969501 | 3.988154 | {
"github_metadata": {
"branch": "master",
"commit_count": 264,
"repo_created_at": "2016-11-17T19:10:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58866b05... |
1c6930a5-0543-48a2-945f-bcf3aa34dcf8 | FcAYH/CodeForVSC | zy3.cpp | //二分的边界条件容易混 仔细考虑一下
#include <iostream>
#include <cstdio>
using namespace std;
const int maxn = 100100;
int n;
int len; //记录当前最多能拦截多少导弹
//(实际是最长不升子序列即x数组的长度)
//同时是最后的答案
int a[maxn]; //存所有的导弹
int x[maxn]; //存当前拦截的导弹的高度
int main()
{
while (scanf("%d", &a[++n]) == 1)
x[n] = 1;
n--;
//第一问... | ALGO | 0.999974 | 3.070689 | {
"github_metadata": {
"branch": "master",
"commit_count": 187,
"repo_created_at": "2021-04-03T07:56:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f032db7... |
b513f56a-375f-404c-a0ec-2ae0cb1323ed | gcmgomes/mineira2023 | problems/pastel/solutions/good/naim_dsu.cpp | #include <iostream>
#include <vector>
#include <tuple>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define trav(a, x) for(auto& a : x)
#define allin(a , x) for(auto a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef lon... | ALGO | 0.999966 | 4.423172 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2023-03-04T16:28:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "305a291737... |
4410a78f-014e-4b6e-bd51-9b25f079ce23 | mohammadimrans0/DSA_Cpp | algorithm/Graph/BFS_&_DFS/bfs_on_2d_grid.cpp | #include <bits/stdc++.h>
using namespace std;
void bfs(vector<vector<int>> &grid, int i, int j) {
int rows = grid.size();
int cols = grid[0].size();
queue<pair<int, int>> q;
// Directions for moving in the grid
vector<pair<int, int>> directions = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
// Mark the starting c... | ALGO | 0.999921 | 4.717025 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-03-09T16:49: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": "0f8db16ffb0... |
f3c1d81e-0e0e-4d12-b4ce-53c2c880c43f | LukamanIs/week-8-c-assignment | main.cpp | // program name goes here
// your name goes here
// any example usage or helpful command line arguments go here
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip> // For output formatting
using namespace std;
// Constants
const int MAX_BOWLERS = 10; // Maximum number of bowlers
const int NUM_... | TOOL | 0.949513 | 6.432787 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-12-21T03:52: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": "77c231a91deb... |
23d7f1a0-e6e6-4fcc-8d5f-2f793c4a7f2e | vinanthijain/C-Plus-Plus | Program/inorder.cpp | #include <iostream>
#include <limits.h> // For INT_MIN
using namespace std;
// Define the structure for a node in the binary tree
struct Node {
int data;
Node* left;
Node* right;
// Constructor to create a new node
Node(int value) {
data = value;
left = nullptr;
right ... | ALGO | 0.999998 | 7.072373 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-02-17T12:55: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": "29e1c5740f4a... |
08461c74-240f-49fb-b602-aac72cf1b312 | MeshInspector/MeshLib | source/MRMesh/MRLevelOfDetails.cpp | #include "MRLevelOfDetails.h"
#include "MRObjectMesh.h"
#include "MRMesh.h"
#include "MRMeshDecimate.h"
#include "MRBuffer.h"
#include "MRTimer.h"
#include "MRParallelFor.h"
namespace MR
{
std::shared_ptr<Object> makeLevelOfDetails( Mesh && mesh, int maxDepth )
{
MR_TIMER;
assert( maxDepth > 0 );
mesh.pa... | ALGO | 0.919488 | 6.126796 | {
"github_metadata": {
"branch": "master",
"commit_count": 5624,
"repo_created_at": "2021-12-30T12:20:15.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 647,
"forks": 79,
"issues": 36,
"pull_requests": 14
},
"file_meta": {
"content_id": "4e0... |
58296e3c-da0f-4676-8ec5-9fa27b144972 | sudipnext/nextonCPP | DSA_LAB/lab3/bubblesort.cpp | #include <iostream>
#include <stdlib.h>
// #include<time.h>
using namespace std;
void input(int A[], int n);
void display(int A[], int n);
void bubbleSort(int A[], int n);
int main()
{
int n, arr[100000];
cout << "Enter the number of elements in Array";
cin >> n;
input(arr, n);
cout << "Before Bu... | ALGO | 0.995294 | 4.399384 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2021-12-28T11:43:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b768083849a... |
94cdc62e-9309-458c-b683-bc74a884acb1 | bidhannath2001/LeetCode_Problem | Question_ANS/16. 3Sum Closest.cpp | /*
Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target.
Return the sum of the three integers.
You may assume that each input would have exactly one solution.
Example 1:
Input: nums = [-1,2,1,-4], target = 1
Output: 2
Explanation: The sum t... | ALGO | 0.999998 | 6.278645 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2024-03-31T04:04:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c434bebc1d... |
07495d96-83cc-4120-99fc-acb0c450d2d0 | dangcpr-fit-hcmus-docs/freshman | KTLT/BTTH_Tuan2/TH_Tuan02/Bai02/Bai02.cpp | #include <iostream>
#include <memory.h>
#include <malloc.h>
using namespace std;
void NhapMang(int*& arr, int& n)
{
arr = new int[n];
for (int i = 0; i < n; i++)
{
cout << "arr[" << i << "] = ";
cin >> *(arr + i);
}
}
int* ViTri(int* arr, const int& n, int x)
{
int* p = NULL;
int... | ALGO | 0.999912 | 4.25231 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-03-08T09:32:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4b429b761058... |
a3a5b1ba-0c18-4f42-856c-071a41e1d975 | ishandutta2007/code-library | Math/Matrix_Exponentiation_2x2.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace std;
const int MAX = 1000005;
const int MODULO = 1000000007;
// int power(int a, long long b, int modulo) {
// if (b == 0)
// return 1 % modulo;
// if (b & 1)
// return 1LL * a * power(a, b - 1, modulo) % modulo;
// int half = power(a, b >> ... | ALGO | 0.99998 | 4.028973 | {
"github_metadata": {
"branch": "master",
"commit_count": 1320,
"repo_created_at": "2022-04-27T03:06:52.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "ShahjalalShohag/code-library",
"stars": 11,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
... |
1b25ffd9-de70-44b2-bf47-9ae0d9eee83b | jardon-u/wordnet-blast | wnb/bfs.hh | #ifndef _BFS_HH
# define _BFS_HH
# include <boost/graph/breadth_first_search.hpp>
# include <boost/graph/filtered_graph.hpp>
namespace wnb
{
struct synset;
namespace bfs // breadth first search tools
{
/// bfs_visitor
/// Sum distances and throw answer if target synset found
template <typename Dist... | ALGO | 0.997353 | 5.498745 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2011-08-21T12:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 10,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "4659ad7... |
bfbf07e2-9a04-4425-a36e-680717d70474 | hack1nt0/AC | Contests/cf/edu21/b.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include <sys/resource.h>
#include "../../libs/debug.h"
#endif
typedef long long llt;
typedef vector<int> vi;
typedef vector<llt> vll;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
#define pb push_back
#define all(x) x.begin(),x.end()
#define fi first
#d... | ALGO | 0.999888 | 4.050779 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-12-04T09:51: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": "81cc11ba3... |
b8baf1da-e7ae-43a6-9283-5ef837b3bf66 | hutzuyang/summer-training | week4-cuda/source/main.cpp | #include "cuda_kernel.cuh"
using namespace std;
#define iteration 5
void ReadFile(vector<float> &a, vector<float> &b)
{
ifstream fin;
float temp;
fin.open("A.txt");
if(!fin)
{
cerr << "ERROR: input A.txt failed. \n";
exit(1);
}
while(fin >> temp)
a.push_back(temp);... | ALGO | 0.974919 | 3.576295 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2025-05-12T13:16: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": "10c71a05e10... |
b17d3b7b-29d3-48df-8102-c64c1ece4c85 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/06/0614/personal_submission/cf992d_lyxxys.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 9e18, mod = 998244353, N = 200050;
void solve(){
int n, k;
cin >> n >> k;
vector <int> a(n+1), nxt(n+1);
for (int i = 1; i <= n; ++ i) cin >> a[i];
// 缩区间内数字为1的 段,保证最多隔1次乘以 大于1的整数
for (int i = n, last = 0; i >... | ALGO | 0.999932 | 4.19919 | {
"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": "2fb0... |
ae00566d-d1a5-4f6f-a9ac-d8a145968961 | u-noob-i/contest | Codeforces/867 div3/A.cpp | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <queue>
#include <climits>
#include <sstream>
#include <tuple>
#include <iomanip>
using namespace std;
int n, m, i, j, k;
string s;
long long M = ... | ALGO | 0.999879 | 3.653217 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-09-01T17:42: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": "66a52bbdbf8d... |
43abfa28-8d04-4467-9cbc-d2b5821332cf | eryxcc/lois | src/extra.cpp | #include "../include/loisextra.h"
// needed for phi->alph in getsingletonset
#include "../include/loisinternal.h"
namespace lois {
namespace orderedfield_ops {
RelOrderedField *mainField;
Domain *mainDomain;
}
/*
// the Cartesian product of more than 2
template<class T> void cartesianRange(T beg, T end, eltup... | TOOL | 0.935818 | 4.836753 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2016-10-13T10:00:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7382f6cc... |
b40bb9cc-c829-434a-b45f-e8ccdfcbbc09 | green-fox-academy/scolear | week-02/day-01/data-Listintroduction2/main.cpp | /*
.Create a list ('List A') which contains the following values
Apple, Avocado, Blueberries, Durian, Lychee
.Create a new list ('List B') with the values of List A
.Print out whether List A contains Durian or not
.Remove Durian from List B
.Add Kiwifruit to List A after the 4th element
.Compare the size of List A an... | ALGO | 0.99197 | 5.63239 | {
"github_metadata": {
"branch": "master",
"commit_count": 402,
"repo_created_at": "2019-09-10T09:57:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4397302f... |
605bf806-c1b5-490b-b20d-0ed3355c0019 | murilloeng/Canvas | Test/src/tessellation/convex_loop_ccw_8.cpp | //std
#include <cstdio>
#include <cstdint>
#include <algorithm>
//canvas
#include "Canvas/Canvas/inc/Math/vec2.hpp"
#include "Canvas/Canvas/inc/Objects/Tessellator.hpp"
//test
#include "Canvas/Test/inc/examples.hpp"
void examples::tessellation::convex_loop_ccw_8(void)
{
//data
const uint32_t validator[] = {
0, 4... | ALGO | 0.944566 | 5.281699 | {
"github_metadata": {
"branch": "main",
"commit_count": 413,
"repo_created_at": "2023-09-21T05:41: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": "a151db9761... |
86034d32-3ac4-4b7a-81e3-c2b69593f2ba | edoriggio/ai-cup | src/solvers/two_dot_five_opt.hpp | #include <tuple>
#include <vector>
#include <algorithm>
using namespace std;
/**
* @brief Two-dot-five-opt algorithm step
*
* Perform a single step of the two-dot-five-opt algorithm.
*
* @param solution Solution to be optimized
* @param problem Problem to be solved
* @return Tuple containing the new solutio... | ALGO | 0.999995 | 5.616307 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-11-21T18:33: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": "5d0ff7a7683... |
209909d4-de4f-41e1-a06e-b468b0fb1a0e | Hafiz-Sakib/CMEPL | Final Report/bisection.cpp | #include <bits/stdc++.h>
using namespace std;
#define setp(n) fixed << setprecision(n)
const double error = 1e-4;
double f(double x)
{
return ((sin(x) * sin(x)) - (x * x) + 1);
}
int main()
{
double x = 2.0, y = 3.0, mid = 0.00;
while (1)
{
cout << "Enter the interval [a, b]: ";
cin >... | ALGO | 0.999833 | 4.05517 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-04-21T14:49: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": "f97e528a063... |
c980e1b8-50b5-4f93-a7a7-0052873487c2 | ziglang/zig | lib/libcxx/include/__algorithm/ranges_inplace_merge.h | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | ALGO | 0.999795 | 7.285562 | {
"github_metadata": {
"branch": "master",
"commit_count": 34092,
"repo_created_at": "2015-08-06T00:51:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 40012,
"forks": 2915,
"issues": 3389,
"pull_requests": 267
},
"file_meta": {
"content_i... |
11596155-4751-4401-ae86-ef3508df9f51 | woodjazz/nsg-library | NSG/maths/Vector4.h | /*
-------------------------------------------------------------------------------
This file is part of nsg-library.
http://github.com/woodjazz/nsg-library
Copyright (c) 2014-2017 <NAME>
-------------------------------------------------------------------------------
This software is provided 'as-is', without any expr... | TOOL | 0.906552 | 4.533792 | {
"github_metadata": {
"branch": "master",
"commit_count": 680,
"repo_created_at": "2015-03-14T13:26:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab6b2559... |
bc5a2942-6441-4554-8a58-62e9295308ae | NilFoundation/crypto3 | libs/zk/test/systems/ppzkadsnark/r1cs_ppzkadsnark/run_r1cs_ppzkadsnark.hpp | //---------------------------------------------------------------------------//
// Copyright (c) 2018-2021 <NAME> <<EMAIL>>
// Copyright (c) 2020-2021 <NAME> <<EMAIL>>
//
// MIT License
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation fi... | TOOL | 0.901695 | 7.139891 | {
"github_metadata": {
"branch": "master",
"commit_count": 10456,
"repo_created_at": "2019-04-13T23:20:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 84,
"forks": 13,
"issues": 44,
"pull_requests": 9
},
"file_meta": {
"content_id": "476a... |
62393ee4-bf87-4d44-98ae-1dcd856288f3 | raviagrwl420/mesh-viewer | include/mesh.h | #ifndef MESH_H
#define MESH_H
#include <map>
#include <string>
#include <glm/glm.hpp>
#include <random>
#define PI 3.14159265
using std::string;
using std::to_string;
using std::map;
using std::make_pair;
using glm::vec3;
using glm::vec4;
using glm::normalize;
using glm::cross;
using glm::dot;
using glm::mat4;
us... | ALGO | 0.921866 | 3.515209 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-07-07T19:38:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cdaeffab3... |
02396fe6-d33f-46de-9f4a-8141e593a645 | CNHume/Samples | C++/together/Tree.h | // (C) Copyright 2018, <NAME>. All rights reserved.
//
// 2017-05-14 CNHume Added static root
// 2017-05-13 CNHume Added branch() and ensure()
// 2015-01-04 CNHume Qualified const methods
// 2014-12-18 CNHume Added array usage metrics
// 2014-12-08 CNHume Added Copy and Move Semantics
// 2014-12-07 CNHume Sparse... | ALGO | 0.966222 | 5.984097 | {
"github_metadata": {
"branch": "master",
"commit_count": 1310,
"repo_created_at": "2018-04-03T00:08:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d11769... |
fa16fecc-c352-4dc0-b51f-66a90b52a456 | AnasImloul/Leetcode-Solutions | scripts/algorithms/R/Random Point in Nonoverlapping Rectangles/Random Point in Nonoverlapping Rectangles.cpp | // Runtime: 56 ms (Top 92.9%) | Memory: 67.40 MB (Top 52.26%)
class Solution {
public:
vector<vector<int>> rect;
vector<int> r_area;
int total_area;
Solution(vector<vector<int>> rects) {
rect = rects;
int total = 0;
for (int i = 0; i < rects.size(); i++) {
total += (... | ALGO | 0.999834 | 6.203069 | {
"github_metadata": {
"branch": "main",
"commit_count": 5405,
"repo_created_at": "2022-08-07T11:14:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 382,
"forks": 120,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4e5a... |
4244aaef-152c-49e0-960d-958a6ba604c2 | kiddos/notes | codeforces/1600~1699/1676/g.cc | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
void solve() {
int n = 0;
cin >> n;
vector<vector<int>> adj(n+1);
for (int i = 2; i <= n; ++i) {
int p = 0;
cin >> p;
adj[p].push_back(i);
}
string s;
cin >> s;
s = " " + s;
int ans = 0;
function<pair<int,int>(int... | ALGO | 0.999829 | 4.293369 | {
"github_metadata": {
"branch": "master",
"commit_count": 398,
"repo_created_at": "2017-01-31T13:49:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e65b52fb... |
175f7bfb-5094-49b7-81b0-d157dbbb9c87 | sasidharan10/Cpp | Leetcode/Graph/399_evaluate_division.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
void dfs(string src, string dst, double product, double &ans, unordered_map<string, vector<pair<string, double>>> &adj, unordered_set<string> &vis)
{
if (vis.find(src) != vis.end())
return;
vis.insert(src);
... | ALGO | 0.999946 | 5.99473 | {
"github_metadata": {
"branch": "main",
"commit_count": 617,
"repo_created_at": "2021-06-29T12:55:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "45acf24c34... |
4382f4c1-4dda-4872-bd5a-57abeee9e329 | ChASE-library/ChASE | linalg/internal/mpi/flipSign.hpp | // This file is a part of ChASE.
// Copyright (c) 2015-2024, Simulation and Data Laboratory Quantum Materials,
// Forschungszentrum Juelich GmbH, Germany. All rights reserved.
// License is 3-clause BSD:
// https://github.com/ChASE-library/ChASE
#pragma once
#include "linalg/distMatrix/distMatrix.hpp"
#include "lin... | ALGO | 0.995969 | 7.062701 | {
"github_metadata": {
"branch": "master",
"commit_count": 983,
"repo_created_at": "2021-03-18T13:00:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 17,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8505e7fc... |
8998ab07-d7eb-41a9-8c2c-e4084669bd31 | Oh-noodles/CodeSnippets | BVH/bvh.cpp | #include <algorithm>
#include <cassert>
#include <cstddef>
#include <fstream>
#include <ios>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <array>
class Node {
public:
float x1, y1;
float x2, y2;
Node *parent = NULL;
Node *left = NULL;
Node *right = NULL;
... | ALGO | 0.999775 | 5.392119 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-05T13:35: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": "26a24c5cd6c9... |
259e5f58-cdf3-48fe-ae88-1c401d2e2c15 | joss1992/robot-arduino | code/main/main.ino | /*
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
______________________________________________
| ... | ALGO | 0.985694 | 4.734677 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-09-23T13:32: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": "37b25bcef... |
33399d8a-7c6f-40b9-849e-60ceb6445f88 | stefdasca/CompetitiveProgramming | Codeforces/Codeforces Round #586/CF1220-D12-A.cpp | #include<bits/stdc++.h>
#pragma GCC optimize("O3")
#define fi first
#define se second
#define pb push_back
#define pf push_front
#define mod 1000000007
using namespace std;
typedef long long ll;
int add(int a, int b)
{
ll x = a+b;
if(x >= mod)
x -= mod;
if(x < 0)
x += mod;
return x;
... | ALGO | 0.999975 | 3.121648 | {
"github_metadata": {
"branch": "master",
"commit_count": 917,
"repo_created_at": "2018-09-28T18:19:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b4ba76... |
559907ec-a132-4584-b3d2-46d6fbfd9b15 | fsq/leetcode | 2076. Process Restricted Friend Requests.cpp | class Solution {
public:
vector<int> fa;
int find(int x) {
return fa[x] = x==fa[x] ? x : fa[x]=find(fa[x]);
}
vector<bool> friendRequests(int n, vector<vector<int>>& res, vector<vector<int>>& req) {
fa.resize(n);
iota(fa.begin(), fa.end(), 0);
vector<bo... | ALGO | 0.999959 | 5.565284 | {
"github_metadata": {
"branch": "master",
"commit_count": 1935,
"repo_created_at": "2018-01-18T01:31:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ae8634... |
69743843-fcc7-44ec-b8ba-1ecf6530f8a9 | TrifanBogdan24/Probleme-PBINFO | pbinfo/coduri-cpp/clasa-XI/partitiinumar3.cpp | // #323 - PartitiiNumar3
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("partitiinumar3.in");
ofstream g("partitiinumar3.out");
int n, a, b, st[1000], suma;
void afis(int k)
{
for (int i = 1; i <= k; i++)
g << st[i] << ' ';
g << '\n';
}
void back(int k)
{
if (k <= n)
... | ALGO | 0.99934 | 3.30476 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-05-02T23:21: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": "26d4413fde7... |
72e5388f-cc57-4e03-852e-0c362adbd045 | ja999/dna_seq | population.cpp | #include "population.h"
Population::Population(WordsGraph *graph) {
bool(*fn_pt)(Specimen,Specimen) = Specimen::compare;
specimenSet = new set<Specimen,bool(*)(Specimen,Specimen)>(fn_pt);
while (specimenSet->size() <= size) {
Specimen spec(graph);
specimenSet->insert(spec);
}
}
void Population::tpx(Specime... | ALGO | 0.962299 | 3.688264 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2014-04-09T11:39: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": "2d1c83504... |
52448437-c02b-4a93-8db9-7be786508cbf | hrhabib07/cpp_for_data_structure | Data_Strucutre/linked_list_again/reversing_a_singly_linked_list.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
void instert_at_tail(Node *&head, Node *&tail, int value)
{
Node *newNode = new Node(value);
if (head == NULL)
{
hea... | ALGO | 0.999865 | 4.843986 | {
"github_metadata": {
"branch": "main",
"commit_count": 296,
"repo_created_at": "2024-12-19T07:59: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": "0b0e454ec1... |
28c42f58-dda4-452e-a32e-2e7c8882a7a4 | SagarNarsingani/SDESheetChallenge | Day 20 - BST/PairSum.cpp | #include <iostream>
#include <vector>
#include <unordered_set>
#include "BST.h"
using namespace std;
unordered_set<int> s;
bool ans = false;
// Time Complexity: O(N)
// Space Complexity: O(N) -- Can be reduced to O(H) by using BST Iterator and to O(1) by using morris inorder traversal.
void isTherePair(Node *root, int... | ALGO | 0.999985 | 5.351901 | {
"github_metadata": {
"branch": "main",
"commit_count": 196,
"repo_created_at": "2022-06-07T15:21: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": "2dc0a2543e... |
1a0816db-25d6-4922-a35d-2e82bfb7470a | semenInRussia/cf | olproger/2025/dt4/c.cpp | // semenInRussia 2025
#include <algorithm>
#include <cstdint>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
const int N = 1e5 + 100;
vector<int> g[N];
int w[N], d[N];
int n, m, k;
map<int, int64_t> r[N], f[N], s[N];
bool bad[N];
const int inf = 1e9;
void dfs(int x, int fa = -1) {
in... | ALGO | 0.99996 | 4.480583 | {
"github_metadata": {
"branch": "main",
"commit_count": 140,
"repo_created_at": "2024-05-03T10:20:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d8a3fb318... |
feff2876-3423-4cdc-8d7b-53fc444159c4 | atupal/codeforces | virtual_contests/280_DIV2/b.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
using namespace std;
const int maxn = 1010;
int n, l;
int a[maxn];
inline
int get(double x) {
for (int i = 1; i < n; ++ i) {
if (a[i+1]-a[i] > x*2+1e-10) {
return 0;
}
}
if (a[1]-1e-10 > x) return 0;
if (a[n+1] - ... | ALGO | 0.999979 | 3.261056 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2013-05-12T16:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c0bd0162... |
31032ab5-90bb-44d8-9ea3-95ed537e7143 | networkit/networkit | networkit/cpp/community/PLP.cpp | /*
* PLP.cpp
*
* Created on: 07.12.2012
* Author: <NAME>
*/
#include <omp.h>
#include <networkit/Globals.hpp>
#include <networkit/auxiliary/Log.hpp>
#include <networkit/auxiliary/Random.hpp>
#include <networkit/auxiliary/Timer.hpp>
#include <networkit/community/PLP.hpp>
namespace NetworKit {
PLP::PLP(con... | ALGO | 0.994786 | 6.943731 | {
"github_metadata": {
"branch": "master",
"commit_count": 9146,
"repo_created_at": "2017-02-04T13:04:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 811,
"forks": 235,
"issues": 23,
"pull_requests": 24
},
"file_meta": {
"content_id": "e5... |
1c3b3b07-0453-40d7-ac45-96330211ba77 | ItsTHEAvro/Leetcode-Solutions | 0404-sum-of-left-leaves/0404-sum-of-left-leaves.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.999978 | 6.05066 | {
"github_metadata": {
"branch": "main",
"commit_count": 632,
"repo_created_at": "2024-01-05T20:31: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": "e12f0eb447... |
33c842a5-3f70-4909-964a-c35c3d34d0a0 | theosZA/Cube | CubeSolver/SolverStep/SolverStep_4CornersTwisted.cpp | #include "SolverStep_4CornersTwisted.h"
#include <array>
#include <stdexcept>
#include <string>
#include <vector>
#include "Cube\3x3x3\CornerStructure.h"
#include "Insertions\Corner3Cycle.h"
#include "Insertions\Corners.h"
std::vector<PartialSolution> SolverStep_4CornersTwisted::Solve(const std::vector<CubeMove>& s... | ALGO | 0.999776 | 6.95441 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2016-10-01T12:42: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": "e5aadfd3... |
9d767c24-079d-496f-bdb9-0e2392555876 | Gongyihang/Daily | Universities/wuhandaxue02.cpp | #include <algorithm>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
//公众号:一航代码
int last_num(int n)
{
for (int i = 1, j = n; j > 0; i++, j--) { //计算最大数
n += i;
}
return n;
}
int main()
{
int n;
scanf("%d", &n);
int num = 1;
char c... | ALGO | 0.999985 | 3.438258 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2020-04-16T03:16: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": "7d4fcb191... |
ef800c4c-a720-4467-a504-0a66b8edc287 | joaoabrantesuchoa/Competitive-Programming-CPP | Algoritms_and_data_structures/Search algoritmhs/Binary_Search.cpp | #include <bits/stdc++.h>
using namespace std;
//This algorithm is using to find the position of an element in a order list in O(log N)
//Works this way:
//You have two bourders the low and the high. the low is on the begin of the list and the high on the end.
//You have to move these borders until you find your eleme... | ALGO | 0.999941 | 4.635375 | {
"github_metadata": {
"branch": "main",
"commit_count": 207,
"repo_created_at": "2020-11-28T19:46: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": "5f5fd4fbf9... |
0fc5b24b-3d30-43aa-9505-56b3dd99f766 | cubercsl/The-road-to-ACMer | Misc/CCPC_WinterCamp_2019/Day5/I.cpp | #include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define dbg(args...) \
do \
{ \
cout << "\033[32;1m" << #args << " -> "; \
err(args); ... | ALGO | 0.999867 | 5.161607 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2017-04-28T00:42:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b1ff81... |
9cbe1bdc-a667-4ad4-a48b-7106f64a625f | Andreluss/mint | mint class.cpp | //Author: <NAME>
//This is a copy of an old project
//the mint class can be used like a normal int
//just set the mint::Mod
//and write long, clean expressions without worrying about overflows!
#include "bits/stdc++.h"
using namespace std;
using LL = long long;
#define SIZE(x) (int)(x).size()
#define FOR(i, b, e) for(... | ALGO | 0.999941 | 4.184102 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-10-23T14:58:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36e36f7a3c80... |
022ae6f1-fa3a-479a-975b-9e013c59d252 | Tamilkumaran17/TechDose | seives/Segmented.cpp | #include <bits/stdc++.h>
using namespace std;
// segmented seive
// works in the long range numbers left and right
// left and right are the range of numbers we want to find primes in
// returns a vector of boolean values where left <= i <= right and primes[i] is tr... | ALGO | 0.999512 | 4.191559 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2024-08-29T14:35: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": "4b5be70b4e0... |
6e1fe0cf-a07e-4dae-8aad-e2dbf746de15 | codeAlok/cpp-practise | College_sem3_practical/2_queue_arr_implement.cpp | // Q2. WAP in c/c++ for array implementation of QUEUE with all basic function (push, pop, search, count, display)
// solve -> after deleting element space decreases ???
#include<iostream>
using namespace std;
// **** QUEUE structure creating ****
struct QUEUE
{
int arr[5];
int front, rear;
}Q;
// **** De... | ALGO | 0.999188 | 3.434684 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2022-05-06T17:43: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": "d297a16fe... |
b6e6e9e8-9df4-4d78-9a16-0c010893e293 | hjiang13/LLM4IR | results/Task2_IR_Decompilation/Decompiled_Humaneval_x_cpp_164_Result_O3/CodeLlama_Humaneval_x_cpp_164/test/CPP_116.cpp | <|im_start|>user
class Vector {
public:
void sort(){
size_t n = size();
for (size_t i=0; i<n-1; ++i) {
for (size_t j=i+1; j<n; ++j) {
if (data()[j] < data()[i]) {
std::swap(data()[j], data()[i]);
... | ALGO | 0.997375 | 5.993056 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-05-21T20:32:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0221e630653... |
042190b1-26cf-4739-b9a0-c1d99649f7c7 | Sayeem2004/CodeForces | Contests/1XXX/18XX/180X/1807/F.cpp | #include <bits/stdc++.h>
using namespace std;
bool hit(int x, int y, string d, int gx, int gy) {
if (x == gx && y == gy) return true;
int dx = (d[1] == 'L' ? -1 : 1);
int dy = (d[0] == 'D' ? 1 : -1);
if (dx == -1 && gx > x) return false;
if (dx == 1 && gx < x) return false;
if (dy == -1 && gy ... | ALGO | 0.999895 | 4.488278 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-01-05T22:38: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": "d42e3e8ec6a... |
e37540aa-e276-4277-84bc-b6f045815e34 | matthewsamuel95/ACM-ICPC-Algorithms | DP/Coin Change Problem/NoOfWays.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
/*
Algorithm : Coin Change Problem (No of Ways)
Type : DP
Problem
You have m types of coins available in infinite quantities where the value of each coin is given in the array C = [c0, c1....c m-1] . ... | ALGO | 0.999993 | 4.822011 | {
"github_metadata": {
"branch": "master",
"commit_count": 1421,
"repo_created_at": "2017-10-21T21:46:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2203,
"forks": 1277,
"issues": 4,
"pull_requests": 48
},
"file_meta": {
"content_id": "... |
b8eb5ddc-c5c9-4ff3-a4a2-894fa4edebe2 | MateuszSnamina/stars-ring | starsring_app/stars_ring_basis/src/translation_unique_element.cpp | #include <cassert>
#include <cmath>
#include <iomanip>
#include <stars_ring_basis/cycle_helper_functions.hpp>
#include <stars_ring_basis/raw_state_operations.hpp>
#include <stars_ring_basis/translation_unique_element.hpp>
namespace stars_ring_basis {
TranslationUniqueElement::TranslationUniqueElement(
std::share... | TOOL | 0.927522 | 6.905827 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-09-23T17:51: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": "6a639cae7... |
fc435bb4-9fce-43d9-a163-fc890d20702a | rushighogare/DSA | Recursion/CombinationSum.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(int i, int target, int arr[], vector<int> &temp, int n){
//base case
if(i>=n){
if(target==0){ //we are making target to zero by adding the array elements, if it gets zero means we got subsequence and print that subsequence
for... | ALGO | 0.999987 | 5.261703 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-11-28T06:09:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e1f6bc2c177b... |
07f27ff7-948f-49d1-97d1-599f4bf0966f | didw/coding | algospot/algosrc/problems/fanmeeting/fanmeeting.cpp | #include<cassert>
#include<cstdio>
#include<iostream>
#include<string>
#include<vector>
using namespace std;
// num[] 의 자릿수 올림을 처리한다.
void normalize(vector<int>& num) {
}
// 두 긴 정수의 곱을 반환한다. 각 배열에는 각 수의 자리수가 1의 자리에서부터 시작해 저장되어 있다.
// 예: multiply({3,2,1},{6,5,4}) = 123*456 = 56088 = {8,8,0,6,5}
vector<int> multiply(con... | ALGO | 0.999715 | 3.871975 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2015-12-01T04:53:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "368e7b232... |
a5b47df2-e8c3-473e-a435-d125d68a6bc9 | lookskyblue/Dictionary-BinSrchTree- | Project5/BinSrchTree.h | #pragma once
#include"BinaryTree.h"
class BinSrchTree : public BinaryTree {
public:
/*
BinaryNode* search(char key[]) { return searchRecur(root, key); }
BinaryNode* searchRecur(BinaryNode* n, char key[])
{
if (n == nullptr)
return nullptr;
else if (n->compare(key) == 0)
return n;
else if (n->compare... | ALGO | 0.999892 | 3.151855 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-08-02T22: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": "5d1765e364... |
be4eb9e3-ce28-4809-a2f4-6231321179cb | TengFeiyang01/Algorithm | casual/Training/AcWing1107.cpp | #include <bits/stdc++.h>
#define sz(x) int((x).size())
#define bg(x) begin(x)
#define all(x) bg(x), end(x)
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define eb emplace_back
#define lb std::lower_bound
#define ub std::upper_bound
const int inf = 0x3f3f3f3f;
using ll = long long;
using PII = std::pair... | ALGO | 0.99999 | 3.979805 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2024-07-12T15:01:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "483fd17bb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.