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 |
|---|---|---|---|---|---|---|---|
3e514082-020d-450e-9d7d-13c94a100e76 | Shankarn9060/Shankarn9060 | deque.cpp | #include<stdio.h>
#include<stdlib.h>
int f=-1,r=-1,n,*queue;
void rear_enqueue(int val)
{
if((f==0&&r==n-1)||f==r+1)
{
printf("Queue Overflow\n");
}
else if(f==-1&&r==-1)
{
f=0;
r=0;
queue[r]=val;
}
else
{
r=(r+1)%n;
queue[r]=val;
}
}
void front_enqueue(int val)
{
if((f==0&&r==n-1)||f==r+1)
{
p... | ALGO | 0.999288 | 3.242294 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2022-01-12T07:25: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": "07e8e8bd602... |
6a5df8a0-a5ee-4c60-a126-42f43bfa5d59 | RyanYoung25/maestor | src/ArmWristXYZ.cpp | /**
* The arm meta joint controller. This uses a simpilfied
* Arm inverse kinematics that <NAME> derived. He worked
* really hard on it and deserves a ton of credit for it.
*/
#include "../include/ArmWristXYZ.h"
const int ArmWristXYZ::NUM_PARAMETERS = 3;
const int ArmWristXYZ::NUM_CONTROLLED = 4;
//Expected Pa... | ALGO | 0.962417 | 6.121178 | {
"github_metadata": {
"branch": "master",
"commit_count": 127,
"repo_created_at": "2014-03-21T14:32:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7cfcf071... |
191247d7-017e-491b-8162-4ef221d2ef7d | cassiehaydock/Cryptology-High-Performance-Computing | vigenere-cipher-normal/vigenere-cipher.cpp | #include <bits/stdc++.h>
#include <string>
#include <chrono>
#include <iostream>
#include <fstream>
using namespace std;
#define TRUE 0
#define FALSE 1
// This function generates the key until it's length is equal to the length of original text
string generateKey(string str, string key)
{
int shorter = (str.size() <... | ALGO | 0.998156 | 4.882103 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-10T17:16:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f97e5abfff7... |
3ab2d89f-eff9-4ba2-adea-56f8a2c87502 | CalvinL15/Algorithm-Design-and-Analysis-Fall-2018 | HW4/Candy.cpp | #include<stdio.h>
#pragma optimize ("O3")
#include <unistd.h>
//ref: https://www.geeksforgeeks.org/m-coloring-problem-backtracking-5/
//ref: travelsciencetech.blogspot.com/2012/10/graph-coloring-problem-with.html
const int kBuf = 131072;
inline char Readchar() {
static char buf[kBuf], *p = buf, *end = buf;
if (p... | ALGO | 0.999963 | 3.654524 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-10-28T06:29: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": "e6adf976a... |
faeadb8a-2aac-4aad-a222-b3d4878a50a1 | Shubham0850/google | cpp/learning_cpp/RootOfQuardaticEq.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a, b, c;
float r1, r2;
cout << "Program to find the root of quardatic equation" << endl;
cout << "Enter a: ";
cin >> a;
cout << "ENter b: ";
cin >> b;
cout << "ENter c: ";
cin >> c;
r1 = (-b + sqrt(b *... | ALGO | 0.998823 | 3.21363 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-12-11T03:17:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1ded8d233876... |
46ed89a1-1c9d-4d9d-99c8-2296d3412309 | Gabriel765324/Carpeta | IOI/crocodile/crocodile.cpp | #include "crocodile.h"
#include "bits/stdc++.h"
using namespace std;
struct Arista{
long long Nodo, Peso;
};
struct Nodo_por_ver{
long long Distancia, Nodo;
};
bool operator<(const Arista &a, const Arista &b){
if(a.Peso < b.Peso) return 1;
if(a.Peso > b.Peso) return 0;
return a.Nodo < b.Nodo;
}
bool operator<... | ALGO | 0.999712 | 3.710261 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-06-22T21:22: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": "051bedb02ee2... |
42b23236-b29e-4e29-9791-78c2d94eb390 | DILET1/usacoarchive | USACO training problems/2016 December/silver/moocastkruskal.cpp | #include <bits/stdc++.h>
using namespace std;
/**
The problem essentially asks for the maximum edge weight in a minimum spanning tree of all the cows, with the special condition of the edge weights being the distance, squared.
Possibly for the convenience of not needing to square-root distances when calculating them w... | ALGO | 0.999945 | 4.244691 | {
"github_metadata": {
"branch": "main",
"commit_count": 250,
"repo_created_at": "2022-01-28T18:13:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0f675195a... |
7e938be1-c6e9-4af9-a5c7-8b123ed3059b | ershehzan/Cpp_Codes | Merge two sorted Lists.cpp | #include <iostream>
using namespace std;
// Node class represents a single node in the linked list
class Node
{
public:
int data; // Data stored in the node
Node *next; // Pointer to the next node
// Constructor to initialize the node with a value
Node(int value)
{
data = value;
... | ALGO | 0.999996 | 6.112371 | {
"github_metadata": {
"branch": "main",
"commit_count": 640,
"repo_created_at": "2024-10-05T10:47:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89ad845409... |
10dfa65b-27c1-4644-bb12-6076214ffc1f | Popichi/Karipso-Public | cpp_practice_codes/algorithms/sorting/heapsort.cpp | /* This is an implementation of a heapsort algorithm using an array as the
underlying data structure to simulate heap behavior. */
/* TO DO: 1) 243, 1043, 4399, 456, 0, 1, 34323433, 533, 17, 49 returns
0, 1, 17, 49, 243, 533, 456, 1043, 4399, 34323433 which is
incorrect. Fix the bug! */
#... | ALGO | 0.999869 | 4.962391 | {
"github_metadata": {
"branch": "master",
"commit_count": 153,
"repo_created_at": "2018-07-11T07:31: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": "03f26e9b... |
8914d618-8f33-4961-83ee-f71e9ed8f228 | martinpetkovski/martinpetkovski.github.io | alg/s/spratovi.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n;
cin >> n;
//najmal sprat za koj znaeme deka ako go frlime topcheto kje se skrshi
int najmal = 1000000;
//najgolem sprat za koj znaeme deka ako go frlime topcheto nema da se skrshi
int najgolem = 0;
for (in... | ALGO | 0.999825 | 3.588463 | {
"github_metadata": {
"branch": "master",
"commit_count": 625,
"repo_created_at": "2015-01-07T00:24:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "8fbd75dc... |
4d8b7448-c22e-4a9e-9106-8d72c51034f2 | takfuruya/DVRPC | Program/src/BronKerbosch.cpp | #include "BronKerbosch.h"
#include <vector>
#include <stdexcept>
#include "opencv2/opencv.hpp" // OpenCV 2.4.5
using namespace std;
class Vertex;
class VertexSet
{
public:
// Constructor
VertexSet(int totalVertices);
VertexSet(int totalVertices, bool initVal);
VertexSet(const VertexSet& other);
const Vert... | ALGO | 0.999209 | 5.828815 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2014-04-10T22:51:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50d67d2d3... |
ed080f66-6085-42fd-81f6-1279b4c1d40b | YuanzhongLi/CompetitiveProgramming | AtCoder/ABC/133/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,s,n) for (int i = (int)s; i < (int)n; i++)
#define ll long long
#define pb push_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
static const int MAX = 100005;
static const int INFTY = (1<<21);
static const int WHITE... | ALGO | 0.999987 | 4.601608 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2020-03-23T13:46: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": "032dbc8d... |
b1ecb074-f8da-4863-ab00-39ee13085217 | orfeotoolbox/OTB | Modules/FeaturesExtraction/Filtering/ChangeDetection/include/otbJoinHistogramMI.h | /*
* Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* 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 ... | ALGO | 0.938556 | 6.124007 | {
"github_metadata": {
"branch": "develop",
"commit_count": 34510,
"repo_created_at": "2015-07-17T15:56:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 370,
"forks": 120,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "fe... |
f7162799-4ee6-408e-981d-2b8b5f6ccba0 | zethfoxster/coh-score | AuthServer/lib/arda2/util/utlGenericHash.h | /*****************************************************************************
created: 2004/01/13
copyright: 2004, NCSoft. All Rights Reserved
author(s): <NAME>
purpose:
*****************************************************************************/
#ifndef INCLUDED_utlGenericHash_h
#define INCLUDED_utlGene... | ALGO | 0.992101 | 5.462149 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-07-28T14:30:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24a811b4b0... |
da4ac22f-0f3d-469b-9957-6280ab843156 | Reva22/LeetCode | Implementing Dijkstra Algorithm - GFG/implementing-dijkstra-algorithm.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to find the shortest distance of all the vertices
//from the source vertex S.
vector <int> dijkstra(int n, vector<vector<int>> adj[], int src)
{
// Code here
vector... | ALGO | 0.999953 | 5.852709 | {
"github_metadata": {
"branch": "main",
"commit_count": 204,
"repo_created_at": "2023-03-02T07:38: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": "3eda101f61... |
afa5f258-b5f9-40ff-84f0-58ec2f72c998 | skyellen/robwork-mirror | RobWork/src/rwlibs/softbody/beam/ModRussel_NLP.cpp | /*
Copyright 2013 The Robotics Group, The Maersk Mc-Kinney Moller Institute,
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
Unle... | ALGO | 0.999706 | 5.375214 | {
"github_metadata": {
"branch": "master",
"commit_count": 5380,
"repo_created_at": "2019-01-12T02:01:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93caa68... |
771c4727-7dbc-42fb-88ac-008cd2782b0d | rheiland/bct-cpp2 | degrees_dir.cpp | #include "bct.h"
/*
* Computes degree, in-degree, and out-degree for a directed graph. Connection
* weights are ignored.
*/
VECTOR_T* BCT_NAMESPACE::degrees_dir(const MATRIX_T* CIJ, VECTOR_T** id, VECTOR_T** od) {
if (safe_mode) check_status(CIJ, SQUARE | DIRECTED, "degrees_dir");
// CIJ = double(CIJ~=0);
// ... | ALGO | 0.997206 | 5.246529 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-01-17T08:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e7ff4f40a... |
0e0e1f2e-c12c-41f4-8cde-ad5001c812a1 | UChiSeclab/perfforge | problems/1061_C/metadata/synthesized_constraints/solutions_0107/generated_tests_022_generated_tests_051/transformed_program.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> x[1000005];
int a[100005];
long long f[1000005];
void check_max_value_invariant(int max_value) {
if (max_value > 500000) { // Threshold chosen based on problem constraints and observations
cerr << "Warning: Performance bottleneck condition triggere... | ALGO | 0.99993 | 4.9347 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-07-05T21:17:37.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c75d9307e815d... |
b4d12907-9e5d-4f57-b190-ab1a2427447d | debnsuma/CN2022 | IntroToCpp/L10/getCompressedString.cpp | #include <iostream>
using namespace std;
string gen_compressed_str(string str)
{
char output[1000000];
int ix = 0;
int len = str.length();
for (int i = 0; i < len; i++) {
// Count occurrences of current character
int count = 1;
while (i < len - 1 && str[i] == str... | ALGO | 0.999991 | 4.159214 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2022-03-26T20:52: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": "caa812d463f6... |
7753f4dd-c2f8-46ee-bdb7-0fdf8ec15b35 | k-vikingsson/soct | crab/include/crab/domains/array_smashing.hpp | /*******************************************************************************
* Array smashing domain
*
* FIXME: assume all array accesses are aligned wrt to the size of the
* array element (e.g., if the size of the array element is 4 bytes
* then all array accesses must be multiple of 4). Note that this
* as... | ALGO | 0.920708 | 6.992321 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-08-31T08:49: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": "11a71107e0... |
c68b7627-dcc4-45c4-b063-d0e10f5c3de9 | DominikPetrovic/Diplomski-seminar-2017 | dynarobinsim/DynaRobinIKin/ALGLIB/alglibmisc.cpp | /*************************************************************************
Copyright (c) <NAME> (ALGLIB project).
>>> SOURCE LICENSE >>>
This program is a Commercial Edition of the ALGLIB package licensed
to Fakultet strojarstva i brodogradnje (Licensee).
Only Licensee and its Sublicensees can use/distrib... | ALGO | 0.994613 | 5.742026 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2017-05-08T14:06:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33bd8d9a0... |
fb868ef1-738a-4a7a-8d1d-66954bc32544 | karpiu/karp-trie | src/trie.h |
#ifndef TRIE_INCLUDED
#define TRIE_INCLUDED 1
#include <iostream>
#include <cstring>
using namespace std;
template <typename T>
class trie {
private:
// node of trie. we do not want this to be visible to user
struct trie_node {
T* v;
char c;
trie_node * next;
trie_node * left;
... | ALGO | 0.97373 | 4.985322 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2011-12-11T20:19: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": "c949d79501... |
b96f27a2-5f1a-4dfc-bb5f-73dbe7992202 | fangohr/oommf | oommf/app/oxs/local/2dpbc-Oct-2013/pbc_exchangeptwise.h | /* FILE: pbc_exchangeptwise.h -*-Mode: c++-*-
*
* 6 neighbor exchange energy on rectangular mesh, with
* exchange coefficient A specified on a cell-by-cell
* basis. The effective coefficient between two neighboring
* cells is calculated on the fly via 2.A_1.A_2/(A_1+A_2)
*/
#ifndef _OXS_PBC_EXCHANGEP... | TOOL | 0.943377 | 5.542051 | {
"github_metadata": {
"branch": "master",
"commit_count": 298,
"repo_created_at": "2015-09-24T11:27:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 30,
"forks": 8,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7dbdaa... |
b8585c60-f709-4a4e-a57b-78e92edfae67 | marlovi/aulas | material estrutura de dados/ED_Template/LLDE/listasLinearesDE/listasLinearesDE/main.cpp | //
// main.cpp
// listasLinearesDE
//
// Created by <NAME> on 04/04/2018.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include <iostream>
using namespace std;
struct noh{
int info;
struct noh *ant,*prox;
};
typedef struct noh *LLDE;
void inserirInicioLLDE(LLDE *l, int vr);
void mostrarLLDE(LLDE l... | ALGO | 0.998746 | 4.586852 | {
"github_metadata": {
"branch": "master",
"commit_count": 199,
"repo_created_at": "2017-07-22T23:41:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 9,
"issues": 0,
"pull_requests": 106
},
"file_meta": {
"content_id": "053b26... |
a5c95a98-2769-4108-ac63-04aa4a169013 | rabienrose/3d_vision | visual_map/src/maplab-common/include/maplab-common/vector-window-operations.h | #ifndef MAPLAB_COMMON_VECTOR_WINDOW_OPERATIONS_H_
#define MAPLAB_COMMON_VECTOR_WINDOW_OPERATIONS_H_
#include <algorithm>
#include <functional>
#include <vector>
#include <glog/logging.h>
namespace common {
namespace window_vec_ops {
template <typename Type>
using WindowOperation = std::function<Type(
typename ... | TOOL | 0.996363 | 7.6823 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2019-02-11T05:53:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 22,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b2dfe9... |
35c71c8a-9c85-462f-8730-449facedab8f | mohitm15/competitve_solns | codechef_solns/VWL.cpp | //March Bileration #1 2019- Problem 1
//By <NAME>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,cnt1=0,cnt2=0,cnt3=0,cnt4=0,cnt5=0,cnt=0;
std::cin >> n;
char ch[n];
for(int i=0;i<n;i++)
{
std::cin >> ch[i];
if(ch[i]=='a' )
cnt1++;
else if(ch[i]=='e')
cnt2++;
else i... | ALGO | 0.999995 | 4.112305 | {
"github_metadata": {
"branch": "master",
"commit_count": 602,
"repo_created_at": "2018-12-24T08:01:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbd62ce... |
5ca1cb63-a9a4-42f5-b61e-71a369658fa8 | wcysai/CodeLibrary | BZOJ/2809.cpp | /*************************************************************************
> File Name: 2809.cpp
> Author: Roundgod
> Mail: <EMAIL>
> Created Time: 2018-07-11 15:08:24
************************************************************************/
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#define MAX... | ALGO | 0.999954 | 3.670768 | {
"github_metadata": {
"branch": "master",
"commit_count": 1109,
"repo_created_at": "2018-05-21T06:39:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "28d4652... |
522d4027-4f4c-4bdc-9b04-8b1108c83c2e | moonlightTNs/Algorithm | Search_sort/quick_selectSUM.c++ | #include <iostream>
using namespace std;
int patition(int a[], int l ,int r ){
int pivot = a[r] ;
int i = l-1 ;
for(int j = l ; j <= r ; j++){
if(a[j] < pivot){
i++ ;
swap(a[i] , a[j]) ;
}
}
swap(a[i+1],a[r]) ;
return i+1;
}
int QS(int a[] , int ... | ALGO | 0.999985 | 4.101657 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-12-19T12:00: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": "06d6692b732... |
8de6c691-0952-47ea-aab1-c49147ece54d | akmayank94/ads | kmp.cpp |
#include <iostream>
#include <vector>
using namespace std;
// Function to compute the Longest Prefix Suffix (LPS) array
void computeLPS(const string &pattern, vector<int> &lps) {
int length = 0; // length of the previous longest prefix suffix
lps[0] = 0; // lps[0] is always 0
int i = 1;
while (i ... | ALGO | 0.999975 | 6.388762 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-11-29T12:16:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4578d099ac6... |
612f4e8e-7e01-45b5-8072-ddcd6a019450 | mukuldeep/cs | cp/CodeForces/cdfr_1140A.cpp | //
// Created by me on 21-08-2021.
//
#include <bits/stdc++.h>
#define SYNC ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define DRIVER int main(){SYNC ll t=1;W_(t)soln(t);return 0;}
#define TEST_DRIVER int cc_main(){SYNC ll t=1;W_(t)soln(t);return 0;}
#define FR_(a,c) for (ll (a)=0;(a)<(c); (a)++)
#define FR_... | ALGO | 0.999942 | 3.972854 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2021-05-31T12:51: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": "6065cb0981e... |
d13a0e8e-616f-499f-b894-deca7e07302a | rahulnongmeikapam/CTSD-II | studentrecord3(2)ii.cpp | #include <stdio.h>
struct Student {
int roll_no;
char name[50];
char gender;
int marks[5];
float percentage;
};
void calculatePercentage(struct Student *s) {
int total = 0;
for (int i = 0; i < 5; i++) {
total += s->marks[i];
}
s->percentage = (float)total / 5;
}
void swap(st... | ALGO | 0.999385 | 5.139184 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-03-14T12:55: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": "e15156eccc3c... |
6179e4db-88b2-456b-b98a-ab09056ac176 | husterxsp/leetcode | 355-design-twitter/Twitter.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <unordered_set>
using namespace std;
class Twitter {
public:
struct Tweet {
int time;
int id;
Tweet(int time, int id) : time(time), id(id) {}
};
... | ALGO | 0.99974 | 6.177868 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2016-06-27T12: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": "7594b71cf... |
6ec4c61d-1754-40f3-a922-516718c54c9b | MiguelAngelLardo/UTN | 1.1)PRO1_LAB1_SPD_MAT_ARSO/1-Programacion1/2.4)Guia2_DECISIONES_UTN2024/EJ_22/G2_Ej22.cpp | /*22 Una fábrica de caramelos dispone de un presupuesto inicial para inaugurar su
sucursal en Villa <NAME>. Se sabe que para producir caramelos tienen los
siguientes costos:
- Costo de alquiler de $100000
- Costo por caramelo producido de $2.50
- Costo por mantenimiento cada 1000 caramelos de $50000
Dados el presupuest... | ALGO | 0.959652 | 4.302493 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2024-02-11T00:06:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b4117581399... |
abd168a7-4547-4ed1-b2b6-d3932807e922 | klyuevskiy/haar_kr | haar.hpp | #if !defined(__HAAR_LIB_H_)
#define __HAAR_LIB_H_
#include <iostream>
#include <print>
#include <vector>
#include <cassert>
#include <bit>
#include <algorithm>
#include <ranges>
#include <execution>
#include <type_traits>
#include <cmath>
#include <tuple>
template <typename T>
void print_vector(std::vector<T> const& ... | ALGO | 0.991222 | 4.894421 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-11-19T11:45: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": "c7b4cf6f85... |
cd8df1aa-6255-4be2-a68c-88a39c8787f9 | marg-tools/CoMeT | pin_kit/source/tools/SimpleExamples/inscount2_mt.cpp | /*BEGIN_LEGAL
Intel Open Source License
Copyright (c) 2002-2018 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright noti... | TOOL | 0.912925 | 6.881621 | {
"github_metadata": {
"branch": "main",
"commit_count": 320,
"repo_created_at": "2021-09-04T09:33:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 21,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "4776fcd5... |
74f30069-ca64-45ca-933a-6608cda7b775 | Clqsin45/acmrec | 图论/图论疯狂500题/并查集/HDU 1213 How Many Tables.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
#define N 1004
#define M
#define LL __int64
#define INF 0x3f7f7f7f
int f[N], rank[N], vis[N], ans;
void init(int n){
int i;
for(i = 1; i <= n; i++){
f[i] = i; rank[i] = 1;
}
memset(vis, 0, siz... | ALGO | 0.999891 | 4.162574 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-11-28T03:37: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": "a51ec36927... |
943dfe05-7420-418a-9162-a1834dff888f | Golimorph/RESEARCH | TrivialPar.cpp | //
// MCsimulation.cpp
// PyrochloreG
//
// Created by <NAME> on 2017-08-30.
//
//
#include "TrivialPar.h"
TrivialPar::TrivialPar(Parameters *parameters, Crystal *crystal, Ewald *ewald , Eigen::VectorXd *spinOrientation)
:
parameters(parameters),
ewald(ewald),
spinOrientation(spinOrientation)
{
NNlist... | ALGO | 0.994927 | 5.608325 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-03-17T11:02: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": "18d1631a61c4... |
423f0c37-045e-405f-8426-1736f09e3b13 | khiner/notebooks | accelerated_c++/chapter_5/palindromes.cpp | #include <cctype>
#include <iostream>
#include <string>
#include <vector>
using std::cin; using std::cout; using std::isupper;
using std::endl; using std::string; using std::vector;
bool isPalindrome(const string& s) {
for (string::size_type i = 0; i < s.size() / 2; i++) {
if (s[i] != s[s.size() - i - 1])... | ALGO | 0.999893 | 4.657807 | {
"github_metadata": {
"branch": "master",
"commit_count": 167,
"repo_created_at": "2017-12-18T00:56:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 86,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d31034... |
609c8642-f651-4472-9800-e234ecbba2c7 | Hsu1997/Leetcode | daily/2023/649_Dota2_Senate.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
string predictPartyVictory(string senate) {
int Rban = 0;
int Dban = 0;
string s;
while(true){
bool same = true;
for (auto i : senate){
if (... | ALGO | 0.999986 | 4.948556 | {
"github_metadata": {
"branch": "main",
"commit_count": 1965,
"repo_created_at": "2022-01-25T09:04: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": "6705c0ab8... |
c37cdde0-2299-4775-aae1-865d9f10ef92 | gargimahale/Competitive-Programming | LeetCode/Medium/Unique Paths.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int uniquePaths(int m, int n) {
vector<vector<int>> dp(m, vector<int>(n));
for (int i = 0; i < m; ++i){
for (int j = 0; j < n; ++j){
if (!i || !j){
dp[i][j] = 1;
... | ALGO | 0.999953 | 6.370912 | {
"github_metadata": {
"branch": "master",
"commit_count": 1240,
"repo_created_at": "2021-02-12T07:19: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": "1fb1154... |
1fe5e9d1-755c-454e-bda3-4163f6006bb1 | Apress/beg-cplusplus17 | Beginning C++ 17 source code/Examples/Chapter 05/Ex5_04A.cpp | // Multiple calculations in a loop expression's third control expression
// by using the comma operator
#include <iostream>
#include <iomanip>
int main()
{
unsigned int limit{};
std::cout << "This program calculates n! and the sum of the integers up to n for values 1 to limit.\n";
std::cout << "What upper limit... | ALGO | 0.999316 | 5.658864 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-03-09T12:23:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 118,
"forks": 66,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "6ede4cd2... |
a0a8ba47-f22f-4015-99bc-37898eeda8a8 | Pseudo-iitian/DSA_2024 | Heap/11CBT.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(){}
Node(int data){
this->data = data;
this->left = NULL;
this->right= NULL;
}
};
void calculateDataPoints(Node* root,int &data){
if(root==NULL) return ;
// inorder ... | ALGO | 0.99989 | 4.160995 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2024-01-07T14:09:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12fc3c2a6... |
fc48c39f-1154-44c4-9a0c-bc18cf097f6b | kokroiceork75/tracer_velodyne | controller/src/sim_along_wall_tracer.cpp | ////////////////////////////// include ///////////////////////////////////////////
#include <sstream>
#include <iostream>
#include <algorithm>
#include "ros/ros.h"
#include "std_msgs/String.h"
#include "sensor_msgs/LaserScan.h"
#include "geometry_msgs/Twist.h"
#include <fstream>
#include <math.h>
#include <move_base_... | ALGO | 0.990759 | 3.0919 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2023-11-16T05:37:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f40601d82e0... |
5cd92832-5be2-4393-9840-cd9042035f98 | Bernoully/Codeforces-Gym | D. Sudoku - ACM Arabella Collegiate Programming Contest 2015.cpp | #include <iostream>
#include <algorithm>
using namespace std;
const int dx[] = {0,0,0,3,3,3,6,6,6};
const int dy[] = {0,3,6,0,3,6,0,3,6};
int main(){
int tc;
cin >> tc ;
while(tc--){
int a[10][10];
string s;
bool finalz = true;
for(int i = 0;i < 9;i++){
cin >>s ;
for(int j = 0; j < 9;j++)
a[i][j] = s[j]... | ALGO | 0.999543 | 5.430712 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2015-09-29T16:32:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e1f3abf2... |
0a8c5938-fed2-46b1-bcc7-772ce15e0748 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/09/0924/personal_submission/cf731f_yawn_sean.cpp | #include <bits/stdc++.h>
// #pragma GCC optimize("O3,Ofast,unroll-loops")
// #include <bits/extc++.h>
// using namespace __gnu_cxx;
// using namespace __gnu_pbds;
using namespace std;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, M = 2e5;
cin >> n;
vector<i... | ALGO | 0.999954 | 3.95998 | {
"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": "2775... |
17470909-4d99-4393-bbca-d4b9153b928a | Lukas0310/Logica-Difusa | Trapecio.cpp | #include "Trapecio.h"
Trapecio::Trapecio(std::string nombre, std::vector<std::string> coor) {
setNombre(nombre);
char tipo ='R';
setTipo(tipo);
setConjuntoFuzzy(coor);
setAltura(0);
}
void Trapecio::setX1(float x1) {
this->x1=x1;
}
void Trapecio::setX2(float x2) {
this->x2=x2;
}
void Tra... | TOOL | 0.976138 | 4.69238 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2024-04-30T02:42:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "23d5334cc9a... |
27c0d81b-e46b-4c92-b9db-078f1751afb4 | code-grass/code-grass-2020-Huawei-code-craft-preliminary-contest | main.cpp | /***********************
author:code-grass
**********************/
#include<iostream>
using namespace std;
#include<vector>
#include<time.h>
#include<algorithm>
#include<unordered_map>
#include<fstream>
#include<queue>
//#define TESTCODE //本地运行
#define SUBMITCODE //提交代码
#ifdef TESTCODE //本地运行
#define ReadFileP... | ALGO | 0.999908 | 3.790582 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-05-20T01:56: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": "a0266b1f68... |
cee5fca3-de4d-4b6b-be15-075095122480 | Hidden-Forest/Grade_one | test_5_8/test_5_8/源.cpp | #define _CRT_SECURE_NO_WARNINGS 1
//#include<stdio.h>
//int main()
//{
// int arr[10];
// for (int i = 0; i < 10; i++)
// {
// scanf("%d", &arr[i]);
// }
// int max = arr[1];
// int min = arr[1];
// for (int i = 0; i < 10; i++)
// {
// if (arr[i] >= max)
// {
// max = arr[i];
// }
// if (arr[i] <= min)
// {
// ... | ALGO | 0.998277 | 3.342222 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2020-03-30T09:58: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": "c3e29ceb7... |
f6ad614c-8527-4a4a-b05d-7f7ceece7390 | HyeminBaek/CS-Algorithm_Study | 11~20주차/15주차/김도영/SWEA/1.cpp | #include<iostream>
#include <cstring>
using namespace std;
int n;
int map[10][10];
pair<int, int> movdir[] = {{1, 0}, {0, -1}, {-1, 0}, {0, 1}};
int main(int argc, char** argv)
{
int test_case;
int T;
cin>>T;
for(test_case = 1; test_case <= T; ++test_case)
{
memset(map, 0, sizeof(map));
cin >> n;
... | ALGO | 0.999838 | 3.419216 | {
"github_metadata": {
"branch": "main",
"commit_count": 1123,
"repo_created_at": "2021-01-10T05:56:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebf5e9de2... |
70a6fe81-26e7-4f8e-bdca-e9263b28de8c | nouhjaber/c- | c++/c++/notes/if&&else/if-elseLadder.cc | #include <iostream>
using namespace std;
int main ()
{
//? 3. **if-else if-else ladder**: Allows checking multiple conditions in sequence. || (**تسلسل if-else if-else**: يسمح بالتحقق من عدة شروط بالتسلسل)
int num;
int even = 0, odd = 0, pos = 0, zero = 0, neg= 0;
cin >> num;
if (num % 2 ==... | ALGO | 0.999718 | 4.492543 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-12-06T17:33: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": "3f485f458f4... |
67d90904-57b7-4947-aa0a-04497e4b8291 | hadiuzzaman524/heavy-task- | 1/main.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Suppose, there is a sequence of 5 numbers. Numbers are in random order, Write a program that will find
the missing number in the sequence.
Input:
9 18 6 3 12
Output:
15
*/
int findGCDOfTotalArray(vector<int> arr, int n)
{
int result = arr[0];
for (int i = 1; i... | ALGO | 0.999919 | 4.090562 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-12-28T18:46:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aff19c0c2986... |
88a8076e-1a5b-4323-8a89-e403cb693395 | tewarideepak/dsa-training | Day-03/complement_of_number.cpp | int bitwiseComplement(int n){
int ans = 0, mul = 1, rem;
if (n == 0) return 1;
while(n){
rem = n % 2;
rem = rem ^ 1;
n /= 2;
ans = ans + rem * mul;
mul *= 2;
}
return ans;
}
// Approach:
// Find the number of bits in the binary representation of n:
//... | ALGO | 0.999997 | 5.895875 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2025-02-09T16:06: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": "4746ff05fa3... |
b18e430a-9a75-4f51-8eb8-3d2d827b2557 | TristramAr/LeetcodeCode | leetcode/递归回溯分治/46全排列.cpp | #include <iostream>
#include <vector>
#include <set>
using namespace std;
class Solution
{
public:
vector<vector<int>> permute(vector<int> &nums)
{
vector<int> item;
vector<vector<int>> result;
set<int> path;
backtrack(nums, result, path, item);
return result;
}
pri... | ALGO | 0.999996 | 5.617952 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-10-07T02:49: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": "2197a6d556... |
1aa0615b-6d8d-4d54-8587-d1b3bc46538f | HockageDano/lab44 | lab44/Source.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
double x, xp, xk, dx, R, y;
cout << "xp = "; cin >> xp;
cout << "xk = "; cin >> xk;
cout << "dx = "; cin >> dx;
cout << "R = "; cin >> R;
cout << "<NAME>";
cout << fixed;
cout << "---------------------------" << endl;
cou... | ALGO | 0.99845 | 3.681973 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-10-25T09:57:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7498f76dd5... |
bad21c08-2b45-4efa-83df-467553bab79a | PhoenixChheav/Spring2023_CSCI241 | Assign2/hanoi.cpp | //***************************************************************************
//
// hanoi.cpp
// CSCI 241 Assignment 2
//
// <NAME> (Z-ID: Z1980761)
// <NAME>(Z-ID: Z1966108)
//***************************************************************************
#include <string>
#include <cctype>
#include <cstdlib>
#includ... | ALGO | 0.996123 | 5.021962 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2023-02-21T20:42: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": "186bbabc4... |
6b39960c-0ea9-40bd-bbf0-27e5a64e11e7 | gky360/contests | atcoder/abc149/e/Main.cpp | /*
[abc149] E - Handshake
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
#define ALL(c) (c).begin(), (c).end()
const int MAX_N = 1e5;
const int MAX_A = 2 * 1e5;
int N;
ll M;
int A[MAX_N];
int c[MAX_A + 1];
ll... | ALGO | 0.999992 | 4.685831 | {
"github_metadata": {
"branch": "master",
"commit_count": 1196,
"repo_created_at": "2017-12-10T10:00: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": "130ab0a... |
c0922ac2-9fb0-4c58-8c75-5f3c669d1e24 | CrazyCoders001/Assignements | VVP-TY/CSE-Electronics/57_Navin/String/program3.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
// 3. Count Vowels and Consonants
cout << "3. Count Vowels and Consonants" << endl;
string str1;
int vowels = 0, consonants = 0;
cout << "Enter a String : ";
cin>>str1;
for (int i = 0; i < str1.length(); i++) {
... | ALGO | 0.998904 | 4.559428 | {
"github_metadata": {
"branch": "main",
"commit_count": 145,
"repo_created_at": "2025-06-13T05:54:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c55e98da08... |
e5e0d1f5-d6af-4cc7-84f8-2062be7f4571 | ishandutta2007/codeforces-a | alan233/normal/1592/C.cpp | // Author: wlzhouzhuan
#pragma GCC optimize(2, 3, "Ofast")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pb push_back
#define fir first
#define sec second
#define rep(i, l, r) for (int i = l; i <= r; i++)
#define per(i, l, r) for (in... | ALGO | 0.999962 | 4.885562 | {
"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": "5397c7f32533... |
28d97216-f84b-4289-94c0-02663300ad67 | autocore-ai/AutowareAuto | src/control/trajectory_follower/src/interpolate.cpp | // Copyright 2018-2021 The Autoware Foundation
//
// 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 law... | ALGO | 0.998501 | 7.595642 | {
"github_metadata": {
"branch": "master",
"commit_count": 1458,
"repo_created_at": "2021-05-27T23:50:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 45,
"forks": 26,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e39d3d... |
accfa288-b535-4242-bac3-a9485a672322 | Soumil-07/leetcode | easy/kdistanceIndices.cpp | // https://leetcode.com/problems/find-all-k-distant-indices-in-an-array/
class Solution {
public:
vector<int> findKDistantIndices(vector<int>& nums, int key, int k) {
deque<int> keyPositions;
vector<int> ret;
for (int i = 0; i < nums.size(); i++) {
if (nums[i] == key)
... | ALGO | 0.999985 | 6.633003 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-24T12:29: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": "26fe6ea11dec... |
9a90dc0b-fd2e-427f-b8f8-888ad9c2d96f | lr580/algorithm_template | code/p4718_pollard_rho_old.cpp | #include <bits/stdc++.h>
using namespace std;
#define sc(x) scanf("%lld", &x)
typedef long long ll;
ll qpow(ll a, ll b, ll p)
{
ll r = 1;
for (; b; b >>= 1)
{
if (b & 1)
r = (__int128)r * a % p;
a = (__int128)a * a % p;
}
return r;
}
bool millerRabin(ll p)
{ // 判断素数
i... | ALGO | 0.999957 | 3.977004 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2022-03-24T05:19:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d255d77a... |
150ca533-a28b-4595-b1c4-728028c1be5b | Ujjwal-Kaushal/Cp-Codes | B_Set_of_Strangers.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAX_N = 700;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
void dfs(int i, int j, int color, vector<vector<int>>& grid, vector<vector<bool>>& visited, vector<pair<int, int>>& component) {
int n = grid.size(), m = grid[0].size();
... | ALGO | 0.999965 | 5.910029 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2025-06-16T21:24:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1af3f4eb6b6... |
00205fbc-7b2a-43ed-95e9-d6fa9a09d052 | SergeyKozhin/SAP_OS | task.cpp | /*********************************/
/* task.c */
/*********************************/
#include <cstdio>
#include "sys.h"
#include "rtos_api.h"
int findPriority(int period) {
for (int i = MAX_TASK - 1; i >= 0; --i) {
if (System->Priorities[i] == period) {
return i;
... | TOOL | 0.995478 | 4.552637 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-04-22T21: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": "2950e4bc85c4... |
724e9a8a-cc7d-4eb4-8559-fd0aadbb8779 | LukasCastillo/apio-notebook | solves/2.2.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
const int MOD = 1000000000;
struct SeggsTree{
SeggsTree *l = 0, *r = 0;
int low, high;
struct Data{
ll sum, maxW;
int size;
int maxId;
Data() {size = 0;sum=0;maxId=-1; maxW =-1;}
Data(ll sm, i... | ALGO | 0.999655 | 4.535934 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-16T16:25: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": "dce33902c04c... |
026e4e55-08c2-458c-aa9f-1397708708df | mruxim/codeforces | 351/CF351B.cpp | // .... .... .....!
// P..... C.....!
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <cassert>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <numeric>
#include <cstdio>
#include... | ALGO | 0.995919 | 3.089582 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-04-10T12: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": "5c6915d9f9... |
b30d8065-8290-4abd-b60c-7bebb972313d | hoonably/PS | 백준/Gold/31790. 간단한 문제/간단한 문제.cc | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef pair<int,int> pii; typedef pair<ll,ll> pll;
typedef tuple<int,int,int> tiii;
const int dx[6] = { 1,0,0,-1,0,0 };
const int dy[6] = { 0,1,-1,0,0,0 };
const int dz[6] =... | ALGO | 0.999993 | 3.839801 | {
"github_metadata": {
"branch": "main",
"commit_count": 1856,
"repo_created_at": "2023-12-13T05:33:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d34f6c61e... |
f5be0a29-ea10-4d8d-96a5-8413121a7de0 | Watzum/satsat | solver/src/DimacsReader.cpp | //
// Created by <NAME> on 08.02.2025.
//
#include "include/DimacsReader.h"
#include <iostream>
#include <limits>
#include <map>
#include <string>
#include "include/CNFFormula.h"
#include "include/Dimacs.h"
#include "include/DimacsFormatException.h"
DimacsReader::DimacsReader(CNFFormula& formula): relation(formula)... | TOOL | 0.926932 | 5.47417 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2025-01-31T17:20: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": "5954d46bd65... |
04c86da3-0603-486f-a7ec-7a91b12112d9 | luanaamorim04/competitive_programming | DIV3/neps/c.cpp | #include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <iomanip>
#include <map>
#include <cstring>
#include <set>
#include <stack>
#include <bitset>
#define ll long long
#define INF (1e9)
#define MAX (int) (2e5 + 5)
#define MOD 1000000007
#define par pair... | ALGO | 0.999982 | 3.370106 | {
"github_metadata": {
"branch": "master",
"commit_count": 471,
"repo_created_at": "2020-09-20T23:27:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24c6c495... |
b072095e-cb7c-4752-a276-fda1cc629057 | believe-that-23/codechef_p | infinity_21/a.cpp | #include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define endl "\n"
#define fi first
#define se second
#define pb push_back
#define ppb pop_back()
#define pf push_front
#define ppf pop_front()
#define eb emplace_back
#define mp make_pair
#define ll long long
#define ll... | ALGO | 0.999911 | 3.995447 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-05-23T14:40: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": "c3fb5c0a1f5... |
750fffe7-d208-45f7-b6f5-545b78035604 | d2school/da4qi4 | src/utilities/des3_utilities.cpp | #include "daqi/utilities/des3_utilities.hpp"
#include <cstdlib>
#include <cstring>
#include <vector>
#include "openssl/des.h"
namespace da4qi4
{
namespace Utilities
{
std::string DESEncrypt(std::string const& clearText, std::string const& key)
{
DES_cblock keyEncrypt;
std::memset(keyEncrypt, 0, 8);
if ... | TOOL | 0.941554 | 6.895944 | {
"github_metadata": {
"branch": "master",
"commit_count": 243,
"repo_created_at": "2019-04-04T13:48:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 157,
"forks": 42,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1970... |
3ef91a9c-78fe-4abe-a828-83d3b380f7b7 | yahiafarghaly/ELC-303B-Computer3 | File Analysis tool and Small Search Engine using in-order linked list/inord_list.h | /*
* InOrderLinkedList.h
*
* Created on: Mar 23, 2016
* Author: Yahia
*/
#ifndef INORD_LIST_H_
#define INORD_LIST_H_
using namespace std;
#include<string>
#include<iostream>
#include <algorithm>
#include<assert.h>
#include<vector>
#define _INVALID_STR "INVALIDSTR#@!"
struct WORD_DATA_t
{
string _word;
u... | ALGO | 0.998477 | 4.390644 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-10-20T19:40: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": "d8ce5477d7... |
6e168ce3-ae89-4c33-b8cb-2f88c5ab3422 | shashikantkaushik/DSA | binary search/34. Find First and Last Position of Element in Sorted Array.cpp | //
// 34. Find First and Last Position of Element in Sorted Array.cpp
// C++ DSA
//
// Created by <NAME> on 05/07/23.
//
int firstocc(vector<int> nums , int target)
{
int start = 0;
int end = nums.size() -1;
int mid = start + (end - start)/2;
int value = -1;
while(start <= end)
{
... | ALGO | 0.999864 | 6.258855 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2023-06-29T18:59: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": "00c1a617f73... |
99eedb94-4346-49d7-9f3a-5be6732b5fb0 | Avinash-31/dsa | dp/8minimumPathSum.cpp | // using memoization
class Solution {
public:
int fn(int i,int j,vector<vector<int>> &grid,vector<vector<int>>&dp){
//base case
if(i==0 && j==0){
return dp[0][0] = grid[0][0];
}
if(i<0 || j<0){
return 1e9;
}
if(dp[i][j]!=-1){
return... | ALGO | 0.999981 | 6.202766 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-05-15T11:50:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3af05f4725b... |
a9932544-0b66-4e8b-a64d-39624c735ba7 | kuuhaku0721/LeetCode-master | LeetCodeString/LeetCodeString/13罗马数字转整数.cpp | #include <iostream>
#include <string>
#include <map>
using namespace std;
/*
* 罗马数字包含以下七种字符: I, V, X, L,C,D 和 M。
字符 数值
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
例如, 罗马数字 2 写做 II ,即为两个并列的 1 。12 写做 XII ,即为 X + II 。 27 写做 XXV... | ALGO | 0.999446 | 4.25262 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2024-02-17T05:51: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": "f3f78df62a3... |
b2d24d0d-a4bb-4ab1-aaab-c46976564f8e | luobuyu/Code-test-daily | nowcoder/round13/A.cpp | // #pragma GCC optimize(2)
#include <bits/stdc++.h>
#define ll long long
#define lll long long
#define PII pair<int, int>
namespace FAST_IO
{
inline char nextChar()
{
static char buf[1000000], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ?... | ALGO | 0.999983 | 3.779016 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2021-09-10T08:03: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": "6c5d03dc... |
42a0ad2c-4b49-45b1-8e37-ae77ce933a58 | Jayashsatolia403/CP | Leetcode/Practice/1642_Furthest_Building_You_Can_Reach.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int furthestBuilding(vector<int>& v, int b, int l) {
priority_queue<int, vector<int>, greater<int> > pq;
vector<int> diffs;
int n = v.size();
for (int i=1; i < n; i++) {
diffs.push_back((v[i] <= v[i... | ALGO | 0.999954 | 4.437387 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2021-11-25T05:26:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "494cc2a5882... |
5eb4d80d-2720-4f5f-9611-d887dc0643f4 | GyeongminY/Algorithm | 백준/Gold/1759. 암호 만들기/암호 만들기.cc | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int n, m;
char str[16];
char arr[16];
bool isused[16];
void func(int k) {
if (k == n) {
bool a = false, b = false;
int acnt = 0, bcnt = 0;
for (int i = 0; i < n; i++) {
if (arr[i] == 'a' || arr[i] == 'e' || arr[i] == 'i' || arr[i... | ALGO | 0.999883 | 3.517997 | {
"github_metadata": {
"branch": "main",
"commit_count": 106,
"repo_created_at": "2023-08-13T01:37:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14b5209389... |
36ae2fbd-9fde-4651-8b57-8d60ed0a9e4c | OpenPPL/ppl.cv | src/ppl/cv/x86/integral.cpp | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... | ALGO | 0.990809 | 5.487491 | {
"github_metadata": {
"branch": "master",
"commit_count": 307,
"repo_created_at": "2021-06-30T13:12:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 507,
"forks": 115,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a208... |
5d57f4ca-2a8e-44f1-bd47-a7aa9b87b35c | Vaishnavi2701-mk/Data_Structure_CPP_Coding_Ninjas | Graph-1/HasPath.cpp | /*
Code : Has Path
Given an undirected graph G(V, E) and two vertices v1 and v2 (as integers), check if there exists any path between them or not. Print true if the path exists and false otherwise.
Note:
1. V is the number of vertices present in graph G and vertices are numbered from 0 to V-1.
2. E is the number of e... | ALGO | 0.999939 | 4.820893 | {
"github_metadata": {
"branch": "main",
"commit_count": 649,
"repo_created_at": "2022-03-07T07:16:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50dc62f2b2... |
88abcd05-e51c-4802-9b2d-8702bfbad6be | GopherTeen/OJ_Code | Problems/nowcoder/练习赛 132/B.江.cpp | // Date: 2024-11-30 星期六
#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#endif
using namespace std;
using ll = long long;
static constexpr int MOD = 1'000'000'007;
void solve() {
int n, m, k;
cin >> n >> m >> k;
vector<int> a(n);
for (int& v : a) {
cin >> v;
}
ranges::so... | ALGO | 0.999851 | 5.110114 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2024-11-01T07:27: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": "3cf1d1a51... |
08a0a2ee-e1c7-4b23-a544-0af3bf0411e4 | tsuyosshi/Atcoder | templates/BeamSearch.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define ALL(x) (x).begin(),(x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
typedef pair<int,int> PI;
typedef pair<int,pair<int,int>> PII;
static const int INF=1010000000000000017LL;
static const double eps=1e-12;
sta... | ALGO | 0.999989 | 3.899193 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2022-07-17T05:18:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "439ea2d10... |
de46240d-49d9-465d-a745-db94a2241ce8 | floreezyy/cmps116-IoT | dev/rkhamamo/src/utils/emissions/HelpersHBEFA.h | /****************************************************************************/
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
// Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
/****************************************************************************/
//
// This prog... | ALGO | 0.988925 | 6.447838 | {
"github_metadata": {
"branch": "master",
"commit_count": 134,
"repo_created_at": "2019-02-05T19:41:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "325c27e2... |
11eac7a7-10c6-4203-8561-c2e9251b3aef | dagangfang/leetcode | daily/20220614#498/Solution.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <deque>
#include <limits.h>
#include <string.h>
#include <stack>
#include <string>
#include <list>
#include <queue>
using namespace... | ALGO | 0.999991 | 5.207354 | {
"github_metadata": {
"branch": "main",
"commit_count": 312,
"repo_created_at": "2020-11-18T06:06: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": "f1d8db16d7... |
38e55f79-50f5-4de0-b991-05fed58bf320 | fkrafi/UVa | 10944.cpp | #include<stdio.h>
#include<string.h>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
typedef pair<int, int> pii;
int R, C, H;
pii S;
queue<pii> Q;
vector<pii> hash;
char grid[25][25];
int mem[1<<16][21];
int seen[20][25][25], cst[20][25][25], vst=1;
int dr[] = {-1, -1, -1, 0, 0, 1, 1, 1};
i... | ALGO | 0.999371 | 3.323722 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2012-12-09T07:30:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c0fa497aa... |
8481a748-35f0-4608-8ead-c99eb9c5912c | sharanabasavakallur/Data-Structures-cplusplus- | 10basicmath.cpp |
//1.finding prime numbers <= given no.
//(naive method)
/*#include<iostream>
using namespace std;
bool isPrime(int n)
{
for(int i=2;i*i<=n;i++){
//i*i becoz n has pair of devisors and small divisor among them is always <= sqroot(n)
//let n=20 pair of devisors>=2 are (2,10) & (4,5) and 2,4 are <= s... | ALGO | 0.999659 | 3.170597 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-05-23T14:06:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8eb09ce556a... |
bf76134c-6188-4066-b8d2-07165f7b4752 | Shivamkumar26/Leetcode-Solutions | DFS of Graph - GFG/dfs-of-graph.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
void traverse(int start, vector<int> adj[],
vector<int>& vis, vector<int>& dfs) {
vis[start] = 1;
dfs.push_back(start);
for(auto it: adj[start]) {
if(!vis[it])
... | ALGO | 0.999961 | 6.494508 | {
"github_metadata": {
"branch": "main",
"commit_count": 1157,
"repo_created_at": "2022-09-25T06:03:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5aa9a0d4f... |
91b4c430-bb4d-4d50-a26d-a47ec252d9a4 | dude003/dsa | heap.cpp | /*Implementation of heap data structure using heap sort in cpp*/
#include <iostream>
using namespace std;
class heap1
{
public:
void heapify(int arr[], int n, int i)
{
int largest = i;
int l = 2 * i + 1;
int r = 2 * i + 2;
if (l < n && arr[l] > arr[largest])
{
... | ALGO | 0.999944 | 5.228261 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-06-05T14:56: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": "1e3798f2ba98... |
0afa8387-1583-43f3-8dbe-8c2babd66d9f | biribas/icpc | brazil-subregional/2024/I.cpp | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
#define SETUP ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define MAX_VALUE 1000000
#define MAX_FOOD 100000
#define MOD 1000000007
int main(void) {
SETUP
// spf[n] = smallest prime factor of n
vector<int> spf(MAX_VALU... | ALGO | 0.99989 | 4.444468 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-22T02:54:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49b657061ad4... |
f9c86c82-99ae-484e-8c2c-a78cbbac93e4 | anjalipathak13/Practice-Leetcode-Question | 1029-two-city-scheduling/1029-two-city-scheduling.cpp | class Solution {
public:
// typedef pair<int, int> pi;
static bool cmp(int a,int b)
{
return a>b;
}
int twoCitySchedCost(vector<vector<int>>& costs) {
/* priority_queue<pi, vector<pi>, greater<pi> > p1;
int n=costs.size();
priority_queue<pi, vector<pi>, greater<pi> > p2... | ALGO | 0.999977 | 5.662599 | {
"github_metadata": {
"branch": "main",
"commit_count": 2551,
"repo_created_at": "2021-10-31T12:05:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "00ee7516c... |
396ed83a-5806-4287-a046-67c10a3bc3bc | deepak-tiwarrri/Data_Structures_And_Algo | Array/3Sum.cpp | #include <bits/stdc++.h>
using namespace std;
vector<vector<int>> threeSum(vector<int> &nums)
{
// brute will be to use three loop
// sort the nums and store in set<vector<int>>
// and then return it
// set<vector<int>> stt;
// for (int i = 0; i < nums.size(); i++)
// {
// for (int j = i + 1; j ... | ALGO | 0.999891 | 5.514982 | {
"github_metadata": {
"branch": "main",
"commit_count": 136,
"repo_created_at": "2022-10-30T15:09:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3810d5284f... |
49ffcc4d-39a3-4c2e-a84e-3ce4c29abebf | binary-ho/BaekjoonRecord | 백준/Gold/16929. Two Dots/Two Dots.cc | #include<iostream>
#include <string>
#include <stack>
#include <vector>
//#include <algorithm>
//#include <queue>
//#include<cstring>
using namespace std;
pair<int, int> prev_node[51][51];
int N, M;
bool check[51][51];
string s[51];
stack<pair<int, int>> stack_1;
//vector<int> vec[50][50];
// x는 아래가 플러스, y는 오른쪽이 플러스... | ALGO | 0.999995 | 4.946464 | {
"github_metadata": {
"branch": "main",
"commit_count": 436,
"repo_created_at": "2022-04-28T20:55:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f6de361de... |
f3b9ee4e-1c29-4566-9524-66a3e8723e23 | vick-254/DSAlgo_Practice | Phase 2/Backtracking/mazeObstacles_allPaths.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
void mazeAll(string p, int r, int c, vector<vector<bool>> maze)
{
if (r == maze.size() - 1 && c == maze[0].size() - 1)
{
cout << p << endl;
return;
}
if (!maze[r][c])
{
return;
}
maze[r][c] = false;
... | ALGO | 0.999712 | 4.096448 | {
"github_metadata": {
"branch": "main",
"commit_count": 250,
"repo_created_at": "2023-06-14T11:50:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "593662c6e1... |
59b5ed13-a6b6-44d4-9e2f-74d1692eef9c | Sekakou/OIsrc | algorithm/offline/mo-algo/ordinary/loj3751necklace.cpp | #include <bits/stdc++.h>
using namespace std;
namespace IO
{
const int S = 1 << 20;
char B[S], *H = B, *T = B;
inline int gc() { return (H == T) && (T = (H = B) + fread(B, 1, S, stdin), H == T) ? EOF : *H++; }
template <typename T = int>
inline T input(T *p = nullptr)
{
static T *o = new... | ALGO | 0.999974 | 3.987334 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2023-01-17T01:23: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": "18415774... |
0eb32cce-02a1-441f-b577-2140dd9d6d36 | ishandutta2007/codeforces-y | yuu/normal/1592/C.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k;
int a[100001];
bool done[100001];
int x[100001];
vector <int> g[100001];
void dfs(int u) {
done[u] = 1;
x[u] = a[u];
for (int v : g[u])
if (!done[v]) {
dfs(v);
x[u] ^= x[v];
}
}
int get(int u, bool p0 = 0) {
... | ALGO | 0.999962 | 4.765099 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40: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": "2e0a6035f437... |
17b41337-4e4e-41a3-a4ae-3c3daec40254 | openvinotoolkit/openvino | src/common/transformations/src/transformations/common_optimizations/interpolate_sequence_fusion.cpp | // Copyright (C) 2018-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "transformations/common_optimizations/interpolate_sequence_fusion.hpp"
#include <algorithm>
#include <memory>
#include <numeric>
#include <tuple>
#include <utility>
#include <vector>
#include "itt.hpp"
#include "openvino/... | ALGO | 0.967549 | 6.553104 | {
"github_metadata": {
"branch": "master",
"commit_count": 19551,
"repo_created_at": "2018-10-15T10:54:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8597,
"forks": 2656,
"issues": 303,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
afc75b03-74a8-4959-b1b9-7eb8199a10fd | huanyizhiyuan/ICPC-workspace | 2024CCPC上海省赛/A.cpp | #include<bits/stdc++.h>
#define i64 long long
#define int i64
using PII = std::pair<int, int>;
using TIII = std::tuple<int, int, int>;
constexpr int inf = 1e18 + 5;
constexpr int mod = 1e9 + 7;
int n, m, k;
std::vector<std::vector<int>> a;
void solve()
{
std::cin >> n >> m;
n ++, m ++;
a.assign(n + 1, std:... | ALGO | 0.99994 | 3.406231 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-20T12:09: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": "0fe3486ea2d4... |
88730591-3be1-426a-bec8-4f3d0c05de4a | Chesterfun/CodingInterviews | src/leetcode114.cpp | //
// Created by shmil on 2019/8/31.
// 二叉树转链表:给定一个二叉树,就地转换为单链表,单链表中节点顺序为二叉树前序遍历顺序。就地转换意思是不能额外申请空间储存链表
//
#include <iostream>
#include <stdio.h>
#include <stack>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x): val(x), left(nullptr), right(nullptr) {}
... | ALGO | 0.999977 | 5.060565 | {
"github_metadata": {
"branch": "master",
"commit_count": 100,
"repo_created_at": "2019-05-07T03:38:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d1cb12d... |
37a28317-b22c-4dda-bfc9-f68e521378af | ishandutta2007/codeforces-h | heart_blue/normal/1027/B.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999794 | 3.632209 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb922a884daa... |
d171a876-2399-4317-97fe-45462d6714d3 | greysondn/tas-stuff | cpp/nds/spanish_for_everyone/wordsearch.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <vector>
// WSL - i686-w64-mingw32-g++ -static-libgcc -static-libstdc++ -o name.exe name.cpp
#include <windows.h>
// I'm being lazy, fix your own code.
using namespace std;
// load dictionary, nothing fancy
vector<string> loadDictionary()
{
// eve... | TOOL | 0.915406 | 4.038783 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2021-04-02T06:04: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": "540c99a6a... |
f15bc8b0-6f5e-49e5-bed9-27510939658a | samusamusam/CS5330_Spring2024 | Project 3/segment.cpp | /*
<NAME>
<NAME>
2/22/24
This file contains functions to create a region map and color the region map.
*/
#include <unordered_set>
#include <cstdio>
#include <cstring>
#include <queue>
#include "opencv2/highgui.hpp"
#include "opencv2/opencv.hpp"
using namespace std;
using namespace cv;
/**
* This function c... | ALGO | 0.992126 | 6.839455 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-02-04T03:21: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": "5881bbe84ac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.