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 |
|---|---|---|---|---|---|---|---|
f07c51b3-763a-4627-aefd-2a1d9a238d96 | UdaySharmaGitHub/DSA-CPP | Coding Ninja and Studio/Coding Interview Questions/Hard/Implement_Atoi.cpp | /*
Implement Atoi
Given a string, s, the objective is to convert it into integer format without utilizing
any built-in functions. If the conversion is not feasible, the function should return -1.
Note: Conversion is feasible only if all characters in the string are numeric
or if its first character is '-' and rest ar... | ALGO | 0.999299 | 4.783617 | {
"github_metadata": {
"branch": "main",
"commit_count": 292,
"repo_created_at": "2023-11-19T16:25:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b58741a28... |
72ea74d7-e7b5-4b8b-8d63-fe17249b87d1 | KratosMultiphysics/Kratos | applications/DEMApplication/custom_constitutive/DEM_global_damping_viscous.cpp | // Kratos Multi-Physics - DEM Application
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: <NAME> (<EMAIL>)
//
// Project includes
#include "DEM_global_damping_viscous.h"
#include "custom_utilities/GeometryFunctions.h"
namespace Kratos
{
DEMGlo... | TOOL | 0.916037 | 6.176761 | {
"github_metadata": {
"branch": "master",
"commit_count": 106408,
"repo_created_at": "2017-02-13T10:58:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1141,
"forks": 265,
"issues": 381,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
3a60fb11-b250-482b-8e4a-2bd7f4abea60 | BijanRegmi/Competitive-Coding | GCES/Repeated String.cpp | #include <bits/stdc++.h>
using namespace std;
#define deb(x) cout << #x << ": " << x << std::endl;
#define debb(x, y) \
cout << #x << ": " << x << " " << #y << ": " << y << std::endl;
#define debarr(x) ... | ALGO | 0.99825 | 4.003194 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2021-12-16T15:21: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": "c76202164... |
87445523-e634-4afd-a983-538bb99c391d | cormoran/CompetitiveProgramming | src/contest/topcoder/SRM689div1/ColorfulGarden.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
#define rep(i,j) for(ll i=0;i<j;i++)
#define repeat(i,j,k) for(ll i=(j);i<(k);i++)
#define all(v) v.begin(),v.end()
class ColorfulGarden {
public:
vector <string> rearr... | ALGO | 0.999971 | 4.322656 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2016-08-18T12:24: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": "af114105... |
91262bd5-6e25-4f24-a741-fe5b7335734b | p3dm/IT3040 | src/lab_05/bai1_4/gentest.cpp | #include <bits/stdc++.h>
using namespace std;
int random(int L, int H) {
return (rand() << 16 | rand()) % (H - L + 1) + L;
}
int main(int argc, char** argv) {
if (argc > 1) srand(atoi(argv[1]));
else srand(time(NULL));
// Sinh số lượng thành phố và cạnh
int n = random(2, 20);
int m = random(n... | ALGO | 0.996667 | 3.703854 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-11-27T15:06: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": "efeace4f9e1... |
2b676af5-d4c1-4daf-92ea-52fc9f92307a | luk6xff/Algo | snippets/BinaryHeap.cpp | // BinaryHeap.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#in... | ALGO | 0.999511 | 4.034833 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2018-05-21T23:25:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1500bbd21... |
97aab214-8fa4-48e3-af7e-009c7798986e | ithsarasak/Programming | Compettitive programming/ALL OI/IOI/2014/Holiday.cpp | #include <bits/stdc++.h>
#include "holiday.h"
using namespace std;
//#define fuck
const int N = 1e5 + 10;
struct item{
long long va;
int sz, l, r;
}seg[20*N];
int ver[N], cnt = 1;
unordered_map<long long, int> mp;
long long va[N], ans = -1LL;
int n, s, d;
vector<long long> coord;
int newleaf( long long va, i... | ALGO | 0.999943 | 3.803835 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2019-04-03T08:43:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15e9c5cc3... |
7c5cb568-4b59-4bb1-aefc-8f6b37d9ad2f | kimsoohwan/OpenGP | src/mean/MeanGP.hpp | #ifndef _MEAN_FUNCTION_GAUSSIAN_PROCESS_HPP_
#define _MEAN_FUNCTION_GAUSSIAN_PROCESS_HPP_
#include "../util/macros.h"
#include "../data/TrainingData.hpp"
//#include "../data/DerivativeTrainingData.hpp" // TODO
#include "../data/TestData.hpp"
#include "../inf/InfExactGeneral.hpp" // InfExactGeneral
#include "../gp/Gau... | ALGO | 0.973883 | 5.673371 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2014-03-26T00:55:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee59e319c... |
40cdee23-4dec-4aa6-959f-07e967863fa3 | chelloiaco/leetcode | reduction/main.cpp | #include <algorithm>
#include <iostream>
#include <vector>
class Solution {
public:
int reductionOperations(std::vector<int>& nums) {
// If it's of length 1, return 0 operations
if (nums.size() == 1) {
return 0;
}
int result{0};
int operations{0};
std:... | ALGO | 0.999882 | 6.450901 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-09-09T01:34: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": "8506eeb7ff9... |
1ad4812e-f863-4cf0-aa39-cc7cea88b156 | ShortTailLab/ph-open | Classes/boost/geometry/strategies/cartesian/side_by_triangle.hpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 <NAME>, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 <NAME>, Paris, France.
// Copyright (c) 2009-2012 <NAME>, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL), copyright (c... | ALGO | 0.991177 | 7.451546 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2014-08-20T03:23:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 518,
"forks": 332,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "161522... |
1096856b-4c38-448f-8b8e-ffd5b7b907e3 | piotrNajder/snakeQt | src/cSnake.cpp | #include "../include/cSnake.h"
#include <limits>
#include <cmath>
#include <iostream>
Snake::Snake(Array2D<uint8_t> g, Array2D<uint8_t> f, std::vector<Point> pts) {
points = pts;
gradient = g;
flow = f;
width = g.cols;
height = g.rows;
}
std::vector<Point> Snake::adaptPoints() {
int32_t loop =... | ALGO | 0.999921 | 5.470795 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-01-06T12:59: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": "8c3fc3f1a6... |
e2d7698d-6a21-483d-8b26-4e22dd3fffbd | SpongeEdmund/Bitgen | bitgen_v4/bitgen/AdjustBiPipDir.cpp | #include "AdjustBiPipDir.h"
#include <cassert>
#include <vector>
#include <exception>
#include <sstream>
#include <boost/foreach.hpp>
#include <cstdio>
#define foreach BOOST_FOREACH
using std::vector;
using std::ostringstream;
DriveStatus JudgeDriveStatusInOneTile( const string& portName, const string& tileName, cons... | TOOL | 0.927862 | 4.8846 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2013-08-14T05:07:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b22acf80... |
953bc775-e238-4998-9158-40b146301518 | MAZHARMIK/Interview_DS_Algo | strings/Determine if String Halves Are Alike.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=oSSMo0PCQts
Company Tags : Google, Amazon, Microsoft, Meta
Leetcode Link : https://leetcode.com/problems/determine-if-string-halves-are-alike/
*/
/******************************************************** C++ *****... | ALGO | 0.991122 | 5.71227 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
44b717a5-251a-4018-b2d6-f027dd23af37 | stellaraccident/iree-forge | trees/iree/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorization.cpp | // Copyright 2021 The IREE Authors
//
// Licensed 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
#include "iree/compiler/Codegen/PassDetail.h"
#include "iree/compiler/Codegen/Passes.h"
#include ... | TOOL | 0.965148 | 6.212682 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2021-07-09T22:31:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "b7e8939499d... |
f12d5975-6a1d-4007-95b1-e1805db49fed | plusplus7/LeetCodeSolutions | src/surrounded_regions.cc | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int n,m;
void visit(vector< vector<char> > &board, int x, int y) {
if (x < n-1 && board[x+1][y] == 'O') {
board[x+1][y] = '7';
visit(board, x+1, y);
}
if (y < m-1 && board[x][y+1... | ALGO | 0.998839 | 4.354706 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2014-10-15T04:50:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3620410d... |
131413e5-810e-4318-8096-3fc3a49a06f2 | cmanh75/cp | 1294C-CF.cpp | //problem "1294C-CF"
//created in 20:16:03 - Mon 07/10/2024
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
void solve() {
int n;
cin >> n;
int a = 0, b = 0;
for (int i = 2; i <= sqrt(n); i++) {
if (n % i == 0) {
a = i;
n /= a;
break;
... | ALGO | 0.999768 | 4.740378 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2024-08-20T08:36:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d2a39040db... |
47d35f48-bd90-421c-9dcc-de49cf141e98 | MBATech-NMIMS-2021/DSA | Notes/classmatesNotes/SamsNotes/Sam'sSolutions/DSExp5Q1Q2Q3Q4.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
struct Node
{
int data;
Node *nextElement;
Node *previousElement;
};
class doublyLinkedList
{
private:
unsigned int doublyLinkedListSize;
Node *head = new Node;
public:
void createDoublyLinkedList()
{
... | ALGO | 0.997308 | 4.696557 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2022-01-18T15:41:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ddd1809102b4... |
1bbb0264-bc44-42fd-b92f-10a9243912e4 | ziyeshanwai/METAHUMAN51 | Source/MetaHumanMeshTracker/Private/nrr/include/nrr/MarkerConstraints.h | // Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include <carbon/Pimpl.h>
#include <nls/Cost.h>
#include <nls/DiffDataMatrix.h>
#include <nls/geometry/BarycentricCoordinates.h>
#include <nls/utils/ConfigurationParameter.h>
namespace epic::nls {
/**
* Class to evaluate marker constraints (point2poin... | ALGO | 0.940358 | 7.043173 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-06-20T06:18:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5d42841a628... |
0109b344-ea25-41df-a7f4-d7ffa3f50b64 | markatopoulou/fvmtl-ccelc | code_caffe-rc3_fvmtl_ccelc/src/caffe/layers/correlation_constraint_layer.cpp | #include <vector>
#include "caffe/layers/correlation_constraint_layer.hpp"
#include "caffe/util/math_functions.hpp"
#include <cmath> // std::abs
namespace caffe {
template <typename Dtype>
void CorrelationConstraintLayer<Dtype>::LayerSetUp(
const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& to... | DATA | 0.994849 | 6.328688 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-06-13T12:39:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3de8237482... |
593b298f-4fc3-4141-ad15-880babdbe608 | google/cpp-from-the-sky-down | string/string.cpp | // Copyright 2018 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | TOOL | 0.95659 | 7.376513 | {
"github_metadata": {
"branch": "master",
"commit_count": 337,
"repo_created_at": "2018-08-15T19:59:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 275,
"forks": 33,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "84f3cd... |
19935196-4890-410d-b45e-18ede72d88b9 | jeonggyunkim/problemsolving | boj/56786386b11b.cpp | #include <iostream>
using namespace std;
int main() {
int arr[10001];
int zero[10001];
int one[10001];
int two[10001];
int n;
scanf("%d", &n);
for (int i = 0; i < n; ++i) scanf("%d", arr + i);
two[0] = zero[0] = 0;
one[0] = arr[0];
for (int i = 1; i < n; ++i) {
two[i] = one[i - 1] + arr[i];
one[i] = ... | ALGO | 0.999988 | 3.420903 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2020-10-04T16:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a02797d2... |
9f8c9496-d863-4bb2-93dd-3275eb05a1f0 | bluedawnstar/algorithm_study | library/set/vanEmdeBoasTree.cpp | #include <cassert>
#include <memory>
#include <vector>
#include <algorithm>
using namespace std;
#include "vanEmdeBoasTree.h"
/////////// For Testing ///////////////////////////////////////////////////////
#include <time.h>
#include <cassert>
#include <string>
#include <iostream>
#include "../common/iostreamhelper.... | ALGO | 0.99417 | 5.45144 | {
"github_metadata": {
"branch": "master",
"commit_count": 1274,
"repo_created_at": "2016-12-10T02:41:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 58,
"forks": 8,
"issues": 58,
"pull_requests": 0
},
"file_meta": {
"content_id": "3be70... |
9bf4a71a-b17d-4cd7-9453-8fe56758009a | rashig-13/DSA | Dynamic-Programming/Paint_House_lc.cpp | There is a row of n houses, where each house can be painted one of three colors: red, blue, or green. The cost of painting each house with a certain color is different. You have to paint all the houses such that no two adjacent houses have the same color.
The cost of painting each house with a certain color is represe... | ALGO | 0.998623 | 5.571354 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2021-05-28T06:36:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "875705d9d8... |
93b892c7-e612-4f1e-91d2-a2f647be7527 | vaibhavchaubey/DSA-Practice | Boundary Traversal of binary tree - GFG/boundary-traversal-of-binary-tree.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define MAX_HEIGHT 100000
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
... | ALGO | 0.999575 | 5.433569 | {
"github_metadata": {
"branch": "main",
"commit_count": 714,
"repo_created_at": "2022-06-19T16:10: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": "b4a8939bc9... |
6cbceb5f-d085-4263-822a-5cfdb3c0711f | manasa0520/Leetcode | 8) String to Integer (atoi).cpp | // Approach 1
class Solution {
public:
int myAtoi(string str) {
string num;
unordered_set<int> digits = {'0','1','2','3','4','5','6','7','8','9'};
bool is_negative = false;
int n = str.length();
if(n==0)
return 0;
int i=0;
... | ALGO | 0.999786 | 5.129414 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2024-03-03T05:13: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": "30b0226455b... |
785a1de8-30d6-4c73-bfdd-122f906e65ca | jorden-io/cmath | src/math.cpp | #include "math.hpp"
namespace math
{
double cubed(double n)
{
return n * n * n;
};
double sqrt(double n)
{
if (n == 0 || n == 1)
{
return n;
}
int start = 1, end = 1000;
while (start + 1 < end)
{
int mid = start + (end... | ALGO | 0.994271 | 3.520866 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2023-01-04T22:11:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d167256711... |
d7f5ec25-da2e-4b5f-8f59-8f2424177f90 | grupo3ulp/TP2A_EDA | Guia2ej4.cpp | #include <iostream>
using namespace std;
//Ejercicio 4: Escriba un programa que tome cada 4 horas la temperatura exterior, leyéndola durante un período de 24
//horas. Es decir, debe leer 6 temperaturas. Calcule la temperatura media del día, la temperatura más alta y la más baja
int main() {
float temp, media = 0,... | ALGO | 0.961013 | 3.733938 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-10-04T01:37:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57b60387bcfe7... |
dea8f116-89c7-46d2-8df2-e94843d92fa0 | newpolaris/algorithm | baekjoon/2250.cpp | #include <cstdio>
#include <algorithm>
int cnt = 1;
int left[10001];
int right[10001];
int level[10001];
void Inorder(int idx, int lv) {
int l = left[idx], r = right[idx];
if (l > 0) Inorder(l, lv+1);
level[cnt++] = lv;
if (r > 0) Inorder(r, lv+1);
}
int main() {
#ifdef _DEBUG
freopen("2250.in", "r"... | ALGO | 0.999966 | 3.498999 | {
"github_metadata": {
"branch": "master",
"commit_count": 398,
"repo_created_at": "2016-10-21T06:12: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": "2dd2afc8... |
720ac588-3cdd-4383-bc0c-d12068af0eb1 | Carboniferous/AltAI | AltAI/city_optimiser.cpp | #include "AltAI.h"
#include "./city_optimiser.h"
#include "./city_log.h"
#include "./civ_log.h"
#include "./map_analysis.h"
#include "./specialist_helper.h"
#include "./happy_helper.h"
#include "./game.h"
#include "./player.h"
#include "./city.h"
#include "./player_analysis.h"
#include "./tactic_actions.h"
namespace ... | ALGO | 0.99749 | 5.734798 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2011-12-19T20:02: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": "accd81b1e... |
69756f06-f801-4a62-8d85-34a7bef6acf5 | Khrustalion/2-semester | ARCHVM/Representation of numbers/main.cpp | #include <string>
#include <cstring>
#include <iostream>
#include <cstdint>
#include <algorithm>
#include <ostream>
#include <ios>
#include <cstdlib>
struct ArgumentsFixed {
int A;
int B;
int rounding;
long long number_1;
char operation = 0;
long long number_2;
};
struct ArgumentsFloat {
... | TOOL | 0.964809 | 3.965776 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2024-03-01T06:34: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": "e68b953152a... |
b64d55d3-4496-4a79-8667-02f548f8578f | Chandrashekharsk/dsa_cpp | day39/subArraySumEqualsK.cpp | // 560. Subarray Sum Equals K
#include<iostream>
#include<vector>
#include<unordered_map>
using namespace std;
int subarraySum(vector<int>& nums, int k){
int count = 0;
for(int i=0; i<nums.size(); i++){
int sum = 0;
for(int j=i; j<nums.size(); j++){
sum += nums[j];
if(sum == k) count++;
}
... | ALGO | 0.999761 | 5.506123 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2024-09-17T18:52: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": "74e7f633b64... |
032b6f2c-b838-4ef7-9603-2e0bcb5f0257 | PerfectLifeG/Algorithm-Competition | PracticeMakesPerfect/2023Spring/4.9_/d__.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=300010;
const int mod=998244353;
#define sc(n) scanf("%d",&n)
#define all(x) x.begin(),x.end()
#define no cout<<"No"<<endl
#define yes cout<<"Yes"<<endl
int h[N],e[N],ne[N],idx;
void add(int a,int b){
e[idx]=b;
ne[idx]=h[a];
h[a]... | ALGO | 0.999978 | 4.322071 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-08-27T07:51:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24c7852a4080... |
bf667512-2918-43f3-9890-385ddd19393d | nybzmr/CP | cp31/1300/D_Buying_Shovels.cpp | // Author: <NAME>
#include <bits/stdc++.h>
using namespace std;
#define pi (3.141592653589)
#define mod 1000000007
#define pb push_back
#define is insert
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define min3(a, b, c) min(c, min(a, b))
#define min4(a, b, c, d) min(d, min(... | ALGO | 0.999975 | 4.990012 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-07-22T18:12:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36a37da8dce7... |
e6b15399-9e2e-482e-a3b8-f6938a8450d8 | st107035/programming-c-2023-2024 | Homework-6/2023.11.26-Homework-6/Source.cpp | #include <iostream>
#include <fstream>
#include <ctime>
#include"Task.h"
using namespace std;
int* Fiber(ifstream &f, bool print_flag)
{
int n, t, priority;
int size = 0;
f.open("Tasks.txt");
f >> n;
Task* data = new Task[n];
int* rdata = new int[n];
for (int i = 0; i < n; ++i)
{
f >> t >> priority;
tr... | ALGO | 0.999663 | 4.351183 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-11-18T20:28: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": "b7bae914d592... |
b004d4e4-9096-46cb-b827-0ad2e291c1d5 | acsdavid97/TUCN_CS_3yr-2 | FLT/resources_lab/1TABSIMB/DEF2.H | // FISIERUL: def2.h
enum Boolean {false,true};
typedef struct _intrare{
char *nume;
int atribut; // de obicei referinta la o structura de atribute
}INTRARE;
class hash { //clasa tabela de dispersie
private:
int D ; //dimensiunea tabelei
int LIMITA_INCERCARI;
INTRARE tabela_dispersie[... | TOOL | 0.940963 | 3.96825 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2018-03-02T11:44:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02e102c66... |
25bf7145-2bc9-4e27-8904-9598a8b882a0 | zimpha/competitive-programming | spoj/UJ01.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main() {
int T; scanf("%d", &T);
for (int _ = 0; _ < T; ++ _) {
int A, B, N; scanf("%d%d%d", &A, &B, &N);
LL left = min(A, B), right = (LL)max(A, B) * N;
int AB = A * B / __gcd(A, B);
while (left < right) {
LL mid = (left... | ALGO | 0.99998 | 3.517074 | {
"github_metadata": {
"branch": "master",
"commit_count": 352,
"repo_created_at": "2016-08-17T16:37:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1bb472... |
cc723633-65b8-4f39-a7ca-a4aedfea89b4 | Ticlero/algorithm_study_with_cpp | 그리디 알고리즘/11장 실습/2_multi_or_plus.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdlib>
#include <ctime>
#include <stdio.h>
#include <string.h>
using namespace std;
#define MAX_SIZE 21
int plus_fun(int x, int y)
{
return x + y;
}
int multi_fun(int x, int y)
{
return x * y;... | ALGO | 0.999908 | 3.205042 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2020-10-07T16:06: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": "daf7b1fd85d... |
2687ebb3-93ba-4a5a-8ffe-9de933bf0d1e | sakuragi97/cpp-opencv | src/histogram1d.cpp | #include "histogram1d.h"
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgcodecs/imgcodecs.hpp>
#include <opencv2/imgproc/imgproc.hpp>
Histogram1D::Histogram1D()
{
// Prepare argument of 1D histogram
histSize[0] = 256;
hranges[0] = 0.0;
hranges[1] = 255.0;
ranges[0] = hranges;
channels[... | TOOL | 0.987235 | 5.156821 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-12-24T19:44: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": "0b5bff4a57b2... |
c85ff0af-0fdb-4710-a000-aeeac9076254 | Kumar-Akshat22/Assignments-DSA | Arrays-Assignment/TwoSum.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
// Also known by the name Key-Pair problem
// Two Pointer Approach
vector<int> twoSum(vector<int> &arr, int target){
// Array must be sorted to apply two pointer approach
sort(arr.begin() , arr.end());
int n = arr.size();
... | ALGO | 0.999941 | 4.943213 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-06-20T04:17: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": "a34049aa29f... |
76e9feeb-9505-49e1-8114-eb4e5286b1f2 | DDeo99/Algorithm-Study | DataStructure/2042(2).cpp | // BOJ 백준 2042번 구간 합 구하기
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;
long long N,M,K;
vector<long long> nums;
vector<long long> indexTree;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin>>N>>M>>K;
f... | ALGO | 0.999911 | 4.94281 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2023-07-28T15:14: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": "153fc115... |
2d60b936-332f-4c36-8c7e-0fcf3b589b7d | pompon0/lazyparam_prover | kbo.h | #ifndef KBO_H_
#define KBO_H_
#include "util/short.h"
#include "pred.h"
#include "types.h"
#include <algorithm>
inline size_t max_var(Term t) {
switch(t.type()) {
case Term::VAR: return Var(t).id();
case Term::FUN: {
Fun tf(t);
size_t h = 0; for(auto i=tf.arg_count(); i--;) util::maxi(h,max_var(tf.arg(i... | ALGO | 0.993111 | 3.840357 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-04-17T20:59: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": "3c64e1c70... |
5a82c656-fbd8-42e8-8256-8786c450751e | abhi061201/GFG-LEETCODE-CODINGNINJA-SOLUTION | Implementing Dijkstra Algorithm - GFG/implementing-dijkstra-algorithm.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the shortest distance of all the vertices
//from the source vertex S.
vector <int> dijkstra(int n, vector<vector<int>> adj[], int S)
{
vector<int>dist(n... | ALGO | 0.999959 | 5.860598 | {
"github_metadata": {
"branch": "main",
"commit_count": 1328,
"repo_created_at": "2022-01-11T12:52:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a4de364c9... |
a24f0f85-953e-4b84-aedc-66b01cda1e3e | Edwin-Kevin/LeetCode | 19_Remove_Nth_From_End.cpp | /**
* 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 *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* removeNthFr... | ALGO | 0.99998 | 5.729422 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-04-08T14:06: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": "4574cf0be9f... |
63124db5-675c-44fe-986f-16c273bcccd4 | Swarajballal/DSA-Folder | Week-2-CMN-functions/moveallnegum.cpp | #include<iostream>
#include<vector>
using namespace std;
// method 1 using sort STL
//sort(arr.begin(), arr.end()); time complexity o(nlogn) and space complexity o(n)
//method 3 using pointer time complexity o(n) and space complexity o(1)
// void moveneg(vector<int> arr)
// {
// int low = 0, mid = 0, high = ar... | ALGO | 0.999969 | 4.376714 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2023-02-08T15:07: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": "9f9f6bf8... |
5b6bfbd4-a61d-4631-9120-66fc791935ea | lindseyjin/Competitive-Programming | Leetcode/Easy/reverse-only-letters.cpp | class Solution {
public:
string reverseOnlyLetters(string S) {
if (S.length() == 0) return S;
string ans = "";
vector<int> non_letters;
char temp;
// reverse string and store indexes of non letters
for (int i = S.length() - 1; i >= 0; i--) {
... | ALGO | 0.9991 | 6.145785 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2018-03-01T18:15: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": "88b52c180... |
01daabbd-ae3e-42b6-8ffb-266d654a1a5f | chirag05-coder/Competitive_Coding | Equilibrium_point_gfg.cpp | Link for Ques:
https://practice.geeksforgeeks.org/problems/equilibrium-point-1587115620/1#
#include <iostream>
using namespace std;
// } Driver Code Ends
#include<bits/stdc++.h>
class Solution{
public:
// Function to find equilibrium point in the array.
// a: input array
// n: size of array
int... | ALGO | 0.999485 | 5.776144 | {
"github_metadata": {
"branch": "main",
"commit_count": 575,
"repo_created_at": "2021-03-27T07:19:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d622bba40... |
e7925a76-af87-4b8a-a107-cfbd17dcf81c | ShrajanPandey/-CrackYourInternship-Challenge | 1627-graph-connectivity-with-threshold/1627-graph-connectivity-with-threshold.cpp | class Solution {
public:
vector<int> parent , size;
int find( int child ){
if( parent[child] == child ){
return child;
}
return parent[child] = find(parent[child]);
}
bool Union(int a , int b ){
int pa = find(a);
i... | ALGO | 0.999853 | 5.629431 | {
"github_metadata": {
"branch": "main",
"commit_count": 1318,
"repo_created_at": "2022-05-04T08: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": "a7e377988... |
47bd2ed2-3838-4dae-a731-a5756bdd0c84 | jyh-violet/HeterMM | src/ycsb.cpp | #include <iostream>
#include <chrono>
#include <random>
#include <cstring>
#include <vector>
#include <fstream>
#include <iostream>
#include <stdlib.h>
#include <atomic>
#include <thread>
#include <sched.h>
#include <string.h>
#include <time.h>
#include <libconfig.h>
#include "hm.hpp"
#include "index/clht_lb_res.h"
#in... | TOOL | 0.948291 | 3.484208 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-10-05T12:01: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": "60bb251251e8... |
19fceca4-b7ee-41f0-8035-1e51b45bf3a5 | tenacious-39/-SdeSheetChallenge-StriversSdeSheetChallenge | day23/palindromeLinkedList.cpp | /**
* 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 *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseList... | ALGO | 0.999873 | 6.099651 | {
"github_metadata": {
"branch": "main",
"commit_count": 237,
"repo_created_at": "2022-06-04T15:22: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": "a61cd14ff8... |
ba880e0a-dc0f-49e0-a8f1-9a2c4c5806bc | chris4540/algorithm_exercise | leetcode/reverse-int/revint.cpp | #include <string>
#include <iostream>
#include <cassert>
#include <limits>
using namespace std;
// ---------------------------------------------------
class Solution {
public:
int reverse(int x) {
int ret = 0;
while (x != 0) {
// shift 1 pos in decimal system
if (mulOverflo... | ALGO | 0.999951 | 5.389834 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2020-04-05T08:23: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": "bee88d39... |
447bd936-cc27-4cad-a960-95cccd9c97cf | wonbin0221/ProblemSolving | Problem_Solving-Studio/Collab/Solution/test.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
using namespace std;
bool compare(const pair<int, pair<int, int>>& a, const pair<int, pair<int, int>>& b) {
return a.first > b.first;
}
int findDifficulty(vector<vector<int>>& cells, vector<vector<bool>>& visit, pair<int... | ALGO | 0.999932 | 4.884879 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-04-19T04:30: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": "a3aee933cde5... |
f7efdc1d-bed7-48d3-8d12-2dfe9248d7da | PedroAngeli/Competitive-Programming | Solutions/Atcoder/Contests/AtCoder Beginner Contest 168/d.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
int n,m;
const int nax = 1e5 + 5;
vector <int> adj[nax];
int ans[nax];
bool bfs(int s){
queue <int> q;
q.push(s);
vector <bool> vis(n+1,false);
while(!q.empty()){
int u = q.front();
q.pop();
for(int i=0;i<adj[u].size();i++){
... | ALGO | 0.999997 | 4.207964 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2019-07-26T00:01: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": "5065668c9... |
59b37dd6-e8ca-44d7-9534-f42fc0f0b6f4 | SooinPark1019/PS | 백준/Diamond/24272. 루트 노드가 많은 트리일수록 좋은 트리이다/루트 노드가 많은 트리일수록 좋은 트리이다.cc | #include <ext/rope>
#include <bits/stdc++.h>
#define _USE_MATH_DEFINES
//#pragma GCC optimize ("O3")
//#pragma GCC optimize ("Ofast")
//#pragma GCC optimize ("unroll-loops")
#define pii pair<int,int>
#define pll pair<ll,ll>
#define PB push_back
#define fi first
#define se second
#define all(v) (v).begin(), (v).end()
#d... | ALGO | 0.999953 | 4.302868 | {
"github_metadata": {
"branch": "main",
"commit_count": 483,
"repo_created_at": "2024-09-01T15:38: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": "759d9ca904... |
873776be-a2e0-423a-ade7-f5ad963ea43c | lauragalera/Skyscrapers-Problem-Backtracking | code/main.cpp | //<NAME>
//u1959173
//pràctica 1
/**
*@file main.cpp
*@brief part principal del programa
*@author <NAME>
*/
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <chrono>
#include "Solucio.h"
#include "Solucionador.h"
using namespace std;
/** @... | ALGO | 0.999239 | 4.47369 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-09-10T17:05: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": "5ca06422e... |
7bbc6919-25ea-4aaa-9d3b-d8301f20fe6a | DanielMcInnes/aoc2021 | 2022/23a/grid.h | #ifndef GRID_H
#define GRID_H
#include <map>
#include <vector>
#include <cassert>
typedef enum {
North,
South,
West,
East
} Direction;
class xy {
public:
xy(const int x, const int y) : x(x), y(y) {}
int x;
int y;
xy relativeLocation(const Direction direction) const {
switch (direction) {
case North: retu... | ALGO | 0.987839 | 5.64619 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2021-12-02T05:36: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": "1c77a507541... |
a71dd8c0-9ad7-425a-b558-6d84e31fd463 | frozenca/CLRS3 | 5/5.4-4.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <random>
#include <unordered_map>
#include <utility>
#include <vector>
std::mt19937 gen(std::random_device{}());
std::uniform_int_distribution<> birthday(1, 365);
int main() {
constexpr size_t N = 94;
constexpr size_t trials... | ALGO | 0.999339 | 4.580507 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-02-09T03:14:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 55,
"forks": 19,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95ec2aca5... |
abf1f75d-2f29-4856-84cb-a3eb6596987c | Tudor67/Competitive-Programming | LeetCode/Problems/Algorithms/#1937_MaximumNumberOfPointsWithCost_sol1_dp_O(RxCxC)_time_O(C)_extra_space_TLE.cpp | class Solution {
public:
long long maxPoints(vector<vector<int>>& points) {
const int ROWS = points.size();
const int COLS = points[0].size();
// At (row)th iteration:
// maxPoints[row % 2][col]: max points at cell (row, col)
// when we start f... | ALGO | 0.999933 | 5.874317 | {
"github_metadata": {
"branch": "master",
"commit_count": 615,
"repo_created_at": "2020-02-27T19:56:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70a92494... |
c66efd4d-6200-45be-b436-8654f71f86b1 | QbitQuantum/Basics | Исходники/Aggregate.cpp | bool
Aggregate::onLiteralFalse(
Solver& solver,
Literal currentLiteral,
PropagatorData p )
{
int position = p.position();
assert_msg( abs( position ) > 0 && abs( position ) < static_cast< int >( literals.size() ), abs( position ) << " >= " << literals.size() );
assert_msg( currentLiteral == ( po... | ALGO | 0.993564 | 5.689858 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2024-03-06T07:05: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": "0162ac575ae... |
60924eb5-712c-4c3e-b140-99156374cee3 | iit2018110/DS-ALGO | Binary Search/matrixMedian.c++ | #define vvi vector<vector<int>>
int solve(vvi &mat, int k) {
int ans = 0;
for(int i = 0; i < mat.size(); ++i) {
int lo = 0, hi = mat[0].size()-1;
int res = 0;
while(lo <= hi) {
int m = lo + (hi - lo)/2;
if(mat[i][m] > k) hi = m-1;
else {
... | ALGO | 0.99999 | 5.310123 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-10-25T07:36: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": "d5d77885eca0... |
45fdadd6-9245-4fd4-befd-836e428a86c0 | Liocko/plus | main.cpp | #include <iostream>
using namespace std;
int main() {
// Создание динамических массивов для таблиц A, B и C
int **A = new int*[3];
for (int i = 0; i < 3; ++i) {
A[i] = new int[4];
}
double **B = new double*[4];
for (int i = 0; i < 4; ++i) {
B[i] = new double[2];
}
dou... | ALGO | 0.999796 | 4.256976 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-02-20T09:30: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": "a9e61281edb5... |
adeccc4e-b62c-4199-a582-383f2d5216d8 | pidddgy/competitive-programming | codeforces/1418B.cpp | #include <bits/stdc++.h>
using namespace std;
// #define cerr if(false) cerr
#define watch(x) cerr << (#x) << " is " << (x) << endl;
#define endl '\n'
#define ld long double
#define int long long
#define pii pair<int, int>
#define fi first
#define se second
#define sz(a) (int)a.size()
#define all(x) (x).begin(), (x).en... | ALGO | 0.999971 | 3.409457 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2018-07-01T19:03:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4998ad321... |
fa231cf7-c667-4812-9cdb-5816af0796c8 | mastermanas805/codelibrary | LinkedLists/Merge Two Sorted Lists/code.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
ListNode* mergeTwoLists(ListNode* list1, ListNode* list2) {
... | ALGO | 0.999983 | 5.457323 | {
"github_metadata": {
"branch": "master",
"commit_count": 375,
"repo_created_at": "2021-06-08T05:25: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": "8d1efb6f... |
31b66cd4-e617-4f5d-9abe-1899d49be688 | azharakbar/EXPRESSION-EVALUATOR | evaluator.cpp | #include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
using namespace std ;
struct stack {
double operand ;
int opcode ;
};
stack A[100] ;
int top = -1 ;
int getOperand ( char expr[] , int &from ){
int operandValue = 0 ;
while ( isdigit(expr[from]) ){
if ( (expr[fro... | ALGO | 0.996682 | 3.818494 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2015-05-15T01:55: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": "fe968345c... |
19e00ff6-559f-4a4e-ba14-86e45e2cdd10 | PaulinL/tp_cpp_template | mainV1.cpp | /*
L'objectif est d'écrire une hiérarchie de classe de matrice: matrice dense, triangulaire sup, diagonale.
1. Écrire une classe matrix_t_ abstraite avec comme interface
- operator(i, j) virtuelle pure
- trace() qui renvoit la somme des éléments sur la diagonale
- print() qui affiche la matrice dans le terminale
... | TOOL | 0.915999 | 5.862594 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2019-11-12T22:37: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": "800a095a03... |
86ad97f9-f996-49e9-91de-335bb286cd78 | yuan-xiong/xycode | leetcode/round4-2020/20-merge-2-list.cpp | #include <algorithm>
#include <iostream>
#include <stack>
#include <string>
#include <vector>
#include <queue>
using namespace std;
template<typename T>
void printVector(vector<T> vec) {
//cout << "[-] " << __func__ << endl;
for(int i = 0; i < vec.size(); ++i) {
cout << vec[i] << " ";
}
cout << endl;
}
templat... | ALGO | 0.999988 | 4.832143 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-12-30T04:19: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": "284a15af2... |
b1739177-045f-4a00-b038-8dc66549ddfc | aniliitb10/Wordle | include/words/frequent_words.h | #pragma once
#include <utility>
#include <vector>
#include <string>
#include <utility>
#include <map>
#include <algorithm>
#include <util.h>
#include <words/words.h>
/**
* A class which suggests words based on how frequently they are used in the language
* - source: https://www.kaggle.com/rtatman/english-word-freq... | TOOL | 0.983269 | 6.756687 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-01-07T19:47: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": "f5326e1c686... |
f29ee6ab-4b47-4f91-bd03-75d8ce373650 | metehkaya/Algo-Archive | Problems/LeetCode/Solutions/2816.Double_a_Number_Represented_as_a_Linked_List.cpp | /*
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
*/
class Solution {
public:
ListNode* doubleIt(ListNode* head) {
int num = 0;
ListNode* node ... | ALGO | 0.999941 | 5.380703 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-04-04T19:44: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": "6fbf6887024... |
72339175-3765-4ae0-acb2-94713dec075e | SteffiKeranJ/Data-Structures-and-Algorithms-Cpp-and-Scala | Hashmap/groupAnagrams.cpp | /**
49. Group Anagrams
Given an array of strings strs, group the anagrams together. You can return the answer in any order.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.
Example 1:
Input: strs = ["eat","tea",... | ALGO | 0.999992 | 6.246245 | {
"github_metadata": {
"branch": "master",
"commit_count": 423,
"repo_created_at": "2019-08-01T19:30:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17378c2d... |
c6bc0371-e809-4b71-a67f-bdd65033e7a2 | ppremraj697/dsa-practice | Practice/stlVector.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void printVector(vector<int> v, int size)
{
cout << "Printing vector ";
for (int i = 0; i < size; i++)
{
cout << v[i] << " ";
}
cout << endl;
}
void stlVectors()
{
vector<int> v;
for (int i = 34; i > 25; i--)
{
... | TOOL | 0.939694 | 3.553164 | {
"github_metadata": {
"branch": "master",
"commit_count": 123,
"repo_created_at": "2023-03-10T11:59: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": "02d12979... |
f66693a6-e209-4db1-b3b5-33783017ae38 | vitorvilela/multigrid | tanh/tools.cpp | //tools.cpp
#include <cstdlib>
#include <iostream>
using std::cout;
#include <stdio.h>
#include <math.h>
#include "system.h"
#include "solvers.h"
#include "tools.h"
#include "exact.h"
double INFINITY_NORM(double ***Pex, double ***P, double ***E, int nx, int ny, int nz)
{
int i, j, k;
double MAX = 0... | ALGO | 0.999341 | 4.213726 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-02-27T11:49:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70ec7217b... |
e1a364f7-b90c-48ac-8204-49b6d188e446 | OSGeo/PROJ | src/projections/eck4.cpp |
#include <math.h>
#include "proj.h"
#include "proj_internal.h"
PROJ_HEAD(eck4, "Eckert IV") "\n\tPCyl, Sph";
// C_x = 2 / sqrt(4 * M_PI + M_PI * M_PI)
constexpr double C_x = .42223820031577120149;
// C_y = 2 * sqrt(M_PI / (4 + M_PI))
constexpr double C_y = 1.32650042817700232218;
// RC_y = 1. / C_y
constexpr dou... | ALGO | 0.996216 | 5.797482 | {
"github_metadata": {
"branch": "master",
"commit_count": 7437,
"repo_created_at": "2015-05-22T07:00:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1867,
"forks": 842,
"issues": 84,
"pull_requests": 1
},
"file_meta": {
"content_id": "f7... |
87294418-7e4d-4724-b1f0-93699dff211b | Gaurav237/DSA | CodeForceProblem/problems/1694A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define rep(i , j , n) for(ll i = j ; i <= n ; i++)
#define per(i , j , n) for(ll i = j ; i >= n ; i--)
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector... | ALGO | 0.999948 | 4.082329 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-06-12T11:54: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": "1c41d27826... |
fbcb9eeb-c0ab-46df-bfc2-96f98ed7e932 | Shrey97B/CS610_Programming_For_Performance | Assignment_04/20111060-p3.cpp | // g++ -std=c++11 -fopenmp 20111060-p3.cpp -o 20111060-p3 -ltbb
#include <chrono>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <omp.h>
#include <tbb/tbb.h>
using std::cout;
using std::endl;
using std::chrono::duration_cast;
using HR = std::chrono::high_resolution_clock;
using HRT... | ALGO | 0.998687 | 6.47668 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-01-21T14:39: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": "f6d45231c2... |
7e778045-3af8-4976-8078-48a3e46d70f2 | ishandutta2007/codeforces-l | luhong/normal/938/D.cpp | #include <cstdio>
#include <queue>
using namespace std;
typedef pair<long long, int> P;
priority_queue<P, vector<P>, greater<P> > pq;
long long d[201000];
int h[201000], nxt[401000], to[401000], K = 0; long long cost[401000];
void ins(int u, int v, long long c) {nxt[++K] = h[u]; h[u] = K; to[K] = v; cost[K] = c;}
v... | ALGO | 0.999787 | 3.207945 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c2c8df6d366... |
f2c8977e-7f7d-4b27-b021-2b2436e8e297 | kisuk010203/PS | C++/String/KMP/11585.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX 100
int pi[MAX];
char T[2 * MAX];
char P[MAX];
int n;
void initPi() {
pi[0] = 0;
int j = 0;
for (int i = 1; i < n; i++) {
while (j > 0 && P[i] != P[j])
j = pi[j - 1];
if (P[i] == P[j])
pi[i] = ++j;
}
}
int ... | ALGO | 0.999981 | 4.253214 | {
"github_metadata": {
"branch": "master",
"commit_count": 124,
"repo_created_at": "2023-08-16T13:07: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": "2903abcb... |
fdb6cb7e-c237-4bcc-8e62-10af63451e5e | dwaynethebard/Math-and-Coding-probelms | Project Euler/Problem 2/main.cpp | #include <stdio.h> /* printf */
#include <math.h> /* sqrt */
int Fib(int N);
int FibEven(int N);
long BinetFibNum(int N);
long BinetFibNumSum(int N);
int main(int argc, char *argv[])
{
int Binetsum,simsum,evensum;
Binetsum =BinetFibNumSum(4000000);
evensum =FibEven(4000000);
simsum =Fib(400... | ALGO | 0.999957 | 4.5664 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2020-03-26T02:57: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": "3a378161... |
4102e24e-7927-408c-b878-552d1f70b5de | jakiemillman/DataConteiners | ForwardList/ForwardList.cpp | // ForwardList
#include <iostream>
#include <time.h>
using namespace std;
using std::cin;
using std::cout;
using std::endl;
#define tab "\t"
#define delimiter "\n--------------------------------------------------------\n"
class Element
{
int Data;
Element* pNext;
static int count;
public:
Element(int Data, ... | TOOL | 0.978033 | 5.25895 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2023-05-16T18:53:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5cf1c6b0f5... |
1c913ac6-fc00-42ce-a72e-9801e63f7c79 | akhilkammila/leetcode-screenshotter | editorial_code/1-999/087. Scramble String/cpp-0.cpp | class Solution {
public:
bool isScramble(string s1, string s2) {
int n = s1.size();
vector dp(n + 1, vector(n, vector<int>(n)));
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
dp[1][i][j] = s1[i] == s2[j];
}
}
for (int leng... | ALGO | 0.999992 | 6.185745 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-06-02T16:24:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 912,
"forks": 294,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "a373c99... |
78a00bc9-5634-47d5-9b59-c99c0dab86be | fernandesitalo-zz/Competitive-Progamming | UVA OJ - ALL/geo_uva11639.cc | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS 1e-9
#define DEG_to_RAD(theta_) (M_PI*theta_/180.0)
#define abre freopen("in","r",stdin);
#define pb push_back
#define PI 2*acos(0)
#define x first
#define y second
typedef pair<int,int> ponto;
typedef pair<ponto,ponto> quadrilatero;
... | ALGO | 0.998955 | 3.859586 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-05-31T13:26: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": "f2a135eac... |
eda0c9d2-18cd-4f9c-8695-7e8daaf30161 | HieuKVN/CPlusPlus | ! TU ON TAP/TONGNSNT/TONGNSNT.CPP | #include <bits/stdc++.h>
#define nmax 10000000 // broken 10^12
using namespace std;
long long f[nmax];
void sang(long long u)
{
long long j;
for (long long i = 0; i <= u; i++)
{
f[i] = 1;
}
f[0] = f[1] = 0;
for (long long i = 2; i * i <= u; i++)
{
if (f[i])
{
... | ALGO | 0.999924 | 4.218214 | {
"github_metadata": {
"branch": "main",
"commit_count": 149,
"repo_created_at": "2024-07-24T04:04: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": "283fd209aa... |
26299c40-4d3e-49e7-b91d-03e4f3bd5d7d | Thinker28/USACO | cses/shortestroutes2.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(void){
int n, m, q;
cin >> n >> m >> q;
vector<vector<long long> > dp(n + 1, vector<long long> (n + 1, 1e18));
for(int i = 0; i < m; i++){
int a, b, w;
cin >> a >> b >> w;
if(w < dp[a][b]){
dp[a][b]... | ALGO | 0.999961 | 4.044188 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-03-07T02:28:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b3a93923d... |
11b2c56b-45c2-4097-9e18-fe8bdb6b08d3 | NouemanKHAL/Competitive-Programming | Codeforces/1015/B [Obtaining the String].cpp | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define beg begin
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define sz(x) ((int) (x).size())
#define sqr(x) ((x) * (x))
#define rep(i,n) for(int i=0;i<n;i++)
#... | ALGO | 0.999979 | 3.471116 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-08-28T21:46: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": "ee068f20c... |
583ef3d3-4bd1-4735-a44c-14b354fdfa35 | stan-dev/math | stan/math/opencl/prim/segment.hpp | #ifndef STAN_MATH_OPENCL_PRIM_SEGMENT_HPP
#define STAN_MATH_OPENCL_PRIM_SEGMENT_HPP
#ifdef STAN_OPENCL
#include <stan/math/opencl/matrix_cl.hpp>
#include <stan/math/opencl/err.hpp>
#include <stan/math/opencl/prim/block.hpp>
namespace stan {
namespace math {
/**
* Return the specified number of elements as a row/col... | ALGO | 0.976306 | 5.197585 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28933,
"repo_created_at": "2015-07-01T18:40:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 195,
"issues": 298,
"pull_requests": 19
},
"file_meta": {
"content_id": ... |
77f8eca4-2d41-4856-ae42-a03bda8f7232 | Mohammed-Nour/AGLA_predator_prey_system | Eigenvalues and Differential Equations.cpp | #include <iostream>
#include <cmath>
#include <bits/stdc++.h>
using namespace std;
int main()
{
double v0, k0, alphaOne, betaOne, alphaTwo, betaTwo, timeLimit,V0,K0;
int counts;
double vi,ki;
// Input the parameters
cin >> V0 >> K0 >> alphaOne >> betaOne >> alphaTwo >> betaTwo >> timeLimit >> coun... | ALGO | 0.999724 | 3.131294 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-05-01T12:37: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": "c07121fce1df... |
ab28d07d-0764-444d-8854-ce23ed78a870 | Miroier/Algorithm-note-for-Codeup | 《算法笔记》6.2小节--C++标准模板库(STL)介绍->set的常见用法详解/A.cpp | #include "cstdio"
#include "set"
using namespace std;
int main()
{
int N;
scanf("%d", &N);
set<int> a[N + 1];
set<int>::iterator it;
for (int i = 1; i <= N; i++)
{
int M;
scanf("%d", &M);
for (int j = 0; j < M; j++)
{
int m;
scanf("%d", &m)... | ALGO | 0.999685 | 3.609435 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2019-08-13T09:15:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1138e4e... |
5960b927-7610-4b8e-bbbc-04db5d5802aa | guowanwei/UE4.24.3 | Engine/Plugins/Experimental/MeshModelingToolset/Source/MeshModelingTools/Private/MeshSpaceDeformerTool.cpp | // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "MeshSpaceDeformerTool.h"
#include "InteractiveToolManager.h"
#include "ToolBuilderUtil.h"
#include "SegmentTypes.h"
#include "DynamicMeshAttributeSet.h"
#include "MeshNormals.h"
#include "ToolSceneQueriesUtil.h"
#include "Intersection/Intersection... | ALGO | 0.994851 | 6.819322 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-05-25T17:01:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "3b0ad5ff50... |
c17d921d-990e-496c-8602-944577b52b0f | nragland37/cpp-projects | data_structures-II/10-AList-Sorting-Algorithms/sortedAList.h | //*****************************************************************************************************
//
// This header file defines a class template for an array-based list with the following sorting
// algorithms: selection, quick sort
//
//*****************************************************************... | ALGO | 0.996229 | 5.833253 | {
"github_metadata": {
"branch": "main",
"commit_count": 424,
"repo_created_at": "2022-01-27T21:33:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 414,
"forks": 53,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "f9935ca... |
0fa9a1c1-8b29-4be1-9325-d25403066142 | AndrewYGHUB/leet | solution/1600-1699/1602.Find Nearest Right Node in Binary Tree/Solution.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.999974 | 5.929176 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-07-21T06:56: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": "7577a180950b... |
07b4af5f-ed61-466b-af6b-ac9931b597fb | ishandutta2007/codeforces-d | danya090699/normal/1394/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int sz=2e5+10;
bool sm[10][10][10][10], bad[10][10];
int k, c[10], an=0;
void dfs(int l)
{
if(l>k)
{
int ok=1;
for(int a=1; a<=k; a++)
{
if(bad[a][c[a]])
{
ok=0;
break;
... | ALGO | 0.999961 | 4.290832 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31: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": "7d087765217d... |
31b57218-1137-47f6-b0fc-814fe4a19af7 | RentoYabuki06/atcoder | kyopro-tessoku-practice/A/a64_ShortestPath2.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e9;
int N, M;
int A[100009];
int B[100009];
int C[100009];
vector<pair<int, int>> graph[100009];
int cur[100009];
int main() {
cin >> N >> M;
for (int i = 1; i <= M; i++) {
cin >> A[i] >> B[i] >> C[i];
... | ALGO | 0.999981 | 4.194146 | {
"github_metadata": {
"branch": "main",
"commit_count": 192,
"repo_created_at": "2024-03-31T03:08: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": "47f316f6b3... |
7fd199d7-3b8d-4b3c-9b03-d86a33cdf040 | The-Loved-One/IPMP | Week2/q41_largest_sum_contigous_subarray.cpp | #include <bits/stdc++.h>
using namespace std;
// KADANE'S ALGORITHM
class Solution{
public:
string maxSum(string w,char x[], int b[],int n)
{
map<char, int> mp;
// mapping values present in b
// to their respective chars in x
for(int i = 0; i < n; i++) mp[x[i]] = b[i]; ... | ALGO | 0.99993 | 4.894712 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-02-28T18:20: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": "53a03b0336f6... |
d0464c41-99a5-4941-8ec9-6e71c03b85a3 | 26sramirez6/SkipList | SkipList.hpp | /*
* SkipList.hpp
*
* Created on: Oct 4, 2018
* Author: 26sra
*
Skip Lists: http://cs.ipm.ac.ir/asoc2016/Resources/Theartofmulticore.pdf Chapter 14
Motivation: Randomized datastructure with logarithmic depth. A simplier alternative
to red-black trees or AVL trees when implemented with concurrency.
Concurre... | ALGO | 0.996682 | 4.980287 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-01-08T20:57:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0306626c60... |
3290a8b7-d621-4fe1-84fe-4f2bb8478070 | Gaurav-20/LeetCode-Solutions | 1905-count-sub-islands/1905-count-sub-islands.cpp | class Solution {
public:
int n, m;
void dfs(vector<vector<int>>& grid1, vector<vector<int>>& grid2, int x, int y, bool& flag) {
if (x < 0 || y < 0 || x >= n || y >= m || grid2[x][y] != 1) {
return;
}
grid2[x][y] = 2;
if (grid1[x][y] == 0) {
flag = fal... | ALGO | 0.999834 | 5.899472 | {
"github_metadata": {
"branch": "main",
"commit_count": 4680,
"repo_created_at": "2022-03-05T07:21:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d3f68e7a... |
4a0cca34-c9b9-4f3c-9ea1-665e8884efe5 | swift/swift | Swift/Controllers/Contact.cpp | /*
* Copyright (c) 2013 <NAME>
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
/*
* Copyright (c) 2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swift/Controllers/Contact.h>
#include <b... | TOOL | 0.948756 | 6.629544 | {
"github_metadata": {
"branch": "master",
"commit_count": 3966,
"repo_created_at": "2015-03-09T17:34:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 272,
"forks": 65,
"issues": 25,
"pull_requests": 18
},
"file_meta": {
"content_id": "55a... |
efce2931-720b-4a53-93f0-5d93ccd88778 | Mks1311/6Companies30Days-Challenge | Adobe/Trim_a_binary_search_tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999998 | 6.056323 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2024-01-01T13:45: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": "f9f2f98f2b4... |
192481b2-1373-48ff-8470-171922887bb9 | AnirbanBanerjee25/Cpp-Codes | one_b.cpp | //Name - <NAME> Reg No - 21BPS1061
/*Let us assume that VIT Student is appointed as the Data Analyst
in a stock exchange.
Write a CPP program to predict the stocks for this week based
on the previous week rates for the following companies with
static data members and static member functions along with
other class memb... | ALGO | 0.972005 | 3.668922 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2022-06-24T14:05: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": "04d755f0a10... |
10bd5ff5-73dc-40fe-ae69-0e3b664aec88 | YarinHananiya/metaprogramming | compile_time_ranges_array.cpp | /*******************************************************************************
* create array of ranges in compile-time
* Author: <NAME>
* ****************************************************************************/
#include <array> // std::array
#include <tuple> // std::tuple
#include <type_traits> /... | TOOL | 0.901082 | 6.536158 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-05-09T10:16: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": "6cd326d68e... |
2ffbf878-fb84-4c9b-901c-6951c50af0c2 | blasco991/ALGO2020 | menu/knapsack.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> val;
void printknapSack(int W, int wt[], int val[], int n) {
int i, w;
int K[n + 1][W + 1];
for (i = 0; i <= n; i++) {
for (w = 0; w <= W; w++) {
if (i == 0 || w == 0)
K[i][w] = 0;
else ... | ALGO | 0.999991 | 3.567067 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2020-03-23T22:35: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": "99bfd30b5... |
ccf18e71-7864-4dd1-9b38-1d2fbee31481 | Notairo/Over-complicated-Hello-world | Over Complicated Hello World/Function.cpp | #include "function.h" // contains forward declarations, is needed because the functions call one another
bool password() // if password is right set master to true
{
std::string input{};
std::cout << "Enter family name (Capital first letter of course): ";
std::cin >> input;
return (input == "Benichou");
}
char ... | ALGO | 0.978999 | 3.203175 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-11-23T08:00: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": "dc72538d2c1f... |
84c38f66-f87f-446f-8a07-8673422b46be | h-sinha/CP-codes | Codeforces/1176D.cpp | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << " : " ... | ALGO | 0.99992 | 3.365697 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2018-12-01T14:51:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b651eb4c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.