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 |
|---|---|---|---|---|---|---|---|
3eb738f9-27c6-49e4-a33e-945bf852e296 | SergioEstevao11/FER-RProg | lab4/sergio_estevao.cpp | #include <iostream>
#include <Eigen/Dense>
#include <opencv2/opencv.hpp>
int main() {
Eigen::MatrixXd m1(5, 5);
Eigen::MatrixXd m2(5, 5);
Eigen::VectorXd v1(5);
Eigen::RowVectorXd jmbagInitials(5);
jmbagInitials << 0, 0, 3, 6, 5;
m1 = jmbagInitials.colwise().replicate(5);
m2 = m1 + Eigen... | ALGO | 0.998924 | 4.575672 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-10-25T21:11: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": "d895962eb133... |
ceb5913f-19bc-457c-a8cf-e77e488224d5 | H178561/ThreeBodyDecays | include/FormFactors.hh | #ifndef FORM_FACTORS_HH
#define FORM_FACTORS_HH
#include <complex>
#include <functional>
#include <vector>
using complex = std::complex<double>;
namespace FormFactors
{
// Basic Blatt-Weisskopf form factor
/**
* @brief Calculates the Blatt-Weisskopf barrier factor
* @param q Momentum value
* @... | ALGO | 0.958793 | 6.000055 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2025-04-22T08:39:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b46f919e89... |
71c8c204-0169-4fed-b367-2297d3e33bb9 | akhikolla/testpackages | fuzzedpackages/multinet/src/src/community/ml-cpm.ipp | namespace uu {
namespace net {
template <typename M>
std::unique_ptr<CommunityStructure<VertexLayerCommunity<const typename M::layer_type>>>
mlcpm(
const M* mnet,
size_t k,
size_t m
)
{
// Step 1: find max-cliques
auto cliques = find_max_cliques(mnet,k,m);
if (cliques.size()==0)
{
... | ALGO | 0.999375 | 5.035852 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66cc4bcb3f... |
fea6e1c3-2cda-4ce0-b80b-e26b84b42a0a | mr-ahabib/CPP | Sorting.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int arr[n];
int temp = 0;
for (int i = 0; i < n;i++){
cin >> arr[i];
}
// sort(arr, arr + n);
// cout << "after sorting " <<... | ALGO | 0.999986 | 4.959259 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-03-19T14:30: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": "5f78898e07... |
4ebc4aac-2335-4f86-95d4-0ea5a75daea6 | ddarkclay/programming-cookbook | C++ All Programs/10_all_switch.cpp | #include<conio.h>
#include<iostream>
using namespace std;
inline float square(int x)
{
return(x*x);
}
inline float cube(int y)
{
return(y*y*y);
}
inline float max(int x,int y)
{
return(x>y)?x:y;
}
inline float min(int x,int y)
{
return(x<y)?x:y;
}
main()
{
int a,b,ch;
char yes;
cout<<"Arith... | ALGO | 0.925336 | 3.119891 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-12-14T18:02:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8a1823fe55... |
619dc86c-520e-4750-adde-3bbefef76846 | Rishi-Rusia/DSA | Apna college DSA c++/7_LINKED LISTS/doubly-linked-list.cpp | //Program for doubly linked lists
#include <iostream>
using namespace std;
//node class for a doubly linked list
class node{
public:
int data;
node* next;
node* prev;
node(int val)
{
data=val;
next=NULL;
prev=NULL;
}
};
void display(node* &head)
{
node* temp=head;
while(... | ALGO | 0.999448 | 5.362407 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-09-24T06:24: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": "949c593f404... |
03e6e8b8-28c1-4631-8d45-dbcfbe0289a2 | sks8960/Arduino | escape_corner/escape_corner.ino | #include <Servo.h> // Include servo library
Servo servoLeft; // Declare left and right servos
Servo servoRight;
void setup() // Built-in initialization block
{ Serial.begin(9600);
tone(4, 3000, 1000); // Play tone for 1 second
delay(1000); // Del... | TOOL | 0.916199 | 5.72258 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-19T06:30: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": "5bd4bce46ada... |
1d26c98d-60e2-49c2-aacb-4949d6fe605d | Namr/DigitRecognition | src/network.cpp | #include "network.hpp"
Layer::Layer(int neuronCount, int inputLength) {
weights = MatrixXd::Random(neuronCount, inputLength);
bias = VectorXd::Random(neuronCount);
sumDeltaW = MatrixXd::Zero(neuronCount, inputLength);
sumDeltaB = VectorXd::Zero(neuronCount);
}
Network::Network(int *shape, int layerCount, Vec... | ALGO | 0.989924 | 5.14365 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2018-05-14T22:34: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": "2ec2fee6b... |
f738f5dd-624b-4092-adcf-9a2ad04891a6 | YunusEmreErdogan/Gaussian-Elemination-using-LU-Factorization-2-Power-Iteration-Method | Gaussian_Elemination_using_LU_Factorization.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <math.h>
using namespace std;
int main(int argc, char *argv[])
{ // FILE READINGS AND TAKING DATA FROM FILES
string yaz;
int n = 0; // n corresponds to row number of the matrix
fstream A, b;
A.open(argv[1]);//First parameter is the name of th... | ALGO | 0.997395 | 3.458194 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2020-05-27T21:35:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b91e5e63e... |
aa46ff50-aba1-4821-a80b-7dbeac1963c9 | efugier/Automates-1D | simulator.cpp | #include "simulator.h"
Simulator::Simulator(const Automate &automate, unsigned int buffer) : automate(automate), max_nb_etats(buffer)
{
etats = new Etat *[max_nb_etats];
for (unsigned int i = 0; i < max_nb_etats; i++)
etats[i] = NULL;
reset();
}
Simulator::Simulator(const Automate &automate, const... | ALGO | 0.964855 | 4.639672 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-03-22T22:14: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": "a6829cb2dd... |
5cd4cdbc-47a1-4568-92d1-0b3c136f1f00 | isl-org/Open3D | cpp/open3d/ml/tensorflow/misc/RadiusSearchOps.cpp | // ----------------------------------------------------------------------------
// - Open3D: www.open3d.org -
// ----------------------------------------------------------------------------
// Copyright (c) 2018-2024 www.open3d.org
// SPDX-License-Identifier: MIT
// ---... | ALGO | 0.987542 | 7.116939 | {
"github_metadata": {
"branch": "main",
"commit_count": 4194,
"repo_created_at": "2016-12-02T16:40:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12555,
"forks": 2448,
"issues": 1245,
"pull_requests": 37
},
"file_meta": {
"content_id": ... |
0fe1c1e1-0034-4e42-8cb1-affb191041cf | ishandutta2007/codeforces-m | mahdi_jfri/normal/906/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int maxn = 1e5 + 20;
int is[maxn];
bool has[30];
// 0 : is not
// 1 : may be
int main()
{
int n;
cin >> n;
fill(is , is + maxn , 1);
int res = 0;
for(int i = 0; i < n; i++)
{
int t = 0;
for(int j = 0; j < 26; j++... | ALGO | 0.999392 | 3.311841 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4251b0e5c57... |
a22836a3-1520-477f-b4ed-1e00bf9873f0 | vietnakid/ACM-ICPC | FreeContest/begin_11/HCN.cpp | #include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector< vector<int> > vvi;
typedef vector<ll> vl;
typedef vector< vector<ll> > vvl;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector< vii> vvii;
#define INF 1000000007
#define INFL... | ALGO | 0.999958 | 3.886821 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2018-04-07T11:55: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": "f46f25ece... |
175cd585-7797-4068-89f8-650e2b6a0bf2 | hmanhduc2k/Static-Program-Analyzer | Team19/Code19/src/spa/src/commons/ShuntingYard.h | #pragma once
#include <string>
#include <stack>
#include "Shunt.h"
// ai-gen start(copilot, 0, e)
// prompt: used copilot
enum class Precedence {
INVALID = -1,
LOW = 1,
HIGH = 2,
};
class ShuntingYard {
public:
static std::string convertToPostfix(const std::string& infixExpression);
private:
stati... | ALGO | 0.988934 | 5.641874 | {
"github_metadata": {
"branch": "master",
"commit_count": 1549,
"repo_created_at": "2024-04-20T15:52: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": "f22e75b... |
c289516a-a62f-4bfc-b267-6ed709869681 | nclement/kaust-2017 | 02March/main.cpp | #include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
void isPrime(int n) {
// Tests for
// n % 1 == 0
// n % 2 == 0
// ...
// n % n == 0?
int factors = 0;
for (int i = 1; i < n; i++) {
if (n % i == 0) {
factors++;
}
}
... | ALGO | 0.981295 | 3.765 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2017-01-06T23:26: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": "18392ace7... |
111ffbc0-b179-47d3-a882-ee96a8154316 | Apress/exploring-c-plus-plus | listings/list4105.cpp | /** @file list4105.cpp */
/** Listing 41-5. Finding a Subrange that Matches the First Four Digits of π */
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <ostream>
#include <vector>
#include "data.hpp"
#include "randomint.hpp"
int main()
{
intvector pi(4);
pi.at(0) = 3;
... | ALGO | 0.998514 | 5.709156 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-10-13T23:40:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53d5e5bd07e... |
5ec839e4-7ee3-45dc-9fab-8f0e5946296d | AmrARaouf/algorithm-detection | graph-source-code/34-D/152205.cpp | //Language: GNU C++
#include <cstdio>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
using namespace std;
#define mp make_pair
#define pb push_back
#... | ALGO | 0.99998 | 3.47599 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2015-11-10T10:51: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": "81f7c038a2... |
b049fd01-74ee-4635-9bfd-2ff056068c22 | drviruses/CP | farfeb.cpp | /*
@uthor: <NAME>
user: CodeChef: dr_virus_ ; Codeforces,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll long long
#define ld double
#define pp pair<ll,ll>... | ALGO | 0.999919 | 4.502798 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-10-20T06:14:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf9f0e415a... |
1fc7ea7c-12e2-4865-bc73-d84eedbd115a | metbosch/AMMM_Course_Project | grasp/grasp.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <assert.h> /* assert */
#include <stdlib.h> /* atoi */
/***** Constants and types definitions *****/
#define MAX_ITERS 100
#define ALPHA 0.5
#define INF 999999999
#define MAX_CONSTRUCTIVE_DEPTH 100
//#... | ALGO | 0.99697 | 3.609368 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2016-01-08T15:52: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": "2f77a5e32f... |
10367f8b-091b-4899-b9ab-798a157886b0 | fstqwq/Nemesis | SCL_others/Other/SJTU_ACM_Platelet/Template/2. Math/2.5 高斯消元/高斯消元.cpp | db a[maxn][maxn], x[maxn];
int main()
{
int rank = 0;
// the size of the matrix is m * (n + 1)
// And it's an augmented matrix
for (int i = 1, now = 1; i <= m && now <= n; ++now)
{
if (fabs(a[i][now]) < eps)
{
for (int j = i + 1; j <= m; ++j)
if (fabs(a[j][now]) > fabs(a[i][now]))
{
for (int k ... | ALGO | 0.999926 | 3.507807 | {
"github_metadata": {
"branch": "master",
"commit_count": 248,
"repo_created_at": "2019-09-08T16:45:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aabfbe4... |
68232d1b-692e-45aa-885e-227c28b6c736 | jakubkid/cppCheatSheet | cppCode/binary_search_iterative.cpp | // C++ program to implement iterative Binary Search
#include <iostream>
using namespace std;
// A iterative binary search function. It returns
// location of x in given array arr[left..right] is present,
// otherwise -1
// array needs to be sorted from low to high (ascending)
int binarySearch(int arr[], int left, int ... | ALGO | 0.999977 | 5.638359 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-07-06T18:46: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": "c0ac350e5b... |
8a37b3e2-e31c-4df5-9891-5fb6b44e0209 | wuuuiYan/Cpp-Primer-Code | exercise/20230726_test.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int a = 0;
int j = 0;
int m = 0;
while (m <= n){
a = a + 1;
for (int b = 1; b <= a; b ++){
j = j + a;
m = m + 1;
}
}
if (m != n)
j = j - ( m - ... | ALGO | 0.999957 | 3.40288 | {
"github_metadata": {
"branch": "main",
"commit_count": 201,
"repo_created_at": "2023-04-07T11:17:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a10772b2b... |
5722226a-213e-40dd-8c3f-b47534fab3b9 | liuyubobobo/Play-Leetcode | 0501-1000/0967-Numbers-With-Same-Consecutive-Differences/cpp-0967/main.cpp | /// Source : https://leetcode.com/problems/numbers-with-same-consecutive-differences/
/// Author : liuyubobobo
/// Time : 2019-03-17
#include <iostream>
#include <vector>
using namespace std;
/// Backtrack
/// Time Complexity: O(2^N)
/// Space Complexity: O(N)
class Solution {
public:
vector<int> numsSameCons... | ALGO | 0.999379 | 6.113398 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb... |
d40e9f3a-c732-4fbf-8265-25cb4e98aa6a | SamuelXing/Algorithm | cpp_solutions/LinkedList/Linked_List_Cycle_II.cpp | /*
* Given a linked list, return the node where the cycle begins.
* If there is no cycle, return null.
*
**/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
// also slow and fast pointer
class Solution {
publ... | ALGO | 0.999877 | 5.287372 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2017-06-08T17:56: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": "d9984672c... |
72276ff5-5a34-4da4-93af-9295251adb6c | sahadat-11/Codeforces | 1626/A.Equidistant_Letters.cpp | //In The Name of ALLAH
#include<bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
#define ll long long
void solve() {
string s; cin >> s;
map<char, int> mp;
for(auto u : s) mp[u]++;
for(auto u : mp) {
if(u.second == 2) cout << u.first;
}
for(auto u : mp) {
if(u.second == 2) cout <... | ALGO | 0.999888 | 3.671602 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2023-07-26T17:20: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": "9ad0cc170a0... |
6f767e14-a933-4f15-8ed5-3b9f5dc5b7d2 | jonasbhjulstad/MCMC | include/SMC_Sampler.hh |
#ifndef SMC_SAMPLER_HH
#define SMC_SAMPLER_HH
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <ostream>
#include <cstring>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_matrix.h>
#include <chrono>
#include <fstream>
#include <limits>
#includ... | ALGO | 0.965667 | 6.807774 | {
"github_metadata": {
"branch": "Inspera",
"commit_count": 5,
"repo_created_at": "2021-04-09T08:17: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": "d7b5b19e5... |
e1a5fda2-9479-45b9-a09c-005c27fe0240 | zpelgrims/pota | src/lens.h | #pragma once
#include <cmath>
#include <vector>
#include <algorithm>
#include "../../Eigen/Eigen/Core"
#include "../../Eigen/Eigen/LU"
#include "global.h"
#ifndef M_PI
# define M_PI 3.14159265358979323846
#endif
// sin approximation, not completely accurate but faster than std::sin
inline float fast_sin(float x){... | ALGO | 0.994646 | 5.441791 | {
"github_metadata": {
"branch": "dev",
"commit_count": 1087,
"repo_created_at": "2017-11-11T22:45:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 20,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af5eba79d... |
ed2bdd56-d31d-41eb-98b8-3d6dae6a6373 | fricai/competitive-programming | codeforces/1399/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, a, b) for (auto i = (a); i < (b); ++i)
#define per(i, a, b) for (auto i = (b); i-- > (a); )
#define trav(e, x) for (auto &e : x)
#define eb(x...) emplace_back(x)
#define all(x) begin(x), end(x)
#define rall(x) (... | ALGO | 0.999884 | 4.3051 | {
"github_metadata": {
"branch": "master",
"commit_count": 2301,
"repo_created_at": "2021-09-29T18:57:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e67710... |
ee3b2f1c-5c9a-46c6-b81d-13abd63d8675 | ElvisRodriguez/Courses | CS244-Object_Oriented_Programming/EggProblem/solution.cpp | #include <iostream>
#include <cassert>
#include "eggs.h"
using namespace std;
/*
Read the problem on the board and write your solution in the body of the
find_floor() function below.
Do not change the arguments passed in the function.
You are not allowed to access the break_point attribute of Eggs A/B.
You can howev... | ALGO | 0.999523 | 4.419653 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2019-08-10T21:18: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": "96c4ed7a2... |
09571af8-ca5f-4697-bdd9-dc73d762e2a4 | XamMushki/Cpp-Programs | cartesianProduct.cpp | #include <iostream>
using namespace std;
int main()
{
int set_a_size;
int set_b_size;
// Set A declaration and initialization
cout << "Enter set A size: ";
cin >> set_a_size;
string set_a[set_a_size];
cout << "Enter " << set_a_size << " elements of set A: " << endl;
for (int i = 0; i <... | ALGO | 0.976045 | 4.953957 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2022-09-27T16:25:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c637e32f... |
14b61c1c-6fc7-43ed-b277-2f2be4233856 | tico88612/Solution-Note | LuoguOJ/Luogu 1087.cpp | #pragma GCC optimize ("O2")
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define _ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define FZ(n) memset((n),0,sizeof(n))
#define FMO(n) memset((n),-1,sizeof(n))
#define F first
#def... | ALGO | 0.999862 | 3.140059 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2017-07-30T09:40:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d7b1d2f2... |
d0d1c121-e8b7-4779-acf0-b214ec66c2fc | XDEv11/Codeforces | Edu_Round_161/D.cpp | //#pragma GCC optimize ("O3")
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
using namespace std;
// fast disjoint set union
class LDSU {
vector<int> pa, sz, mn;
int find(int x) { // collapsing find
return pa[x] == -1 ? x : pa[x] = find(pa[x]);
}
void unionn(int... | ALGO | 0.999963 | 4.465637 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-02-06T13:58: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": "36e4d16933... |
f84ac811-912c-4604-a2c7-0fb767de659f | ahmed-dinar/UVA | UVA Solved Problem/12626 - I ❤ Pizza/12626 - I ❤ Pizza.cpp | #include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
using namesp... | ALGO | 0.999784 | 3.244731 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2014-11-13T16:57: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": "e20ba1140... |
ea460b1f-a36e-4174-ab12-7b867fd19cf1 | plumzero/querecord | 01_Cpp/ch07/07_多线程与同步/t/02_unique_lock.cpp |
#include <thread>
#include <mutex>
#include <condition_variable>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
#include <chrono>
std::mutex mtx;
std::condition_variable cond;
std::map<std::thread::id, int> use_map; /** 统计使用的线程次数 */
void add(int& num, int& sum)
{
while (true) {
... | TOOL | 0.948976 | 5.211352 | {
"github_metadata": {
"branch": "master",
"commit_count": 729,
"repo_created_at": "2019-12-29T01:12: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": "eb7a9ecd... |
43929ff2-5035-4369-96b1-dbdb1b4ec09c | Koyama-Tsubasa/LeetCode | Problems/No.160_Intersection_of_Two_Linked_Lists/intersection_of_two_linked_lists.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
// count the number of nodes
int CountNodes(ListNode *node) {
int count = 1;
while (node->next) {
... | ALGO | 0.999656 | 5.183345 | {
"github_metadata": {
"branch": "main",
"commit_count": 1093,
"repo_created_at": "2022-06-14T14:59: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": "8ac554a61... |
7e7e716e-2f12-4985-863d-bb9749e34bdc | micklevast/Dsa_practice | College/Tree/All-normal-tree/i_tree_using_array.cpp | #include <iostream>
using namespace std;
int arr[20] = {0};
void set_root(int data)
{
if(arr[0]!=0)
cout<<"tree already has exit root\n";
else
{
arr[0]=data;
}
}
void set_left_tree(int val, int parent)
{
if (arr[parent] == 0)
{
cout << "can't insert these " << 2*parent+1 <<" ... | ALGO | 0.999452 | 3.274389 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-02-03T14:06: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": "5dbd4977b1a9... |
e66ed215-24e6-491d-a4b6-f59dc158bd4c | joaopaulocastilho/aBNT-Codes | URI/uri1582-CASTILHO.cpp | #include <stdio.h>
void ordena(int &n1, int &n2, int &n3){
int aux, maior;
maior = n1;
if(maior < n2){
maior = n2;
aux = n1;
n1 = n2;
n2 = aux;
}
if(maior < n3){
maior = n3;
aux = n1;
n1 = n3;
n3 = aux;
}
}
int pitagoras(int n1, int n2, int n3){
n1 *= n1;
n2 = (n2*n2) +... | ALGO | 0.999692 | 4.393867 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2017-09-19T17:43:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "480c605ca... |
feb20bac-fc8b-419c-884c-6a4323efae2a | ishandutta2007/codeforces-t | tmwilliamlin168/normal/1015/E2.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, dp[1000][1000], a;
string g1[1000];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m;
for(int i=0; i<n; ++i) {
cin >> g1[i];
memset(dp[i], 0x3F, 4*m);
}
auto b1=[&](const int &i, const int &j) {
if(g1[i][j]=='*')
++a;
else
... | ALGO | 0.99991 | 3.23844 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a87195afe165... |
74803247-e2fb-400c-9e01-5371a0a55017 | talentspsp/audio_analysis | spuc/functions/window.cpp | /*
* SPUC - Signal processing using C++ - A DSP library
*
* This program 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 2, or (at your option)
* any later version.
*
* This program is... | ALGO | 0.948271 | 4.283241 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2011-05-17T07:15:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2133b9c2b... |
4e49ce49-920f-48cc-8692-f5eccd8328b8 | mudar-hussain/DSA_Leetcode_Practice | 138-copy-list-with-random-pointer/138-copy-list-with-random-pointer.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
Node* next;
Node* random;
Node(int _val) {
val = _val;
next = NULL;
random = NULL;
}
};
*/
class Solution {
public:
//2nd Approach
Node* copyRandomList(Node* head) {
if(!head) return head;
... | ALGO | 0.998101 | 5.525892 | {
"github_metadata": {
"branch": "main",
"commit_count": 2021,
"repo_created_at": "2021-11-27T17:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "077b1633d... |
8218f76d-3c64-4494-b291-387db7053a0c | ishandutta2007/codeforces-w | wiwiho/normal/1144/F.cpp | #include <iostream>
#include <assert.h>
#include <algorithm>
#include <vector>
#include <utility>
#include <queue>
bool check(std::queue<int> &queue, std::vector<std::vector<int> > &eov, std::vector<std::pair<int, int> > &edge,
int* vertices){
bool ans = true;
while(!queue.empty()){
in... | ALGO | 0.999971 | 4.080983 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:34:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9767b37d2467... |
495feaaa-9227-4e38-97de-1f59cde8da85 | abhikdas7421/Leet-Code | Move all zeroes to end of array - GFG/move-all-zeroes-to-end-of-array.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
void pushZerosToEnd(int arr[], int size) {
// code here
int i = 0, j = 0;
int n = size-1;
while(j <= n) {
if(arr[i] != 0) {
... | ALGO | 0.999788 | 6.013433 | {
"github_metadata": {
"branch": "main",
"commit_count": 1505,
"repo_created_at": "2023-10-15T15:40: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": "bc83d6a98... |
afc5ef13-edf9-418d-8e18-4b058e66bf39 | tanmay-pro/CompProg | codeforces/182D.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define PI 3.14159265
#define br cout << endl
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define amazing ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL... | ALGO | 0.999978 | 4.616583 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-03-09T17:11: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": "d93a2ebc6a1f... |
94b97610-e4bc-4f46-a20c-51fdf235a4ba | anindiangeek/450DSA | Graphs/TopoSort.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
vector<int> topoSort(int V, vector<int> adj[])
{
}
};
/* Function to check if elements returned by user
* contains the elements in topological sorted form
* V: number of vertices
* *res: array containing elements in topologic... | ALGO | 0.999939 | 5.671051 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2022-01-10T06:40:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "efa35bacdb9... |
d0ae9f8d-e078-48f8-bb56-2d59d4227ceb | anisimovajulia/Parallels | OpenMp/OpenMp/Main.cpp | #include <omp.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
//task1
void main1() {
int size, rank;
#pragma omp parallel num_threads(8)
{
size = omp_get_num_threads();
rank = omp_get_thread_num();
printf("Hello world threadnum %d number of threads %d \n", rank, size)... | TOOL | 0.99307 | 3.290747 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-04-05T09:36: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": "74de74d736... |
1be425d6-283a-442c-97a0-b3fda8a19113 | gopoma/competitive-programming | UVa/Math01/Blackandwhitepainting.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "helpers/debug.h"
#define MACRO(code) do {code} while (false)
#define RAYA MACRO(cerr << "\033[101m" << "================================" << "\033[0m" << endl;)
#else
#define dbg(...)
#define RAYA
#endif
template<class T> using V = vector<T>;
#def... | ALGO | 0.999624 | 4.829626 | {
"github_metadata": {
"branch": "main",
"commit_count": 821,
"repo_created_at": "2023-08-11T20:58: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": "118d68b573... |
8c41ed2c-2f80-48a1-ab87-c73fc93f7171 | kunnjjj/CB-LEVEL-UP-MAR-23 | DoubtSession2/longest_valid_parenthesis.cpp | // DP WHICH GIVES TLE
class Solution {
public:
int longestValidParentheses(string s) {
int n=s.size();
int ans=0;
vector<vector<int>> dp(n,vector<int> (n));
for(int i=n-1;i>=0;i--)
{
for(int j=i;j<n;j++)
{
if(s[i]=='(' && s[j]=... | ALGO | 0.999093 | 5.422501 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2023-03-17T17:59:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffc9ce0d85d... |
e0429838-bc0a-4e82-ba05-fafdcc1ea91f | fhormoz/caviar | CAVIAR-C++/armadillo/include/armadillo_bits/fn_det.hpp | // Copyright (C) 2008-2015 National ICT Australia (NICTA)
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// -----------------------------------------------------... | ALGO | 0.998984 | 6.692993 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2014-12-05T22:46:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 60,
"forks": 25,
"issues": 17,
"pull_requests": 1
},
"file_meta": {
"content_id": "2abba... |
39b6c118-19ac-4a9a-aee7-ff9b5ec48526 | KDE/kstars | kstars/ekos/guide/internalguide/guidestars.cpp | /*
SPDX-FileCopyrightText: 2020 <NAME> <<EMAIL>>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "guidestars.h"
#include "ekos_guide_debug.h"
#include "../guideview.h"
#include "fitsviewer/fitsdata.h"
#include "fitsviewer/fitssepdetector.h"
#include "Options.h"
#include <math.h>
#include <stellarsolve... | ALGO | 0.992464 | 7.042117 | {
"github_metadata": {
"branch": "master",
"commit_count": 15825,
"repo_created_at": "2015-09-18T11:52:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 239,
"forks": 116,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "987... |
d51d0c39-b2e9-468d-a7b3-a39788413106 | darker-space/Spoj | CHOCOLA.cpp | #include <iostream>
#include<stdio.h>
#include<string>
#include<list>
#include<set>
#include<cmath>
#include<queue>
#include<deque>
#include<algorithm>
#include<vector>
#include<typeinfo>
#include <stdlib.h>
#include<iomanip>
#include<map>
#include<unordered_map>
#define N 100000000
#define f(i,a,b) for(ll i=a;i<b;i++)... | ALGO | 0.999956 | 3.079319 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-02-01T13:05: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": "9d236df75... |
e0109e4e-d147-46a0-8861-285dab676341 | pyni/matrix_from_twovectors | main.cpp | #include "math.h";
void CrossProduct(double a[3], double b[3], double ret[3])
{
ret[0] = a[1] * b[2] - a[2] * b[1];
ret[1] = a[2] * b[0] - a[0] * b[2];
ret[2] = a[0] * b[1] - a[1] * b[0];
}
double DotProduct(double a[3], double b[3])
{
double result;
result = a[0] * b[0] + a[1] * b[1] + a[2] * b[... | ALGO | 0.999706 | 3.760242 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-10-24T11:37:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c0ce13146... |
848ced54-d253-43ff-8a23-0d64eb1ae371 | Pandey-SaurabhP/Codechef-Codes | codechef_LTIME73B_3_3.cpp | /**
@Author -> saurabhP
**/
#include <iostream>
#include <unordered_set>
#include <algorithm>
#define read(arr, n) for(int i = 0; i < n; i++) std::cin >> arr[i];
#define print(arr, n) for(int i = 0; i < n; i++) std::cout << arr[i] << " ";
typedef long long int lld;
using namespace std;
void fast(){
std::ios_b... | ALGO | 0.99942 | 4.155392 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-07-24T15:10: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": "68128f5fcb... |
89ab4142-c5dd-4503-93b1-70e06de57a2c | jas-karan/myLeetcode | number-of-connected-components-in-an-undirected-graph/number-of-connected-components-in-an-undirected-graph.cpp | class UnionFind {
private: vector<int>root;
public:
int cnt;
UnionFind(int size) {
cnt=size;
root = vector<int>(size);
for (int i = 0; i < size; i++) {
root[i] = i;
}
}
int find(int x) {
if (x == root[x]) {
return x;
}
... | ALGO | 0.999957 | 6.199309 | {
"github_metadata": {
"branch": "main",
"commit_count": 2643,
"repo_created_at": "2021-12-25T09:57:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef2958b4e... |
aafbb0b0-47f9-4f9c-a823-9afad0464720 | Tipriest/AlgorithmPractice | leetcode/hashMap/exp3.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
/**
*
* just simple comment
* ! important
* ? should this achieved solution
* @author Tipriest (<EMAIL>)
* @brief
* @param[in] cost My Param doc
* @return int
* @author Tipriest (<EMAIL>)
*/
int minCostClimbin... | ALGO | 0.999889 | 4.603037 | {
"github_metadata": {
"branch": "main",
"commit_count": 113,
"repo_created_at": "2023-10-13T00:05:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5fd051c84c... |
d61d43be-197c-43d7-a091-37bc5afcad57 | idriss-arto/leetcode | 150.逆波兰表达式求值.cpp | /*
* @lc app=leetcode.cn id=150 lang=cpp
* 栈
* [150] 逆波兰表达式求值
*/
/*
* 思路:
* 栈的经典应用。逆波兰表达式
* 注意下数据溢出问题,用longlong储存数字
*/
// @lc code=start
#include <stack>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
int evalRPN(vector<string>& tokens) {
//* 力扣修改了后台测试数据,需要用longlong
s... | ALGO | 0.999959 | 5.641348 | {
"github_metadata": {
"branch": "main",
"commit_count": 153,
"repo_created_at": "2024-12-15T13:11: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": "598911ba34... |
b2a0b31f-9063-4ebe-a022-19efa22b871f | ishandutta2007/codeforces-p | pikel_rik/normal/1730/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
string s;
cin >> s;
int n = (int) s.length();
string answer;
vector<int> freq(26);
for (int i = 0; i < n;) {
... | ALGO | 0.999958 | 5.614748 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49: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": "fcf6beb7562a... |
25080d98-e209-421e-898d-56ef7add1a79 | Akash9131/DSA-Question | Heap/heap.cpp | #include<iostream>
using namespace std;
class Heap{
public:
int arr[250];
int size = 0;
Heap() {
size = 0;
}
void insertintoHeap(int val) {
// we want to insert value
size = size + 1;
int index = size;
//insert value
arr[index] = val;
... | ALGO | 0.999446 | 3.910695 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-29T11:55: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": "8012c234fe46... |
dd14dbfe-878e-4564-b65b-3544e9124b42 | yashkundu/cp | CodeForces/972Div2/B.cpp | /**
* author: lazyhash(yashkundu)
* created: 16 Sep, 2024 | 20:51:19
**/
#include <iostream>
#include <vector>
#include <random>
#include <chrono>
using namespace std;
typedef long long ll;
typedef long double ld;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, m, q;
int a, b, ... | ALGO | 0.999917 | 4.492826 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2023-01-01T05:45: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": "db1eb80ef... |
cad59397-0f43-4fc4-bf08-21bf3728f94c | ahupowerdns/hello-cpp | lambdas.cc | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <functional>
using std::vector;
using std::string;
using std::cout;
using std::endl;
int main()
{
vector<std::string> v{"9", "12", "13", "14", "18", "42", "75"};
string prefix("hi ");
for_each(v.begin(), v.end(), [&prefix]... | ALGO | 0.995943 | 4.835485 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-06-16T08:20:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 74,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9408bdb8... |
9782e3c8-689f-42b9-8bbe-1873c0865e61 | Junghs-cloud/Baekjoon | Silver/1/_27737.cpp | #include <iostream>
#include <stack>
using namespace std;
bool** isVisited;
int** arr;
int N, M, K;
int useMushroom = 0;
struct pos
{
int x = 0;
int y = 0;
pos(int a, int b)
{
x = a;
y = b;
}
};
stack<pos> posStack;
void dfs(int i, int j)
{
posStack.push(pos(i, j));
isVisited[i][j] = true;
int mushroomCou... | ALGO | 0.999974 | 4.262072 | {
"github_metadata": {
"branch": "master",
"commit_count": 816,
"repo_created_at": "2023-01-08T13:47: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": "ddeadafc... |
58a11aec-7f0c-4a38-84ad-f1202857e7eb | touhid91/hfa | ch6.strings/ll/merg.k.sorted.l.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* merge(ListNode* l1, ListNode* l2) {
ListNode* d = new ListNode(0);
ListNode* r = d;
while (l1 || l2) {
... | ALGO | 0.999953 | 6.065034 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-03-18T15:33:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6904895cc... |
592fdc4f-ba36-42e5-bd60-fc1bcd36719d | touhid91/lc.amz | 4.recursion/4.4.word.search.II.cpp | /**
* @file 4.4.word.search.II.cpp
* @author <NAME> <<EMAIL>>
*
* @date Thu Jun 25 2020
*
* @brief
*/
#include <bits/stdc++.h>
using namespace std;
class trie {
public:
trie *next[26];
bool leaf;
trie() {
leaf = 0;
for (int i = 0; i < 26; ++i) {
next[i] = 0;
}
}
void insert(strin... | ALGO | 0.999943 | 5.900542 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-06-26T12:40:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e0d93c4ef1... |
070137e8-a6b0-42eb-9eb9-be615ef91884 | ishandutta2007/codeforces-x | xellos/normal/1608/F.cpp | // iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <chrono>
#include <random>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include ... | ALGO | 0.999985 | 4.418219 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38: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": "59673270556d... |
740c9474-01f8-4078-9c2e-ffaad51d02b1 | spolstra/hotsniper-reliability | reliability_external.cpp | #include <algorithm>
// #include <filesystem> // Not available in C++11
#include <fstream>
#include <iostream>
#include <regex>
#include <sstream>
#include <string>
#include <vector>
#include <memory>
#include <utility>
#include <tuple>
#include <limits>
#include "rmodel.h"
#include "em_model.h"
using namespace std;
... | ALGO | 0.937901 | 5.901953 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2022-09-09T14:49:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "251d2e0cb40... |
ce0f7d6c-10b9-4372-a750-350527c3a2fb | Zaxeyy/C-CPP-_LearingCode | test5.19/test5.19/Matrix_Fibonacci.cpp | #include"head.h"
struct Matrix2_2 {
_int64 m[2][2];
};
Matrix2_2 multiply(Matrix2_2 a, Matrix2_2 b){
Matrix2_2 res;
res.m[0][0] = a.m[0][0] * b.m[0][0] + a.m[0][1] * b.m[1][0];
res.m[0][1] = a.m[0][0] * b.m[0][1] + a.m[0][1] * b.m[1][1];
res.m[1][0] = a.m[1][0] * b.m[0][0] + a.m[1][1] * b.m[1][0];
res.m[1][1] =... | ALGO | 0.999841 | 3.483654 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-05-18T01:04: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": "862ae869de66... |
fbf1b90d-3858-4fdb-b5d4-1684b82eca8a | ssmzmert/Data-Structures | 2/decompress.cpp | #include <iostream>
#include <string>
#include <fstream>
#define not_found "thIsIteMisSReaLLyNotInString"
using namespace std;
string uncompress[4096] = { not_found }; //initially all strings are unfound
int main() {
ifstream input("compout");
ofstream output("decompout");
for (int i = 0; i < 256; i++) {
uncompres... | ALGO | 0.999324 | 3.344288 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-10-18T12:02: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": "14c79ab9a691... |
9b63a937-466c-410a-b9d6-3276b77551eb | Jasonsd19/multilayer-perceptron | multilayerPerceptron.cpp | #include <matrix.h>
#include <algorithm>
#include <random>
// Represents a hidden layer in a multilayer perceptron, consists of weights and biases.
struct hiddenLayer {
matrix weights;
matrix biases;
hiddenLayer(matrix weights, matrix biases) : weights(weights), biases(biases) {}
};
// This represents a m... | DATA | 0.929468 | 5.673716 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-04-30T09:23:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f68f0b0b41e2... |
560bf8a0-b925-49cd-9628-a6e48cee072f | stsquad/mpeg4ip | common/video/mpeg4-2000/type/warp.cpp | /*************************************************************************
This software module was originally developed by
<NAME> (<EMAIL>), Microsoft Corporation
<NAME> (<EMAIL>), Microsoft Corporation
<NAME> (<EMAIL>), Microsoft Corporation
<NAME> (<EMAIL>), Microsoft Corporation
(date: March, 1996)
and als... | ALGO | 0.99799 | 5.718629 | {
"github_metadata": {
"branch": "master",
"commit_count": 647,
"repo_created_at": "2009-04-22T18:36:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 39,
"forks": 34,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e3608... |
c4feb517-a723-4852-8095-618677d5ad1e | tpn/cuda-samples | v10.2/7_CUDALibraries/nvgraph_SSSP/nvgraph_SSSP.cpp | /*
* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
*
* Please refer to the NVIDIA end user license agreement (EULA) associated
* with this source code for terms and conditions that govern your use of
* this software. Any use, reproduction, disclosure, or distribution of
* this software and related... | ALGO | 0.996169 | 3.914871 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2016-10-02T21:04:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 61,
"forks": 41,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "385ea55... |
6df380ab-19a7-4e89-8537-3b1ff0825c44 | Aman149/LeetCode-Questions | 0073-set-matrix-zeroes/0073-set-matrix-zeroes.cpp | class Solution {
public:
void setZeroes(vector<vector<int>>& matrix) {
int row = matrix.size(), col = matrix[0].size();
bool firstRowZero = false, firstColZero = false;
// Check if first row should be zero
for(int j = 0; j < col; j++) {
if(matrix[0][j] == 0) {
... | ALGO | 0.998657 | 6.895135 | {
"github_metadata": {
"branch": "main",
"commit_count": 1043,
"repo_created_at": "2021-12-24T14:30: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": "c60c61fbf... |
9af97f01-fae8-460d-b5a6-52c8d8426633 | cms-sw/cmssw | RecoTracker/LSTCore/standalone/code/rooutil/ttreex.cc | // .
// ..: <NAME>, <EMAIL>
#include "ttreex.h"
using namespace RooUtil;
///////////////////////////////////////////////////////////////////////////////////////////////////
//
//
// TTree++ (TTreeX) class
//
//
///////////////////////////////////////////////////////////////////////////////////////////////////
//__... | DATA | 0.905215 | 3.449655 | {
"github_metadata": {
"branch": "master",
"commit_count": 251237,
"repo_created_at": "2013-06-26T14:09:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1144,
"forks": 4480,
"issues": 947,
"pull_requests": 108
},
"file_meta": {
"content_id... |
823e647d-ad06-4181-8087-499fda0535ee | ldqcarbon/RTK | code/rtkI0EstimationProjectionFilter.hxx | /*=========================================================================
*
* Copyright RTK Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... | ALGO | 0.961089 | 5.649812 | {
"github_metadata": {
"branch": "master",
"commit_count": 3489,
"repo_created_at": "2016-03-29T08:02: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": "1772f1e... |
db952eeb-0968-4e08-b862-62956a977bad | pratikp2/Turing_Tasks | Task-524538/Turn3-ModelA.cpp | #include <iostream>
#include <atomic>
#include <thread>
#include <vector>
// Atomic counter class
class AtomicCounter {
public:
AtomicCounter() : counter(0) {}
// Inline function to increment the counter atomically
inline void increment() {
counter.fetch_add(1, std::memory_order_relaxed);
}
... | ALGO | 0.981041 | 6.616758 | {
"github_metadata": {
"branch": "main",
"commit_count": 257,
"repo_created_at": "2024-09-24T16:12: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": "7f676b900d... |
15807921-abec-435e-a151-5dfd86fed027 | Itsme-Parth/Data-Structures-and-Algorithms | Graphs/bipartiteGraphDfs.cpp | class Solution
{
public:
bool checkBipartite(int node, vector<int> adj[], int color[])
{
if (color == -1)
color[node] = 1;
for (auto itr : adj[node])
{
if (color[itr] == -1)
{
color[itr] = 1 - color[node]; //change the color fir... | ALGO | 0.999804 | 5.90653 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2020-10-19T18:22: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": "c86110b4... |
0ac55d2b-8825-4e5a-9ad8-8503d35252b3 | naman4u13/Camera_Calibration | Camera_Calibration/Source.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
using namespace cv;
using namespace std;
void getWorldPts(Size boardSize, float chessSqDim, vector<Point3f>& worldPts)
{
for (int i = 0; i < boardSize.height; i++)
{
for (int j = 0; j < boardSize.width; j++)
{
worldPts.push_back(Point3f(j*chessSqDim, i*chessS... | TOOL | 0.995571 | 5.095562 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-02-10T06:33:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b08eed5cc... |
559eee0e-f75c-4129-af86-62f6a2621692 | shannonliang312/leetcode-shannon | 58.最后一个单词的长度.cpp | /*
* @lc app=leetcode.cn id=58 lang=cpp
*
* [58] 最后一个单词的长度
*/
#include <string>
using namespace std;
// @lc code=start
class Solution {
public:
int lengthOfLastWord(string s) {
if (s == "") return 0;
int i = 0, j = 0;
int res = 0;
int length = s.length();
char *ps = new ... | ALGO | 0.99962 | 5.609667 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-09-17T08:31:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5995f2060... |
8d34fd4d-5799-4d65-b5a9-41f0bfb0013a | shacojx/SourceCodeGameTLBB | Game/Client/WXClient/World/BuildingCollisionMng.cpp | #include "StdAfx.h"
#include ".\buildingcollisionmng.h"
#include <math.h>
#include "..\Procedure\GameProcedure.h"
#include "../WxRender/ResourceProvider.h"
const INT BUILD_COLLISION_SEARCH_RANGE = 30;
CBuildingCollisionMng::CBuildingCollisionMng(VOID)
{
}
CBuildingCollisionMng::~CBuildingCollisionMng(VOID)
{
}
//
... | TOOL | 0.926565 | 3.104791 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-05-18T05:16:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 53,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "70e7f0d4... |
425b0e7d-63eb-4ad7-99f6-7102d2a5d5c8 | TahaHussain0911/Data-Structure-Algo | Hashing/OpenHashing.cpp | #include <iostream>
using namespace std;
struct OpenHash
{
int value;
OpenHash *next;
};
const int HS = 10;
OpenHash *HT[HS];
void addKey(int number)
{
int key = number % HS;
OpenHash *ptr = new OpenHash();
ptr->value = number;
ptr->next = NULL;
if (HT[key] == NULL)
{
ptr->value ... | ALGO | 0.996933 | 4.139877 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2022-10-21T14:00: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": "0472fe678... |
1b5fb638-59be-4f49-96f3-e079f1421ff3 | bmevprog/onkepzokor-archives | acm_icpc_hun_2022/K/k.cpp | #include <bits/stdc++.h>
using namespace std;
struct MaxMatchBipartiteGraph {
vector<vector<int>> adj;
vector<bool> visited;
vector<int> match;
MaxMatchBipartiteGraph(int n) {
adj.resize(n);
match.resize(n, -1);
visited.resize(n);
}
//Augmenting path.
bool DFS(int from) {
if(visited[from]) retu... | ALGO | 0.999981 | 4.03438 | {
"github_metadata": {
"branch": "main",
"commit_count": 156,
"repo_created_at": "2022-09-09T19:54:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d7b1c2b375... |
20abe5d3-085a-47bd-8d98-96b144d54708 | lord-of-nothing/yet-another-cpp-hw | 10.04.cpp | #include <cassert>
#include <cmath>
#include <iterator>
#include <stack>
#include <utility>
/////////////////////////////////////////////////////////////////////////////////////
template <typename T>
class Stack_v1 {
public:
void push(T x) {
auto max = std::empty(m_data) ? x : std::max(x, m_data.top().second.s... | ALGO | 0.995627 | 6.457974 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-09-23T18:53: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": "80f354ee36c... |
635ed2ae-adac-46c2-a576-6d301babd201 | Shantanu993/GFG_DailyPractice | Difficulty: Medium/Multiply two strings/multiply-two-strings.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public: /*You are required to complete below function */
string multiplyStrings(string s1, string s2) {
//Your code here
bool neg1 = false, neg2 = false;
if (s1[0] == '-') {
neg... | ALGO | 0.999959 | 5.934892 | {
"github_metadata": {
"branch": "main",
"commit_count": 1292,
"repo_created_at": "2024-04-01T02:16: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": "398c4833b... |
2e305513-bef3-402c-8fab-e9c036e6e06a | edmondium/codeforces | SmiloAndMinecraft.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
using ll = long long;
static constexpr int MAXN = 500;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int T;
std::cin >> T;
while (T--) {
int n, m, k;
std::cin >... | ALGO | 0.999752 | 5.068541 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2025-04-17T10:54:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff657a42b35... |
f2f5e1c0-b1c9-46a3-b084-8ab6bd501f6c | FullStackParihar/cpp | ankit sir array quetions/Question_9.cpp | // 9. Find the Most Frequent Element in an Array
// o Explanation: Determine the element that appears most often in the array. o Given Array: {1, 3, 2, 1, 4, 1, 5, 2}
// o Expected Result: 1 /
#include <iostream>
int findMostFrequentElement(int arr[], int n) {
int maxCount = 0;
int mostFrequent = arr[0];
... | ALGO | 0.999983 | 6.950391 | {
"github_metadata": {
"branch": "main",
"commit_count": 180,
"repo_created_at": "2024-08-07T11:03: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": "b151271418... |
e82d1d00-46e0-4dd2-b6b0-d4d537a61f7f | eat-swap/LeetCodeDaily | cpp/2210/221022-CN.cpp | #include <vector>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <tuple>
#include <functional>
#include <iostream>
/**
* 1235. Maximum Profit in Job Scheduling
*
* We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i].
* You'... | ALGO | 0.999945 | 6.456898 | {
"github_metadata": {
"branch": "master",
"commit_count": 613,
"repo_created_at": "2021-12-25T04:02: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": "41ae7a4b... |
903d80e0-f16d-4df4-b962-2c903988cda2 | miaohang123/PAT-code | 1096:Consecutive factor/Consecutive_factor.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
using namespace std;
const int N = 100002;
int prime[N];
bool mark[N];
int primesize;
void init(){
primesize = 0;
for(int i = 2; i <= N; i++){
if(mark[i]) continue;
prime[primesize++] = ... | ALGO | 0.999945 | 3.682684 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-03-10T08:33: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": "6a7ef1b1c7... |
6108a95e-043d-46c5-99c2-ffb8b0a32101 | tsuchi0410/AtCoder | library_C++/コンテナと型/mint.cpp | const int MOD = 998244353;
// modint
// https://github.com/drken1215/algorithm/blob/master/MathNumberTheory/modint.cpp
template<int MOD> struct Fp {
// inner value
long long val;
// constructor
constexpr Fp() : val(0) { }
constexpr Fp(long long v) : val(v % MOD) {
if (val < 0) val += MOD;
}
// g... | ALGO | 0.999827 | 4.818156 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2023-11-04T03:38:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "174e19e83... |
0c92d9be-c3b4-416e-9392-6168c4358202 | sourashis59/DSA | DynamicProgramming/knapsack/editDistance.cpp | // https://leetcode.com/problems/edit-distance/submissions/1347172456/
class Solution {
public:
string s, t;
int m, n;
vector<vector<int>> memo;
// mc(i, j) = min cost to convert s[i...end] to t[j...end]
int mc(int i, int j) {
if (i == m && j == n) return 0;
// delete/insert
... | ALGO | 0.999998 | 6.215177 | {
"github_metadata": {
"branch": "main",
"commit_count": 211,
"repo_created_at": "2022-09-28T13:16: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": "9f066aa5aa... |
1fad8b5d-470b-4130-a9bf-e9e88fe7a4ea | flick-23/HacktoberFest | 03. Recursion/minimum_sum_partition_dp.cpp | #include <bits/stdc++.h>
using namespace std;
void subsets(int arr[], int n, int sum, vector<vector<int>> &t)
{
for (int i = 0; i < n + 1; i++)
{
for (int j = 0; j < sum + 1; j++)
{
if (j == 0)
t[i][j] = 1;
else if (i == 0)
t[i][j] = 0;
... | ALGO | 0.999866 | 4.633441 | {
"github_metadata": {
"branch": "main",
"commit_count": 188,
"repo_created_at": "2021-10-03T05:19:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 51,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae81423e9... |
1e7e0315-ca00-41e6-b845-39ac33fa02e4 | yuyichao/gctests | cpu_server/main.cpp | //
#include <stdint.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <vector>
#include <iostream>
#include <sstream>
static int find_cpu(int *counts,... | WEB | 0.939525 | 4.298557 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2017-04-30T22:50: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": "e5c51fe11... |
83485455-aa88-49b4-bd23-3d952cd1e6a0 | kikutabryan/drone-winch-gripper | src/Functions.ino | /*
* Function name: signOfNumber
* Parameters: float number
* Return: int
* Summary: gets the sign of a number
*/
int signOfNumber(float number)
{
if (number < 0)
return -1;
else if (number >= 0)
return 1;
}
/*
* Function name: mapPWM
* Parameters: float value, float fromLow, float fromHigh, float toLow, f... | TOOL | 0.986825 | 5.876499 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-04-28T22:28: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": "2b777f2381a7... |
60e9f1c4-0451-48e1-bd3d-419e08c4ef86 | PNU-PULSE/2021-Fall | Dijkstra/BOJ_1719/BOJ_1719.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
using mypair = pair<int, int>;
vector<vector<mypair>> vec;
int n, m;
void print_next_node(int start, vector<int>& trace) {
int curr;
for (int i = 0; i < n; ++i) {
if (i == start) {
cout << '-' << ' ';
continue;
}
if (trace[i] ... | ALGO | 0.999986 | 4.357653 | {
"github_metadata": {
"branch": "main",
"commit_count": 137,
"repo_created_at": "2021-09-25T06:16:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff50a28f43c... |
d6e6926c-7229-4b6f-a14d-6b9ebc67b635 | CSE21098/Problem-Solving | HW/Searching-5/abc.cpp | int findLCM(int a, int b) {
return (a * b) / __gcd(a, b);
}
int main() {
int left = 1, right = INT_MAX, divisorA, divisorB, divisorC, targetCount;
cin >> divisorA >> divisorB >> divisorC >> targetCount;
while (left <= right) {
int middle = left + (right - left) / 2;
int count = (middle... | ALGO | 0.999972 | 4.314818 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2024-03-08T15:16: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": "cbad1b0cf2b... |
02fa9ce8-ebc4-456f-8137-d434289be721 | reddy-lab-code-research/MuST-CoST | data/transcoder_evaluation_gfg/cpp/MAXIMUM_NUMBER_2X2_SQUARES_CAN_FIT_INSIDE_RIGHT_ISOSCELES_TRIANGLE.cpp | // Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include... | ALGO | 0.9911 | 5.214057 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-02-08T19:28:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cde98b7901f... |
bc23eede-6f28-4d82-a909-4cc43ed14cb7 | xyb7910/cpp_fire | luogu/未分类/求整数的和与均值.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <iomanip>
#define x first
#define y second
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
... | ALGO | 0.999076 | 3.520925 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2024-09-28T08:44: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": "cc02c8e80e... |
21f4a912-9601-458f-b220-4b5529d3c472 | mfeingol/almonaster | Source/Almonaster/Scoring/AlmonasterScore.cpp | //
// Almonaster.dll: a component of Almonaster
// Copyright (c) 1998 <NAME> (<EMAIL>)
//
// This program 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 2
// of the License, or (at your opti... | TOOL | 0.939194 | 6.293669 | {
"github_metadata": {
"branch": "master",
"commit_count": 292,
"repo_created_at": "2019-11-23T03:35:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81eb9af7... |
cb5b46d3-3bc7-4110-8066-4fd6ae6e22ef | echo-xiao9/SJTU-SE-Sophomore | SE127_SoftwareEngineeringPractice/QtLab/lab4/参考/Tree.h | //
// Created by Smile on 2019/4/8.
//
#ifndef C_BINARYDIMEN_TREE_H
#define C_BINARYDIMEN_TREE_H
#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
/****************************************************************
* Write your code below
*******************************... | ALGO | 0.999518 | 3.956302 | {
"github_metadata": {
"branch": "main",
"commit_count": 144,
"repo_created_at": "2021-03-27T03:33:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8eba413f08... |
472865cf-3912-436d-88c2-66b3091baf54 | Frederique-Hsu/Data_Structure_and_Algorithm | Trees/bounding_volume_hierarchy_tree/bvh_tree.hpp | /*!
* \file bvh_tree.hpp
* \brief bounding volume hoerarchy tree
* \details
*
*/
#pragma once
#include <list>
class BVH; // bounding volume hierarchy
class AABB; // axis-aligned bounding box
class CollisionList;
class Node;
class LeafNode;
class InternalNode;
using NodePtr = Node... | ALGO | 0.997937 | 5.847213 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2015-03-22T15:52:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2705ed333... |
b5915956-bf27-4fd2-8a11-edb1107653c4 | YosysHQ/yosys | libs/minisat/SolverTypes.h | /***********************************************************************************[SolverTypes.h]
Copyright (c) 2003-2006, <NAME>, <NAME>
Copyright (c) 2007-2010, <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), ... | TOOL | 0.951359 | 3.390517 | {
"github_metadata": {
"branch": "main",
"commit_count": 15303,
"repo_created_at": "2013-01-05T10:10:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3933,
"forks": 973,
"issues": 482,
"pull_requests": 128
},
"file_meta": {
"content_id": "... |
61b95ea7-d4c0-47fd-befe-35a4ff2b3e5f | mar-things/Wall_following_robot | Autonomous_Car/Testing_systems/Testing_systems.ino |
int stateLast;
int stateCurrent;
int rotationCount = 0;
int stateCount = 0;
int stateCountTotal = 0;
int statesPerRotation = 6;
int distancePerStep;
int wDiameter = 77; // Wheel Diameter in mm
int wdistance =0;
int encL=26;
int servoM = 28;
int enA = 18;
int in1 = 20;
int in2 = 19;... | ALGO | 0.998135 | 4.842817 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-10-02T19:10: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": "816ba923536d... |
ed67f1fd-c65f-4d30-9a2c-0bd9f93e22a4 | ArjunTa1war/codeforces | 437c.cpp | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define M 1000000007
#define all(v) begin(v),end(v)
using namespace std;
void solve()
{
int n,m;
cin>>n>>m;
map<int,int>mp;
for (int i = 1; i <= n; i++){
int num;cin>>num;
mp[i]=num;
}
... | ALGO | 0.999989 | 3.683908 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-01-08T19:24: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": "557bb198d36e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.