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 |
|---|---|---|---|---|---|---|---|
979cfc75-652c-4ab6-b03b-a9621cdee233 | ishandutta2007/codeforces-v | vepifanov/normal/656/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define makeunique(x) sort(all(x)), (x).resize(unique(all(x)) - (x).begin())
#define re return
#define y0 y2415
#define y1 y3... | ALGO | 0.999474 | 3.367777 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92819d9277e4... |
61167bcb-b752-4692-a1bb-c4f2f0fbaef2 | dshinchan/cprogramming | DS Algo Problems/896_Monotonic_Array.cpp | /*896. Monotonic Array
An array is monotonic if it is either monotone increasing or monotone decreasing.
An array nums is monotone increasing if for all i <= j, nums[i] <= nums[j]. An array nums is monotone decreasing if for all i <= j, nums[i] >= nums[j].
Given an integer array nums, return true if the given array ... | ALGO | 0.999913 | 5.883508 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2021-03-02T16:51:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81a80b7504... |
864b4e02-7814-4120-bfbf-957513be3647 | yurisantanaa/AlgoritmoseEstruturasdeDados1 | exemplos/codigos.cpp | #include <iostream>
//METODOS DE ORDENACAO
//BUBBLESORT
void bubblesort(int vetor[],int tamanho){
int i,k;
for(i = 0;i < tamanho - 1; i++) {
for(k = 0;k < tamanho - 1;k++) {
if(vetor[k] > vetor[k + 1]) {
swap(vetor[k],vetor[k+1]);
}
}
}
}
//INSERTIO... | ALGO | 0.999144 | 3.897322 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-10-02T18:25: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": "1c1d855aa94... |
35df1663-e5a2-4904-9393-e826b8781983 | AChiolini/MultiplicationDecomposition | Operation/And.cpp | #include <stdexcept>
#include "And.h"
And::And()
{
this->shift_input1 = 0;
this->shift_input2 = 0;
this->latency = 0;
}
And::And(int shift_input1, int shift_input2)
{
setShiftInput1(shift_input1);
setShiftInput2(shift_input2);
}
And::And(int shift_input1, int shift_input2, double latency)
{
s... | TOOL | 0.983872 | 6.202793 | {
"github_metadata": {
"branch": "master",
"commit_count": 120,
"repo_created_at": "2017-06-09T11:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1dfcc9c3... |
f76b00f7-5b9c-49e8-846f-aa79e0a62a9f | Andrew10x/KR | KR_IP96_KulykA_Var5_Matrix/Header.h | #pragma once
#include <fstream>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
using namespace std;
void output(int**, int, int);
class Matrix
{
protected:
int sum0, mult0;
int** A;
int** B;
int n1, n2;
int m1, m2;
public:
Matrix();
void fill_A();
void fill_B();
void fill_A_B_fr... | ALGO | 0.971593 | 3.503915 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-06-01T14:38:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8101e6aea4... |
d2fb09df-ec3d-4daa-a12c-95899c0f89af | priaga20/CB-Algo | NumberTheory/DivisibleSubArrays.cpp | #include <iostream>
using namespace std;
#define ll long long
ll int divisibleSubArrays(ll int *arr,ll int n)
{
//finding cumulative sum and taking mod simultaneously bcoz values are large
ll int *cm=new ll int[n+1];
cm[0]=0;
for(ll int i=1;i<n+1;i++)
{
cm[i]=( (cm[i-1]%n) + (arr[i-1]%n... | ALGO | 0.999761 | 4.250418 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-05-05T20:09: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": "f0fc56d7a... |
4db69f65-8df4-4692-b7a3-f3a5fdbf8a7f | carled7/trab_KMP_ED2 | trab_KMP.cpp | #include <stdio.h>
#include <cstdio>
#include <iostream>
#include <string.h>
//#include <cstring>
#define TAM 1000
using namespace std;
typedef struct nome{
char fullName[40];
} NOME;
void calcPrefix(char p[], int lps[]) {
lps[0] = 0;
int i = 0, j = 1;
while (j < strlen(p)) {
if (p[i] == p... | TOOL | 0.987513 | 3.026411 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-05-26T13:17: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": "936fc065b830... |
d295f9ff-c754-477a-bc7d-691f57326819 | InsightSoftwareConsortium/ITK | Modules/Registration/Common/include/itkKappaStatisticImageToImageMetric.h | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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.o... | ALGO | 0.927641 | 6.307918 | {
"github_metadata": {
"branch": "main",
"commit_count": 57165,
"repo_created_at": "2010-07-27T15:48:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1517,
"forks": 701,
"issues": 268,
"pull_requests": 49
},
"file_meta": {
"content_id": "f... |
c412520b-22f1-494a-9e1c-ef194e26bc08 | alexandraneamtu/VR-Lab | lab1/rt-complete/main.cpp | #include <cmath>
#include <iostream>
#include <string>
#include "Vector.hpp"
#include "Line.hpp"
#include "Geometry.hpp"
#include "Sphere.hpp"
#include "Image.hpp"
#include "Color.hpp"
#include "Intersection.hpp"
#include "Material.hpp"
#include "Scene.hpp"
using namespace std;
using namespace rt;
double imageToVie... | ALGO | 0.916408 | 4.634722 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-12-01T13:39: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": "6fca265dc5... |
b472192e-fe27-4688-897b-fce96660fa5b | snl-dakota/dakota-packages | acro/tpl/momhlib/MOMHLib/MO/tmotools.h | /*
Multiple Objective MetaHeuristics Library in C++ MOMHLib++
Copyright (C) 2001 <NAME>, <NAME> (<EMAIL>)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation (www.gnu.org);
either version 2.1 of t... | ALGO | 0.999932 | 5.880224 | {
"github_metadata": {
"branch": "devel",
"commit_count": 279,
"repo_created_at": "2021-08-17T16:15:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 6,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "bf45f01fcd... |
52b52ec5-c914-4b91-9802-b1880683ee11 | ki7348/Algorithm | cpp/dfs_bfs/14502.cpp | #include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
int n,m;
int graph[9][9];
int new_graph[9][9];
bool check[9][9];
vector<pair<int,int>> v;
vector<int> graph_temp;
vector<vector<int>> graph_index;
vector<int> graph_index_individual;
bool check_graph[100];
queue<pair<int,... | ALGO | 0.999848 | 3.837415 | {
"github_metadata": {
"branch": "main",
"commit_count": 145,
"repo_created_at": "2021-04-08T05:50: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": "6006fbc9bb... |
67b1731c-4108-4924-991f-0e7718681588 | PastaFosil/ComputerScienceMaster | algoritmos/CPP/Tarea4/tarea4.2.cpp | /**********************************************************
* <NAME>
* PROGRAMACION Y ALGORITMOS
* TAREA 4 C++
*
* Verifica si un numero es potencia de 2 y muestra la
* posicion del bit activo.
************************************************************/
#include <iostream>
using namespace std;
int main(){
... | ALGO | 0.977344 | 5.447881 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-09-23T03:30: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": "6fc526d13a0... |
4427c87a-4516-4547-9227-d4022f61ef56 | robotakia/solar-car | Προγραμματισμός/obstacle_avoidance.ino | #define trigPin 9
#define echoPin 10
#define ena 6
#define in1 2
#define in2 3
#define enb 7
#define in3 4
#define in4 5
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(ena, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(enb, OUTPUT);
pinMode(in3, OUTPUT);
pinMod... | ALGO | 0.977483 | 5.702386 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-01-11T13:20:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c8f02485df8... |
78bcfaec-8f36-449f-bd12-9d28df23aff1 | poilpy/MLprojects | cpp/CharIdf/Neuron.cpp | #include "Neuron.h"
Neuron::Neuron(unsigned numOutputs, unsigned index)
{
for (int i = 0; i < numOutputs; ++i)
{
vOutputWeights.push_back(Link());
vOutputWeights.back().weight = randomWeight();
}
nIndex = index;
}
void Neuron::setOutputVal(double val)
{
dOutputVal = val;
}
... | ALGO | 0.915661 | 4.380921 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2016-10-13T11:42:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a0b03843... |
82e0cbd2-e1a6-4e48-9d12-68da846b592e | A4d1l/SpojSolutions | MBall.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector < long long > vll;
typedef pair < long long, long long > pll;
typedef pair < int, int > pii;
typedef vector < int > vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vpii > vvpii;
typedef... | ALGO | 0.999944 | 3.900707 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2015-02-20T10:46: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": "b7fa63d7f7... |
11b57c79-f383-4aef-bc31-bbbeaba65d5f | nazmul4532/DS_Lab_CSE_4304 | Lab2/200042118_T01L02_1B.cpp | #include <bits/stdc++.h>
#define ll long long int
#define PI 3.14159265359
#define am_so_cool_you_know (ios::sync_with_stdio(0), cin.tie(0),cout.tie(0));
#define kaam_shesh return 0;
#define nl "\n"
using namespace std;
class Dynamic_Array
{
public:
... | ALGO | 0.995605 | 3.867566 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-10-19T15:25: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": "e420bbb9dff... |
eaecc41f-4502-49c2-ae00-f7f923b26058 | kss418/Atcoder | ABC/300/340/348/B.cpp | #include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define fastio cin.tie(0), cout.tie(0), ios... | ALGO | 0.999993 | 4.495932 | {
"github_metadata": {
"branch": "main",
"commit_count": 1312,
"repo_created_at": "2024-09-16T15:54: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": "54f4f6418... |
a0f39df2-df63-4808-b5fa-57b214a41083 | WhiZTiM/coliru | Archive2/21/8ea056aec89b00/main.cpp | #include <iostream> // Basic C++ lib
#include <fstream> // File Handling lib
#include <ctime> // clock time lib
#include <queue> // STL
#include <vector> // for sorting
#include <algorithm> // std:sort
#include <stdio.h> //sizeof
#include <list> // to sort
using namespace std;
struct node{
string name;
... | ALGO | 0.999884 | 3.904847 | {
"github_metadata": {
"branch": "master",
"commit_count": 42630,
"repo_created_at": "2016-04-21T16:34:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf247d... |
f52a4fcd-fd91-4ac5-87a1-c1753dd74fab | sabbirislam111/CPP | 1 to 27/module 24 mid tarm exam/77.cpp | #include <bits/stdc++.h>
using namespace std;
void inputArray(int a[], int n) {
for (int i = 0; i < n; i++) {
cin >> a[i];
}
}
class Node{
public:
int value;
Node* next;
Node(int val) {
this->value = val;
this->next = NULL;
}
};
void displayLi... | ALGO | 0.999961 | 4.050287 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-07-01T05:32: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": "9ec6124deb1d... |
8dcdb46a-a76d-4e31-bde6-618c455c0a26 | omidm/nimbus | applications/physbam/physbam-lib/Public_Library/PhysBAM_Dynamics/Level_Sets/PARTICLE_LEVELSET_RLE.h | #ifndef COMPILE_WITHOUT_RLE_SUPPORT
//#####################################################################
// Copyright 2005-2006, <NAME>, <NAME>, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//##########################... | ALGO | 0.992983 | 5.803047 | {
"github_metadata": {
"branch": "master",
"commit_count": 3869,
"repo_created_at": "2017-04-27T02:25:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be3e9... |
03178c3b-c66e-4d50-a584-6265532f81aa | RavEngine/RavEngine | deps/SteamAudio-All/pffft/pf_cic.cpp | /*
This software is part of pffft/pfdsp, a set of simple DSP routines.
Copyright (c) 2014, <NAME> <<EMAIL>>
Copyright (c) 2020 <NAME> <<EMAIL>>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Red... | ALGO | 0.99747 | 6.012197 | {
"github_metadata": {
"branch": "master",
"commit_count": 2900,
"repo_created_at": "2020-08-05T21:53:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 749,
"forks": 49,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9990... |
d4182dfa-3d72-4000-9e92-2d7daaa7ba18 | opencv/opencv_contrib | modules/tracking/samples/kcf.cpp | /*----------------------------------------------
* Usage:
* example_tracking_kcf <video_name>
*
* example:
* example_tracking_kcf Bolt/img/%04.jpg
* example_tracking_kcf faceocc2.webm
*--------------------------------------------------*/
#include <opencv2/core/utility.hpp>
#include <opencv2/tracking.hpp>
#inclu... | ALGO | 0.953785 | 6.089097 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 4557,
"repo_created_at": "2013-09-11T13:28:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9757,
"forks": 5828,
"issues": 553,
"pull_requests": 88
},
"file_meta": {
"content_id": "07... |
d8c8906e-ef01-4415-a453-e3988135fd40 | talha4t/codeforces | difficulty-1200/1826A-Trust-Nobody.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
bool solve() {
int n; cin >> n;
int a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
int ans = -1;
for (int i = 0; i < n; i++) {
int cnt = 0;
for (int j = 0; j < n; j++) {
if (a[j] ... | ALGO | 0.999916 | 5.387455 | {
"github_metadata": {
"branch": "master",
"commit_count": 443,
"repo_created_at": "2022-10-23T02:52:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05de0bde... |
db4eb49b-6dee-4c56-9e60-3ae4d77b0e8c | Olgittmar/myAoC_2021 | src/solutions/3/day_3_part_2.cpp | #include <solutions/3/day_3_part_2.h>
#include <iostream>
#include <utils/utils.h>
#include <solutions/3/day_3_part_1.h>
namespace solutions {
// cppcheck-suppress unusedFunction
auto SubmarineLifeSupportRating(const std::string_view& input) -> int
{
auto bitstrings = utils::SplitString(input, '\n');
std:... | ALGO | 0.994973 | 6.059815 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2021-11-30T17:55:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb152e88c... |
f815586c-f79a-4608-b5c1-9069d2211618 | ArmandoFG/Proyecto2-Datos2 | Servidor/Raton.cpp | /*
* File: Raton.cpp
* Author: arman
*
* Created on 1 de julio de 2020, 07:38 PM
*/
#include <cstdlib>
#include <random>
#include "Raton.h"
#include "bresen.h"
#include "math.h"
#include "Matrix.h"
/**
* @brief Construct a new Raton:: Raton object
*
* @param raton int
*/
Raton::Raton(int raton) {
t... | TOOL | 0.961578 | 3.974718 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2020-06-19T01:52:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83f4c689... |
73e79d10-72bc-45c1-9df2-49d176c37294 | ebmw/Data-Structure-and-Algorithm | Data Structures/Trees/BTree.cpp | #include <iostream>
#include <cassert>
#include <vector>
using namespace std;
template <typename T>
class BinaryTree
{
private:
// To avoid creating node structure and so on
T data{};
BinaryTree *left{};
BinaryTree *right{};
public:
BinaryTree(T data) : data(data)
{
}
void print_inorder()
{
if (left)
l... | ALGO | 0.999986 | 5.582717 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-12-07T17:52: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": "9654595a112... |
82f1e9a8-edae-4c15-a55d-9f3b9a6269cc | ishandutta2007/codeforces-s | sugim48/normal/644/A.cpp | #define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#... | ALGO | 0.999584 | 3.134743 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5688f8b0825b... |
9dd979a6-2dab-4e89-ae6c-7d6bc2853a7f | RisshabSingla/Competitive-Programming | Code Forces/Contests/Pinely Round 4 (Div. 1 + Div. 2)/A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
const int mod = 1000000007;
bool isPossible(vector<ll> &arr, ll n, ll index)
{
}
i... | ALGO | 0.999833 | 4.439781 | {
"github_metadata": {
"branch": "main",
"commit_count": 138,
"repo_created_at": "2022-10-29T12:01:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25412ec3a0... |
72c61447-56e7-4af2-ac31-3c32941e0ea3 | timoninas/analysis-algorithms | lab_01/alg_laewenstein.cpp | //
// alg_laewenstein.cpp
// aa_lab1
//
// Created by <NAME> on 14.10.2019.
// Copyright © 2019 <NAME>. All rights reserved.
//
#include "alg_laewenstein_.h"
int Mmin (int a, int b, int c)
{
int min = a;
int max = a;
if (b > max) max = b;
if (c > max) max = c;
if (b < min) min = b;
if (c < min) mi... | ALGO | 0.999959 | 3.825752 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2019-09-11T12:45:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f720beb8... |
e72ca247-f346-4164-b98b-04f8027d6644 | rahul2106/LabAlgo | reversechck.cpp | #include<stdio.h>
struct node
{
int data;
struct node* next;
};
void print(struct node* head)
{
while(head!=NULL)
{
printf("%d ", head->next);
head=head->next;
}
}
void push(struct node *head)
{
struct node* new_node = (struct node*) malloc(sizeof(head));
new_node->data = new_data;
new_node->next = (*... | ALGO | 0.999356 | 4.231441 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-06-26T14:40: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": "4727bf3353... |
c47e72e1-18b4-4132-8d6d-247725457c55 | eyamagishi/AtCoder | C++/ADT/202311w5/20231129_2/d.cpp | // AC 33:53
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> A(n);
for (int i = 0; i < n; i++) cin >> A.at(i);
sort(A.begin(), A.end());
int cnt = 0;
for (int i = 0; i < n; i++) {
if (i + 1 < n && (A.at(i) == A.at(i + 1))) continue;
cnt++;
}
cout << cn... | ALGO | 0.999977 | 4.921357 | {
"github_metadata": {
"branch": "master",
"commit_count": 235,
"repo_created_at": "2023-11-03T09:02: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": "ede8218d... |
4f05f9cf-b1e5-4715-9ebf-9e7d9124bdbe | Justme0/leetcode | 023-merge-k-sorted-lists.cpp | /*
Merge k sorted linked lists and return it as one sorted list. Analyze and
describe its complexity.
*/
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {}
};
class Solution {
class Cmp {
... | ALGO | 0.999722 | 6.059562 | {
"github_metadata": {
"branch": "master",
"commit_count": 121,
"repo_created_at": "2015-08-09T16:03:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "89124981... |
83b65dad-f404-4ef6-912a-ca3ce0f79eea | Nugahh/CPP | CPP-08/ex02/srcs/main.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | TEST | 0.92539 | 6.071832 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2023-05-31T21:07:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9ad69fb17a... |
cd4e7005-eec8-472c-9ac2-00b7c037b43c | NoviceCoderInfinity/DSA_CP | geek_for_geeks/Print_1_To_N_Without_Loop.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Complete this function
void printNos(int n) {
// Your code here
print_recursively(1, n);
}
void print_recursively(int curr, int n) {
if (curr > n) return ;
... | ALGO | 0.998771 | 6.049659 | {
"github_metadata": {
"branch": "main",
"commit_count": 122,
"repo_created_at": "2024-08-19T08:23: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": "8849beaa56... |
25a382b8-dff7-4cdf-b8f0-14cba19bb93a | lightmen/leetcode | misc/flatten-nested-list-iterator.cpp | /**
* // This is the interface that allows for creating nested lists.
* // You should not implement it, or speculate about its implementation
* class NestedInteger {
* public:
* // Return true if this NestedInteger holds a single integer, rather than a nested list.
* bool isInteger() const;
*
* //... | ALGO | 0.999338 | 6.261474 | {
"github_metadata": {
"branch": "master",
"commit_count": 814,
"repo_created_at": "2015-03-29T06:13:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 69,
"forks": 21,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "359666... |
4c544821-afb1-4ce1-bdc5-95de7135f3e5 | klb3713/aoapc-book | BeginningAlgorithmContests/exercises/ch8/UVa11100.cpp | // UVa11100 The Trip, 2007
// <NAME>
// 题意:现在有一系列的包裹,形状都是一样的,所以小包可以套在大包的里面,这样包就少了一个。给出一系列大小不同的包,要求设计一种互相套起来的方案,使最后留下的piece最少。在此前提下piece里包数的最大值应尽量小
// 算法:注意大小相同的包不能相互套,假设大小为s的包有cnt[s]个,则max{cnt[s]}就是答案。方案构造也不难:排序以后循环给piece 1, 2, 3, ..., k
#include<cstdio>
#include<vector>
#include<map>
#include<algorithm>
using namespa... | ALGO | 0.999987 | 3.652987 | {
"github_metadata": {
"branch": "master",
"commit_count": 198,
"repo_created_at": "2013-09-22T01:26:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 181,
"forks": 56,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a591b... |
0648afbb-4017-4e4e-a887-312d990ffc4d | BorkowskiDominik/LeetCode | 2462-total-cost-to-hire-k-workers/2462-total-cost-to-hire-k-workers.cpp | enum class ALGORITHM {SINGLE_HEAP, TWO_HEAP};
constexpr auto ALGO = ALGORITHM::TWO_HEAP;
class Solution {
struct Candidate {
int cost;
int index;
inline bool operator>(const Candidate& other) const {
return cost == other.cost ? index > other.index : cost > other.cost;
}... | ALGO | 0.999911 | 5.834377 | {
"github_metadata": {
"branch": "main",
"commit_count": 689,
"repo_created_at": "2025-05-30T14:14: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": "c5df04f882... |
9fc723d0-1020-441f-8c43-52e20de7c896 | tecdatalab/biostructure | db/Updater/generators/LZerD/utils.cc | #include "utils.h"
#include "MersenneTwister.h"
#include "constants.h"
#include <algorithm>
#include <fstream>
/*
template <class T>
inline string to_string (const T& t)
{
stringstream ss;
ss << t;
return ss.str();
}
*/
// Returns false if at some point a critical point was faulty
bool check_cp(vector<cp... | ALGO | 0.994938 | 3.364957 | {
"github_metadata": {
"branch": "master",
"commit_count": 764,
"repo_created_at": "2019-01-08T18:53:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 39
},
"file_meta": {
"content_id": "4981220f... |
5665fefa-4fa1-4c6a-8e12-5449eb6ecf66 | glebmk/eth-algolab-2018 | week3/firsthit/main.cpp | #include <iostream>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <math.h>
#include <vector>
using namespace std;
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
K::Ray_2 read_ray() {
long x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
return K::Ray_2(K::Point_2(x1, y1), K::Poi... | ALGO | 0.999878 | 4.348167 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-01-30T15:58:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26758fe992... |
96a6a81d-731a-4a10-8cec-b90cdcb6d235 | tr0j4n034/Project-Euler | Solutions/107.cpp | //
// main.cpp
// practice
//
// Created by Mahmud on 5/10/18.
// Copyright © 2018 Mahmud. All rights reserved.
//
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <utility>
#include <cassert>
using namespace std;
const int M... | ALGO | 0.998987 | 3.530627 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-04-15T07:09:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbb67c0d22... |
24c51ed5-2827-4e23-aa57-73d137395e19 | woohyunjng/Coding-Practice | PS/Baekjoon/17000/17399.cpp | #include <bits/stdc++.h>
#define int long long
#define MAX 100100
#define MAX_LOG 18
using namespace std;
typedef pair<int, int> pr;
int N, parent[MAX][MAX_LOG], depth[MAX];
vector<int> arr[MAX];
bool checked[MAX];
void dfs(int K)
{
int A;
stack<int> st;
st.push(K);
checked[K] = true;
while (!s... | ALGO | 0.999983 | 5.267379 | {
"github_metadata": {
"branch": "main",
"commit_count": 485,
"repo_created_at": "2022-06-04T14:40: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": "da685cddbd... |
da1ea3f0-a181-4807-8124-84d70675d63c | ishandutta2007/codeforces-k | kotatsugame/normal/1677/E.cpp | #include<iostream>
#include<vector>
#include<map>
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
#ifdef _MSC_VER
#include <intrin.h>
#endif
namespace atcoder {
namespace internal {
int ceil_pow2(int n) {
int x = 0;
while ((1U << x) < (unsigned int)(n)) x++;
return x;
}
... | ALGO | 0.999718 | 4.399804 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "717eca5fec8e... |
c8d263e0-6b79-4ae3-a7b9-90392f5e7cfa | julesrodrigues11/NumberGameWithObjects | OOPCoursework/main.cpp | #include "NumberList.h"
//Function to change the command passed to upper case
void toUpper(std::string& str)
{
for (int i = 0; i < str.length(); i++)
{
str[i] = toupper(str[i]);
}
}
//Function to check whether the string passed through is only alphabets
//Returns a boolean accordingly
bool isAlpha(std::string st... | TOOL | 0.994102 | 4.712844 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-01-30T14:43:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "523906864d33... |
b1c0796e-d041-4787-a1af-0af9ed40eca6 | doyaGu/VxMath | src/VxIntersect_FaceFace.cpp | #include "VxIntersect.h"
XBOOL VxIntersect::PointInFace(const VxVector &point, const VxVector &pt0, const VxVector &pt1, const VxVector &pt2, const VxVector &norm, int &i1, int &i2)
{
return FALSE;
}
XBOOL VxIntersect::RayFace(const VxRay &ray, const VxVector &pt0, const VxVector &pt1, const VxVector &pt2, const ... | ALGO | 0.994222 | 4.661548 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-17T14:49: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": "5e4389952571... |
37ab024d-f814-454a-a509-058c18324307 | hritik2002/Leetcode-Problems | 0010-regular-expression-matching/0010-regular-expression-matching.cpp | class Solution {
public:
int dp[32][32];
bool solve(string s, string p, int i, int j, int n, int m) {
if(dp[i][j] != -1) {
return dp[i][j];
}
if(j == m) {
return dp[i][j] = (i == n);
}
if(p[j + 1] == '*') {
if(solve(s, p, i, j ... | ALGO | 0.999957 | 4.937837 | {
"github_metadata": {
"branch": "main",
"commit_count": 2341,
"repo_created_at": "2022-04-11T16:40:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89808ead4... |
14eca5dc-637b-4694-8b90-18a2cdc3cdf5 | vtpx/md5 | md5.cpp | #include <cstring>
#include <cstdio>
#include "md5.h"
static const uint32_t v_init[] = {
0x67452301, 0xefcdab89,
0x98badcfe, 0x10325476
};
static const uint32_t T[4][16] = {
{
0xd76aa478,0xe8c7b756,0x242070db,0xc1bdceee,
0xf57c0faf,0x4787c62a,0xa8304613,0xfd469501,
0x698098d8,0x8b44f7af,0xffff5bb1,0x895cd7be... | ALGO | 0.998944 | 5.490921 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-12-20T10:42: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": "5b892cf673... |
0f3f96ba-cdab-44c6-8a74-826f23c3b6e7 | Priyadarshan2000/Hacktoberfest_2k22 | DSA/Egg Dropping Puzzle.cpp | /*Egg Dropping Puzzle
You are given N identical eggs and you have access to a K-floored building from 1 to K.
There exists a floor f where 0 <= f <= K such that
any egg dropped at a floor higher than f will break,
and any egg dropped at or below floor f will not break.
There are few rules given below.
An egg that sur... | ALGO | 0.999951 | 5.057525 | {
"github_metadata": {
"branch": "main",
"commit_count": 441,
"repo_created_at": "2022-10-05T06:57:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 15,
"forks": 103,
"issues": 5,
"pull_requests": 28
},
"file_meta": {
"content_id": "08d906... |
094e0808-2618-4f6a-8c1c-c4d750f3a1c3 | chirathr/dataStructuresLab | labSheet7/1doublyLinkedList.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node *next;
Node *previous;
};
class DoublyLinkedList {
Node *newNode, *temp, *temp2, *head;
int noOfNodes;
public:
DoublyLinkedList() {
head = NULL;
noOfNodes = 0;
}
void display() {
temp = head;
while(temp != NULL) {
cout <... | ALGO | 0.998809 | 5.283946 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2016-02-01T14:14:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2bbb5473b... |
17e4378a-ba80-4dea-ad79-bfc528bd3123 | mightycandle/Minesweeper | mines.cpp | #include<bits/stdc++.h>
//#include<iostream>
//#include<cstring>
using namespace std;
//coordinates within 8x8 are valid
bool valid(int x, int y){
return (x >= 0) && (x < 8) && (y >= 0) && (y < 8);
}
void printhash(){
cout<<"\033[1;35m"<<'#'<<"\033[0m"<<" ";
}
void printx(){
cout<<"\033[1;31m"<<'x'<<"\033[... | ALGO | 0.983373 | 3.713757 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-07-16T10:16: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": "879444981... |
fd09eaed-70ce-41eb-8e82-20cc754b5140 | verbovyar/MIPT | ProgrammingIntroduction/bridge/bridge.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::pair;
using std::vector;
struct Bridge {
vector<int> answer;
bool* used = nullptr;
int* intime = nullptr;
int* fup = nullptr;
int timer = 0;
int count = 0;
};
struct Edge {
int to = 0;
... | ALGO | 0.999989 | 4.54379 | {
"github_metadata": {
"branch": "master",
"commit_count": 160,
"repo_created_at": "2020-08-31T18:53:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6df92659... |
5f91c14c-bd0d-42c5-9abc-f62e3a4b35f1 | KimNattanan/compet | etc/JOI2024_boardgame.cpp | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;
#define f first
#define s second
#define eb emplace_back
vector<int> adj[50005];
string s;
int p0[50005];
queue<pair<int,ll>> q;
ll c[50005],c2[50005];
deque<pair<int,ll>> dq;
ll ans[50005],ans2[50005];
struct fenwick{
vecto... | ALGO | 0.999976 | 3.644789 | {
"github_metadata": {
"branch": "main",
"commit_count": 595,
"repo_created_at": "2023-09-16T09:01:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e3abf7674... |
e0404e25-0d59-4225-a5c8-ebb941a9b8b0 | thegamer1907/Code_Analysis | CodesNew/632.cpp | #include <set>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <iostream>
#include <cstring>
using namespace std;
#define ll long long
#define dd double
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define fast_io ios_ba... | ALGO | 0.999951 | 3.664245 | {
"github_metadata": {
"branch": "master",
"commit_count": 73,
"repo_created_at": "2019-05-24T10:35:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04e74f8fb... |
6f51adfa-009e-4d69-a48f-9a957ba628fc | KiranSampatWagh/CPP_Programs | SinglyLLL.cpp | #include<iostream>
using namespace std;
#pragma pack(1)
struct node
{
int data;
struct node * next;
};
typedef struct node NODE;
typedef struct node * PNODE;
typedef struct node **PPNODE;
class SinglyLL
{
public:
PNODE First;
int iCount;
SinglyLL();
void InsertFirst(i... | ALGO | 0.999753 | 4.721939 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-12-18T16:37: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": "e5e64141888a... |
e60bc8a6-c022-4bcd-875c-bc188c5774f3 | tanmaysahay94/Algorithm | interviewbit/arrays/interval2.cpp | /**
* Definition for an interval.
* struct Interval {
* int start;
* int end;
* Interval() : start(0), end(0) {}
* Interval(int s, int e) : start(s), end(e) {}
* };
*/
struct cmp
{
bool operator() (const Interval& a, const Interval& b)
{
if (a.start == b.start)
r... | ALGO | 0.99997 | 5.653158 | {
"github_metadata": {
"branch": "master",
"commit_count": 424,
"repo_created_at": "2014-05-26T07:29:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "691b4d6a... |
dfd103be-b68c-426d-b04f-da2e8a1c8591 | 026rus/csce4123 | hw8/167TheSultansSuccessors/167TheSultansSuccessors.cpp | /*
* =====================================================================================
*
* Filename: main.cpp
*
* Description: Home work 8 167 The Sultan's Successors
*
* Version: 1.0
* Created: 10/23/2016 06:00:47 PM
* Revision: none
* Compiler: gcc
*
* ... | ALGO | 0.999618 | 4.323825 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-10-14T22:18:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "633c246cc... |
60030db5-a7ad-4579-90c9-b8593e9a1bbd | akash-lanard/Competitive-Programming | Algorithm Implementation/Miscellaneous/Number of 1s in decimal representation of a to b.cpp | #include <bits/stdc++.h>
using namespace std;
#define LL long long
LL O[35]; // Number of 1's in binary representation of 0 to 2^n-1
// 2^(n-1) + 2*O(n-1);
LL V[35]; // 2^n-1
void pre() {
V[0] = 0;
O[0] = 0;
V[1] = 1;
O[1] = 1;
LL two = 1;
for(int i=2; i<=32; i++) {
two *= ... | ALGO | 0.999874 | 4.349329 | {
"github_metadata": {
"branch": "master",
"commit_count": 497,
"repo_created_at": "2017-08-22T17:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b859821e... |
d7d80fe9-2547-48ef-92b0-6e3b74081042 | vasanthi13/MissionRnD-C-Strings-Worksheet | src/commonWords.cpp | /*
OVERVIEW: Given two strings, find the words that are common to both the strings.
E.g.: Input: "one two three", "two three five". Output: "two", "three".
INPUTS: Two strings.
OUTPUT: common words in two given strings, return 2D array of strings.
ERROR CASES: Return NULL for invalid inputs.
NOTES: If there are no... | ALGO | 0.992838 | 4.288615 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2016-03-12T13:54: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": "38a20e574... |
76e7200b-4971-48be-aa52-9c7586de82c5 | jizhang-cmu/autonomy_stack_mecanum_wheel_platform | src/slam/dependency/gtsam/gtsam/discrete/AlgebraicDecisionTree.h | /* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: <NAME>, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* ------------... | ALGO | 0.987165 | 6.807997 | {
"github_metadata": {
"branch": "jazzy",
"commit_count": 86,
"repo_created_at": "2024-08-16T13:03:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 135,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "99e7e29c... |
aeefd8be-8f7a-41aa-8528-d31e30cfd894 | TechShivam02/Data-Structures-And-Algorithm | Linked_list/Love_babbar_LList/Lec_48/RemoveDupFromSorted.cpp | #include<iostream>
using namespace std;
struct node{
int data;
struct node* next;
struct node* prev;
node(int newData){
this->data = newData;
this->next = NULL;
this->prev = NULL;
}
... | ALGO | 0.999826 | 4.353109 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-07-31T18:13: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": "7270675d0de... |
57b55d5d-76c2-4f44-bf3b-c9e9d2b80bd2 | hannapodeszwa/Studia | sem.1/lab-10/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.cpp | // ConsoleApplication1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
typedef int typ;
struct element
{
typ wartosc;
element * pNext;
element * pPrev;
};
void dodajNaPoczatek (element *&pHead, element *&pTail, const typ &liczba)
{
if (pHead == nullptr)
{
... | ALGO | 0.998375 | 4.561195 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2019-03-16T10:22: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": "8651a998b... |
b28e0e53-dab0-4558-b29f-076ba5e40b00 | Tarun0312/DSA-Supreme | Week3/Live/08September2023/5ThreeSumOrTripletSum.cpp | // https://leetcode.com/problems/3sum/
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void tripletSum(vector<int>& arr,int target){
int n = arr.size();
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
for(int k=j+1;k<n;k++){
if(arr[i]+arr[j]+arr... | ALGO | 0.998467 | 5.271208 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2023-09-10T18:46: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": "8c61db89f68... |
1c15747e-dbae-41ff-b6e2-2afc35e495d6 | rmonno/ENOX-controller | src/lib/vlog-socket.cc | /* Copyright 2008, 2009 (C) Nicira, Inc.
*
* This file is part of NOX.
*
* NOX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
... | TOOL | 0.964407 | 6.973076 | {
"github_metadata": {
"branch": "master",
"commit_count": 780,
"repo_created_at": "2013-10-05T09:20:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38915834... |
3d47c5e6-8466-4fa8-993f-fc7163a2b536 | sncodeGit/openmp_labs | Task3/Task3_light.cpp | #include <iostream>
#include <vector>
#include <ctime>
#include <cstdlib>
#include "omp.h"
using namespace std;
size_t N = 0, M = 0;
// Boundaries of values of matrix elements
int leftBoard = -10, rightBoard = 10;
// For time execution
clock_t startTime = 0, endTime = 0;
void rowsMultiply(const vector< vector<int> >... | ALGO | 0.997212 | 3.660248 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2019-12-28T12:16: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": "7f253a554... |
82eb07de-cd80-4e45-8f69-17ce57a2f7d2 | PoisWu/coding | lc/1448. Count Good Nodes in Binary Tree/solution.cpp | #include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using lli = long long int;
templat... | ALGO | 0.999876 | 5.402401 | {
"github_metadata": {
"branch": "main",
"commit_count": 230,
"repo_created_at": "2021-06-04T20:44: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": "63090491a7... |
ba1bb0ea-6ec6-419c-96d8-38937bb8510c | jgsiqueira/icpc_notebook | 3_math/3.31_matriz_inversa_modular.cpp | #include <stdio.h>
#include <vector>
#include <iostream>
#include <math.h>
using namespace std;
/*
MATRIZ INVERSA MODULAR
Aplicacoes:
Calcula a inversa de uma matriz modulo m.
Dizemos que uma matriz tera uma matriz inversa
modular se for quadrada e se o produto das duas
mat... | ALGO | 0.999801 | 3.277649 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-04-17T15:47:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e506a0ca0c... |
4dd5e584-3b02-493a-b4ca-01a766ce0abb | losangler/C_project | 算法程序-用C++语言实现/ch12/第一类椭圆积分.cpp | //第一类椭圆积分.cpp
#include <cmath>
#include <iostream>
using namespace std;
//k 要求0=<k<=1。
//f 参数。
//函数返回第一类椭圆积分值。
double elp1(double k, double f)
{
int n;
double pi,y,e,ff;
double fk(double,double);
if (k<0.0) k=-k;
if (k>1.0) k=1.0/k;
pi=3.1415926; y=fabs(f);
... | ALGO | 0.999692 | 4.514861 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-05-13T11:16: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": "3d9f57495... |
be929227-ebe1-422d-90c0-a85e89041318 | Ravkhande/C-Concepts | Arrays/Problem1.cpp |
/*
Program to find the minimum (or maximum) element of an array
*/
#include<iostream>
using namespace std;
void Maximum(int arr[])
{
int iMax = 0, i = 0,length=0;
iMax = arr[0];
length = sizeof(arr) / sizeof(int);
for (i = 0; i < length; i++)
{
if (arr[i] > iMax)
{
iMax = arr[i];
}
}
cout << "Maximu... | ALGO | 0.999731 | 4.524843 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2021-03-17T18:34: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": "fe3518eaf07... |
d8530cba-cdfe-4b9a-81a1-0f627d9be752 | rmankour/software_dev_team2 | fonction.cpp | #include "fonction.h"
#include <cstdlib>
#include <string>
#include <iostream>
/**
* Adds a node at the end of the linked list.
* @param value is an integer corresponding to eather 0 or 1 for yes/no or and/or or to a number that identifies a variable
* @param type is an integer taking the value 1 for yes/no, 2 for a ... | TOOL | 0.995923 | 3.149198 | {
"github_metadata": {
"branch": "master",
"commit_count": 177,
"repo_created_at": "2020-05-04T14: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": "152daecd... |
e6921c57-33cc-43fb-b537-5a30da5dd193 | BH4DKC/iMSTK | Source/Constraint/PbdConstraints/imstkPbdPointPointConstraint.cpp | /*=========================================================================
Library: iMSTK
Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
& Imaging in Medicine, Rensselaer Polytechnic Institute.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file e... | ALGO | 0.998 | 6.699084 | {
"github_metadata": {
"branch": "master",
"commit_count": 3614,
"repo_created_at": "2022-06-23T21:31:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "aad811a... |
a29c9a94-b4fa-4577-95a9-82df6a7aa082 | AnshT013/50Days-Coding-Challenge | NumberOfSubarraysWithLcmAtLeastK_Day28.cpp | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
while (b) {
int temp = a % b;
a = b;
b = temp;
}
return a;
}
int lcm(int a, int b) {
return (a / gcd(a, b)) * b;
}
int subarrayLCM(vector<int>& nums, int k) {
int count = 0, n = nums.size();
for (int... | ALGO | 0.999879 | 5.462864 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2025-05-02T16:32: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": "2bc59b38ec5... |
3c87d48f-cda0-45ee-9f34-9f9a42ff379b | k-oksenych/PriorityQueue | PriorityQueue/Queue.h | #pragma once
#include <iostream>
#include "Node.h"
using namespace std;
template <typename T>
class PriorityQueue
{
public:
PriorityQueue();
PriorityQueue(const PriorityQueue& source);
PriorityQueue(PriorityQueue&& source);
~PriorityQueue();
PriorityQueue& operator=(const PriorityQueue& right);
PriorityQueue&... | ALGO | 0.998432 | 5.114128 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-01-14T12:03: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": "909c731619... |
c400c7cc-f3af-4765-8822-fd315045e430 | drrtuy/misc | c_pp/maxmin/MinMaxHeap.h | #pragma once
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <ratio>
#include <utility>
#include <vector>
template <typename CMP> class MinMaxHeap {
public:
MinMaxHeap() : size_(0) { heap_.push_back(0); };
~MinMaxHeap(){};
void siftUp() {
size_t idx = heap_.size() - 1;
int parent = ... | ALGO | 0.96268 | 5.30498 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2016-12-26T12:57:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f38486a... |
bf63fad3-b29a-4d48-9c43-180a0e30bc91 | cheuk-fung/Programming-Challenges | Codeforces/Div1/R179/B.cc | #include <iostream>
#include <algorithm>
using namespace std;
long long mat[555][555], mat_r[555][555];
long long ans[555];
int x[555];
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cin >> mat[i][j];
}
}
for (int i = 0; i < n... | ALGO | 0.999994 | 4.205263 | {
"github_metadata": {
"branch": "master",
"commit_count": 423,
"repo_created_at": "2011-03-05T17:28:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dff227a9... |
d3dd1af2-7a0b-4d09-8c9f-b090ad6902aa | congngale/practice | sources/codeforces/112/a.cc | #include <iostream>
#include <string>
using namespace std;
/*
* code: 112A
* name: <NAME>
* tags: implementation, strings
* url: https://codeforces.com/contest/112/problem/A
*/
int main() {
// init
size_t i = 0;
int ret = 0;
std::string a, b;
// read a
cin >> a;
// read b
cin >> b;
// check ... | ALGO | 0.999988 | 4.219981 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2020-09-13T19:55: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": "5633dcf26... |
24e96d77-a4b6-41fe-af45-e33d8284d67b | Siddharth-A/amzn | dynamic-programming/dp-practice.cpp | /**
*(I) 0-1 knapsack problem
* 1 subset problem: https://www.geeksforgeeks.org/subset-sum-problem-dp-25/
* 2 equal sum partition https://leetcode.com/problems/partition-equal-subset-sum/
* 3 count of subset sum
* 4 minimum subset sum diff
* 5 target sum
* 6 # of su... | ALGO | 0.999745 | 4.67271 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2021-09-08T01:49: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": "76da906f... |
accc38e9-28d7-4581-861f-91b7411793ad | Shitaibin/leetcode-2016 | 125.ValidPalindrome.cpp | // v1
class Solution {
public:
bool isPalindrome(string s) {
string new_s;
for (auto e : s) {
if (e >= 'a' && e <= 'z') {
new_s += e;
} else if (e >= 'A' && e <= 'Z') {
new_s += e - 'A' + 'a';
} else if (e >= '0' && e <= '9') {
... | ALGO | 0.999757 | 5.903298 | {
"github_metadata": {
"branch": "master",
"commit_count": 293,
"repo_created_at": "2016-01-25T04:13: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": "7f407aa2... |
a4cfa313-fba4-44b1-9fbb-64f0dae4e1fc | Deepakkr22iitk/leetcode_questions | 0684-redundant-connection/0684-redundant-connection.cpp | // The idea behind DSU is that each node is in its own a separate set. As we go through the edges,
// we perform a union operation that merges the sets of the two connected nodes. This helps us track
// which nodes are in the same component. If, during this process, we encounter an edge where the two
// nodes are al... | ALGO | 0.999981 | 5.875712 | {
"github_metadata": {
"branch": "main",
"commit_count": 1634,
"repo_created_at": "2024-07-01T17:05: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": "b3f7fc0e7... |
1abc42c5-e891-4ae8-a68a-8d5ba4734efc | ApoorvaRajBhadani/competitive-programming | 1271c.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pii;
#define fo(i,s,e_ex) for(i=s;i<e_ex;i++)
#define Fo(i,k,n) for(i=k;k<n?i<=n:i>=n;k<n?i+=1:i-=1)
#define endl '\n'
#define MOD 1000000007//998244353
#define pbb push_back
#define mpp make_pair
#define ... | ALGO | 0.999888 | 4.117292 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-04-04T14:12: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": "7f1603fdf9... |
3f50e6d4-3f4e-4478-9699-e6a4cb18c3f9 | thehs29/TTUD | exhaustive_search (brute_force)/V_Kpath.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, k;
int paths = 0;
int cnt = 0;
vector<int> e[64];
bool visited[64];
void solve(int id) {
int sz = e[id].size();
for(int i = 0; i < sz; i++) {
if(!visited[e[id][i]]) {
visited[e[id][i]] = true;
++paths;
if(pa... | ALGO | 0.999957 | 4.178335 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-06-24T15:22: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": "1d8ed61262c... |
1e33f3fe-0204-4449-95c0-3f0b65f44762 | kobortor/Competitive-Programming | cf/0644/A.cpp | #include<bits/stdc++.h>
// Created by kobortor On 01:56:00 on 26-05-2020
using namespace std;
#define allof(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int ans[101][101];
int main(){
cin.tie(0);
cin.sync_with_stdio(0);
int n, a, b;
cin >> ... | ALGO | 0.999817 | 3.246472 | {
"github_metadata": {
"branch": "master",
"commit_count": 617,
"repo_created_at": "2017-07-02T02:41:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c570edd... |
1f33f893-a16f-4fc6-a552-90c04adacb8a | JinYeJin/algorithm-personal | SWEA/7/8993_.cpp | /*
SWEA 8993.하지추측
2020-03-26 진예진
27/31 맞음
문제 링크 https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AW6GFM8aLacDFAVX&categoryId=AW6GFM8aLacDFAVX&categoryType=CODE#;return%20false;
*/
#include <stdio.h>
#include <vector>
using namespace std;
int main(void){
int T;
long long N;
vec... | ALGO | 0.999577 | 4.420871 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2020-03-05T05:03: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": "ea610733... |
3b6bf17d-2e43-4005-b885-9f39f2f7d4db | rashikatyagi/GeeksForGeeks | Difficulty: Easy/Merge two binary Max heaps/merge-two-binary-max-heaps.cpp | //{ Driver Code Starts
// Initial Template for C++
// C++ program to merge two max heaps.
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
void heapify(vector<int> &arr, int index, int n){
int currIndex = index;
in... | ALGO | 0.999978 | 4.641954 | {
"github_metadata": {
"branch": "main",
"commit_count": 151,
"repo_created_at": "2024-08-01T11:27: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": "06755b690f... |
b954e854-38cd-4500-95bd-b38453fb2d6d | akai007/study_sc | udemy_c_data_structure_algorithms/09_matrices/144_diagonal_matrix.cpp | #include <iostream>
using namespace std;
class Matrix
{
private:
int *A;
int n;
public:
Matrix(int n);
~Matrix();
void set(int i, int j, int x);
int get(int i, int j);
void toString();
};
Matrix::Matrix(int n)
{
this->n = n;
A = new int[n];
}
Matrix::~Matrix()
{
delete [] A;
}
void Matrix::set(in... | ALGO | 0.970085 | 4.061871 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2021-02-24T09:33: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": "1afbf67535... |
4fdad855-b8db-493e-bd6e-e60c16c17787 | liangkarl/usaco | ch.1/1.3/namenum/namenum.cpp | /*
ID: <NAME>
TASK: namenum
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <map>
#include <list>
using namespace std;
#define TO_KEYPAD_NUM(x) ((x)+2)
#define TO_INDEX(x) ((x)-'A')
#define DIC_LEN 4616
string name_to_num(const string name) {
// static const char ta... | ALGO | 0.997746 | 3.90887 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2020-11-19T01:13: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": "c875ae6eb... |
e90550f2-ac8c-48ac-a0d8-78c1ce23c327 | Safin178/Rating-Rocket | C_Stripes.cpp | //----------- <NAME> -------------/
#include<bits/stdc++.h>
using namespace std;
//someone who’s willing to stand before a mountain and take it head on even though he knows he’ll lose
typedef vector<long long> vl;
typedef vector<int> vi;
#define all(v) ((v).begin()), ((v).end())
#define sz(v) ((int)((v).size()))... | ALGO | 0.999662 | 3.550189 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2023-07-08T06:13: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": "ef3f62108a4... |
dea24539-310d-48bf-9ef3-d4e69f35f5b3 | abhishekverma051/Problem-Solving-with-C-DSA- | c++/Lomuto-part.cpp | // in lomuto partition the last element of the array should be taken as pivot and then partiotioning is don acc...
#include<bits/stdc++.h>
using namespace std;
void lomuto(int a[],int low,int high)
{
int pivot=a[high]; // means that that the pivot element should be last in this case
int i=low-1; // i = -1
... | ALGO | 0.999692 | 4.811086 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-04-09T21:25: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": "89ead80eb7... |
a73ab9e1-5230-428f-a7ff-3ee54035be0e | SumukhBhende/Learn-Cpp | Lab4/lab4q3.cpp | /*
Create a class Person with suitable data members. Create a derived class BankUser from
Person with suitable data members. Create another class Account. Create a class Savings
that derives from both BankUser and Account. Make use of appropriate member functions
and data members to illustrate the usage of multiple inh... | TOOL | 0.946204 | 5.618219 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2025-01-08T09:32: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": "480dcad7e18... |
b2ad4d04-2357-48d0-bb1e-7c401997bc66 | romie88/leetcode | Surrounded.Regions.cpp | //Surrounded Regions
//
//Given a 2D board containing 'X' and 'O', capture all regions
//surrounded by 'X'.
//
//A region is captured by flipping all 'O's into 'X's in that
//surrounded region.
//
//For example,
//
//X X X X
//X O O X
//X X O X
//X O X X
//
//After running your function, the board should be:
//
//X X X... | ALGO | 0.999516 | 6.86909 | {
"github_metadata": {
"branch": "master",
"commit_count": 279,
"repo_created_at": "2014-10-17T17:22: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": "5b6a8e71... |
7075cad3-8ae1-4519-9c91-53389a649b52 | Jussick/Codes | LeetCodes/28s-按序打印(多线程).cpp | //C++ file
/***********************************************
#
# Filename: 01-按序打印.cpp
#
# Author: luhg - <EMAIL>
# Description: leetcode:1114
我们提供了一个类:
public class Foo {
public void one() { print("one"); }
public void two() { print("two"); }
public void three() { print("three"); }
}
三个不同的线程将会共用一个 ... | ALGO | 0.998337 | 5.43508 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2021-12-24T07:56: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": "55c84d379... |
2dcc7e94-696b-4921-96ce-9774c0aca55d | areslp/matlab | SparseSuite/SuiteSparse/SPQR/Source/spqr_cpack.cpp | // =============================================================================
// === spqr_cpack ==============================================================
// =============================================================================
// spqr_cpack copies the C matrix from the frontal matrix F and
// stores ... | ALGO | 0.999953 | 5.816808 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2012-11-02T03:38:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 180,
"forks": 170,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "bec67... |
674a24cd-0b43-4885-94ff-f5d139fd80fb | gaoxiang12/slambook | ch8/directMethod/direct_semidense.cpp | #include <iostream>
#include <fstream>
#include <list>
#include <vector>
#include <chrono>
#include <ctime>
#include <climits>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <g2o/core/base_unary_edge.... | ALGO | 0.998372 | 4.654133 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2016-06-27T06:19:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7186,
"forks": 3302,
"issues": 193,
"pull_requests": 11
},
"file_meta": {
"content_id": ... |
33c5f073-d3e2-45e6-99f1-f89436c30f2a | siva-msft/cpptraj | src/ClusterMatrix.cpp | #include <cfloat> // FLT_MAX
#include "ClusterMatrix.h"
#include "CpptrajStdio.h" // PrintElements
#ifdef _OPENMP
# include <omp.h>
#endif
// ClusterMatrix::FindMin()
/** Find the minimum not being ignored; set corresponding row and column. */
#ifdef _OPENMP
double ClusterMatrix::FindMin(int& iOut, int& jOut) {
int ... | ALGO | 0.996315 | 4.942961 | {
"github_metadata": {
"branch": "master",
"commit_count": 9277,
"repo_created_at": "2020-04-21T19:28:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a9c9c5... |
216a704e-9df6-49f4-b84a-34ccf74f6e16 | OmkarLolage21/CPU_Scheduling_Algorithms | nextfit.cpp | #include <iostream>
using namespace std;
struct Block
{
int size;
bool allocated;
};
void nextFit(Block *memory, int numBlocks, int processSize, int &lastAllocated)
{
int startIndex = lastAllocated;
do
{
if (!memory[startIndex].allocated && memory[startIndex].size >= processSize)
... | ALGO | 0.999281 | 4.469867 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2023-10-04T17:33: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": "ba109e61c... |
f019a239-93e1-40e6-8654-46644063056b | kylevedder/ServiceRobotControlStack | catkin_ws/src/control_stack/include/cs/path_finding/astar.h | #pragma once
// Copyright 2020 <EMAIL>
// School of Engineering and Applied Sciences,
// University of Pennsylvania
//
//
// 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 restrictio... | ALGO | 0.999658 | 5.929205 | {
"github_metadata": {
"branch": "master",
"commit_count": 323,
"repo_created_at": "2019-10-29T15:18:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05f979b4... |
4e2fbb18-8679-46cf-9ef6-c984a5ff88b4 | Oishi1029/Y2_CW | DIES/Lab3/2/Lab3.cpp | // Lab3.cpp
#include "Lab3.h"
#include <iostream>
#include <iomanip>
#include <cmath>
#include <stdexcept>
Matrix::Matrix(int n, int m) : rows(n), cols(m) {
data.resize(n, vector<double>(m, 0.0));
}
void Matrix::inputMatrix() {
cout << "Enter the matrix elements row by row:\n";
for (int i = 0; i < rows; i... | ALGO | 0.996401 | 5.976946 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2024-12-01T14:32: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": "9df97adc319... |
ad3c28db-d199-4b1b-800f-4328be6c0246 | Anirudh257/Leetcode_Solutions | 0151-reverse-words-in-a-string/striver_reverse_approach.cpp | // Time complexity: O(n), Space complexity: O(1)
// But works in C++ as it has mutable strings, not work for Java that has immutable strings
class Solution {
public:
string reverseWords(string s) {
int idx = 0; // New index that helps in skipping spaces
int size = s.size();
int end = size - ... | ALGO | 0.999883 | 5.849871 | {
"github_metadata": {
"branch": "main",
"commit_count": 834,
"repo_created_at": "2022-08-22T05:59:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c95c95301f... |
bcb4e5b9-89f3-462e-8639-2b076d9fd70b | IBM/dna-replication | src/SimulationBatchClient.cpp | #include <fstream>
#include <mpi.h>
#include <vector>
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include "Simulation.h"
#include "misc/DataManager.h"
#include "particle_behaviors/IsotropicParticleDiffusionBehavior.h"
#include "particle_behaviors/ProbabilisticParticleActivationBehavior.h"
#in... | DATA | 0.997186 | 6.108721 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2019-10-30T13:56:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fbc09c6dfa... |
01676c88-160d-4b09-8be2-90f99da351e5 | zoltanmaric/h264-fer | fer_h264/fer_h264/moestimation.cpp | #include "moestimation.h"
#include "mocomp.h"
#include "headers_and_parameter_sets.h"
#include "quantizationTransform.h"
#include "ref_frames.h"
#include "mode_pred.h"
#include "h264_math.h"
#include "limits.h"
#include "openCL_functions.h"
#define P_Skip_Treshold 0.98
int zigZagIdx[16][2] = {{0, 0}, {1, 0}, {0, 1},... | ALGO | 0.999318 | 3.628389 | {
"github_metadata": {
"branch": "master",
"commit_count": 324,
"repo_created_at": "2015-03-13T08:24: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": "3f2c14e3... |
2f25ee81-11ad-4158-a263-4bdd05f18257 | ishandutta2007/codeforces-a | amethyst0/normal/1450/D.cpp | #pragma comment(linker, "/STACK:1000000000")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <memory.h>
#include <cassert>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cmath>
#include <ctime>
#i... | ALGO | 0.999913 | 3.42085 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92d780b568e8... |
64735416-20a5-446d-aa94-a6f8b51a880d | HariomJoshi/POTD | week7/16 February/swapNodesInPairs.cpp | //question -> https://leetcode.com/problems/swap-nodes-in-pairs/?envType=list&envId=rrs3r4z6
#include<bits/stdc++.h>
using namespace std;
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x)... | ALGO | 0.999979 | 6.135581 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2024-01-03T05:56: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": "0825ebc29af... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.