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 |
|---|---|---|---|---|---|---|---|
5c6e0617-ebe7-49b5-bd67-4f2546dd6d5b | CPcoding0930/ACMPractice-C- | Coin Flipping easy game (complex)/unsuccessful_example_1.cpp | #include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int RcountDifference(vector <vector<char> > table, int col, int var) {
int Difference = 0;
for (int j = 0; j < col; j++) {
if (table[var][j] == '1') {
Difference -= 1;
}
else {
Difference += 1;
}
}
return Difference;
}
i... | ALGO | 0.999924 | 5.065105 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2020-02-12T02:06:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4efa45ca... |
4f7b281a-2b23-4e19-b4e9-314040ff4b68 | tao-luke/LeetCodeSolution | 91-decode-ways/91-decode-ways.cpp | class Solution {
public:
int numDecodings(string s) {
//this problem can be resolved with dp!
//consider this sequence:
// # 1 1 1 0 6
// A 1 2 3 2 2
//let dp[i] be the # of decoding for up to that index
//at each index, we consider 2 things. if this idnex and the pre... | ALGO | 0.999135 | 4.910869 | {
"github_metadata": {
"branch": "main",
"commit_count": 567,
"repo_created_at": "2021-03-12T00:10: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": "18a83fa4ff... |
45278a8c-e76e-4511-ac19-30f8577aec0f | PacktPublishing/The-Modern-Cpp-Challenge | Chapter10/problem_81/main.cpp | #include <iostream>
#include <string>
#include <string_view>
#include <fstream>
#include "ZipFile.h"
#include "utils/stream_utils.h"
#ifdef USE_BOOST_FILESYSTEM
# include <boost/filesystem/path.hpp>
# include <boost/filesystem/operations.hpp>
namespace fs = boost::filesystem;
#else
# include <filesystem>
# ifdef ... | TOOL | 0.921263 | 6.593947 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2018-05-18T11:28:53.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 326,
"forks": 109,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "c63a71... |
238d5169-5128-4eee-8d4d-60699599c975 | mspeed/AoC2021 | 2/controls.cpp | #include<fstream>
#include<iostream>
#include<string>
#include<utility>
#include<tuple>
using std::ifstream;
using std::cout; using std::endl; using std::cerr;
using std::string;
using std::pair; using std::tuple; using std::get; using std::make_tuple;
using Coord_t = uint32_t;
using Position = tuple<Coord_t, Coord_... | ALGO | 0.968154 | 4.780785 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2021-12-02T23:00: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": "85da5eaf910e... |
36d3fd89-7b63-4ae2-a704-67ee779273ac | chadac/cppgp | src/cross.cpp | #include "cross.h"
#include <cstdlib>
double rand_double() {
return ((double) rand() / (RAND_MAX));
}
// GPCross
GPCross::GPCross(Fitness* f) : f(f) {}
Program* GPCross::cross(Program* pool int pool_size, int new_pool_size) {}
//GPCrossTree
GPCrossTree::GPCrossTree(Fitness* f, int max_depth, double cross_p) :
... | ALGO | 0.978079 | 4.484895 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-03-31T20:37:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "927b228019... |
9016b549-ec64-4826-b586-1ff36da3c001 | MegviiRobot/OdomLaserCalibraTool | src/icp/icp.cpp | #include <math.h>
#include <string.h>
//#include <gsl/gsl_matrix.h>
#include <gsl_eigen/gsl_eigen.h>
//#include <gpc/gpc.h>
#include <egsl/egsl_macros.h>
#include "csm/csm_all.h"
#include "icp/icp.h"
void sm_journal_open(const char* file) {
file = 0; (void) file;
/* journal_open(file);*/
}
void ld_invalid_if_ou... | ALGO | 0.994297 | 4.94725 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-03-15T09:28:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 388,
"forks": 167,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "e0516a... |
23af8cfc-a195-4181-baae-13401315b889 | DmitryNekrasov/CV-labs | transform.cpp | #include "transform.h"
#include <cassert>
#include <cmath>
#include <random>
#include <unordered_map>
#include <vector>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_linalg.h>
#include "simple.h"
#include "space.h"
namespace mycv {
namespace transform {
static TransformationT getTransformation(const desc::BlobsT& ... | ALGO | 0.999465 | 6.070509 | {
"github_metadata": {
"branch": "master",
"commit_count": 101,
"repo_created_at": "2016-02-23T03:16: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": "4fc87432... |
0498a6e1-1337-4163-9e99-8693f5e77c32 | ohmatheus/PhysicEngine2D | CollisionEngineDynamic_VS2015/CollisionEngine_VS2015/CollisionEngine/PhysicEngine.cpp | #include "PhysicEngine.h"
#include <iostream>
#include <string>
#include <algorithm>
#include "GlobalVariables.h"
#include "World.h"
#include "Renderer.h" // for debugging only
#include "Timer.h"
#include "BroadPhase.h"
#include "BroadPhaseBrut.h"
void CPhysicEngine::Reset()
{
m_pairsToCheck.clear();
m_colliding... | ALGO | 0.926593 | 4.500448 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-12-04T10:17: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": "08fc362ddf... |
ccd97946-5ea2-473f-affa-a2732f1bf37b | in-formant/in-formant | external/armadillo/include/armadillo_bits/spop_symmat_meat.hpp | // Copyright 2008-2016 <NAME> (http://conradsanderson.id.au)
// Copyright 2008-2016 National ICT Australia (NICTA)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.or... | ALGO | 0.998866 | 6.654653 | {
"github_metadata": {
"branch": "with-qt",
"commit_count": 197,
"repo_created_at": "2019-09-14T12:28:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 229,
"forks": 40,
"issues": 19,
"pull_requests": 1
},
"file_meta": {
"content_id": "f98f... |
acec1433-ecb9-4c2a-8034-fd0864363fa0 | shehroz000/pdc-project | dijkstra.cpp | // sequential dijkstra
// g++ -std=c++17 dijkstra.cpp -o dijkstra
// ./dijkstra
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <limits>
#include <chrono>
#include <algorithm>
#include <numeric>
#include <boost/g... | ALGO | 0.998717 | 6.50473 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-06T15:34: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": "3ead11db2593... |
90e454bc-a197-4b4a-a469-d3288b55a7a5 | albertomontesg/algorithms-lab | exercises/a_new_hope/a_new_hope.cpp |
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
struct center {
center (int n) {
sup = vector<uint16_t>(n, 0);
}
vector<uint16_t> sup;
map<uint16_t, map<int, int> > extsup;
map<int, int> bestmap;
};
int best_stormtroopers(vector<center>& centers, int c, int mas... | ALGO | 0.999688 | 4.235867 | {
"github_metadata": {
"branch": "master",
"commit_count": 147,
"repo_created_at": "2016-09-28T09:01: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": "6811fbec... |
bbff893a-0a18-4f61-967d-069fde0ed245 | absolution1/dunetpc | dune/DataPrep/Tool/AdcCodeMitigator_tool.cc | // AdcCodeMitigator_tool.cc
#include "AdcCodeMitigator.h"
#include <iostream>
#include <sstream>
using std::string;
using std::cout;
using std::endl;
using std::istringstream;
using Index = AdcCodeMitigator::Index;
using IndexVector = AdcCodeMitigator::IndexVector;
using Name = AdcCodeMitigator::Name;
using NameVecto... | ALGO | 0.961 | 6.610679 | {
"github_metadata": {
"branch": "feature/dbrailsf_refactor",
"commit_count": 11018,
"repo_created_at": "2021-04-22T11:55:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"c... |
e7344f2a-4c84-4049-ae49-fd573d470bfa | Devanshu171/DSA-LeetCode | Next Permutation - GFG/next-permutation.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:
void reverse(vector<int>&arr,int i,int j){
while(i<j){
swap(arr[i],arr[j]);
i++;
j--;
}
}
vector<int> ... | ALGO | 0.99998 | 5.9892 | {
"github_metadata": {
"branch": "main",
"commit_count": 3360,
"repo_created_at": "2021-10-04T14:54: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": "0a8bd54f1... |
5de3b7bb-556f-4fa4-94c1-90df87e4dd78 | Yosuamuliawan19/algorithm-bank | Vjudge/graph_part_1_20-03-2018/o2.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
int n , m , k, s;
int sx, sy;
bool stop = false;
string maze[600];
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int cnt;
void dfs(int x, int y){
for (int i=0;i<4;i++){
int a = x + dx[i], b = y + dy[i];
if (a >=0 && b >=0 && a < n && b < m... | ALGO | 0.999957 | 3.731583 | {
"github_metadata": {
"branch": "main",
"commit_count": 745,
"repo_created_at": "2021-05-27T16:21: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": "4c1ba81893... |
776d3f76-15da-4e48-8588-d258380ad285 | jamperezmondragon/Competitive-Programming | cf/1714/A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using pi = pair<int, int>;
using vii = vector<vector<int>>;
using mii = map<int, int>;
#define in(a) for (auto &e : a) cin >> e
#define sz(x) int((x).size())
#define all(a) a.begin(), a.end()
#define ptp p... | ALGO | 0.999924 | 3.920886 | {
"github_metadata": {
"branch": "main",
"commit_count": 95,
"repo_created_at": "2022-01-06T02:47: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": "ab3f968ecdb... |
7646f341-c5c2-4262-9a1e-c2bb4547ef2f | lballabio/QuantLib | ql/pricingengines/barrier/analytictwoassetbarrierengine.hpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2012 Master IMAFA - Polytech'Nice Sophia - Université de Nice Sophia Antipolis
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org... | ALGO | 0.911323 | 6.870671 | {
"github_metadata": {
"branch": "master",
"commit_count": 17543,
"repo_created_at": "2015-12-17T16:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6151,
"forks": 1964,
"issues": 51,
"pull_requests": 11
},
"file_meta": {
"content_id":... |
28512ad8-7b61-492b-8819-a9a12ed337bf | Chaitanya-Shahare/code-forces | 271A-beautiful-year.cpp | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
int getUniqueLength(string s) {
sort(s.begin(), s.end());
return string(s.begin(), unique(s.begin(), s.end())).size();
}
int main() {
string y;
cin >> y;
int n = stoi(y);
/* cout << getUniqueLength("2001"); */
for (int ... | ALGO | 0.999613 | 4.310618 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-07-09T17:52:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bfd38ec5962... |
00f86d34-7c34-4271-ac3d-352ebd9517cb | kunheekimkr/PSbank | 삼성2022동계대학생양성과정/3/user code.cpp | #include <cstring>
#include <random>
#include <iostream>
using namespace std;
#define MISS 0
#define CARRIER 1
#define BATTLESHIP 2
#define CRUISER 3
#define SUBMARINE 4
#define DESTROYER 5
extern int fire(int r, int c);
int guess[10][10];
int lim;
int success;
int shot;
void debug()
{
cout << '\n';
for (int... | ALGO | 0.995701 | 3.839404 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2022-02-04T07:06:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "765df7df0fe... |
b78be096-1c97-4ad9-8e9a-267c12ed7c55 | anzaika/guidance | libs/phylogeny/siteSpecificRate.cpp | // $Id: siteSpecificRate.cpp 11008 2012-10-16 21:54:04Z rubi $
#include "siteSpecificRate.h"
#include "numRec.h"
#include "checkcovFanctors.h"
#include "definitions.h"
/********************************************************************************************
ML - full data (1)
************************************... | ALGO | 0.997127 | 3.216015 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-08-28T12:48:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 3,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd2321e6... |
1ac0b93b-c9be-459b-a729-8508035cef1d | renanclemonini/logicasenai | vetores/estudoVetores/estudoVetores.cpp | #include <iostream>
using namespace std;
int main(){
setlocale(LC_ALL, "portuguese");
cout<<" MENU PRINCIPAL "<<endl;
cout<<" Aqui iremos verificar seguintes aspectos: "<<endl;
cout<<" - Se eles são pares ou impares"<<endl;
cout<<" - Se são maiores que 5 ou menores que 5"<<endl;
cout<<" - Exibe o... | ALGO | 0.997501 | 3.653989 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-08-08T14:26: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": "32816567b0ec... |
602fee89-10b7-47d8-841f-f9bf43fd56d6 | root-project/root | core/zip/src/RZip.cxx | /*************************************************************************
* Copyright (C) 1995-2017, <NAME> and <NAME>. *
* All rights reserved. *
* *
* For the licensing terms see $... | ALGO | 0.984133 | 6.267418 | {
"github_metadata": {
"branch": "master",
"commit_count": 93033,
"repo_created_at": "2013-06-27T10:46:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2899,
"forks": 1363,
"issues": 467,
"pull_requests": 269
},
"file_meta": {
"content_id"... |
62f38ac1-24f6-475c-8f92-9df278c80da1 | SaiVamshiK/revised-ds | 2 Pointer Technique/Sort an array with 0 1 2.cpp | Given an array with n objects colored red, white or blue,
sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
Note: Using library sort function is not allowed.
... | ALGO | 0.999943 | 4.990395 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-03-20T15:43: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": "da288518c3... |
13e15f64-cc5a-43b4-81fa-28d20f5b6223 | hvdieu/mycode | Cpp/DHEXP.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef pair<long long, int> lli;
typedef long long ll;
typedef unsigned long long ull;
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Rep(i,a,b) for(int i=a;i>=b;i--)
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, f) for(__typeof... | ALGO | 0.999972 | 3.655645 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2017-04-23T16:30: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": "124b9e9067... |
d1fb5abb-c00c-41a4-a2c7-5d09db3c7706 | rforzachamp821/ZeeTerminal-CommandLine-Program | CommandFiles/CalculationAlgorithm/CalculationAlgorithm.h | //
// CalculationAlgorithm.h - Contains the interface for the CalculationAlgorithm class.
//
#include <string>
#include <tgmath.h>
// CalculationAlgorithm - A numerical-only calculator class with support for up to a theoretical 18 trillion characters per calculation line.
//
// It supports the modern implementation o... | TOOL | 0.964956 | 4.125004 | {
"github_metadata": {
"branch": "main_ZeeTerminal",
"commit_count": 61,
"repo_created_at": "2023-07-04T19:25:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": ... |
856eca44-e714-4948-a9fe-2c9dab87c4c0 | Mayank9mare/Codeforces | div 778 2/681 div2/d2.cpp | #include<bits/stdc++.h>
#define pb push_back
#define mk make_pair
#define ll long long
#define ss second
#define ff first
#define pll pair<ll,ll>
#define vll vector<ll>
#define mll map<ll,ll>
#define mod 1000000007
#define w(x) ll x; cin>>x; while(x--)
#define ps(x,y) fixed<<setprecision(y)<<x;
#define fo(i, j, k, in) ... | ALGO | 0.999453 | 3.753273 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2021-06-14T15:01:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32eac43a1... |
35e7f534-3ed1-4fab-99bb-ba2946932938 | GuyOnWifi/CCC-Prep | laa/reputation.cpp | // VM7WC '16 #4 Gold - Restoring Reputation
#include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
typedef long long ll;
using namespace std;
int dp[1001][1001];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int D, I, R;
... | ALGO | 0.999601 | 3.718481 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2025-02-01T15:54:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "86a14b6b63c... |
06c54a10-5f1f-4a51-9f87-f1e1a747854d | MonsieurWilson/beautyofProgramming | rebuildBinaryTree.cpp | #include <iostream>
#include <vector>
using namespace std;
struct TreeNode {
TreeNode *left, *right;
int val;
TreeNode(int v): left(nullptr), right(nullptr), val(v) {}
};
TreeNode *build(vector<int>::iterator preBeg, vector<int>::iterator preEnd, vector<int>::iterator inBeg, vector<int>::iterator inEnd) ... | ALGO | 0.999998 | 5.763138 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2015-04-26T10:25: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": "9fa02dc4b... |
aae30e11-9a98-4510-9d01-423ab7fb8448 | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/08_20209_75.cpp | /*
* Google Code Jam 2008
* Qualification Round
* Problem B: Train Timetable
*
* <NAME>
* <EMAIL>
* Handle: JRR
*/
using namespace std;
#include <cstdio>
#include <iostream>
typedef pair<int,int> ipair;
ipair solve(const int T,
const int NTRIPS,
const int depart[],
const int arrive[],
cons... | ALGO | 0.997342 | 3.945554 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00: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": "98677fa9d... |
7c495ee9-d53f-4044-8565-a2cf41528fdd | linjw1008/leetcode | binary_tree_zigzag_level_order_traversal_V1.h | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vector<vector<int>> zigzagLevelOrder(TreeNode* root) {
if (root == nullptr) return vec... | ALGO | 0.999997 | 6.176087 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2019-07-28T15:10: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": "6c22a908... |
44056394-5c38-4e83-9746-7b08d203b46b | tp7/RgTools | RgTools/common.h | #ifndef __COMMON_H__
#define __COMMON_H__
#include <algorithm>
#define NOMINMAX
#include <Windows.h>
#pragma warning(disable: 4512 4244 4100)
#include "avisynth.h"
#pragma warning(default: 4512 4244 4100)
#include <smmintrin.h>
typedef unsigned char Byte;
#define RG_FORCEINLINE __forceinline
#define USE_MOVPS
enum... | TOOL | 0.955522 | 3.683017 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2013-10-15T11:27:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5296bb308... |
ba4d1be3-7b3c-40c0-9d91-67bcd68950c6 | leechan02/Algorithm_study | baekjoon/silver/21921/blog.cpp | #include <iostream>
#include <vector>
int main() {
std::ios::sync_with_stdio(0);
std::cin.tie(0);
std::cout.tie(0);
int N, X;
std::cin >> N >> X;
std::vector<int> days(N, 0);
for (int i = 0; i < N; ++i) {
std::cin >> days[i];
}
int max = 0, start = 0, tmp = 0, count = 1;
for (int i = 0; i < ... | ALGO | 0.999992 | 4.610558 | {
"github_metadata": {
"branch": "main",
"commit_count": 356,
"repo_created_at": "2023-10-13T04:58:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ed57c7e19... |
e35e228f-af5d-4197-a769-c9d0b17520e7 | sgrade/cpptest | leetcode/maximal-square.cpp | // 221. Maximal Square
// https://leetcode.com/problems/maximal-square/
#include <bits/stdc++.h>
using namespace std;
// Based on Leetcode's Approach #3 (Better Dynamic Programming)
class Solution {
public:
int maximalSquare(vector<vector<char>>& matrix) {
int rows = matrix.size(), cols = matrix[0].size... | ALGO | 0.999913 | 6.143835 | {
"github_metadata": {
"branch": "master",
"commit_count": 2401,
"repo_created_at": "2020-08-01T16:38: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": "6ccb071... |
2ff49b7e-11c6-4b53-a891-0c18f7545bcd | IljaSir/CopilotSolverForLeetCode | C++/Medium/WrongAnswer/minimum-average-difference_2.cpp | class Solution {
public:
int minimumAverageDifference(vector<int>& nums) {
int n = nums.size();
vector<int> pre(n + 1);
for (int i = 0; i < n; ++i) {
pre[i + 1] = pre[i] + nums[i];
}
int res = 0;
double minAvg = 1e9;
for (int i = 0; i < n ... | ALGO | 0.999964 | 6.405777 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-07-28T08:23: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": "0ba4d6af4264... |
97d7de1a-4db1-4bba-a08c-bbe4c6a1c11a | ZhouWeikuan/zoj | unpassed/2760.cpp | #include<iostream>
#include<cstring>
// TLE
using namespace std;
enum {
SIZ = 104,
};
int N, S, T;
int mat[SIZ][SIZ];
int rev[SIZ][SIZ];
unsigned dis[SIZ];
bool mark[SIZ];
int findMin()
{
int r = -1;
for(int i=0; i<N; i++){
if(mark[i]) continue;
if( r==-1 || dis[r] > dis[i])
r ... | ALGO | 0.999968 | 3.708681 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2009-06-01T02:13:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee126746... |
72c74f0a-6c03-442b-927c-de68e193cbd3 | Yang-33/competitive-programming | topcoder/SRM/SRM 605/AlienAndHamburgers.cpp | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <set>
#include <sstream>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cctype>
#include <climits>
#include <list>
#include <fstre... | ALGO | 0.99994 | 4.718001 | {
"github_metadata": {
"branch": "master",
"commit_count": 2978,
"repo_created_at": "2017-01-06T04:52:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 11,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7d640... |
5ff8fbdc-4ec7-4965-aaa3-dd0175655769 | chiaminchuang/Leetcode | Medium/58-Delete Operation for Two Strings/58.cpp | class Solution {
public:
int minDistance(string word1, string word2) {
int len = LongestCommonSubstringLen(word1, word2);
return (word1.size() - len) + (word2.size() - len);
}
int LongestCommonSubstringLen(string word1, string word2){
int m = word1.size();
int n = ... | ALGO | 0.999989 | 5.726885 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2017-10-18T05:36: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": "885b9cd9... |
e76f8b8c-792a-485f-9c46-671323303cb9 | BhandariSakshi/C-Plus-Plus-Programs | ArrMinNum.cpp | #include <iostream>
using namespace std;
class ArrayX
{
private:
int iSize = 0;
int *Arr = NULL;
public:
ArrayX(int iNo);
void Accept();
int Minimum();
};
ArrayX ::ArrayX(int iNo)
{
cout << "Inside constructor" << endl;
iSize = iNo;
Arr = new int[iNo];
}
void ArrayX ::Accept()
{
... | ALGO | 0.999843 | 4.704789 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2025-01-09T17:56: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": "451a59f1e... |
e2ec68a7-bd48-4e2a-9348-4ef8a33c61f3 | erleben/num4lcp | fluid2d_solver/CODE/include/cusplibrary-0.5.1/cusp/system/cuda/detail/multiply/dense.h | /*
* Copyright 2008-2014 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | TOOL | 0.990802 | 6.433434 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2015-03-19T07:10:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6f47798c... |
bcdca179-74d9-4e91-a4b4-c2324dd8c1aa | vm-iiit/Custom-bash-shell | child_handler.cpp | #include"header.h"
void child_handler(char** parr, bool pflag, bool rtflag)
{
ll lv;
int fd;
bool decide;
char pathh[30];
getcwd(pathh, 30);
for(lv=0; parr[lv] != NULL; lv++);
if(pflag || rtflag)
{
if(!pflag && rtflag)
{
//cout<<"runnin\n";
... | TOOL | 0.945511 | 3.025195 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2019-09-01T17:03: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": "d0fa3d75d... |
26f21066-db4d-4bb7-8288-600bbe62ef1d | Joaco-gavernet/competitive-programming | codeforces/binary-search/step3/B.cpp | #include <bits/stdc++.h>
using namespace std;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
// neal Debugger
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, type... | ALGO | 0.999996 | 4.687394 | {
"github_metadata": {
"branch": "master",
"commit_count": 523,
"repo_created_at": "2023-07-10T02:25:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6337c840... |
870b9f61-af8b-4fff-955f-78c37b2ab06e | Thasin-Sheikh/Codeforces-Solutions | 91B .cpp | ///*<NAME>***///
/***Stay_Home_Stay_Safe***/
///**Author <NAME>**///
#include<bits/stdc++.h>
using namespace std;
#define MAX 1e6+10
#define MOD 1000000007
#define PI acos(-1)
#define R 510
#define makefast__ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using ll=long long int ;
using dl =double;
using ld=l... | ALGO | 0.999958 | 4.072433 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-03-27T10:45:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "427e3903e... |
ddca5389-3a79-4173-8af0-896fc2bdce65 | FaisalAhmedNour/CP | Codeforces/C++/B. BerSU Ball.cpp |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a, b, cnt = 0;
vector<int> boy, girl;
cin >> a;
for(int i = 0; i < a; i++)
{
int x;
cin >> x;
boy.push_back(x);
}
sort(boy.begin(), boy.end());
cin >> b;
for(int i = 0; i < b; i++)
{
... | ALGO | 0.999976 | 3.512995 | {
"github_metadata": {
"branch": "main",
"commit_count": 135,
"repo_created_at": "2022-08-24T23:37: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": "2544d7c2e3... |
5aefe395-4a44-42d6-b107-821d75d0ae27 | MAZHARMIK/Interview_DS_Algo | Arrays/Leetcode Easy/Merge Two 2D Arrays by Summing Values.cpp | /* Scroll down to see JAVA code also */
/*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=G2XFLIjoIHA
Company Tags : will update later
Leetcode Link : https://leetcode.com/problems/merge-two-2d-arrays-by-summing-values
*/
/*************************... | ALGO | 0.999758 | 5.286914 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
7533da9f-b295-4f02-a4b0-2ff5a1bf9cec | Rayhke/BaekjoonHub_Cplusplus | 백준/Silver/11403. 경로 찾기/경로 찾기.cc | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
vector <int> v[101];
bool w[101], r[101][101];
void V(int R) {
queue <int> q; q.push(R); w[R] = 1;
while (!q.empty()) {
int X = q.front(); q.pop();
for (int n = 0; n < v[X].size(); n++) {
int Y = v[X][n]; r[R][Y] = 1;
if (!w[Y]) {... | ALGO | 0.999964 | 4.533857 | {
"github_metadata": {
"branch": "main",
"commit_count": 1851,
"repo_created_at": "2023-03-07T15:53:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb1612608... |
52e6a0db-6a69-4462-9375-ab303f21cbe7 | LeNgocQuy2901/LTNC_Homework | week4/6.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int gcd(int a, int b) {
while (b != 0) {
int temp = b;
b = a % b;
a = temp;
}
return a;
}
int lcm(int a, int b) {
return (a * b) / gcd(a, b);
}
vector<int> getFactors(int num) {
vector<int> fa... | ALGO | 0.999683 | 4.802638 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2024-04-25T08:46: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": "58f9a13bf2... |
6bfa8f3f-90aa-44ac-9cb1-bb4468dbfff1 | ShucunZhao/Leetcode | C++/12DynamicProgramming/518CoinChangeII/fullKnapsackDP.cpp | /* Fully knapsack question:
*I. dp[i][j]: The maximum value of the first i objects can full fill a knapsack
whose size is j exactly.
*II.Inference formula: If nums[i] > j: dp[i][j] = dp[i-1][j]
else dp[i][j] = max(dp[i-1][j], dp[i][j-nums[i]]+nums[i]) -- Diff with 01 knapsack he... | ALGO | 0.999993 | 5.425836 | {
"github_metadata": {
"branch": "main",
"commit_count": 1047,
"repo_created_at": "2022-09-27T05:51:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "189f1925b... |
b47391cd-05fa-419e-b3fc-406a145c2fe8 | TeslaLabs/alloy | include/core/AlloyDenseSolve.h | /*
* Copyright(C) 2015, <NAME>, Ph.D. (<EMAIL>)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, me... | ALGO | 0.995448 | 5.835296 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2017-01-26T18:08:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30b3ce2c09... |
f9a6447d-6cfd-4402-b936-406093c378ab | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/06/0611/personal_submission/cf893d_jerry66.cpp | #include <bits/stdc++.h>
#define int long long
#define x first
#define y second
using namespace std;
typedef pair<int, int> PII;
typedef long long LL;
const int N = 300100;
const int mod = 998244353;
int n;
int a[N];
void solve()
{
int d;
cin >> n >> d;
for (int i = 0; i < n; i ++ ) cin >> a[i];
... | ALGO | 0.999753 | 3.822624 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "a28a... |
3a843e75-042d-4572-8d12-5b0921088c57 | aizsfgk/leetcode-cn | editor/cn/[124]二叉树中的最大路径和.cpp | //路径 被定义为一条从树中任意节点出发,沿父节点-子节点连接,达到任意节点的序列。同一个节点在一条路径序列中 至多出现一次 。该路径 至少包含一个 节点,且不
//一定经过根节点。
//
// 路径和 是路径中各节点值的总和。
//
// 给你一个二叉树的根节点 root ,返回其 最大路径和 。
//
//
//
// 示例 1:
//
//
//输入:root = [1,2,3]
//输出:6
//解释:最优路径是 2 -> 1 -> 3 ,路径和为 2 + 1 + 3 = 6
//
// 示例 2:
//
//
//输入:root = [-10,9,20,null,null,15,7]
//输出:42
//... | ALGO | 0.999991 | 6.200008 | {
"github_metadata": {
"branch": "master",
"commit_count": 244,
"repo_created_at": "2021-12-02T07:21: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": "40b924d2... |
c1ff21f6-f4c6-4ead-9df6-adf667ae4ed6 | manato444/Game-Jam-T | Game/DriveAndAvoid/Object/RankingData.cpp | #include "RankingData.h"
#include<stdio.h>
#include<string.h>
RankingData::RankingData()
{
for (int i = 0; i < 6; i++)
{
score[i] = NULL;
rank[i] = NULL;
for (int j = 0; j < 15; j++)
{
name[i][j] = '\0';
}
}
}
RankingData::~RankingData()
{
}
//初期化処理
void RankingData::Initialize()
{
//ランキングデータの読み込み
... | TOOL | 0.94777 | 3.967918 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2024-02-12T01:33:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3ea42aa9f5... |
67b405ac-ec89-4b58-b093-a23c463cea34 | felix-rojas/verano-algos | act02/main.cpp | # include <stdio.h>
# include <iostream>
# include <vector>
unsigned int factorialRecursivo(unsigned int n){
if(n <= 1){
return 1;
}
return n * factorialRecursivo(n-1);
}
unsigned int factorialIterativo(unsigned int n){
int count = n;
for (int i = 2; i < count; i++)
{
n*=i... | ALGO | 0.999956 | 5.742178 | {
"github_metadata": {
"branch": "main",
"commit_count": 124,
"repo_created_at": "2022-06-27T13:16:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c988f2e92f... |
3700e710-fc91-4acc-9064-0276ad6874a7 | prateeksharma21/Competitive-Programming | Contest/Codeforces/Educational Codeforces Round 90/e.cpp | #ifdef Prateek
#include "Prateek.h"
#else
#include <bits/stdc++.h>
using namespace std;
#define debug(...) 42
#endif
#define F first
#define S second
#define pb push_back
#define int ll
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
using ll = long long;
const int MOD = 1e9+7, N = 1e5 + ... | ALGO | 0.999887 | 3.643988 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2019-09-30T19:06:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe18b23c0... |
9451c1c9-193c-4d4f-9ebb-5088a0b403a1 | RogelRC/Competitive-Programming | Less or Equal.cpp | #include <bits/stdc++.h>
using namespace std;
/*
1 3 3 5 7 10 20
*/
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, k, cont = 0, sol = -1;
cin >> n >> k;
vector<int> lista(n);
for(int i = 0; i < n; i ++){
cin >> lista[i];
}
sort(lista.begin(), lis... | ALGO | 0.999978 | 3.532354 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-03-13T02:58: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": "3338b6a1d9b... |
65cfc5db-26cf-4fed-83e6-4a2938acb5d3 | JRgit03/Algorithm | codeforce/ProblemSetPractice/B. Spreadsheets.cpp | #include <bits/stdc++.h>
using namespace std;
string s;
bool is_number(char ch) {
return ch >= '0' && ch <= '9';
}
bool is_RXCY(string s){
bool flag=false; // 表示以'R'开头,C之间是否存在数字
if(s[0]!='R') return false;
if(!is_number(s[1])) return false;
for(int i=1;i<s.size();i++){
if(is_number(s[i])... | ALGO | 0.999473 | 3.996894 | {
"github_metadata": {
"branch": "master",
"commit_count": 229,
"repo_created_at": "2023-08-28T13:50:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0ab5fa1... |
eba22986-bd7f-4e43-b85d-a55f35b6248d | khanhvu207/competitiveprogramming | old_files/Olympiad/CST 2019/Thầy Hưng/13-10-2018/assignment/11824.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int n, t;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(0);
freopen("11824.INP", "r", stdin);
freopen("11824.OUT", "w", stdout);
cin >> t;
while (t--)
{
vector<int> L;
while (ci... | ALGO | 0.999613 | 3.78048 | {
"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": "f1493a6... |
0b5ad26c-941e-47a1-b0a9-16853be30a2a | Chauhanrudra18/VECTOR-AND-ITS-OPERATIONS | CODE(VECTOR&OPERTAIONS)..cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void push(vector<int> &v)
{
int size, element;
cout << "Enter the size of the vector" << endl;
cin >> size;
cout << "Enter the elements of the vector" << endl;
for (int i = 0; i < size; i++)
{
cin >> elemen... | TOOL | 0.992103 | 4.061344 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-15T16:35: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": "f3302884810b... |
838ed1fe-cf70-42a3-9a2a-d7867d722f70 | ishandutta2007/codeforces-a | al13n/normal/223/B.cpp | #pragma comment(linker,"/STACK:256000000")
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cstdlib>
#include <cstring>
#include <memory.h>
using namespace std;
#define sz(v) ((int)(v).size())
#define forn(i,n) for(i... | ALGO | 0.999996 | 3.306975 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "badd67a22464... |
664c88a9-b90f-46dd-a2f9-23e49bf21c17 | TienTim/Online-Judge | OnlineJudge/144 - Student Grants.cpp | ////
//// 144 - Student Grants.cpp
//// OnlineJudge
////
//// Created by <NAME> on 2022/1/20.
////
//
//#include <iostream>
//#include <iomanip>
//using namespace std;
//
//int main() {
// int n, k;
// while (cin >> n >> k && n && k) {
// int grant[n];
// for (int i=0; i<n; i++) {
// g... | ALGO | 0.999795 | 3.329717 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-01-22T02:42: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": "ec3bc15e029... |
232bde70-d348-4637-b7c4-9ca6602aa671 | swapnil0207/DSA1 | DSA Assignment 10-deque(linked_list).cpp | //============================================================================
// Name : deque.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <io... | ALGO | 0.949332 | 5.688723 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-10-11T06:06: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": "1831be83bf... |
9416ac5d-25a8-4724-b08d-647fd4adfbe1 | NovaPigeon/Programming_Practice | 往年题/程设期中考试15-17填空题答案/2017期中考试填空题答案/gw11.cpp | /* 要做数据
题名:前K大的偶数
输入n个整数,输出整数数列中大小排名前k的偶数
输入
有多组数据
第一行是数据组数 t
对每组数据:
第一行为整数n (n>=3)和k
接下来的一行为n个整数,保证这些整数中至少有k个偶数。
输出
对每组数据,输出k个整数,降序排列,表示选出来的大小排名前k的偶数
样例输入
2
9 4
1 2 4 3 6 6 7 8 9
3 2
18 16 14
样例输出
8 6 6 4
18 16
*/
#include <algorithm>
#include <iostream>
#include <stack>
#include <queue>
#include <vector>
#inc... | ALGO | 0.999335 | 4.094498 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-10-02T18:18:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "377ff40e7935... |
3af20c29-7ebb-43cb-9a10-7ef31db067f7 | PermAdut/task-manager- | src/system.cpp | #include <unistd.h>
#include <cstddef>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
#include "include/linux_parser.h"
#include "include/process.h"
#include "include/processor.h"
#include "include/system.h"
using std::set;
using std::size_t;
using std::string;
using std::vector;
/**
* Retur... | TOOL | 0.976926 | 5.202977 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-10-21T15:53: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": "3af0bd7f77c9... |
32a982dc-a35d-4fce-9a99-88b1979ec2e6 | mmengjiadai/Computational-Method | 11/11.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <string.h>
#define M_PI 3.14159265358979323846 // pi
using namespace std;
// 设置待求极值的函数
double f(double x1, double x2 )
{
return 100 * pow(x2 - x1 * x1, 2) + pow(1 - x1, 2);
}
// 设置nabla函数
double nabla1(double x1, double x... | ALGO | 0.999989 | 4.124887 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-01-17T03:30: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": "77f6e1fc9f9c... |
ac61856b-9c6f-4146-9894-476859fcf823 | Bistard/oj | leetcode/code/886.possible-bipartition.cpp | /*
* @lc app=leetcode id=886 lang=cpp
*
* [886] Possible Bipartition
*/
// @lc code=start
#ifndef __utility__
#define __utility__
#include <bits/stdc++.h> // Include every standard library(s)
using namespace std;
#ifndef __constants__
#define __constants__
const double PI = acos(-1);
const int dirs[4][2] = {{0... | ALGO | 0.999878 | 6.034585 | {
"github_metadata": {
"branch": "master",
"commit_count": 125,
"repo_created_at": "2022-09-24T00:16:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ae06036... |
e09b6c08-73ce-41ae-8593-4c43fdb98e63 | AlfanNasution/LIGA-BOLA-STD | caseFungsilitas.cpp | #include "caseFungsilitas.h"
void skor(ListParent &L, club &x, club &y, int &day)
{
addressParent P = findElmClub(L, x);
addressParent Q = findElmClub(L, y);
if(P != NULL && Q != NULL)
{
srand(time(0));
int i = rand()%6;
info(P).skor_club = info(P).skor_club + i;
int j =... | TOOL | 0.990243 | 3.355007 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2019-04-30T15:01: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": "f4847b055... |
20543399-3413-4993-bc80-ac3aa06ab826 | oljindudol/jinyoung_codingtest | 백준/Bronze/30802. 웰컴 키트/웰컴 키트.cc | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <cmath>
#include <string>
#include <stdio.h>
#include <unordered_map>
#include <ostream>
#include <stack>
#include <unordered_set>
#include <sstream>
using namespace std;
template <typename T>
void PrintVec(const vecto... | ALGO | 0.999634 | 4.521949 | {
"github_metadata": {
"branch": "master",
"commit_count": 489,
"repo_created_at": "2023-10-15T13: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": "ba6bf224... |
1d944682-d2ee-4103-b68d-6d9a7c7d98b2 | Cegax123/Competitive-Programming | contest/Contest by Topic/suffix_array/n.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(), (c).end()
#define rall(A) A.rbegin(),A.rend()
#define pb push_back
#define dbg(x) do {cerr << #x <<" = " << (x) << endl; } while (false)
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
//cout << s... | ALGO | 0.999995 | 4.342624 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2022-09-15T13:50: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": "17ed4e7102f... |
15cabfa9-4880-4511-921d-cdaf8d925de1 | kawasin73/arihon | section3/3-2-1/abc032c/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
typedef int long long ll;
int N;
ll K;
vector<int> s;
int main() {
cin >> N >> K;
s.resize(N);
for (int i = 0; i < N; i++) cin >> s[i];
for (int i = 0; i < N; i++) {
if (s[i] == 0) {
cout << N << endl;
return 0... | ALGO | 0.999932 | 3.884475 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-10-05T01:19: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": "d0644139a9... |
8a837bc7-0310-45ac-8dc8-1b6ac7082146 | nodfans/the-algorithm | cpp-alg/algorithm/BinarySearch.cpp | #include <array>
#include <iostream>
#include <vector>
int ArrayBinarySearch(std::array<int, 10> &array, int target) {
int left = 0;
int right = array.size() - 1;
while (left <= right) {
int mid = left + (right - left) / 2;
if (array[mid] == target) {
return mid;
} else if (array[mid] < target... | ALGO | 0.999944 | 6.341985 | {
"github_metadata": {
"branch": "main",
"commit_count": 416,
"repo_created_at": "2023-06-27T14:27: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": "ce4df07d0b... |
38621711-90e3-4aa3-8630-c7a8b64dc070 | bakashigure/my_leetcode_solutions | 160. 相交链表.cpp | #if 0
#include <iostream>
#include <vector>
using namespace std;
/* 先求两链的差值,然后长的减去差值,剩下两条长度一样的链
* 从两条链的第一个开始比较,第一个一样的即为相交节点.
*/
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* getIntersectionNode(ListNode* headA, ListNod... | ALGO | 0.999916 | 4.02728 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2021-04-22T15:27:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ae22c2cff8... |
47f1fdaf-77b1-4498-a2c5-0792e0e3e25f | Tshmofen/computational-geometry-bsu | labs/lab4/glab.cpp | #include "glab.h"
#include <string>
#include <algorithm>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
//full input clear to avoid program stuck
void wrong_input(std::istream &in) {
in.clear();
in.ignore(32767, '\n');
cout << "Некорректный ввод, введите еще раз\n>> ";
}
//generate some point... | ALGO | 0.998854 | 4.443836 | {
"github_metadata": {
"branch": "master",
"commit_count": 31,
"repo_created_at": "2020-03-29T16:11: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": "f234ff8e8... |
4e5447bf-919d-4759-82d2-b09ff6225f4c | luanirolon/P3 | u04-colas-luanirolon/Ej-02/main.cpp | //Utilizando una pila y una cola, realizar una función que reciba una cadena y devuelva el
// valor lógico verdadero si dicha cadena es un palidromo.
// No se deben tener en cuenta los espacios y signos de puntuación.
//
//Ejemplos de palidromo:
//
//anita lava la tina
//la ruta natural
//la ruta nos aporto otro paso n... | ALGO | 0.9986 | 6.437179 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-11-16T14:54: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": "9ca21cdd1053... |
0ff48a41-065f-4522-a1d8-d1b1d663fe11 | BornToDeath/cpp | algorithms/jzoffer2/JZ036_逆波兰表达式.cpp | //
// Created by lixiaoqing on 2023/6/20.
//
#include <vector>
#include <string>
#include <stack>
#include <iostream>
using std::vector;
using std::string;
class Solution {
public:
int evalRPN(vector<string> &tokens) {
/*
* 方法: 借助栈
* 时间复杂度 O(n) , 空间复杂度 O(n)
*/
std::stac... | ALGO | 0.999882 | 5.859236 | {
"github_metadata": {
"branch": "main",
"commit_count": 800,
"repo_created_at": "2021-10-28T03:47: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": "1488891ad5... |
532041ac-3e5d-4a6e-9cc8-96cc6d9fdf07 | sneakythumbs/SIPHT | pk.hpp | #ifndef __PK_HPP__
#define __PK_HPP__
#include <cstdlib>
#include <limits>
#include <vector>
#include <opencv2/opencv.hpp>
#include <opencv2/features2d/features2d.hpp>
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "opencv2/flann/miniflann.hpp"
#include "opencv2/features2d/features2d.hp... | ALGO | 0.98232 | 5.680493 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2015-05-14T12:17: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": "5ebf296fd... |
086fe76e-44a9-4238-8d8f-e2f7ad1cd6e8 | lossrual/leetcode | 22-Generate-Parentheses/solution.cpp | class Solution {
public:
/*
vector<string> generateParenthesis(int n) {
string str = "";
for(int i = 0; i < n; i++){
str.push_back('(');
str.push_back(')');
}
vector<string> vs;
vector<string> res;
helper(vs, str, 0);
for(auto c:vs){
... | ALGO | 0.999967 | 5.871336 | {
"github_metadata": {
"branch": "master",
"commit_count": 635,
"repo_created_at": "2016-05-30T08:38: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": "dc7044f6... |
05809f43-d7bc-43d5-9bdb-5ca2d0511fd4 | lclpsoz/competitive-programming | CF/ime-starters-2018/E.cpp | #include <bits/stdc++.h>
using namespace std;
// -----------------
#define x first
#define y second
#define len(x) ((int)(x).size())
using pii = pair<int, int>;
using ll = long long;
using llu = long long unsigned;
using ld = long double;
const ld EPS = 1e-9;
inline int cmp (ld x, ld y = 0, ld tol = EPS) {
return (... | ALGO | 0.999994 | 3.852759 | {
"github_metadata": {
"branch": "master",
"commit_count": 274,
"repo_created_at": "2020-07-09T09:09: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": "b86eaa3c... |
c568eae0-f03c-4644-97fc-e9a9820fe7a1 | jameshegarty/iDSL | examples/convolution_separable/convolution_separable.cpp | #include "../util.h"
#include <math.h>
#include <stdio.h>
#include <assert.h>
float *kernel;
int kernelRadius = 3;
void buildGaussianKernel(float sigma){
kernel = new float[kernelRadius*2+1];
float a = 1.f/(sqrt(2.f*3.14159f)*sigma);
for(int i=0; i<(kernelRadius*2+1); i++){
float x = i-kernelRadius;
k... | DATA | 0.979599 | 5.069278 | {
"github_metadata": {
"branch": "master",
"commit_count": 126,
"repo_created_at": "2012-01-10T23:17:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bb4a62b... |
716727df-4436-43f2-8c79-a7c397d9ca92 | ishandutta2007/codeforces-m | math957963/normal/1545/B.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define N 300100
#define MOD 998244353
#define ll long long
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define rep2(i, a, b) for(int i = a; i <= b; ++i)
#define rep3(i, a, b) for(int i = a; i >= b; --i)
#define eb emplace_back
#define pb push_ba... | ALGO | 0.999895 | 4.486673 | {
"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": "c1b701f475dc... |
84e35548-7c57-4acb-be69-5fd3022a8f7b | snandasena/leetcode-solutions | src/arrays/src/count_of_smaller_number_after_self.cpp |
//
// Created by sajith on 7/23/22.
//
#include "base.h"
class Solution
{
public:
vector<int> countSmaller2(vector<int> &nums)
{
vector<int> ans(nums.size(), 0);
for (int i = 0; i < nums.size(); ++i)
{
int c = 0;
for (int j = i + 1; j < nums.size(); ++j)
... | ALGO | 0.999984 | 6.183382 | {
"github_metadata": {
"branch": "master",
"commit_count": 399,
"repo_created_at": "2022-07-18T06:22:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "a7f76669... |
8790f812-fd39-46ad-a786-8bdb6fb25fdc | project2you/1_ros_arduino_test_encoder | PID.h | #ifndef _PID_H_
#define _PID_H_
#include <Arduino.h>
#define MANUAL_MODE 0
#define AUTO_MODE 1
class PID
{
public:
PID(float Kc, float tauI, float tauD, float interval);
void setInputLimits(float inMin, float inMax);
void setOutputLimits(float outMin, float outMax);
void setTunings(float Kc, float tauI... | ALGO | 0.921797 | 6.341041 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-06-13T11:31: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": "7971193d2... |
70f6a896-8098-44b7-812f-38e472f577b7 | swirleyythrone/DSA | 1442-number-of-operations-to-make-network-connected/number-of-operations-to-make-network-connected.cpp | class DisjointSet{
public:
vector<int> rank,parent,size;
DisjointSet(int n){
parent.resize(n+1);
rank.resize(n+1,0);
size.resize(n+1);
for(int i = 0 ; i < n ; i++){
parent[i]=i;
size[i]=1;
}
}
int findUPar(int node){
i... | ALGO | 0.999886 | 5.247434 | {
"github_metadata": {
"branch": "main",
"commit_count": 465,
"repo_created_at": "2025-01-30T17:53: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": "7a707fad4d... |
7be01035-01b4-4b4c-a71f-f590c182a6e4 | yshivatest/leetcode | set_matrix_zeroes.cpp | /*
Set Matrix Zeroes Total Accepted: 38742 Total Submissions: 123188 My Submissions Question Solution
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
click to show follow up.
Follow up:
Did you use extra space?
A straight forward solution using O(mn) space is probably a ... | ALGO | 0.99939 | 6.327375 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2015-06-05T21:41: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": "6d0c1985a... |
0081c4f6-b88b-458a-852e-1c00736a33aa | harshit027/Codes | My C Codes/CDL.CPP | /*creation of circular doubly linked list :HARSHIT*/
#include"stdio.h"
#include"conio.h"
#include"stdlib.h"
typedef struct cir_doubly
{
int data;
struct cir_doubly *next,*prev;
}node;
node *first,*temp1,*temp2;
/*---------------------------------------------------------------*/
/*creates a circular doubly linked list ... | ALGO | 0.998491 | 5.188154 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2014-11-14T02:02:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c915c9c8... |
60f8f739-290a-411a-8180-b781e8261060 | YashDuhan/C | Yash/C++/DSA/9. DP/Aditya Verma/3. Longest Common Subsequence/Part20_LCSMemoized.cpp | //https://leetcode.com/problems/longest-common-subsequence
//In this solution, we will encounter a Time Limit Exceeded Error because the dp array is being created at each call, increasing both time and space consumption. Thus, we need to create a global dp array to avoid TLE.
//Status : TLE
class Solution {
public:
... | ALGO | 0.99985 | 5.943182 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2023-03-02T04:15:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "47c1d99146... |
d601d546-3fa5-4d87-8341-e2a9b586dd47 | MartyMcFlyHasNoFarmHiaHiaHo/algorithms | sorting/quicksort.h | #ifndef _QUICKSORT_H
#define _QUICKSORT_H
#include <vector>
template <typename T>
inline void swap(T & a, T & b)
{
T c = a;
a = b;
b = c;
}
template <typename T>
int getPivot(std::vector<T> & arr, int hi, int lo)
{
return hi;
}
template <typename T>
int partition(std::vector<T> & arr, int hi, int lo... | ALGO | 0.999986 | 5.611319 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-05-03T17:43: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": "980025772f... |
89ee19db-abf0-48e6-bea5-17484dea8fac | lijinc/DataStructures | compressedstring.cpp | /*
* compressedstring.cpp
*
* Copyright 2012 <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 option) any later version... | TOOL | 0.981438 | 3.861788 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2012-11-30T10:36: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": "1773d7e550... |
07d0e1ce-f31a-4776-914a-f4836e86251d | kss418/BOJ | 백준/Gold/30536. 시루의 산책/시루의 산책.cc | #include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define fastio cin.tie(0), cout.tie(0), ios::sync_with_stdio(0);
#defi... | ALGO | 0.999873 | 4.430666 | {
"github_metadata": {
"branch": "main",
"commit_count": 1502,
"repo_created_at": "2022-09-09T06:57:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db4ce1e3d... |
9b4f572b-e266-4f7d-a83d-90008b31ecc2 | KimMean/Algorithm | 프로그래머스/3/12971. 스티커 모으기(2)/스티커 모으기(2).cpp | #include <iostream>
#include <vector>
using namespace std;
int solution(vector<int> sticker)
{
int answer = 0;
if(sticker.size() == 1)
return sticker[0];
// 스티커를 뜯어내어 최대값 만들기
// 첫 번째 스티커를 포함시
vector<int> dp(sticker.size(), 0); // n개 방 만들고 0으로 초기화
dp[0] = sticker[0];
dp... | ALGO | 0.99921 | 4.437675 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2023-10-19T15:17: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": "00abd998b6... |
029e6800-6485-41ce-8411-4a8839fe00a0 | KratosMultiphysics/Kratos | applications/FluidDynamicsApplication/custom_conditions/wall_condition.cpp | #include "wall_condition.h"
namespace Kratos
{
///@name Specialized implementation of VMS for functions that depend on TDim
///@{
/**
* @see WallCondition::EquationIdVector
*/
template <>
void WallCondition<2,2>::EquationIdVector(EquationIdVectorType& rResult,
const Proces... | ALGO | 0.988965 | 5.734122 | {
"github_metadata": {
"branch": "master",
"commit_count": 106408,
"repo_created_at": "2017-02-13T10:58:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1141,
"forks": 265,
"issues": 381,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
2edbfb94-d39d-464b-bdd8-7d1fad5fe63f | cubercsl/The-road-to-ACMer | Codeforces/892/892B.cpp | #include <bits/stdc++.h>
using namespace std;
#define clr(a, x) memset(a, x, sizeof(a))
#define mp(x, y) make_pair(x, y)
#define pb(x) push_back(x)
#define X first
#define Y second
#define fastin \
ios_base::sync_with_stdio(0); \
cin.tie(0);
typedef long long ll;
typedef long double ld;
typed... | ALGO | 0.999898 | 3.264001 | {
"github_metadata": {
"branch": "master",
"commit_count": 611,
"repo_created_at": "2017-04-28T00:42:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 54,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "182923c... |
c57ca463-8ea3-4f28-934d-3a0b039f8fa2 | RobotLocomotion/drake | planning/dev/mbp_environment_collision_checker.h | #pragma once
#include <functional>
#include <map>
#include <memory>
#include <optional>
#include <queue>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include <Eigen/Geometry>
#include "drake/geometry/scene_graph.h"
#include "drake/multibody/plant/multibody_plant.h"
#include "drake... | TOOL | 0.969969 | 7.277858 | {
"github_metadata": {
"branch": "master",
"commit_count": 33726,
"repo_created_at": "2014-01-26T16:11:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3630,
"forks": 1305,
"issues": 690,
"pull_requests": 46
},
"file_meta": {
"content_id":... |
1cd8a18a-0eb7-444b-92a4-2a9025e2eb2b | jventura10/Ventura_Javier_CSC17A_Fall2017 | Hmwk/Assignment 2/MeanMedianMode/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Purpose: Mean, Median,Mode
* Created on September 27, 2017, 6:30 PM
*/
#include <iostream>
using namespace std;
void mode(int[], int);
void mean(int[], int);
void sort(int[], int);
void median(int[], int);
int main()
{
int array[15];
float total=0.0f;
int n = 1... | ALGO | 0.998263 | 4.401187 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2017-09-14T02:12: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": "a2e016e31... |
f04d217c-ae24-4a54-ba9d-daa955e2e2ed | ChaneHaDa/coding-test | baekjoon/c++/1922.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<int> parent;
int find(int x) {
if(x!=parent[x]) {
parent[x] = find(parent[x]);
}
return parent[x];
}
void merge(int x, int y) {
int pX = find(x);
... | ALGO | 0.999968 | 5.434819 | {
"github_metadata": {
"branch": "main",
"commit_count": 105,
"repo_created_at": "2025-03-28T01:04:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "af6cf2aec9... |
3916ae9c-1766-4a18-b823-eaa8330bc56a | meemknight/ourCraft | shared/splines.cpp | #include <splines.h>
#include <glm/glm.hpp>
glm::vec2 lerp(glm::vec2 a, glm::vec2 b, float r)
{
return a * (1.f - r) + b * r;
}
glm::dvec3 lerp(glm::dvec3 a, glm::dvec3 b, float r)
{
return a * (1.0 - (double)r) + b * (double)r;
}
float applySpline(float p, glm::vec2 *points, size_t s)
{
if (s >= 2)
{
for ... | ALGO | 0.959798 | 4.941858 | {
"github_metadata": {
"branch": "master",
"commit_count": 724,
"repo_created_at": "2021-12-24T15:03:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 335,
"forks": 22,
"issues": 6,
"pull_requests": 3
},
"file_meta": {
"content_id": "c36b5... |
2f69315c-363d-43cf-93cc-268fe48ecc0e | DamianArado/LeetCode-tracker | 1539-kth-missing-positive-number/1539-kth-missing-positive-number.cpp | class Solution {
public:
// int findKthPositive(vector<int>& arr, int k) {
// // brute force
// unordered_map<int, int> mp;
// for(int &i : arr) mp[i]++;
// int current = 1;
// while(k > 0) {
// if(!mp.count(current)) --k;
// ++current;
// }
... | ALGO | 0.999957 | 5.458022 | {
"github_metadata": {
"branch": "master",
"commit_count": 4716,
"repo_created_at": "2021-10-28T18:31:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70e1211... |
9b615762-dff8-4472-9d71-17410a0055b6 | namir-ahmed/Virtual-Machine-OS-Simulation | src/main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <math.h>
#include "pcb.h"
#include "disk.h"
#include "memory.h"
#include "memory_manager.h"
#include "loader.h"
#include "cpu.h"
#include "metrics.h"
Disk disk = Disk(2048 * 4);
Memory ram = Memory(1024 * 4);
MemManager mmu(&ram, 16); // 4 words per fram... | ALGO | 0.995068 | 4.352682 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-10-06T22:37: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": "cf0ff9214... |
26a453bf-2ab3-4d62-95cf-1dd6fcd46f11 | madhu9613/cses | SlidingWindow/SlidingWindowMode.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
unordered_map<ll, ll> freq;
map<ll, set<ll>> CountToNum;
auto insert = [&](ll val)
{
ll oldfreq = freq[val]++;
if (oldfreq > 0)
{
CountToNum[oldfreq].eras... | ALGO | 0.999995 | 3.39934 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2025-03-27T15:05: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": "d3aa48f5b2d... |
4b1b5310-426e-4cea-a217-442c992c7942 | prathmesh-gavande/leetcode | 0926-find-and-replace-pattern/0926-find-and-replace-pattern.cpp | class Solution {
public:
//this function normalises all the words and pattern into a similar format
//so that we can compare them and find the solution
void createUpdateMapping(string& str) {
//find mappping
char start = 'a';
char mapping[300] = {0};
for(auto ch: str) {
... | ALGO | 0.999935 | 5.73952 | {
"github_metadata": {
"branch": "main",
"commit_count": 333,
"repo_created_at": "2023-09-14T03:28:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a889b54ff... |
1db72bc4-7ab1-483e-a827-b2b41420cabd | navyxliu/leetcode | probs/prob50.cpp | #include <iostream>
using namespace std;
class Solution {
public:
/**
* @param x the base number
* @param n the power number
* @return the result
*/
double myPow(double x, int n) {
// Write your code here
if (n == 0) return 1.0f;
if (n == 1) return x;
cout ... | ALGO | 0.999722 | 5.468407 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2016-07-19T09:56: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": "8913f06ed... |
ec3260c7-a45e-4a5b-96c8-59a903748af7 | trebegin/ColorTracking | color_tracking.cpp | // <NAME>
// Computer Vision
// color_tracking.cpp
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int THRESHOLD = 0;
int TRACK_THRESHOLD = 120;
Mat median(Mat frame);
int main(int argc, char** argv)
{
// Opens video
VideoCap... | ALGO | 0.99744 | 5.53141 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-03-06T18:45:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6e64d8a5c... |
3d15012b-d23d-4e98-958c-bd5b02352c0b | ishandutta2007/codeforces-i | imeimi/normal/1209/E2.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <string>
#include <cstring>
#include <functional>
#define fs first
#define se second
#ifdef imeimi
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...)
#endif
using namespac... | ALGO | 0.9999 | 3.599519 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "4ee1f566a55c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.