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 |
|---|---|---|---|---|---|---|---|
e16369d8-acfb-47ad-9175-b9a2b4791e6f | hoanxuanbach/Competitive-Programming | OI/CTSC/2015/APP.cpp | // Judges with GCC >= 12 only needs Ofast
// #pragma GCC optimize("O3,no-stack-protector,fast-math,unroll-loops,tree-vectorize")
// MLE optimization
// #pragma GCC optimize("conserve-stack")
// Old judges
// #pragma GCC target("sse4.2,popcnt,lzcnt,abm,mmx,fma,bmi,bmi2")
// New judges. Test with assert(__builtin_cpu_sup... | ALGO | 0.997949 | 5.121203 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2025-04-19T03:31:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "71f57125c3b... |
52cdc96c-c92a-40a4-865c-ec0f1130ba24 | khanhvu207/competitiveprogramming | old_files/Codeforces/1287/b.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std;
int n, k;
string s[1505];
map<string, int> Map;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> k;
for (int i = 0; i < n; ++i) {
cin >> s[i];
}
ll ans = 0L... | ALGO | 0.999937 | 4.41085 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2018-11-20T08:25:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 18,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1418422... |
1371fff1-c28f-436e-973d-4bb25a58122e | surinyach/JUTGE-FIB | X39577_ca-001.cpp | #include <vector>
#include "Estudiant.hh"
#include <algorithm>
#include <iostream>
using namespace std;
double media(int nas, int tam_sub, const vector<bool>& subcj) {
double suma = 0;
for (int i = 0; i < nas; ++i) {
double a;
cin >> a;
if (subcj[i]) suma += a;
}
return su... | TOOL | 0.942154 | 3.845943 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-08T11:10: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": "f64e50e0621d... |
08794fef-249b-485e-be09-18464b97f211 | akormous/dsa | 6_Recursion_And_DP/ClimbingStairs.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Triple Step: A child is running up a staircase with n steps and can hop either 1 step, 2 steps, or 3
steps at a time. Implement a method to count how many possible ways the child can run up the
stairs.
Approach:
Try to run some cases when n = 1, 2, 3
In how many ways ... | ALGO | 0.999764 | 4.074028 | {
"github_metadata": {
"branch": "master",
"commit_count": 354,
"repo_created_at": "2021-07-13T13:30:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8bdc458c... |
9ed90d1b-b4cb-4666-92a0-1e0e364b1771 | soumanpaul/dsa-resources | dsa/0-Data_Structure/9-Graph/0. Representation/directedGraph.cpp | #include<iostream>
using namespace std;
struct Node {
int val;
Node *next;
};
struct Edge {
int src, dest;
};
class Graph {
Node **head; // An array of pointers to Node to represent the adjacency list
int numberOfNodes; // Number of nodes in the graph
public:
Graph(Edge edges[]... | ALGO | 0.999931 | 5.260404 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-03-21T13:48: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": "d4fd5e14634a... |
1bf99734-20c6-4466-9497-b67ac05b58f4 | NeoGeographyToolkit/StereoPipeline | graveyard/CameraAdjust.h | // __BEGIN_LICENSE__
// Copyright (c) 2009-2013, United States Government as represented by the
// Administrator of the National Aeronautics and Space Administration. All
// rights reserved.
//
// The NGT platform is licensed under the Apache License, Version 2.0 (the
// "License"); you may not use this file excep... | ALGO | 0.983952 | 6.190742 | {
"github_metadata": {
"branch": "master",
"commit_count": 7802,
"repo_created_at": "2010-06-11T02:11:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 546,
"forks": 185,
"issues": 25,
"pull_requests": 0
},
"file_meta": {
"content_id": "844... |
dd6e46dd-afc0-488d-8fd6-6edc8af7bfb8 | crishoj/OpenPNL | c_pgmtk/src/pnl2DNumericDenseMatrix.cpp | /////////////////////////////////////////////////////////////////////////////
// //
// INTEL CORPORATION PROPRIETARY INFORMATION //
// This software is supplied under the terms of a license agreement or //
// nond... | ALGO | 0.989039 | 5.95682 | {
"github_metadata": {
"branch": "master",
"commit_count": 1090,
"repo_created_at": "2011-01-10T16:48:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 11,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d7ba... |
1e701568-65ae-483b-a971-6550f39026bb | 92khsang/AOC2021 | day21/star02/main.cpp | #include <vector>
#include <iostream>
#include <string>
#include <chrono>
#include <algorithm>
#include <unordered_map>
using WinCount = std::pair<size_t, size_t>;
struct Posibility
{
uint16_t diceSum;
uint16_t frequency;
};
const std::vector<Posibility> POSIBILITIES = {
{3, 1},
{4, 3},
... | ALGO | 0.999667 | 4.120032 | {
"github_metadata": {
"branch": "develop",
"commit_count": 26,
"repo_created_at": "2022-01-10T23:15:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bdad6950... |
861e23de-b16f-4930-ac66-9e835ae58fb0 | armabon/UE4_CGAL | ThirdParty/CGAL/includes/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path_traits.h | // Copyright (c) 2014 GeometryFactory
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
// 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 v... | ALGO | 0.990201 | 6.772995 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2016-11-22T20:39:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 11,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9b04f0... |
5dda8f4b-2456-443b-a160-526723179944 | devgraphy/Algorithm | programmers/월간코드챌린지시즌2/괄호회전하기.cpp | /* 모델링
문제:문자열 입력시 회전하면서 올바른 괄호 문자열인지 판단
입력:길이 1000 문자열
출력:올바른 괄호 문자열 개수
알고리즘:O(n^2)
문자 하나씩 뒤로 옮겨가면서 올바른 괄호 문자열인지 확인한다.
for i가 시작 위치를 가리키고 정해진 문자 길이동안 확인한다.
*/
#include <string>
#include <vector>
#include <stack>
#include <iostream>
#include <stack>
using namespace std;
int solution(string s) {
stack<char> st;
... | ALGO | 0.99933 | 4.810394 | {
"github_metadata": {
"branch": "main",
"commit_count": 300,
"repo_created_at": "2021-06-07T10:47:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 55,
"pull_requests": 0
},
"file_meta": {
"content_id": "9baf6e160... |
7f0be3a3-09aa-4e15-bb10-fb493a555a39 | perkyfever/numerical-optimization-methods | standard-atmosphere-model/src/tests.cpp | #include <gsl/gsl_errno.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_odeiv2.h>
#include <cmath>
#include <iostream>
#include <string>
#include "constants.h"
#include "integrator.h"
#include "observer.h"
#include "sam.h"
#include "timestepper.h"
int func(double t, const double y[], double f[], void *params) {
(... | ALGO | 0.998415 | 6.051709 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2024-01-18T18:00:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28af1eade65... |
37709f69-53f8-49f8-a5ae-8720d663e067 | vmromanov/vs2.1 | upgrCalc/action.cpp | #include "Action.h"
void Calculation::Operate(Function* func)
{
cout << "\nCalculate Function y = ";
cout << func->GetName() << endl;
func->SetCoeff();
double x = 0;
cout << endl << "Enter x" << endl;
cout << "x = "; cin >> x;
func->SetArg(x);
cout << endl << "y = " << func->GetValue() << endl;
}
void Tabu... | TOOL | 0.936632 | 5.220811 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-09-27T17:49: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": "9ba5384f9ef... |
45d8ba07-27b2-4b1e-aa0f-64d927f8371e | Mahe2112s/OwlCoder-3.0 | Difficulty: Easy/Facing the sun/facing-the-sun.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
// Returns count buildings that can see sunlight
int countBuildings(vector<int> &height) {
// code here
int c=1,j=1,i=0,temp=height[i];
... | ALGO | 0.999675 | 6.140031 | {
"github_metadata": {
"branch": "main",
"commit_count": 364,
"repo_created_at": "2024-01-05T16:01: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": "19ba6c66b8... |
f986f9a5-974d-4d8a-be70-6a38e9df6672 | justtshreyansh/Problem-Solving | Striver SDE Sheet/sort012.cpp | #include<bits/stdc++.h>
using namespace std;
void bruteForce(vector<int> &arr){
sort(arr.begin(),arr.end());
}
void betterSolution(vector<int> &arr){
int count0= 0;
int cnt1=0;
int cnt2=0;
for(int i=0;i<arr.size();i++){
if(arr[i]==0) count0++;
else if(arr[i]==1) cnt1++;
else... | ALGO | 0.999991 | 3.933116 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2025-01-01T10:00: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": "defae6fab... |
648bdac2-bfd4-4a6a-b02d-7ea2f27c97da | YuXinFan/Skip-List-Lib-In-CPP | skiplist.hpp | /* You may only include these two header files. */
#include <utility> /* For std::pair. */
#include <functional> /* For std::less. */
/* You may finally allowed to use // in C++. */
#define RAND_HALF ((RAND_MAX) / 2)
//
//
// The implementation for skiplist class follows here!
//
//
// S K I ... | ALGO | 0.998232 | 4.620478 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-11-23T08:15:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d512fe461... |
c220050d-bda8-4ddb-9ad3-03e8dd5aee09 | KanchanK31/DSA_Practice | Searching/Binary_search.cpp | //time complexity O(logn)
#include<iostream>
using namespace std;
int main()
{
int n,x,low,high,mid;
int ind=-1;
cout<<"enter number of elements in the array"<<endl;
cin>>n;
int arr[n];
int i;
cout<<"enter elements"<<endl;
for(i=0;i<n;i++)
{
cin>>arr[i];
}
cout<<"... | ALGO | 0.999816 | 4.475191 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2022-10-20T16:43: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": "de7c89bac74... |
2a35cc46-d9f0-49e0-b128-4fcb49d93de0 | VenusHui/VenusHui | ACM-ICPC/Nowcoder/笔试/baidu_testB.cpp | /**
* @platform: Nowcoder_Baidu
* @problem: baidu_testB
* @version: Contest Version
* @author: VenusHui
* @date: 2023-03-13
*/
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
const int maxn = ... | ALGO | 0.999904 | 4.446938 | {
"github_metadata": {
"branch": "main",
"commit_count": 368,
"repo_created_at": "2021-08-18T02:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e9d2bfc93b... |
8ec12026-cc6a-470c-a20f-ddd5c4b2b88f | spxuw/RFIM | Source/Gadgets/Mining/1_FastFrequentSubgraphMining/Ullman.cpp | #pragma warning (disable:4786)
#include <iostream>
#include <fstream>
#include <assert.h>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
using namespace std;
#include "gBase.h"
#include "occur.h"
#include "common.h"
#include "Ullman.h"
void UllmanIsomorphism :: Ullman_initial(Umapper * M0... | ALGO | 0.99338 | 3.548035 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-02-12T14:26:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3069858da5a... |
57ed5d0e-316b-45ef-adda-7d6ed3effb16 | mahfuz1703/Problem-Solving | Codeforces/D_X_Sum.cpp | /// In the name of ALLAH
/// <NAME> <NAME>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
... | ALGO | 0.999978 | 4.281877 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2023-01-26T19:18:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9bf840459... |
50c4b21d-268b-4eb6-ac61-b499f09902c5 | DangZhonghua/CodingPractice | array/Medium/Nuts and Bolts Problem.cpp | /*
Nuts and Bolts Problem
https://practice.geeksforgeeks.org/problems/nuts-and-bolts-problem/0
Given a set of N nuts of different sizes and N bolts of different sizes.
There is a one-one mapping between nuts and bolts. Match nuts and bolts efficiently.
Comparison of a nut to another nut or a bolt to another bolt is... | ALGO | 0.999462 | 4.525939 | {
"github_metadata": {
"branch": "master",
"commit_count": 774,
"repo_created_at": "2018-02-26T08:48: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": "fc3909a1... |
8d12ca20-b90a-4bad-8c0e-cb85d0590cfb | Chen-Albert-FENG/ELEC5660 | project_2_phase_1_FENG_Chen/tag_ws/src/tag_detector/src/temp.cpp | #include <iostream>
#include <ros/ros.h>
#include <ros/console.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/image_encodings.h>
#include <cv_bridge/cv_bridge.h>
#include <nav_msgs/Odometry.h>
#include <aruco/aruco.h>
#include <aruco/cvdrawingutils.h>
#include <opencv2/opencv.hpp>
#include <Eigen/Eigen>
#incl... | ALGO | 0.993453 | 5.459754 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-10-22T06:25:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4330af31ef7... |
6b9b8a58-90f6-409d-9cab-7d9ac030503e | fabriciomurai/dufs | include/dufs/maxLikelihood.hpp | #include <map>
#include <set>
//#include "RandomLib/Random.hpp"
#include <gsl/gsl_rng.h>
using namespace std;
#define _FLOAT long double
typedef pair<string, _FLOAT> LabelPi;
namespace dufs
{
#define RANDOM_VERTEX_SAMPLING 0
#define RANDOM_WALK_SAMPLING 1
class Counts {
public:
int rv_samples; // numbe... | ALGO | 0.979142 | 3.367876 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2018-11-08T23:13: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": "8e085081... |
b5ce7d57-7849-436b-bbb0-bf2a13ff48bd | kalxas/mseg | msegstd.h | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* msegstd.h: MSEG Standard mode class *
* Version: 0.9.x *
* Last revised: 09/08/2009 *
* ... | CONFIG | 0.990525 | 5.158569 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2010-09-27T16:13:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 8,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1f5d2fba18... |
821eb64a-5d0a-4c46-aa2a-08771795c1e6 | rurban/fast-hash | hashgen/dep/ulib/test/test_alignhash_bench.cpp | #include <time.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include <ulib/alignhash_tpl.h>
#include <ulib/rand_tpl.h>
uint64_t u, v, w;
#define myrand() RAND_NR_NEXT(u, v, w)
const char *usage =
"%s [ins] [get]\n";
volatile long counter = 0;
DEFINE_ALIGNH... | TOOL | 0.905595 | 4.277816 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2015-11-01T14:25:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b42ff26f... |
9f0fef4f-5f37-458c-943d-5a3a9fb533f7 | SanghunPyoEN/Sorting_Algorithms | quick_sort_determinstic.cpp | #include "sorting.h"
int partition(vector<int>& arr, int low, int high) {
int pivot = arr[high]; // chlose the last element as pivot
// int pivot = arr[low]; // choose the first element as pivot - we can choose any element as pivot
int i = low - 1;
for (int j = low; j < high; j++) {
if (arr[j]... | ALGO | 0.999965 | 5.65006 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2025-04-14T21:15: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": "c2d76730a3... |
01544e9e-ab2d-4c8f-ab17-e6bdd374858b | MrAshwin2142/GFG-Solutions | Hard/Find the String/find-the-string.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution
{
public:
string findString(int n, int k) {
string ans="";
unordered_set<string>st;
for(int i=0;i<n;i++)ans+='0';
st.... | ALGO | 0.999516 | 4.879391 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2023-10-24T05:28:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffce0e9e60... |
f9f752b7-1532-482a-b3f7-f48e87a37a84 | AliOsm/CompetitiveProgramming | CodeForces/832B. Petya and Exam.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <algorithm>
#include <string>
#include <memory.h>
#include <cmath>
#include <cctype>
using namespace std;
string goods, pat, tmp;
bool goodChars[26], badChars[26];
int q, star = -1;
int m... | ALGO | 0.999933 | 3.925681 | {
"github_metadata": {
"branch": "master",
"commit_count": 595,
"repo_created_at": "2016-10-14T11:29:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 138,
"forks": 49,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "17e4c... |
c7081796-5fb1-4c4b-b0e4-c96c77a99fc2 | kaidul/LeetCode_problems_solution | source-code/Best_Time_to_Buy_and_Sell_Stock_III.cpp | // using prefix sum-suffix sum kinda approach
class Solution {
public:
int maxProfit(vector<int> &prices) {
int n = prices.size();
if(n < 1) return 0;
vector<int> profitUntil(n), profitFrom(n);
profitUntil[0] = 0;
int Min = prices[0];
for(int i = 1; i < n; ++i) {
... | ALGO | 0.999938 | 5.726561 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2014-09-21T11:45:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 90,
"forks": 28,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83d325... |
680de954-265b-4eb3-b9cc-bfd501c0c790 | DarkWingMcQuack/GridGraphPathFinder | src/selection/NodeSelection.cpp | #include <algorithm>
#include <fstream>
#include <graph/GridGraph.hpp>
#include <graph/Node.hpp>
#include <selection/NodeSelection.hpp>
using selection::NodeSelection;
using graph::Node;
NodeSelection::NodeSelection(std::vector<graph::Node> left_selection,
std::vector<graph::Node> right_... | ALGO | 0.982492 | 5.84394 | {
"github_metadata": {
"branch": "master",
"commit_count": 278,
"repo_created_at": "2020-08-22T22:38: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": "b6d85fa5... |
fce50cfa-2146-4df6-9a7b-b139e2d13d75 | jameskelly396/HavokStarChaser | GraPhysAniFinal/CCommonTypes/MatrixMath.h | #ifndef _MatrixMath_HG_
#define _MatrixMath_HG_
/* Written by <NAME>, Fanshawe College, (c) 2008 to 2011 */
/* <EMAIL> */
/* */
/* For the 'Game Development - Advanced Programming' cur... | TOOL | 0.912373 | 5.090514 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-05-06T23:13:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8dd1e1bbe... |
f379f1b8-b093-4254-b0d1-9f6044bae24d | carlosal1015/Finite-element-method-FEM | 2017/Gascoigne/Examples/Example2/main.cc | /**
*
* Copyright (C) 2008 by the Gascoigne 3D authors
*
* This file is part of Gascoigne 3D
*
* Gascoigne 3D 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 opti... | ALGO | 0.999612 | 5.354262 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2017-08-15T18:26:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "f2526fc5d... |
b2058fd2-e9c3-44b6-89af-ed6fd62a49cb | e1810/kyopro | ac/abc167/abc167_e/14006837.cpp | #pragma target("avx")
#include<bits/stdc++.h>
using ll = int_fast64_t;
using P = std::pair<ll,ll>;
using V = std::vector<ll>;
template<typename T> using pq = std::priority_queue<T>;
template<typename T> using rpq = std::priority_queue<T, std::vector<T>, std::greater<T>>;
#define REP(i,b,e) for(ll i=b; i<e; i++)
#defin... | ALGO | 0.999981 | 4.272194 | {
"github_metadata": {
"branch": "master",
"commit_count": 1888,
"repo_created_at": "2020-04-02T07:41: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": "52c4efc... |
139130d6-1944-4231-a094-ce8e4f552c59 | KseniaBastrakova/curve_intersection | src/curve_intersection/Intersection/ConjugateGradientMethod.cxx | #include "curve_intersection/Intersection/ConjugateGradientMethod.hxx"
#include "curve_intersection/Intersection/GoldenRatio.hxx"
#include "curve_intersection/Core/Vector.hxx"
#include "curve_intersection/Core/Range.hxx"
#include <algorithm>
#include <limits>
namespace CurveIntersection {
Point ConjugateGradientMetho... | ALGO | 0.999975 | 4.651295 | {
"github_metadata": {
"branch": "master",
"commit_count": 131,
"repo_created_at": "2018-02-04T16:28:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7172d28c... |
c1a126eb-3b85-491a-b306-cd919b61fa1c | llynv/CP-files | 2056C.cpp | /*
Code by: linvg
Created: 17.01.2025 21:46:11
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
string to_upper(string a) { for (int i = 0;i < (int)a.size();++i) if (a[i] >= 'a' && a[i] <= 'z') a[i] -= 'a' - 'A'; return a;... | ALGO | 0.999983 | 4.473982 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-05-26T04:12: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": "85173ef25b5... |
8cd3c4f8-152d-469b-9d7e-185d87026983 | hedwig100/procon-cpp | graph/strongly_connected_components.cpp | #pragma once
#include <bits/stdc++.h>
using namespace std;
struct StronglyConnectedComponents {
private:
std::vector<int> visited;
std::vector<int> memo;
void _dfs(int v) {
group[v] = -1;
for (const int &u : G[v]) {
if (group[u] > 0) _dfs(u);
}
order.push_back... | ALGO | 0.998619 | 5.240175 | {
"github_metadata": {
"branch": "main",
"commit_count": 213,
"repo_created_at": "2020-11-26T06:36:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 13,
"pull_requests": 1
},
"file_meta": {
"content_id": "ef5578d4b... |
4d520d5e-0c7a-4a24-9f04-789d305948ec | DigvijayChavan6/CodeSignal | sortByHeight.cpp | // Some people are standing in a row in a park. There are trees between them which cannot be moved. Your task is to rearrange the people by their heights in a non-descending order without moving the trees. People can be very tall!
// Example
// For a = [-1, 150, 190, 170, -1, -1, 160, 180], the output should be
// so... | ALGO | 0.999989 | 4.194798 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-23T17:52: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": "c8fdbe5f0dde... |
511487c7-ddf5-413e-97a8-c652a5fd7c86 | AKrisadi/DSA-solutions | sum_of_two_arrays.cpp | // Problem Link - https://www.codingninjas.com/studio/problems/sum-of-two-arrays_893186
#include <bits/stdc++.h>
vector<int> reverse (vector<int> &v) {
int i = 0,j = v.size () - 1;
while (i<j) {
swap (v[i++],v[j--]);
}
return v;
}
vector<int> findArraySum(vector<int>&a, int n, vector<int>&b, int m) {
// Write yo... | ALGO | 0.999983 | 4.778765 | {
"github_metadata": {
"branch": "main",
"commit_count": 213,
"repo_created_at": "2022-06-21T17:50: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": "440014a40c... |
fbb23aef-229a-40eb-8fab-4444b59ab89d | KSH-code/Problem-Solving | 827_6.cpp | #include <bits/stdc++.h>
#pragma GCC optimize ("O3")
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
using namespace std;
typedef long long ll;
int xxxx[]={-1,0,1,0,-1,1,1,-1};
int yyyy[]={0,1,0,-1,-1,1,-1,1};
typedef pair<int,int> pii;
void solve(){
int... | ALGO | 0.999993 | 4.196266 | {
"github_metadata": {
"branch": "master",
"commit_count": 117,
"repo_created_at": "2020-07-13T16:12: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": "0d4ddcda... |
f41e867c-45ea-4cec-94aa-d3f19dda2693 | adkrz/AVM | Runtime/Runtime.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include "VM.hpp"
#include <chrono>
#include <filesystem>
#include "string_ops.hpp"
#include "Compiler.hpp"
int main(int argc, char** argv)
{
if (argc <= 1)
{
std::cout << "Arguments: program_file.(asm|avm) -c [-r]\n"
<< "Option -c co... | TOOL | 0.912947 | 5.512516 | {
"github_metadata": {
"branch": "master",
"commit_count": 356,
"repo_created_at": "2023-10-08T19:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0467292e... |
035b8592-f6fb-4c65-8306-d8a0fec44f4d | vawait/ACM | HDU/HDU4370 0 or 1.cpp | /*
* Author: vawait
* Created Time: 2015/8/5 15:12:41
* Problem: HDU4370 0 or 1
*/
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<stack>
#include<ctime>
using namespa... | ALGO | 0.999912 | 3.21371 | {
"github_metadata": {
"branch": "master",
"commit_count": 134,
"repo_created_at": "2014-10-22T05:02:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbd9d7b7... |
d4c5e8b1-bea9-4742-a9fb-33d508060c38 | B-Lang-org/bsc | src/vendor/stp/src/sat/mtl/BasicHeap.h | /******************************************************************************************[Heap.h]
MiniSat -- Copyright (c) 2003-2006, <NAME>, <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Softwa... | ALGO | 0.998666 | 6.069989 | {
"github_metadata": {
"branch": "main",
"commit_count": 887,
"repo_created_at": "2020-01-31T22:01:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1030,
"forks": 156,
"issues": 195,
"pull_requests": 21
},
"file_meta": {
"content_id": "753... |
390ef80a-2e19-46f8-9d8f-021b99c0d59f | rezamokaram/solutions-to-uva-online-judge-problems | 00429/00429.cpp | /* cSpell: disable */
#include <bits/stdc++.h>
using namespace std;
//
int tc;
map<string, int> indices;
vector<string> mp[11];
vector<int> itj[201];
//
int diffStr(string a, string b) {
if(a.size() != b.size()) return 10;
int t=0;
for (size_t i = 0; i < a.size(); i++)
if(a[i] != b[i]) t++;
... | ALGO | 0.999794 | 3.648347 | {
"github_metadata": {
"branch": "master",
"commit_count": 552,
"repo_created_at": "2020-03-18T05:52:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51b6f039... |
741909cf-d017-4e62-91a0-54c3f7de97a2 | skoom21/assignment-2 | Question#3_myVersion.cpp | // ------------------------
// C++ Version (My Custom Version - AC3 + Backtracking)
// ------------------------
#include <iostream>
#include <fstream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <chrono>
using namespace std;
using namespace std::chrono;
const stri... | ALGO | 0.999872 | 6.568935 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-04-11T17:28:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7ca81217fef... |
04819976-a17a-4961-b9e2-8b0179e92720 | Vanshita2608/Data-Structures-Codes- | Stack_2_college.cpp | #include<iostream>
using namespace std;
void push(int TOP, int MAX)
{
int item, i, S[MAX];
cout<<"Enter element to push onto the Stack :--> ";
cin>>item;
if(TOP==MAX)
{
cout<<"OVERFLOW!!!"<<endl;
}
else
{
... | ALGO | 0.994155 | 3.401123 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-10-03T15:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53face29b73c... |
8b8089c7-a06f-480a-96f7-d2e067c5d62e | jizai945/leetcode | example/219_easy_存在重复元素II.cpp | // 219. 存在重复元素 II
// 给你一个整数数组 nums 和一个整数 k ,判断数组中是否存在两个 不同的索引 i 和 j ,满足 nums[i] == nums[j] 且 abs(i - j) <= k 。如果存在,返回 true ;否则,返回 false 。
// 示例 1:
// 输入:nums = [1,2,3,1], k = 3
// 输出:true
// 示例 2:
// 输入:nums = [1,0,1,1], k = 1
// 输出:true
// 示例 3:
// 输入:nums = [1,2,3,1,2,3], k = 2
// 输出:false
// 提示:
// 1 <... | ALGO | 0.999765 | 6.201349 | {
"github_metadata": {
"branch": "main",
"commit_count": 421,
"repo_created_at": "2021-02-19T02:13:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0348613468... |
3be0481f-d896-4633-a0b2-ac390ff8943f | gilsonpcf/algoritmos | exercicios/ascencio/cap09/cpp/EX6.CPP | #include <string.h>
#include <stdio.h>
int main()
{ char frase1[250], frase2[250], nova_frase[250], letra;
int tam1, tam2, i, j, cont;
printf("\nDigite a primeira frase ");
gets(frase1);
printf("\nDigite a segunda frase ");
gets(frase2);
tam1 = strlen(frase1);
tam2 = strlen(frase2);
i = 0;
j = 0;
co... | ALGO | 0.99964 | 3.092653 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2019-03-28T20:58:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 7,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c5eec7... |
9814d522-0f0a-443d-902c-9edc49ae3988 | akshaypandey28/C-PLUS-PLUS | .vscode19-GRAPHS/16_matrix.cpp | #include<bits/stdc++.h>
using namespace std;
/* https://leetcode.com/problems/01-matrix/description/ */
/* https://leetcode.com/problems/map-of-highest-peak/description/?envType=daily-question&envId=2025-01-22 */
//same as matrix 01
class Solution {
public:
//apply multisource bfs from 0's
vector<vector<int>> upda... | ALGO | 0.999909 | 5.866554 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2023-01-29T05:47: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": "6106fa59a4a... |
78189f8f-74f2-4525-a54e-074109bc7d7a | ucb-bar/virgo-kernels | kernels/unaligned/kernel.minimal.cpp | #include <stdint.h>
#include <vx_intrinsics.h>
#include <vx_print.h>
#include <vx_spawn.h>
#include "common.h"
#define HW_TID() ({uint32_t gtid; asm volatile ("csrr %0, mhartid" : "=r" (gtid)); gtid;})
inline void threadblock_barrier(unsigned int barrier_id, unsigned int count) __attribute__((convergent)) {
vx_fe... | TOOL | 0.921149 | 3.809425 | {
"github_metadata": {
"branch": "ae",
"commit_count": 2680,
"repo_created_at": "2025-01-30T04:10:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79b39558c19d... |
7f658337-a7f6-442f-90ae-6b4ce02c4eb1 | owlpaw20/CPArchive | 洛谷题库/[洛谷 P4779]【模板】单源最短路径.cpp | #include <queue>
#include <cstdio>
#include <vector>
#include <climits>
#include <cstring>
using namespace std;
typedef pair<int, int> PII;
const int N = 1e5 + 10;
const int M = 2e5 + 10;
int n, m, s, u, v, w, idx;
int ed[M], nx[M], wt[M], head[N], dist[N];
bool vis[N];
inline void add_edge(int u, int v, int w) {
... | ALGO | 0.999985 | 3.841236 | {
"github_metadata": {
"branch": "main",
"commit_count": 162,
"repo_created_at": "2023-12-17T02:02: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": "307d0493d9... |
9fe1b8fb-1eea-441f-ae53-31a58102fae3 | victorgbd/cGraph | Grafo/grafo.cpp | #include "grafo.h"
void grafo::inicializa()
{
h = NULL;
}
bool grafo::vacio() {
return (h == NULL);
}
int grafo::tamano()
{
int cont = 0;
vertice *aux;
aux = h;
while (aux != NULL) {
aux = aux->sig;
cont++;
}
return cont;
}
vertice *grafo::get_vertice(string dato) {
vertice *aux;
aux = h;
while (aux ... | ALGO | 0.982276 | 3.945092 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-01-23T00:13:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba9999a9db... |
62fcccb3-a97c-4e63-b733-c4b2f2c27977 | NeelDigonto/dsa | src/leetcode/biweekly/BW109/BW109_Q1.cpp | #include <core/Common.hpp>
#include <iostream>
using namespace std;
class Solution {
public:
bool isGood(vector<int> &&nums) {
const auto maxe_it = distance(begin(nums), max_element(begin(nums), end(nums)));
const auto maxe = nums[maxe_it];
if (nums.size() != maxe + 1)
return false;
nums[0] *... | TEST | 0.99873 | 5.792819 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2022-12-24T11:34: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": "a4ccca3a840... |
8487a729-9a0d-4bbe-af24-4106236408c4 | lexiaoyuan/PAT-Practice | basic/c和c++版/Question7_18.cpp | /**
*
* @author 徐仕成
* 7-18 二分法求多项式单根
* 二分法求函数根的原理为:如果连续函数f(x)在区间[a,b]的两个端点取值异号,即f(a)f(b)<0,则它在这个区间内至少存在1个根r,即f(r)=0。
* 二分法的步骤为:
* 检查区间长度,如果小于给定阈值,则停止,输出区间中点(a+b)/2;否则
* 如果f(a)f(b)<0,则计算中点的值f((a+b)/2);
* 如果f((a+b)/2)正好为0,则(a+b)/2就是要求的根;否则
* 如果f((a+b)/2)与f(a)同号,则说明根在区间[(a+b)/2,b],令a=(a+b)/2,重复循环;
* 如果f((a+b)/2)... | ALGO | 0.999926 | 4.1188 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2020-04-22T15:35: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": "79be2d3c4... |
ac3649fd-8f69-4fd7-9961-3db14a71b153 | Tora416/MultiCodeEmbed | dataset/dataset_raw/gcj_cpp/petwill/8294486_5654117850546176_petwill.cpp | #include <bits/stdc++.h>
using namespace std;
// const int inf = 0x7fffffff; //beware overflow
// const LL INF = 0x7fffffffffffffff; //beware overflow
template <typename A, typename B>
ostream &operator<<(ostream &s, const pair<A, B> &p) {
return s << "(" << p.first << "," << p.second << ")";
}
template <typename T>... | ALGO | 0.999319 | 3.125761 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2025-07-10T08:38: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": "8a1fb6a50... |
c789a5de-af36-4cd6-9993-12844941c700 | anish8808/Data-Structures-Concepts-with-LeetCode-Examples | 17-Generic-Binary_Tree/1-lec1.cpp | #include <bits/stdc++.h>
using namespace std;
/*Trees are non-linear data strcture, can be move any direction
Now will see the tree topology
Starting Node is called rootNode
another nodes will call as a child node
also we have some level in the tree
same level nodes called siblings nodes
the node that have no child c... | ALGO | 0.999854 | 4.473952 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2024-09-27T15:48:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "11873bc079... |
5484125d-0e55-44c9-acdf-433128fbb03d | saurav6719/my-codes | c++ dsa /graphs/printing_graph_bfs.cpp | #include<iostream>
#include<list>
#include<unordered_set>
#include<vector>
#include<queue>
using namespace std;
vector<vector<int> > graph;
queue<int> q;
int v; // number of vertices
unordered_set<int> visited;
void add_edge(int src, int dest, bool undirected = true) {
graph[src].push_back(dest);
if (undirec... | ALGO | 0.999985 | 4.919458 | {
"github_metadata": {
"branch": "main",
"commit_count": 1170,
"repo_created_at": "2023-12-25T16:15: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": "f3ee4dd54... |
3d20fa81-aa47-4767-a38d-24bd4a6f6f3d | Kitware/VTK | Filters/FlowPaths/vtkVortexCore.h | // SPDX-FileCopyrightText: Copyright (c) <NAME>, <NAME>, <NAME>
// SPDX-License-Identifier: BSD-3-Clause
/**
* @class vtkVortexCore
* @brief Compute vortex core lines using the parallel vectors method
*
* vtkVortexCore computes vortex core lines using the parallel vectors method,
* as described in
*
* <NAME>... | ALGO | 0.996007 | 5.935794 | {
"github_metadata": {
"branch": "master",
"commit_count": 94968,
"repo_created_at": "2010-04-27T15:12:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2910,
"forks": 1246,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1... |
09d19a04-dd04-4400-b7ff-2e73efb5e0e3 | gudfhr95/Algorithm-Cpp | BOJ/10564.cpp | #include <cstring>
#include <iostream>
using namespace std;
int N, M;
int a[10];
bool d[5001][5001];
void go(int i, int j) {
if (i > N) {
return;
}
if (d[i][j]) return;
d[i][j] = true;
for (int k = 0; k < M; k++) {
go(i + j + a[k], j + a[k]);
}
}
int main() {
int T;
cin >> T;
while (T... | ALGO | 0.999992 | 4.036395 | {
"github_metadata": {
"branch": "main",
"commit_count": 825,
"repo_created_at": "2021-07-29T11:33:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c2f1071f4... |
06a035eb-651b-4f3d-95d6-333ce92907a1 | Hardikmaind/DSA-CPP | Leetcode/Leecode Contests/01062025/_Q1_PartitionArrayIntoTwoEqualProductSubsets_array_bitmanipulation_math_MEDIUM.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
bool checkEqualPartitions(vector<int>& arr, long long target) {
long long int allprod=1;
int n=arr.size();
int bitmask=1<<n;
for(int mask=1;mask<bitmask-1;mask++){
long long prod1=1;
long ... | ALGO | 0.999967 | 5.962119 | {
"github_metadata": {
"branch": "main",
"commit_count": 296,
"repo_created_at": "2024-04-01T16:59: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": "3e7018035b... |
71698883-0067-4935-9bf1-40b9347f5ade | Negationist/Negationst-Codeforces | Codeforces Practice/C. Lazy Narek cf/main.cpp | #include <bits/stdc++.h>
#define int long long
#define pb push_back
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pair<int,int>>
using namespace std;
void solve(){
int n,m;
cin >> n >> m;
vector<string> s(n);
string narek = "narek";
set<char... | ALGO | 0.999913 | 4.399348 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2025-02-18T19: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": "1be23f4b524... |
dfc466a8-3082-48a0-ab80-04b69585eef6 | Shahraaz/CP_S4 | codeforces/DIV2_567/a.cpp | //Optimise
#include <bits/stdc++.h>
using namespace std;
// #define multitest 1
#define Debug 1
#ifdef Debug
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__);
template <typename Arg1>
void ZZ(const char *name, Arg1 &&arg1)
{
std::cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void ZZ... | ALGO | 0.99986 | 3.892883 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2019-05-19T15:08: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": "df29e39c0... |
1d49d5b7-2909-46db-a4e8-110afb28bd7a | georgiosdoumas/ProgrammingCplusplus- | CplusplusPrimer_5thEd_2012/chapter10/Exercise10.42.cpp | /* Exercise 10.42: Reimplement the program that eliminated duplicate words that we
wrote in § 10.2.3 (p. 383 Exercise10.09) to use a list instead of a vector. */
#include <iostream>
#include <list>
#include <string>
#include <algorithm>
using namespace std;
void elimDups(list<string> &wordlist)
{
wordlist.sort();
... | ALGO | 0.999644 | 5.710188 | {
"github_metadata": {
"branch": "master",
"commit_count": 779,
"repo_created_at": "2016-05-20T14:31:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1d625ba... |
531e4b36-aaad-4255-ab1f-fa51261e82a8 | squaresLab/BatFix | results/transcoder/translations/py/SORTING_ARRAY_REVERSE_AROUND_MIDDLE.cpp | bool ifPossible ( int arr [ ] , int n ) {
int cp [ n ] = {
0 }
;
cp = arr ;
sort ( cp , cp + n ) ;
for ( int i = 0 ;
i <= n ;
i ++ ) {
if ( ( ! ( arr [ i ] == cp [ i ] ) && ! ( arr [ n - 1 - i ] == cp [ i ] ) ) || ( ! ( arr [ n - 1 - i ] == cp [ i ] ) && ! ( arr [ n - 1 - i ] == cp [... | ALGO | 0.9999 | 4.017052 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-05-21T15:21:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5dc8295ed50... |
c2509b84-b74d-45dc-91de-e9556e21fa8d | xry224/AlgorithmReview | 整除查询.cpp | /*
整除查询
描述
Given an array of positive integers and many queries for divisibility. In every query Q[i], we are given an integer K , we need to count all elements in the array which are perfectly divisible by K.
Constraints:1<=T<=1001<=N,M<=1051<=A[i],Q[i]<=105
输入
The first line of input contains an integer T denoti... | ALGO | 0.999857 | 4.396946 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-11-30T11:48: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": "b58746e27... |
f66dfab8-2458-4efb-9460-47ec0c31a80e | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/12/62/2.cc | // another fine solution by misof
// #includes {{{
#include <algorithm>
#include <numeric>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cass... | ALGO | 0.999653 | 3.980519 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-09-30T05:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 8,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2bb73202... |
fe39dee0-5d19-464a-b2f3-6fc789d1f8d3 | AdityaBahl/DAA | week4/1.cpp | #include <iostream>
using namespace std;
inline void display(int arr[], int n)
{
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
}
void merge(int a[], int l, int m, int r)
{
int i = l, j = m + 1, k = 0;
int b[r - l + 1];
while (i <= m and j <= r)
{
if (a[i] <= a[j])
{
... | ALGO | 0.999982 | 5.339016 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2022-04-01T05:57: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": "33170153ad5... |
04b3c79f-c31a-4fbe-9ebd-d5aa814487f6 | Kapurin/CPP_code | CP_Game_Boxing/CP_main.cpp | /* Курсовая работа: "Игра "Бокс""
*/
#include <iostream>
#include <fstream>
#include <windows.h>
#include <conio.h>
#include "Boxer.h"
using namespace std;
int main()
{
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
std::srand(time(NULL)); // для генерации случайных чисел при каждом запуске
int Choice = 0; ... | TOOL | 0.926572 | 3.711278 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-02-26T22:50: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": "5c2f1ea8da... |
025a2389-88ca-4f13-9b22-3a384f851d23 | mdmemonyasin/Problems | algorithm/sorting/maximize_the_index_diffrence.cpp | #include<bits/stdc++.h>
using namespace std;
// int main(){
// int n, x;
// cin>>n;
// vector<int> vec;
// for(int i=0;i<n;i++){
// cin>>x;
// vec.push_back(x);
// }
// int ans = INT_MIN;
// for(int i=0;i<vec.size();i++){
// for(int j=0;j<vec.size();j++){
// ... | ALGO | 0.999961 | 4.158108 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2021-02-05T13:15:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39dc1922b7f... |
93b51311-2758-4d25-b3d5-1d80df842afe | singhsanket143/CppCompetitiveRepository | 10x_engg_bootcamp/Graph_series/graph_quick_impl.cpp | // Problem Link -
/* By <NAME> */
#include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ld long double
#define mod 1000000007
#... | ALGO | 0.99995 | 5.282088 | {
"github_metadata": {
"branch": "master",
"commit_count": 304,
"repo_created_at": "2018-06-26T07:06:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 348,
"forks": 160,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "5e4a... |
4bab29c0-ec61-4a2a-87e1-5d8928164107 | tonningp/cis201-class-examples | bcpp3-sourcecode/ch09/worked_example_1/account.cpp | #include <iostream>
#include <iomanip>
using namespace std;
/**
A bank account whose balance can be changed by deposits and withdrawals.
*/
class BankAccount
{
public:
/**
Constructs a bank account with zero balance.
*/
BankAccount();
/**
Constructs a bank account with a given balance.
... | TOOL | 0.988688 | 5.827893 | {
"github_metadata": {
"branch": "master",
"commit_count": 140,
"repo_created_at": "2018-09-17T01:33:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9676eb... |
ab04d4f8-a051-4487-980f-10e9e8145f30 | joel2995/Striver-A-Z-DSA-Sheet-Cpp | 04. Binary Search/Answers/ship_packages.cpp | // Input:
// weights = [1,2,3,4,5,6,7,8,9,10]
// days = 5
// Output:
// 15
// Explanation:
// A ship capacity of 15 is the minimum to ship all the packages in 5 days like this:
// 1st day: 1, 2, 3, 4, 5
// 2nd day: 6, 7
// 3rd day: 8
// 4th day: 9
// 5th day: 10
// Note: The cargo must be shipped in the order given.... | ALGO | 0.999991 | 5.306168 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-11T06:24:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "adcc526247cc... |
0b7e9bff-e4fa-42d3-ac75-c69c8382fe1d | AllanVasc/Competitive-Programming | Contests/2018, XI Samara Regional Intercollegiate Programming Contest/K - Video Reviews.cpp | #include<bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
vector<int> v;
bool check(int qtd, int m){
int count = 0;
for(int i = 0; i < v.size(); i++){
if(v[i] <= count) count++;
else if(qtd){
count++;
qtd--;
}
}
if(count >= m... | ALGO | 0.999988 | 4.070638 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2021-05-12T20:29: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": "8d2dd93ef6... |
5b6d79e6-f564-4ea8-b21f-a3e3ef02cafe | rozanlaudzai/competitive-programming | AtCoder/ABC 352/D-PermutationSubsequence.cpp | #include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
using namespace std;
/*
available: [1, n - k + 1]
implementation: segtree
*/
const int mxn = 2e5 + 10, mod = 1e9 + 7, inf = 2e18;
int n, k, a[mxn], id[mxn], t[800005], tmn[800005];
void bui(int v, int tl, int tr) {
if (tl == tr) {... | ALGO | 0.999968 | 4.401303 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2024-02-04T08:14:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5d4ba8485... |
3b2e3e39-dc57-477b-893d-83bfff1a694c | Pupppy44/geo | Engine/util/helpers.h | #pragma once
#include <string>
#include <algorithm>
#include <fstream>
#pragma comment(lib, "urlmon.lib")
namespace D2D1 {
class ColorF;
}
namespace geo {
namespace util {
// Generate a random string with a given length
std::string generate_id(int);
// Convert a hex color to a D2D1 ColorF
D2D1::ColorF he... | TOOL | 0.91078 | 5.933806 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2023-12-29T14:36:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f94693629... |
8987b113-5965-4ba5-8e26-e171efd952f9 | danos011/Introduction_to_functors | functions.cpp | #include "functions.h"
std::basic_ifstream<char> openFile(const std::string& fileName) {
std::ifstream fileIn(fileName, std::ifstream::in);
if (!fileIn.is_open()) {
throw ErrorFileNotOpen();
}
return fileIn;
}
void inputFromFile(const char* file,std::vector<Polygon> &data) {
std::basic_if... | TOOL | 0.976697 | 4.830199 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-10-10T21:09: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": "2c47c59085... |
ea3a616d-c4fc-426e-ad40-bc0bd7bafa12 | Futsy/Euler | Problem - 051 to 100/Problem - 081.cpp | #include <cmath>
#include <cstdint>
#include <iostream>
//static std::uint_fast32_t numbers[80][80];
int main(){
int solution = 0;
const int size = 80;
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++) {
if (i >= 1 && j >= 1) {
numbers[i][j] = number... | ALGO | 0.999938 | 3.70575 | {
"github_metadata": {
"branch": "master",
"commit_count": 128,
"repo_created_at": "2013-12-28T01:23: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": "f0ed5ba0... |
99e025e2-9b30-4455-8606-16683f80e160 | pratiksaha/practice | algorithms/quickSort.cpp | //Quick Sort
#include<iostream>
#include<cstdlib>
#include<algorithm>
using namespace std;
int partition(int arr[], int l, int r) { //Lomuto partition
int x = arr[r]; //pivot
int i = l-1;
for (int j=l; j<=r-1; j++) {
if (arr[j] < x) {
i++;
swap(arr[i], arr[j]);
}
... | ALGO | 0.999981 | 4.710047 | {
"github_metadata": {
"branch": "master",
"commit_count": 371,
"repo_created_at": "2014-10-03T04:22: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": "c7db1632... |
17355568-b78a-4312-8f40-827fd6834f97 | kbodurri/IntroductiontoObjectOrientedProgramming | homework4/AVL.cpp | /*
* AVL trees functionality (insert, delete, search)
*
* Contributors: <NAME> && <NAME>.
*/
#include "AVL.hpp"
/* Constructor */
AVL::Node::Node(const string& e, AVL::Node *parent, AVL::Node *left, AVL::Node *right) {
this->element = e;
this->parent = parent;
this->left = left;
this->right = right;... | ALGO | 0.994909 | 5.073265 | {
"github_metadata": {
"branch": "master",
"commit_count": 72,
"repo_created_at": "2019-02-20T20:40: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": "848c6f0eb... |
b385600b-2fdf-4354-a69d-b1dc07f296a1 | GorillaSX/DataStructureAndAlgorithm | hash_table/138_CopyListWithRandomPointer.cpp | /*
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
*/
/**
* Definition for singly-linked list with a random pointer.
* struct RandomListNode {
* int label;
* RandomListNode *next, *random;
... | ALGO | 0.972099 | 5.063212 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-01-30T17:34: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": "7143a7bdc... |
c72a44f8-6571-4568-8b67-d04146c7ac08 | HarshCasper/Data-Structures-Algorithms | Problem Solving-Hackerrank/Kitty's Calculations on a Tree.cpp | // https://www.hackerrank.com/challenges/kittys-calculations-on-a-tree/problem
#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <utility>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> pii;
const int MAX_N = 2e5 + 6;
const int MAX_P = 19;
const LL mod = 1e9 + 7;
vec... | ALGO | 0.99993 | 4.028605 | {
"github_metadata": {
"branch": "master",
"commit_count": 346,
"repo_created_at": "2019-12-01T04:12:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 9,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4adcd127... |
f6df2b5a-e074-4d0f-9082-7820238d1efa | mmartinspf/COLBMOG | Colinear_9D.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2019, <NAME> (<EMAIL>)
// All rights reserved.
// Created by <NAME> on 10/01/18.
//
/////////////////////////////////////////////////////////////////////////////////
// IMPORTANT: READ BEFORE DOWNLOADI... | ALGO | 0.996098 | 4.954558 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-12-19T12:20:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc8028e256... |
a372ba78-170d-437d-86e5-bda3032067a3 | mehendisil2004/Lab_Work | OOP/q18.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
class Point {
public:
double x, y;
Point(double x = 0, double y = 0) : x(x), y(y) {}
double distance(const Point& other) const {
return sqrt(pow(x - other.x, 2) + pow(y - other.y, 2));... | ALGO | 0.999457 | 5.43308 | {
"github_metadata": {
"branch": "main",
"commit_count": 86,
"repo_created_at": "2024-08-11T07:36: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": "91643d2ae26... |
fe338a48-5aeb-47ad-8e63-73d853505a6c | AndreHMeyer/PlayersOrdenation | main.cpp | #include <iostream>
#include <string>
#include <time.h>
#include <stdlib.h>
using namespace std;
struct Player {
string name;
int score;
};
Player* gamePlayer = new Player[1000];
string aleatoryName(int sizeName = 10) {
string name;
char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (int i = 0; i < sizeNa... | ALGO | 0.998065 | 4.60558 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-06-27T00:18: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": "3ef8dfa3a0dd... |
6a71861c-6752-497c-9e40-0e3d20981acb | Arpit-2678/Competitive-Programs | Divide the digits.cpp | // LINK=https://www.hackerearth.com/practice/algorithms/greedy/basics-of-greedy-algorithms/practice-problems/algorithm/digits-divide-6f200dd9/
#include<bits/stdc++.h>
#define ll long long int
#define test while(t--)
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define xxx exi... | ALGO | 0.999882 | 4.321578 | {
"github_metadata": {
"branch": "main",
"commit_count": 900,
"repo_created_at": "2021-03-24T14:19: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": "6bc2b7026e... |
f0831240-50f0-41a4-82ef-2c8a5d6b7748 | mariannyneris2004/exercicios-ipc-faculdade | Aula 12/aula12-exercicio02(1).cpp | #include<iostream>
using namespace std;
int main() {
int MATRIZ[5][5], soma_linha[5] = {0,0,0,0,0}, soma_coluna[5] = {0,0,0,0,0};
cout<<"Escreva uma matriz 5x5 (sem repetir valores): ";
for (int i = 0; i < 5; i++){
for (int j = 0; j < 5; j++){
cin >> MATRIZ[i][j];
}
}
... | ALGO | 0.999826 | 4.951871 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-05-27T14:07: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": "1cfc941b23da... |
7691af34-eca4-4f34-bf9e-95758fcbe66e | nico-ig/Desafios-Programacao | semana7/fractais.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
vector<bool> sieve (1e7+15, true);
void eratosthenes (ull n) {
for (ll i = 2; i * i <= n; i++) if (sieve[i])
for (ll j = i * i; j <= n; j += i)
sieve[j] = false;
}
int main() {
cin.tie(0);
ios_base::sy... | ALGO | 0.999979 | 4.263496 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-05-07T17:54: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": "608ffae6e9a... |
779c985e-76ae-4e2f-bc68-d65f35d09898 | EulerDanseur/MyWorks | Basics of Programming/week 11/ChoseSpecialization.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
int stuAmt, coAmt;
cin >> stuAmt >> coAmt;
int permitAmt[coAmt];
for(int i = 0; i < coAmt; i++)
cin >> permitAmt[i];
int name[stuAmt][10];
int will[stuAmt][coAmt];
int admit[stuAmt] = {0};
int nonAdmit = ... | ALGO | 0.998778 | 3.034895 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2023-09-23T17:29:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b983fe0167d... |
52e76d93-ea98-4f62-be8b-82406fa46579 | TheKushagraPerspective/DSA-full-course-with-cpp | BasicsOfCpp/functions/func1.cpp | #include<bits/stdc++.h>
using namespace std;
// functions are used to increase readability
// functions are set of codes which perform something for u
// functions are used to modularise the code
// functions are used to use the same code again and again(multiple times)
// Types of functions -
// 1. void -> it will n... | TOOL | 0.99362 | 3.462817 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-04-29T18:27:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e0c4b7f50f... |
ec4ee407-91fe-47ff-8907-c4a7aa305e9b | Ximoncute/DSA-PTIT | SẮP XẾP TÌM KIẾM/DSA6033.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int n;
cin >> n;
vector<int> A(n);
for (int i = 0; i < n; i++) cin >> A[i];
vector<int> LMin(n), RMax(n);
LMin[0] = A[0];
for ... | ALGO | 0.999879 | 5.258399 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2025-07-06T18:08: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": "6c4b4129f... |
5b4b67fd-6a49-4845-88b5-58e9bc54d14a | manwar/perlweeklychallenge-club | challenge-263/ash/cpp/ch-1.cpp | // Solution of Task 1 of The Weekly Challenge 263
// https://theweeklychallenge.org/blog/perl-weekly-challenge-263/
/*
$ c++ -std=c++20 ch-1.cpp
$ ./a.out
(1, 2)
()
(4)
*/
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
int main() {
vector<vect... | ALGO | 0.999659 | 5.943615 | {
"github_metadata": {
"branch": "master",
"commit_count": 44412,
"repo_created_at": "2019-03-30T01:15:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 194,
"forks": 332,
"issues": 5,
"pull_requests": 4
},
"file_meta": {
"content_id": "05... |
0688cd6f-297b-4110-b53e-cb064bc9ef5a | erich666/GraphicsGems | gemsiv/vec_mat/ray/Polyhedron.cpp | #include <algorithm>
#include <vector>
#include "Polyhedron.h"
#include "algebra3.h"
/************************************************************************
* *
* Class destructor *
* *
************************************************************************/
Polyhedron::~Polyhedron()
{
int i;... | ALGO | 0.999351 | 5.316813 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2013-05-25T22:17:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1466,
"forks": 269,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a9b... |
d4291ed1-14fc-4519-880d-4332689a42a8 | MedAzizTousli/Competitive-Programming-Solutions | OnlineJudge/713_Adding_Reversed_Numbers.cpp | #include <bits/stdc++.h>
#define int long long
#define ll long long
#define FLASH ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(v) ((v).begin()), ((v).end())
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin... | ALGO | 0.999927 | 5.133104 | {
"github_metadata": {
"branch": "master",
"commit_count": 505,
"repo_created_at": "2019-04-23T21:46:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b4124d0... |
e20d16f3-8144-4697-8981-f45625a9e1bb | omidm/nimbus | applications/physbam/physbam-lib/Public_Library/PhysBAM_Solids/PhysBAM_Solids/Collisions/RIGID_DEFORMABLE_COLLISIONS.h | //#####################################################################
// Copyright 2007, <NAME>, <NAME>.
// This file is part of PhysBAM whose distribution is governed by the license contained in the accompanying file PHYSBAM_COPYRIGHT.txt.
//#####################################################################
// Cl... | ALGO | 0.998253 | 6.512976 | {
"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": "cc6d5... |
c3456255-9db5-42a4-b323-dc7380c7113d | mingsjtu/OJ_exercise | poj刷题/串/1016loop.cpp | //http://poj.org/problem?id=1016
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<stack>
using namespace std;
int lei;//
//0-n is self-inventorying
//1-n is self - inventorying after j steps
//2-n enters an inventory loop of length k
//3-n can not be classified after ... | ALGO | 0.999548 | 3.263911 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-10-17T15:05: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": "b394354599... |
bfa9bdb1-1c46-4793-a1d2-15b2d10896ce | xdsopl/qsstv | qsstv/drmtx/common/OFDM.h | /******************************************************************************\
* Technische Universitaet Darmstadt, Institut fuer Nachrichtentechnik
* Copyright (c) 2001
*
* Author(s):
* <NAME>
*
* Description:
* See OFDM.cpp
*
******************************************************************************
... | ALGO | 0.967469 | 6.10258 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-02-18T07:23:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d019c1d0... |
c950bb9f-0087-4224-b25a-9f69e6bb2486 | sramiza/CS_Summer_25 | CS100/lab4t3.cpp | # include <iostream>
# include <string>
using namespace std;
int main(){
string str1, str2;
// cout << "Enter str1: ";
// getline(cin, str1);
// cout << "Enter str2: ";
// getline(cin, str2);
str1 = "axbycz";
str2 = "abc";
bool match = true;
int k = 0;
for (int i = 0; i<str2.length(); i++){
bool found = false... | ALGO | 0.999807 | 4.182598 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2025-07-01T21: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": "3e883ce6581... |
5684fecf-c169-499d-880c-06e9513ea1b8 | Cateds/LeetCode-Practice | 225.implement-stack-using-queues.cpp | /*
* @lc app=leetcode.cn id=225 lang=cpp
* @lcpr version=30118
*
* [225] 用队列实现栈
*/
// @lcpr-template-start
using namespace std;
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <deque>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <stack>
#... | ALGO | 0.997313 | 6.077752 | {
"github_metadata": {
"branch": "main",
"commit_count": 91,
"repo_created_at": "2024-11-05T13:57: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": "c844cb4b4f3... |
9c44cdd8-de64-406f-a583-d80775b08b09 | shj0306/Baekjoon_Algo | kakao_2022/5.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> tree;
int ans = 1, N, val[20], visited[1<<17];
void dfs(int state) {
if (visited[state]) return;
visited[state] = 1;
int wolf = 0, num = 0;
for (int i = 0; i < N; i++) {
if (state & (1 << i)) {
num++;
w... | ALGO | 0.999778 | 4.52213 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2022-03-22T05: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": "3818e9d15... |
f8636dff-fb0f-417b-98cd-0d88104b3308 | JorySchossau/phi-evolutionary-rate | tGame.h | /*
* tGame.h
* HMMBrain
*
* Modified from code by <NAME> Copyright 2010
*
*/
#pragma once
#ifndef _tGame_h_included_
#define _tGame_h_included_
#include "globalConst.h"
#include "tAgent.h"
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
#define ... | ALGO | 0.995536 | 3.159056 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2014-10-07T20:18:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe48b5040... |
ba959361-99a5-4aef-8b9a-be473a680899 | mistakk/c_code | c++_mycode/company_task/l_ali.cpp | using namespace std;
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <unordered_set>
#include <fstream>
#include <numeric>
#include <functional>
int main() {
int m, n;
cin >> m >> n;
vector<int>cost(m, 0);
vect... | ALGO | 0.999986 | 3.715417 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-10-15T08:15:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5d3ab93c2... |
39c63643-574b-481a-a54c-a344a9604c60 | ash0814/Algorithm | 백준/Silver/9465. 스티커/스티커.cc | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void solution()
{
int n;
cin >> n;
int sticker[2][100001] = {0, };
for (int i = 0; i < 2; i++) {
for (int j = 0; j < n; j++) {
cin >> sticker[i][j];
}
}
int dp[2][100001] = {0, };
dp[0][0] = sticker[0][0];
dp[1][0] = stic... | ALGO | 0.999968 | 4.172598 | {
"github_metadata": {
"branch": "main",
"commit_count": 443,
"repo_created_at": "2023-06-26T14:44:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2373645946... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.