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 |
|---|---|---|---|---|---|---|---|
e3749151-8da2-4c1f-aa73-5ce47b871f84 | urparvezali/codes | cds3/A_Boys_and_Girls.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<char> vchar;
typedef vector<string> vstr;
typedef vector<pll> vpll;
typedef map<ll,ll> mll;
typedef map<string,ll> mstrl;
signed main(){
ll b,g; cin>>b>>g;
if... | ALGO | 0.99982 | 3.771741 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2023-10-08T18:33: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": "e7b4819ac31... |
f74ac52c-9784-4929-8d4b-6817ac1e32de | lusongno1/drops | src/num/lattice-eval.tpp | /// \file lattice-eval.tpp
/// \brief Implementation of template-methods
/// \author LNM RWTH Aachen: <NAME>; SC RWTH Aachen:
/*
* This file is part of DROPS.
*
* DROPS is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free ... | ALGO | 0.99922 | 6.306047 | {
"github_metadata": {
"branch": "master",
"commit_count": 62,
"repo_created_at": "2020-06-04T05:38: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": "693e449b6... |
3dd7b10c-b2ef-44fe-9add-d6e29b6ff918 | RapsarKM/ArduinoHandController | Hand_Controller/Hand_Controller.ino | const int Flex0 = A0; //pin connectd to voltage output
const int Flex1 = A1;
const int Flex2 = A2;
const int Flex3 = A3;
const int Flex4 = A4;
const float VCC = 4.48;//actual voltage of Arduino 5v line
const float Resist0 = 10000;// Measured resistance of resistor
const float Resist1 = 10000;
const float Resist2 = ... | ALGO | 0.94105 | 4.576355 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-05-17T18:48: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": "4725fccfb3... |
78455fd2-3b88-402e-ae2b-204b4f31cef8 | ray42/CppStudyPublic | CppPrimer/srcEd5/ch03StringsVectorsAndArrays/exer3-44.cpp | /*
* =========================================================================
* Author: Dr. <NAME> (Zwei), <EMAIL>
* =========================================================================
*/
#include<iostream>
#include<vector>
#include<string>
#include<iterator> // begin, end
using std::cout; using st... | TOOL | 0.91119 | 4.677285 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-03-07T12:09:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f585b549... |
ca8d5f65-479a-4679-aedf-945fad54c81b | lovebaonvwu/leetcode-cpp | 2021/lowest_common_ancestor_of_a_binary_search_tree.cc | /**
* 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:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
return p->val < ... | ALGO | 0.999996 | 6.944901 | {
"github_metadata": {
"branch": "master",
"commit_count": 2622,
"repo_created_at": "2019-04-21T11:29:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f4ee45a... |
e0c41e29-b77c-4013-9990-a2192bfd34a8 | Yugior/CodeforceSolutions | Problems/Cuthuluh_Graph/main.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <functional>
using namespace std;
// Función para verificar si el grafo es conexo
// Complejidad: O(n + m), ya que utiliza BFS para recorrer todos los nodos y aristas.
bool isConnected(int n, vector<vector<int>>& adj) {
vector<bool> visited(n + 1, fa... | ALGO | 0.999989 | 5.228718 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-11-28T03:34: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": "bbb50300b0f... |
27b3f4e1-e78f-4c93-b1f9-667e145fb221 | thuang86714/LeetCode_Cpp | 473_Matchstick_to_Square.cc | //https://leetcode.com/problems/matchsticks-to-square/solutions/1273756/c-simple-and-clean-backtracking-commented-solution/
//a more practical solution
class Solution {
public:
bool makesquare(vector<int>& matchsticks) {
int sum = accumulate(matchsticks.begin(), matchsticks.end(), 0);
if(sum%4)retur... | ALGO | 0.999935 | 5.78801 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2022-12-07T09:13: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": "3a21b236937... |
b479491e-5639-4b29-aa2c-779a6746bcfe | alexandraback/datacollection | solutions_6404600001200128_1/C++/johnchen902/A.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
int m[1000];
int solve1(int n) {
int sum = 0;
for(int i = 0; i + 1 < n; i++)
if(m[i] > m[i + 1])
sum += m[i] - m[i + 1];
return sum;
}
int solve2(int n) {
int max_diff = 0;
for(int i = 0; i + 1 < n; i++)
if(m[... | ALGO | 0.99975 | 3.201025 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cc3723680... |
fe946d2a-4861-4952-bb03-e5a029d08806 | sinkinben/cpp-impl-something | impl-thread-pool/thread_pool.hpp | /* Implement a thread pool in modern C++.
* Explanation: https://www.cnblogs.com/sinkinben/p/16064857.html
* Copyright: https://github.com/progschj/ThreadPool
*/
#include <future>
#include <iostream>
#include <mutex>
#include <queue>
#include <thread>
#include <vector>
namespace impl
{
class thread_pool
{
public... | TOOL | 0.990454 | 6.878244 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-12-02T10:38:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c07a7de70... |
cabfceaf-e744-4a74-aac3-3b14ba6c5e63 | GIBIS-UNIFESP/BIAL | bial/src/LSHGraphAdjacency.cpp | /* Biomedical Image Analysis Library
* See README file in the root instalation directory for more information.
*/
/**
* @date 2012/Sep/26
* Content: LSH graph adjacency.
*/
#ifndef BIALLSHGRAPHADJACENCY_C
#define BIALLSHGRAPHADJACENCY_C
#include "LSHGraphAdjacency.hpp"
#if defined ( BIAL_EXPLICIT_LIB ) && (... | ALGO | 0.989802 | 3.304916 | {
"github_metadata": {
"branch": "master",
"commit_count": 186,
"repo_created_at": "2016-10-03T02:55:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "ffeb1d12... |
0e3d9bef-69f4-44cd-b4fb-f0fa54217190 | nirbhaypandey1712/Array-part2-Assignments-solution-PW | C++ Array2.cpp/Array18.cpp | /*Q3 - Given a vector arr[] sorted in increasing order of n size and an integer x, find if there exists
a pair in the array whose absolute difference is exactly x.*/
#include <iostream>
#include <vector>
using namespace std;
void findPair(const vector<int>& arr, int x) {
int n = arr.size();
int i = 0;
int... | ALGO | 0.999993 | 5.075216 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-08T06:17: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": "287798e0c8f8... |
8116d4c3-28aa-4f4a-a698-dd053d0a627d | Mehulcoder/interviewbit | Array/Findpermutation.cpp | /*
Name: <NAME>
IIT-Guwahati
*/
/*
PROBLEM STATEMENT
Given a positive integer n and a string s consisting only of letters D or I, you have to find any permutation of first n positive integer that satisfy the given input string.
D means the next number is smaller, while I means the next number is greate... | ALGO | 0.999986 | 4.410305 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2019-07-27T17:20:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6994a3c7... |
50952b7d-4c29-4cce-99f1-293106d613af | yashSingodia/problem-solving | Algorithms/PrefixTrie.cpp | #include<bits/stdc++.h>
using namespace std;
class TrieNode {
public:
TrieNode* charArray[26];
bool isEndOfWord;
TrieNode() {
for(int i = 0; i<26; i++) charArray[i] = NULL;
isEndOfWord = false;
}
bool isPresent(char ch) {
return charArray[ch - 'a'] != NULL;
}
... | ALGO | 0.999804 | 4.365349 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2023-12-08T06:21: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": "b8f188e4583... |
e39e39cd-e249-437d-9c93-48f6abf24e92 | saivenkatyalamanchi/Cpp-codes | Heaps/heaps.cpp | #include<iostream>
using namespace std;
class Heap {
public:
int arr[100];
int size;
Heap() {
arr[0] = -1;
size = 0;
}
// T C = O(logn)
void insert(int val){
size = size + 1;
int idx = size;
... | ALGO | 0.999594 | 4.473902 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2024-08-04T04:51:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fabca1c17... |
b0025e14-891d-4410-8d59-2c860f69b356 | JohannaOttb00782280/04_practical | main.cpp | #include <iostream>
using namespace std;
double * read_poly(int &n){
cout << "the degree: ";
cin >> n;
double * c=new double[n+1];
for(int i=0;i<=n;i++){
cout << "coefficient of degree " << i << ": ";
cin >> c[i];
}
return c;
}
void print_poly(double *c, int n){
int i;
cout << c[0];
if(n>0)
... | ALGO | 0.999236 | 4.120414 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-26T12:01:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "29e1563523... |
4d23d74e-6beb-4f2c-84a4-0d23cae76c5d | iji-enow/ENOW-client | Vision/src/DetectRegions.cpp | /*
Copyright [2016] [<NAME>]
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 or agreed to in writing, software
dist... | ALGO | 0.994717 | 5.733744 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2016-08-12T08:34:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13c75f6fa9... |
b127607c-8f6b-4c54-9831-5ea71b8ced1e | dark-horse/grokkingcodeinterview | fastSlowPointers/palindromeLinkedList.h | using namespace std;
#pragma once
#include <vector>
/* url https://www.designgurus.io/course-play/grokking-the-coding-interview/doc/63922d27b689b698075a9ab3 */
/*
** Given the head of a Singly LinkedList, write a method to check if the LinkedList is a palindrome or not.
** Your algorithm should use constant space and... | ALGO | 0.999927 | 6.47286 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-12-11T23: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": "5e7202272f37... |
0a8fad95-30ed-45a4-b93e-f86a8838598f | vbonnici/grafe-sim | analysis/data/p02262/s928871885.cpp | #include <iostream>
using namespace std;
int cnt = 0;
void insertionSort(int a[], int n, int m) {
for (int i = m; i < n; i++) {
int key = a[i];
int j = i - m;
while (j >= 0 && a[j] > key) {
a[j + m] = a[j];
j -= m;
++cnt;
}
a[j + m] = key;
}
}
int main() {
int a[1000000];
... | ALGO | 0.999985 | 3.487929 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-07-10T13:21: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": "6849f353992... |
b8e72156-0de2-465f-a5c1-f1a80f53c5a7 | risal-shefin/Competitive-Programming | LightOJ/1219 - Mafia - 1255461.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <math.h>
#include <stdlib.h>
using namespace std;
#define ll long long
#define pb push_back
vector <ll> graph[10009];
ll par[10009], maf[10009], ans = 0;
ll dfs(ll u, ll p)
{
ll ret = maf[u] - 1;
for(ll i = 0; i < graph[u].size(); i++) {
l... | ALGO | 0.999569 | 3.728837 | {
"github_metadata": {
"branch": "master",
"commit_count": 139,
"repo_created_at": "2019-06-28T19:28:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8f1ab9... |
df76cafc-ec4b-4793-94ef-a456d6961eda | acmeism/RosettaCodeData | Task/Spiral-matrix/C++/spiral-matrix-1.cpp | #include <vector>
#include <memory> // for auto_ptr
#include <cmath> // for the ceil and log10 and floor functions
#include <iostream>
#include <iomanip> // for the setw function
using namespace std;
typedef vector< int > IntRow;
typedef vector< IntRow > IntTable;
auto_ptr< IntTable > getSpiralArray( int dimension )... | ALGO | 0.990608 | 5.384476 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2013-04-08T20:08:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 518,
"forks": 177,
"issues": 12,
"pull_requests": 3
},
"file_meta": {
"content_id": "53e859c... |
92b61272-6928-4398-aa04-bca083cfc0d6 | lyccrius/OI-Solution | CodeForces/786C Till I Collapse TLE.cpp | #include <iostream>
#include <set>
typedef std::set<int> sit;
const int maxN = 1e5;
const int sqrN = 317;
int n;
int a[maxN + 10];
int ans[maxN + 10];
int solve(int k) {
sit s;
int ret = 1;
for (int i = 1; i <= n; i++) {
s.insert(a[i]);
if (s.size() > k) {
s.clear();
... | ALGO | 0.999997 | 4.252882 | {
"github_metadata": {
"branch": "main",
"commit_count": 653,
"repo_created_at": "2022-09-28T05:47: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": "af90e68902... |
b6e97804-d46e-46f7-ac7e-882accf3f042 | guidol/DataStructure | HashTable/HashSet.cpp | #include<iostream>
#include<vector>
using namespace std;
#define MAX_LEN 100000
class MyHashSet{
private:
vector<int> set[MAX_LEN];
int getIndex(int key);
int getPosition(int key, int index);
public:
MyHashSet(){}
void add(int key);
void remove(int key);
bool contain... | ALGO | 0.998687 | 4.692286 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-10-22T00:49: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": "425bf2b608... |
ff4e7b45-1979-4181-aa75-95e38760cff0 | igortakeo/Competitive-Programing | Laboratório de Algoritmos Avançados 2/Aula-11 (Number Theory)/A.cpp | #include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define inf 0x3f3f3f3f
#define MAXN 16000000
#define fastcin ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
int spf[MAXN], f[MAXN];
void sieve() {
spf[1] = 1;
for (int i=2; i<MAXN; i++) sp... | ALGO | 0.999975 | 3.835882 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2019-06-15T04:05: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": "01e5edcbc... |
0f023048-e55c-4de6-b3d2-7f8c530c6382 | YosysHQ/yosys | libs/ezsat/testbench.cc | /*
* ezSAT -- A simple and easy to use CNF generator for SAT solvers
*
* Copyright (C) 2013 <NAME> <<EMAIL>>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice ap... | ALGO | 0.997684 | 5.384813 | {
"github_metadata": {
"branch": "main",
"commit_count": 15303,
"repo_created_at": "2013-01-05T10:10:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3933,
"forks": 973,
"issues": 482,
"pull_requests": 128
},
"file_meta": {
"content_id": "... |
6cd2a1fb-f7f2-4203-ba17-5b7cd56a6bde | canyang2022/cpp-Boot-Camp | Day1/Assignment1/Bouns/bounus2.cpp | /* You are designing a poster which prints out numbers with a unique style applied to each of them. The styling is
based on the number of closed paths or holes present in a giver number. The number of holes that each of the
digits from 0 to 9 have are equal to the number of closed paths in the digit. Their values are... | ALGO | 0.999745 | 4.679528 | {
"github_metadata": {
"branch": "main",
"commit_count": 49,
"repo_created_at": "2022-03-24T13:38: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": "0d98dd28a27... |
54073264-ed8f-4d9a-8be1-8204067bc5dd | ckdals4600/BaekJoon | 백준/Silver/2630. 색종이 만들기/색종이 만들기.cc | #include <iostream>
#include <vector>
using namespace std;
int whiteNum = 0;
int blueNum = 0;
void cut(int startX, int startY, int size, const vector<vector<int>> &map) {
int startColor = map[startY][startX];
bool isDiff = false;
for (int y = 0; y < size && !isDiff; y++)
for (int x = 0; x < size && !isDiff; x+... | ALGO | 0.99978 | 4.647363 | {
"github_metadata": {
"branch": "main",
"commit_count": 140,
"repo_created_at": "2023-09-01T07:24: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": "cd75665945... |
65b5f2cb-6583-47a0-81a4-1fb0ee40b355 | AakashKumar-Code/LeetCode-Daily_Practice | 1331-path-with-maximum-gold/path-with-maximum-gold.cpp | class Solution {
public:
int n, m;
int dr[4]={-1, 0, 1, 0};
int dc[4]={0, 1, 0, -1};
int solve(int sr, int sc, vector<vector<int>>& arr, vector<vector<bool>>& visited) {
if (sr < 0 || sr >= n || sc < 0 || sc >= m || arr[sr][sc] == 0 || visited[sr][sc]) {
return 0; // Base case: out ... | ALGO | 0.999897 | 6.155122 | {
"github_metadata": {
"branch": "main",
"commit_count": 695,
"repo_created_at": "2024-01-01T17:13: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": "d52d85393e... |
25e65c7d-d61c-46f0-91af-466d218a886c | alive-xd/HackerRank-ProjectEuler | Solution/39.cpp | #include <iostream>
#include <set>
#include <vector>
// greatest common divisor
unsigned int gcd(unsigned int a, unsigned int b) {
while (a != 0) {
unsigned int c = a;
a = b % a;
b = c;
}
return b;
}
int main() {
const unsigned int MaxPerimeter = 5000000;
// precomputation step 1:
// count al... | ALGO | 0.999892 | 4.740227 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2024-07-26T01:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4023f1f4b4d... |
1e130b73-be05-43f3-847a-8a9dcca1a939 | kadumkomut/14.Cpp-Gui-Project | Editor Files/NumberPuzzleProject/main.cpp | /*
Program : NUMBER PUZZLE USING WINBGIM GRAPHICS AND MOUSE FUNCTIONS
Written By : <NAME>
Flow Of The Program
-------------------
1.Getting the player name input
2.Setting up the graphic window in the numPuzzle Constructor
3.Run the start function - The intro of the game
4.Run the draw function - the draw ... | ALGO | 0.99751 | 4.014568 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-09-04T07:51:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1c40396de97... |
77e2fcd7-e555-4cd4-95ee-a664f3c7b05a | Sidharth-Agarwal/DSA-CPP | Linked Lists/13FindANodeInLinkedList.cpp | #include<iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
Node* takeInput()
{
int data;
cin >> data;
Node *head = NULL;
Node *tail = NULL;
while(data!=-1)
{
... | ALGO | 0.999876 | 4.689274 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2023-03-05T17:13:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e2b168b88... |
f819427d-ee5c-4b6c-b827-a9b86482be57 | EmptyDust/Algorithm-Codes-and-writeups | codes/0x60_graphs_and_trees/0x65_shortest_path/lgp1690.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int MAXN = 2e2;
int mp[MAXN][MAXN], qey[MAXN], vit[MAXN];
int p, n;
int ans = INT_MAX;
void dfs(int par, int cal, int ct) {
if (cal == p) {
ans = min(ans, ct + mp[par][n - 1]);
return;
}
for (int i = 0;i < p;++i)i... | ALGO | 0.999934 | 4.370269 | {
"github_metadata": {
"branch": "main",
"commit_count": 172,
"repo_created_at": "2023-11-03T02:38:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51e92dcb4d... |
11f188c4-1bf1-45e0-9379-1b0332e9a605 | ishandutta2007/codeforces-a | andrew/normal/1512/G.cpp | #include <bits/stdc++.h>
#define fi first
#define se second
#define p_b push_back
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define all(x) x.begin(),x.end()
#define sset ordered_set
#define sqr(x) (x)*(x)
#define pw(x) (1ll << x)
#define sz(x) (int)x.size()
#define fout(x) {cout << x; ret... | ALGO | 0.999659 | 4.048608 | {
"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": "e5ddeb0e9268... |
d3283dea-9fad-4233-ad03-1f4d6b8a6437 | nd-nuclear-theory/shell | libraries/tbme/tbme_radial_xform.h | /****************************************************************
tbme_radial_xform.h
Carries out radial basis transformation on two-body matrix elements.
Normalization convention: All matrix elements are stored as NAS
RMEs. These RMEs are stored under the group theory Wigner-Eckart
normalization conventio... | ALGO | 0.999409 | 6.944571 | {
"github_metadata": {
"branch": "master",
"commit_count": 815,
"repo_created_at": "2017-05-26T22:25:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "90636b77d... |
63857726-6380-434b-8cd7-d642801a0b83 | google/syzygy | syzygy/optimize/transforms/basic_block_reordering_transform.h | // Copyright 2013 Google Inc. All Rights Reserved.
//
// 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... | ALGO | 0.98337 | 7.7814 | {
"github_metadata": {
"branch": "master",
"commit_count": 3143,
"repo_created_at": "2014-09-03T23:55:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 375,
"forks": 59,
"issues": 41,
"pull_requests": 1
},
"file_meta": {
"content_id": "abe7... |
099f1bcf-f069-405c-b4ba-b1caa53021eb | ishandutta2007/codeforces-a | andr0901/normal/1303/B.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
//vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define fs first
#define sc second
#define... | ALGO | 0.999792 | 3.664694 | {
"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": "c2e0a34a9fea... |
f4f74fc6-ca50-49f4-968d-2f63c6652257 | kingofthebongo2008/examples | cache_aware_hybrid_sorter/src/app/private/main.cpp | #include "precompiled.h"
#include <cstdint>
#include <limits>
#include <assert.h>
namespace cahs
{
namespace loser_tree
{
static const uint32_t stream_count = 4;
struct loser_tree_node
{
float m_key; // compare nodes
uint32_t m_stream; // stream where we... | ALGO | 0.999269 | 4.191749 | {
"github_metadata": {
"branch": "master",
"commit_count": 325,
"repo_created_at": "2012-12-22T08:30:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "4612b9b1... |
b6d2acd6-06aa-429a-b80f-72d3d5037626 | algorithm-random-defense/algorithm_study | src/AS_23_11_week4/donghyun/9009.cpp | // 피보나치
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
vector<int> fibo, input;
void f(int target) {
vector<int> res;
int idx = fibo.size() - 1;
while (target > 0) {
while (fibo[idx] > target)
idx--;
target -= fibo[idx];
res.push_back(fibo[idx]);
}
for (int i = res.size... | ALGO | 0.999995 | 4.639398 | {
"github_metadata": {
"branch": "main",
"commit_count": 362,
"repo_created_at": "2023-11-20T14:52:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bae61915119... |
19884e26-dc23-4ba5-9e06-12e522169b78 | bakkiraju/sharpenskills | SearchAndSort/MergeSort.cc | #include <iostream>
using namespace std;
void printArray( int arr[ ], int n, string s)
{
cout << s << " ";
for (int i=0; i < n; i++)
{
cout << arr[i] << " ";
}
cout << endl;
}
void merge(int arr[], int l, int m, int r)
{
int s1 = (m-l) + 1;
int s2 = (r-m);
int L[... | ALGO | 0.999991 | 5.19076 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-07-10T22:54: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": "bcaba4205... |
b55a1d7f-8aef-4b2b-9617-7d8bc04a0c11 | solARisOP/Data-Structures-and-Algorithms | sde sheet/122_zig_zag_traversal_binary_tree.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vp vector<pii>
class Node
{
public:
int val;
Node *left;
Node *right;
Node() : val(0), left(NULL), right(NULL) {}
Node(int x) : val(x), left(NULL), r... | ALGO | 0.999991 | 4.122523 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2022-02-28T12:01: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": "4d96b06e2... |
42ebaa49-15ea-4946-9a70-bd510c37e267 | jackson-hidley/CSC-1310 | CSC 1310 Lab/Lab10/1310 Lab 10 Heap Given Files/1310 Lab 10 Heap Given Files/ArrayMaxHeap/DriverForMaxHeap.cpp | #include "ArrayMaxHeap.h"
#include <iostream>
#include <string>
using namespace std;
void display(string& anItem)
{
cout << "Displaying item - " << anItem << endl;
}
int main()
{
ArrayMaxHeap<string>* heap1Ptr = new ArrayMaxHeap<string>(2);
heap1Ptr->insert("10");
heap1Ptr->insert("20");
heap1Ptr->in... | ALGO | 0.922117 | 3.945595 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-09-01T14:24:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "869683498162... |
4da43ce9-2f49-487e-93d4-280593b21795 | AllergicMushroom/Applied-Algorithmics-M2 | src/AlgorithmMIP.cpp | #include "AlgorithmMIP.hpp"
#include <sstream>
#include "gurobi_c++.h"
Solution AlgorithmMIP::solveMinCenters(const Graph& graph, int radius)
{
Solution solution;
GRBVar* x;
GRBVar** c;
try
{
std::cout << "Creating the Gurobi environment... ";
GRBEnv env = GRBEnv(true);
... | ALGO | 0.999997 | 6.329108 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2021-10-10T20:59: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": "78ba6fb34... |
3e17dea7-4873-4116-ab97-45fd81d04f3c | nokotan8/coding-practice | leetcode/2_medium/1865_finding_pairs_with_certain_sum.cpp | #include <map>
#include <unordered_map>
#include <vector>
class FindSumPairs {
private:
std::unordered_map<int, int> nums2_freq;
std::map<int, int> nums1_freq;
std::vector<int> nums2;
public:
FindSumPairs(std::vector<int> &nums1, std::vector<int> &nums2)
: nums2(nums2) {
for (int n... | ALGO | 0.999909 | 6.324033 | {
"github_metadata": {
"branch": "main",
"commit_count": 200,
"repo_created_at": "2025-04-30T05:34: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": "607b747f94... |
e3236fe5-c552-436d-88fe-19f32e4d99c0 | Gpax971/COMP4610-HW4 | code/BVH.cpp | #include <algorithm>
#include <cassert>
#include "BVH.hpp"
#include<float.h>
BVHAccel::BVHAccel(std::vector<Object*> p, int maxPrimsInNode,
SplitMethod splitMethod)
: maxPrimsInNode(std::min(255, maxPrimsInNode)), splitMethod(splitMethod),
primitives(std::move(p))
{
time_t start, stop;... | ALGO | 0.998872 | 4.302325 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2024-04-26T02:59: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": "535aae699... |
32bc1511-0709-4af7-9488-6c3a8ac7a82b | mjenrungrot/competitive_programming | UVa Online Judge/v10/1013.cc | /*=============================================================================
# Author: <NAME> - https://github.com/mjenrungrot/
# FileName: 1013.cc
# Description: UVa Online Judge - 1013
=============================================================================*/
#include <bits/stdc++.h>
#p... | ALGO | 0.999639 | 4.833722 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2015-11-17T04:41:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "116115ad... |
db31c540-eb31-4109-8b33-afb8e36328cc | ppdog0/poj | Codeforces/div3/690/E2.cpp | #include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
using ll = long long;
using ld = long double;
const int mod = 1e9 + 7;
const int N = 2e5 + 5;
int fact[N];
int invFact[N];
int fast_pow(int n, int k) {
int res = 1;
while (k) {
if (k & 1) {
res = res * 1ll * n %... | ALGO | 0.999973 | 5.322876 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2020-08-29T02:58: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": "e8f8b3e89... |
497bef61-3a77-4c48-8dc4-68f2dedd6329 | AasthaMehtaTech/DSA_Team12_Uplift_Project | Loops_Patterns_Print/InputOutput/Anmol Kaur/day 9/longest_common_prefix.cpp | // Write a function to find the longest common prefix string amongst an array of strings.
// If there is no common prefix, return an empty string ""
class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
if(strs.empty()) return "";
// finding longest common prefix using sort funct... | ALGO | 0.999917 | 5.836558 | {
"github_metadata": {
"branch": "master",
"commit_count": 1240,
"repo_created_at": "2020-06-06T17:26:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 22,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4d7b... |
c268fee8-d326-4041-8e87-084806b46680 | bvbasavaraju/competitive_programming | leetcode/weekly/314.cpp | /****************************************************
Date: Oct 9th, 2022
Successful submissions : 2
Successful submissions after timeout : 0
Time expiration : 1
Memory exhausted : 0
Not Solved : 0
Incomplete Solution : 0
Wrong Answer/ Partial result : 1
Solved looking at solutions : 0
link: https://leetcode.com/conte... | ALGO | 0.999682 | 5.85842 | {
"github_metadata": {
"branch": "master",
"commit_count": 693,
"repo_created_at": "2019-10-20T13:24:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ed5ea18... |
7b773d68-f380-439b-bff9-7c6b1bc62b47 | mandy-1/DSA-Practice-2022 | Maximum sum Rectangle - GFG/maximum-sum-rectangle.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:
int kaden(vector<int>& arr,int& c){
int ans=INT_MIN,sum=0;
for(int i=0;i<c;i++){
sum+=arr[i];
ans=max(a... | ALGO | 0.999933 | 6.066473 | {
"github_metadata": {
"branch": "main",
"commit_count": 882,
"repo_created_at": "2022-05-03T06:27:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffc9df53f3... |
4efd8103-a04c-4ab9-8b58-5699fcd058e2 | taoonehacker/Algorithm | Basic/main.cpp | //
// Created by Tao on 6/7/20.
//
#include <iostream>
#include "Student.h"
#include "SortTestHelper.h"
using namespace std;
template<typename T>
void selectionSort(T arr[], int n) {
for (int i = 0; i < n; i++) {
//寻找[i,n)区间里的最小值
int minIndex = i;
for (int j = i + 1; j < n; j++) {
... | ALGO | 0.997301 | 5.448631 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-06-07T08:32: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": "21a362be80... |
610b4fb7-bd75-4860-a1c1-2d0cc9535790 | ChaomengOrion/CompetitiveSave | VJ/[2025寒假集训] 数论/Q_Help_Hanzo.cpp | #include <bits/stdc++.h>
using i64 = long long;
#define LOG(...) std::cerr << "Line[" << __LINE__ << "]: " << __VA_ARGS__ << std::endl;
#define LOGV(_vec, _size) std::cerr << #_vec << " = " << '['; for (int _i = 0; _i < (_size); _i++) { std::cerr << (_vec)[_i]; if (_i != (_size) - 1) std::cerr << ", "; } std::cerr <<... | ALGO | 0.999819 | 4.508693 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2024-09-11T05:25: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": "0297421173... |
33d93763-3530-4589-b2cf-5f348e6b84d9 | avantikasuryawanshi/Cpp | CSE1002/PAT4.cpp | #include<iostream>
#include<sstream>
#include<string>
#include<list>
using namespace std;
int SUM = 0;
int letter_ascii();
char ascii_letter();
void getletter();
void getwords();
void sets();
char ascii_letter(int a) //get letter from ascii
{
char c = char(a);
return c;
}
int letter_ascii(char c) //get asci... | ALGO | 0.998882 | 3.613194 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-06-05T12:57:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "08f7a0d951... |
c005bd8f-5462-47a8-8cd1-5c0222dad6ae | ParianshMahajan/DSA | Bakchodi/Number_system.cpp | #include<iostream>
using namespace std;
#include<bits/stdc++.h>
#include<vector>
int dec_to_bin(int n){
int bin=0,i=0;
while(n>0){
int d=n%2;
bin=bin+d*(pow(10,i));
i++;
n=n/2;
}
return bin;
}
int bin_to_dec(int n){
int dec=0,i=0;
while(n>0){
int d=n%10;
d... | ALGO | 0.991783 | 3.282772 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-07-31T16: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": "5312de6b4a8... |
12151ec2-ec14-4f13-b8f8-36a052d32307 | Agasthya-Samyak-Jnan/LeetCode-Problems | Medium/Sum of Square Numbers.cpp | #include<bits/stdc++.h>
using namespace std;
// Link to the Problem : https://leetcode.com/problems/sum-of-square-numbers/
// Difficulty : Medium
/* BRUTE FORCE METHOD */
class Solution {
public:
bool judgeSquareSum(long c) {
long k = sqrt(c);
if (k*k == c) { return true; }
... | ALGO | 0.999845 | 5.161194 | {
"github_metadata": {
"branch": "main",
"commit_count": 353,
"repo_created_at": "2024-05-10T09:06: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": "3a98b7f642... |
a55ebfb9-db13-4f71-bb72-37a64dae43c3 | Altu-Bitu/Altu-Bitu-min | 11월 02일 - 최단 경로/1063.cpp | // 킹 https://www.acmicpc.net/problem/1063
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <map>
using namespace std;
typedef pair<int, int> point;
const int BOARD_SIZE = 8;
map<string, int> directions = {
{"R", 0},
{"L", 1},
{"B", 2},
{"T", 3},
{"RT", 4},
{... | ALGO | 0.999837 | 5.765988 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2021-09-02T07:46:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ffe5df58de2... |
52add28e-86fa-4163-a383-46339f93599b | MaratZiganshin/CodeForcesYandexQualification2019 | InterestingGames/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int K, N;
cin >> K >> N;
int p = 0;
int v = 0;
for (int i = 0; i < N; i++)
{
int temp;
cin >> temp;
if (temp % 3 == 0 && temp % 5 == 0)
{
continue;
}
else if (tem... | ALGO | 0.999973 | 4.551573 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-06-27T17:02:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50d690b254... |
749b5f06-3a07-456e-b0be-afc0538ef411 | sw15-algorithm-study/algorithm_study | 형훈/2623.cpp | #include <algorithm>
#include <iostream>
#include <queue>
using namespace std;
typedef pair<int, int> pii;
vector<int> v[1001];
int in[1001];
int visit[1001][1001];
queue<int> q;
vector<int> r;
int n, m;
int main() {
scanf("%d %d", &n, &m);
for(int i = 0; i < m; i++) {
int num;
scanf("%d", ... | ALGO | 0.999997 | 3.659922 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2020-12-28T09:24:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62db1fcb65... |
dde28ae7-2bfe-4f76-a623-3e92fd553c45 | shreyyzsh/Advent-Of-Code | 2023/cpp/31.cpp | #include <bits/stdc++.h>
using namespace std;
string checkfornum(string mL, int j);
bool isnum(string s) {
for (char c : s) if (!isdigit(c)) return false;
return true;
}
bool search(char target) {
vector<string> symbols = {
"-", "#", "=", "*", "+", "@", "$", "&", "/", "%"};
string targetStr(1... | ALGO | 0.997834 | 4.575086 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-12-22T05:03: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": "9bff0f33079a... |
f535dcd7-06fe-466a-9c7c-daf6ed67dff8 | khabh/Algorithm | bfs/불켜기.cpp | #include <iostream>
#include <queue>
#include <deque>
#include <vector>
#define X first
#define Y second
using namespace std;
int n, m, count = 1;
vector<pair<int, int>> lights[101][101];
int state[101][101];
// 0 - 이동할 수 없고 켜지지도 않은 상태
// 1 - 이동할 수 있고 켜진 상태
// 2 - 이동할 수 없고 켜지기만 한 상태
// 3 - 물리적으로 연결되어 있지만 불이 켜지지 않은 상... | ALGO | 0.999596 | 4.067968 | {
"github_metadata": {
"branch": "main",
"commit_count": 336,
"repo_created_at": "2023-03-08T12:30:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f0985705c... |
1403c8a9-686f-47d8-860d-491946e9a757 | biechuyangwang/nowcoder | solutions/40-在转动过的有序数组中寻找目标值/main_1.cpp | /*
* author: 李俊
* time:2020/12/17
*
* 在转动的有序数组中寻找目标值
*/
/*
* a[m]>=a[l]
* a[l]<=t<a[m] -> r = m-1
* other -> l = m+1
* a[m]<=a[r]
* a[m]<=t<a[r] -> l= m+1
* other -> r=m-1
* 可以通过一些方法去合并使代码简洁,但是逻辑就不简洁了,没有必要。
*/
/*
* 二分查找
*/
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
/**
* ... | ALGO | 0.999997 | 5.302951 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2020-12-07T09:26: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": "49532d5dc... |
2219e3e6-612e-4b56-ba2f-49882e8737d7 | sohag16030/Basic-Programming | Data-structure-Algorithm/Graph Rough/graph(sohel)/String/rabin_carp.cpp | #include<bits/stdc++.h>
using namespace std;
#define B 21
#define M 100000007
int n,m;
int Hash_val(string &s)
{
int hv = 0 , power = 1;
for(int i=m-1 ; i>=0 ;i--){
hv = hv + (s[i]*power) % M;
hv = hv % M;
power = (power * B) % M;
}
return hv;
}
int match(string &text,strin... | ALGO | 0.999992 | 4.814454 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2019-10-29T06:50:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91bbaa055... |
64f192a1-f816-4583-ade7-fe4d670ad82e | liuq901/code | HYSBZ/hy_1901.cpp | #include <cstdio>
#include <cstdlib>
int a[50001],b[50001],p[50001];
int main()
{
void sort(int,int);
int n,m;
scanf("%d%d%*c",&n,&m);
for (int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
p[i]=i;
}
scanf("%*c");
sort(1,n);
for (int i=1;i<=n;i++)
b[p[i]]=i;
for (int i=1;i<=m;i++)
... | ALGO | 0.999931 | 3.116775 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2013-09-18T08:58:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2aa936ee... |
d39540ae-d6c8-4324-b665-9c242a3279f8 | atumbalev/SDP2018 | labs/10 - Binary Search Trees/AVL.cpp | #include <iostream>
#include <assert.h>
#include <vector>
#include <queue>
template<typename K, typename V>
class AVL
{
private:
struct Node
{
K key;
V value;
int height;
Node *parent, *left, *right;
Node(const K& _key, const V& _value, int _height = 0, Node *_parent = ... | ALGO | 0.995458 | 4.989532 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-10-23T22:53:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "75f0799063... |
93e459af-6f51-4ad9-8f83-36702af2f8c8 | akar1012/MyCplus | function/comparestring.cpp | #include <iostream>
using namespace std;
int comparestr ( char str1[], char str2[]);
int main()
{
int size =6;
int flag =0;
char str1[size]= " name";
char str2[size]= " name";
flag = comparestr( str1, str2);
cout<< flag ;
return 0;
}
int comparestr ( char str1[], char str2[]){
int flag =0;
... | ALGO | 0.997757 | 3.223545 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-02-25T16:27: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": "34c387e090a... |
060c702e-d8d9-48e3-8352-80307c62928e | kappybar/competitive_programming_library | Graph/LevelAncester.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define chmin(x,y) x = min((x),(y))
#define chmax(x,y) x = max((x),(y))
#define popcount(x) __builtin_popcountll(x)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
const int INF = 1e9;
cons... | ALGO | 0.999798 | 3.702427 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2020-11-29T03:41:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2c1a2f3580d... |
e6136dc6-e31d-4709-ac88-b5468906c71b | UOSCS/algorithms | BOJ/dp/2098.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int N, W[17][17], dp[17][1 << 16];
int ans_bit;
int dfs(int node, int state)
{
if(state == ans_bit)
if(W[node][1])
return W[node][1];
else
return -1;
if(dp[node][state])
return dp[node][state];
... | ALGO | 0.999774 | 4.145617 | {
"github_metadata": {
"branch": "main",
"commit_count": 449,
"repo_created_at": "2021-02-03T03:03:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e5846e304... |
a0caabbb-80c2-4019-8817-d4e59e1f9c81 | AutuanLiu/Code-Storm2019 | leetcodeCPP/9.palindrome-number.cpp | /*
* @lc app=leetcode.cn id=9 lang=cpp
*
* [9] 回文数
*
* https://leetcode-cn.com/problems/palindrome-number/description/
*
* algorithms
* Easy (55.84%)
* Total Accepted: 65.8K
* Total Submissions: 117.9K
* Testcase Example: '121'
*
* 判断一个整数是否是回文数。回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数。
*
* 示例 1:
*
* 输入: 121
... | ALGO | 0.999922 | 5.856933 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2019-02-16T11:15:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8225ff18... |
6931c204-1447-4ffc-a435-2db3ae4b018d | singhsneha03/DSA-code | QUEUE/2(own).cpp | #include<iostream>
#include<vector>
#include<limits.h>
#include<algorithm>
#include<string.h>
#include<queue>
using namespace std;
class Queue{
public:
int *arr;
int rear;
int front;
int size;
Queue(int size){
this ->size=... | ALGO | 0.990519 | 3.079041 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-01-07T18:30: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": "fb80a0c10cf... |
83155de0-d3fe-4c76-98bb-7960da12361b | tmastercoding/clang | USACO/Silver/BinarySearch2/s10.cpp | #include <iostream>
using namespace std;
int main(){
int n, m, arr[5000];
cin >> n >> m;
for(int i = 0; i < n; i++){
cin >> arr[i];
}
int lo = 0, hi = 9999, mid, min, max, cnt;
while(lo < hi){
mid = (lo+hi)/2;
min = 10000, max = 1, cnt = 0;
for(int i = 0; i < n;... | ALGO | 0.999997 | 3.694508 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2023-10-01T10:39:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0daddc5a17f... |
66413b63-474e-45d1-805a-d6e5a7bc97a7 | ITSJKS/Leetcode-Solutions | 2509-cycle-length-queries-in-a-tree/2509-cycle-length-queries-in-a-tree.cpp | class Solution {
public:
int depth(int u){
return 32 -__builtin_clz(u);
}
int lca(int u, int v){
if(depth(u) > depth(v)) swap(u,v);
int d1 = depth(u);
int d2 = depth(v);
while(d2!=d1){
v/=2;
d2--;
}
while(u!=v){
u/=2... | ALGO | 0.999811 | 5.679449 | {
"github_metadata": {
"branch": "main",
"commit_count": 3261,
"repo_created_at": "2022-09-05T05:16: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": "90638014a... |
4d88594c-847c-4126-94a9-ad15a9017c92 | claytonjwong/leetcode | string_comp_inplace/string_comp_inplace/string_comp_inplace.cpp | /*
443. String Compression
Given an array of characters, compress it in-place.
The length after compression must always be smaller than or equal to the original array.
Every element of the array should be a character (not int) of length 1.
After you are done modifying the input array in-place, return the... | ALGO | 0.999991 | 5.464149 | {
"github_metadata": {
"branch": "master",
"commit_count": 892,
"repo_created_at": "2018-12-28T22:57:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9d8afc2... |
ea6a7746-396a-498c-956b-1d44d0469160 | MaskRay/LeetCode | minimum-number-of-operations-to-make-string-sorted.cc | // Minimum Number of Operations to Make String Sorted
#define FOR(i, a, b) for (remove_cv<remove_reference<decltype(b)>::type>::type i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define ROF(i, a, b) for (remove_cv<remove_reference<decltype(b)>::type>::type i = (b); --i >= (a); )
class Solution {
static cons... | ALGO | 0.99999 | 5.094123 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2014-06-29T09:41:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 488,
"forks": 112,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d1b0... |
ee00c758-3152-4b22-9f96-37eecce52422 | Mwsxy/leetcode | P109.cpp | #include "header.h"
#include <cstddef>
class Solution {
public:
TreeNode* sortedListToBST(ListNode* head) {
int n=0;
ListNode* p = head;
while (p) {
n++;
p=p->next;
}
TreeNode *root = makeTree(n);
inOrderSet(root,head);
return root;
... | ALGO | 0.999976 | 5.621871 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2019-01-12T02:13: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": "b4fae47c... |
cf5ad788-508e-437e-ac76-21ed3513d8cd | ParkDaeYi/Uva | hull.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#define MAX_N 20001
using namespace std;
typedef long long int llt;
ifstream fin;
ofstream fout;
class point {
public:
llt x, y, dx, dy;
point(llt x = 0, llt y = 0) :x(x), y(y), dx(0), dy(0) {}
bool operator<(const point& p) cons... | ALGO | 0.999998 | 4.44382 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2020-03-27T13:20:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3466d973... |
80446ea1-a1ec-49c2-b4b1-0cf1ad201d59 | tanishkakarpe/Data-Structure | coinchange.cpp | /*
Implement Coin Change problem.
Statement Given an integer array of coins[ ] of
size N representing different types of currency and an
integer sum, The task is to find the number of ways to
make sum by using different combinations
from coins[].
Note: Assume that you have an infinite supply of each
type of coin.... | ALGO | 0.999951 | 5.732656 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2025-02-23T11:13: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": "f338fe88f47... |
3e55fe00-3bbf-471d-9a42-fa6a5a0fe12d | mrcchef/CP | Algo_shots/1700/A_Parity_Game.cpp | #include <bits/stdc++.h>
using namespace std;
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;i<=n;i++)
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define mii map<ll,ll>
#define pii pair<ll,ll>
#define vi vector<ll>
#define endl "\n"
#define deb(x) cout ... | ALGO | 0.99999 | 4.89591 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-06-12T05:00: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": "3c67f7232e... |
ffd0abf4-c579-41bf-8c76-68ff90b8a180 | fhiroki/atcoder | ABC/abc003/b/main.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
int main() {
string s, t;
cin >> s >> t;
string w = "atcoder";
int n = s.size();
bool ok = true;
rep(i, n) {
if (s[i] == t[i]) continue;
bool match = false;
... | ALGO | 0.999959 | 3.589257 | {
"github_metadata": {
"branch": "master",
"commit_count": 416,
"repo_created_at": "2020-03-07T08:44:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb6e91db... |
5bfbb676-9de7-4866-ad11-3b9a3facb01d | joriswit/Festival | app/src/main/cpp/rooms_deadlock.cpp | #include <stdio.h>
#include "rooms_deadlock.h"
#include "rooms.h"
#include "board.h"
#include "util.h"
#include "score.h"
#include"positions.h"
#include "deadlock_cache.h"
#include "bfs.h"
board room_with_corridors[MAX_ROOMS];
int room_size[MAX_ROOMS];
int debug_rooms_deadlock = 0;
void init_rooms_deadlock()
{
int... | ALGO | 0.999736 | 4.629003 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2024-01-13T13:08: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": "138ffa6e8... |
a22151c8-39b3-4c37-8190-6cab24864eb7 | chrisbroome/mandelbrot | bak/mandelbrot.cpp | // includes ///////////////////////////////////////////////
#include <cmath> // sin
#include <cstring> //
#include <ctime>
#include <fstream> //
#include <iomanip> //
#include <iostream> // C++ stuff
#include <SFML/Window.hpp>
#include "app-params.h"
#include "app.h"
#include "point.h"
#include "rect.h"
#include... | TOOL | 0.977696 | 5.366127 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2014-09-11T15: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": "159ce4f30... |
85aa46fd-d6cc-4573-9cc4-ddd9bd03ccd0 | ishandutta2007/codeforces-u | uryuuu/normal/1516/C.cpp | #include<iostream>
#include<stdio.h>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<string>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<unordered_map>
#include<time.h>
#include<cstdlib>
#include <chrono>
#include <random>
typede... | ALGO | 0.99997 | 3.030096 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "7ffa8ec5d52b... |
d9ccee1e-7826-4d61-8a77-4b7ffa94e7b7 | sniperzee2/6Companies30Days | Microsoft/Day 4/perfectRectangle.cpp | class Solution {
public:
Solution(){
vector<int> tmp(4,0);
perfect_rect = tmp;
}
bool isRectangleCover(vector<vector<int>>& rectangles) {
int minsum(INT_MAX),maxsum(INT_MIN);
int subrectarea = 0;
for(vector<int> rect : rectangles){
subrectarea += ... | ALGO | 0.999727 | 5.684908 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-01-03T20:55: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": "4b5997eb3c8d... |
a9b7eaef-e35e-470b-acd8-67f2782df77f | minSsan/algorithm | baekjoon/practice/algorithm_lecture/recursion/1463.cpp | #include <iostream>
using namespace std;
const int MAXIMUM_NUM = 2100000000;
int min_count = MAXIMUM_NUM;
void min_calc(int n, int count) { // 10, 0 | 5, 1 | 4, 2
if (n == 1) {
if (count < min_count) {
min_count = count;
}
// return min_count;
return ;
}
if (n... | ALGO | 0.999805 | 4.007763 | {
"github_metadata": {
"branch": "main",
"commit_count": 338,
"repo_created_at": "2022-01-17T03:33: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": "d539728d76... |
926e9aab-263c-45f9-a34f-31e27c152339 | sanikoyes/godot | thirdparty/oidn/mkl-dnn/src/cpu/gemm/s8x8s32/common.hpp | /*******************************************************************************
* Copyright 2019 Intel 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.o... | CONFIG | 0.928101 | 4.504325 | {
"github_metadata": {
"branch": "master",
"commit_count": 48784,
"repo_created_at": "2014-03-11T05:13:41.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "godotengine/godot",
"stars": 125,
"forks": 20,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"con... |
d8c585d3-e72a-47bf-beab-8266a0bb14a8 | AyRawat/My-Code-Journal | AlgoExpert/MinNumberOfJumps.cpp | #include<bits/stdc++.h>
#include<vector>
using namespace std;
vector<vector<int>> temp(1001 , vector<int>(1001,-1));
//Algoexpert's O(n^2)
int minNumerOfJumps(vector<int> array){
vector<int> jumps(array.size() , INT_MAX);
jumps[0] = 0;
for(int i=1;i<array.size();i++){
for(int j=0;j<i;j++){
... | ALGO | 0.999979 | 4.912555 | {
"github_metadata": {
"branch": "main",
"commit_count": 166,
"repo_created_at": "2022-03-13T07:47:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16eb5f74d7... |
d01f3b4b-5424-494a-8fa3-400cfb36d2ca | laurentiu-racovcen/rest-api | requests.cpp | #include <stdlib.h> /* exit, atoi, malloc, free */
#include <stdio.h>
#include <unistd.h> /* read, write, close */
#include <string.h> /* memcpy, memset */
#include <sys/socket.h> /* socket, connect */
#include <netinet/in.h> /* struct sockaddr_in, struct sockaddr */
#include <netdb.h> /* struct hosten... | WEB | 0.908556 | 4.193682 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-28T18:30: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": "79be09ad6354... |
0ee250ef-623b-4bca-ad24-2f6c9eb5ebbc | lets-learn-it/cpp-learning | 11-stl-containers/02-associative-containers/01_map.cpp | #include <iostream>
#include <map>
#include <string>
#include <tuple>
/*
* std::map is sorted associative container that contains key-value pairs with unique keys
* Keys are sorted by using comparision function Compare.
*
* Search, removal and insertion operations have logarithmic complexity.
* Usually implemente... | TOOL | 0.95447 | 5.116135 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2022-07-30T10:00:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34e21370a3... |
7366015c-12ef-4c4e-8361-41920bad339c | Valet78/skillbox | 1-10/5 Logical operators and complex conditions/5.4_z2/main.cpp | /*
Задача 5.4.2. — Входит... И выходит... И входит... Замечательно выходит! "Винни-Пух и день забот".
У Винни-Пуха есть кирпич размера A на B на C. А еще есть стена, в которой проделано прямоугольное
отверстие размера X на Y. Прежде чем подарить все это ослику Иа, Винни-Пух хочет знать, получится
ли просунуть этот ки... | ALGO | 0.994439 | 4.143075 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2023-05-27T09: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": "9dc1d1412c... |
00c11da8-0b81-4037-95b4-233c7acf8f18 | metaflow/contests | uva/chapter_1/10070.cc | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <queue>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.999682 | 3.8219 | {
"github_metadata": {
"branch": "master",
"commit_count": 415,
"repo_created_at": "2014-05-12T04:59: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": "fcae3157... |
a326b8ef-cffa-4a31-ace0-b6b77ef90ecd | Moren00/Application-in-C- | 5. Potenza di un polinomio/5.Potenza.di.un.polinomio.cpp | //Programma che sviluppa l'elevamento a potenza di un qualsiasi binomio (k1*a + k2*b)^n
#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
class Polinomio {
float k1,k2; //parti numeriche
char a,b; //parti letterali
int potenza;
bool doppia_lett; //ci dirÓ se ci sono due lett... | ALGO | 0.999137 | 4.588058 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-02-15T16:03:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c95958cb49... |
fb659ca1-4503-469c-8238-47c1408db9a6 | git-tturami/algorithm | Hyochang/building.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <queue>
using namespace std;
struct position {
int z, y, x;
int cnt;
}typedef p;
queue<p> q;
char visited[30][30][31];
int main()
{
int l, r, c;
char map[30][30][31];
int dx[] = { 1,-1,0,0,0,0 };
int dy[] = { 0,0,1,-1,0,0 };
int dz[] = { 0,0,0,0,... | ALGO | 0.999728 | 3.905595 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2019-03-03T09:11:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 10,
"forks": 24,
"issues": 8,
"pull_requests": 8
},
"file_meta": {
"content_id": "82a9a6c0... |
359a4441-f043-4b5c-b12a-1811ee09a70f | ashigup/DSA | B_Swaps.cpp |
#define ll long long int
#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define vll vector<ll>
#define pll pair<ll, ll>
const ll INF = 1e18;
ll modpow(ll a, ll b)
{
ll ans = 1;
while (b)
{
if (b % 2 == 1)
ans = (ans * a) % mod;
a = (a * a) % mod;
b ... | ALGO | 0.99994 | 3.875415 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2021-10-11T12:29:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d583e60be... |
64404c49-b9f3-40f7-9061-0815a80aa886 | Eugenio8mola/GraphPartitioning | parallelAlgorithms/ParFiducciaMattheyses/partition.h | #include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <utility>
using namespace std;
// Function to perform weighted partitioning using a greedy algorithm
vector<vector<pair<int, int>>> initializePartition(vector<int> weights, int n, int numPartitions) {
// Initialize the partitio... | ALGO | 0.999922 | 6.541924 | {
"github_metadata": {
"branch": "main",
"commit_count": 185,
"repo_created_at": "2024-02-07T19:51: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": "1c12c6732b... |
c6f81ff4-beae-4769-897d-f5460fc2dd41 | zxgdll/geotools | src/util.cpp | #include <set>
#include <list>
#include <sstream>
#include <algorithm>
#include <fstream>
#include <map>
#include <cmath>
#include <string>
#include <tuple>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include "geotools.h"
#include "u... | TOOL | 0.917948 | 4.522563 | {
"github_metadata": {
"branch": "master",
"commit_count": 585,
"repo_created_at": "2016-11-26T09:45:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d07d850... |
9cd0754a-f7b8-4682-8d84-6e5a66ba4230 | Darlokan/Curves | Graphe.cpp | #include "Graphe.h"
int exp(int i,int n)
{
int k = 0;
if(n == 0)
{
return 1;
}
else if (n == 1)
{
return i;
}
else if (n == (n/2)*2)
{
k = exp(i,n/2);
return k*k;
}
else
{
k = exp(i,n/2);
return k*k*i;
}
}
bool Graphe::Belong(int edge,int pt)
{
return ((edges[edge][0] == pt) || (edges[edge]... | ALGO | 0.994426 | 3.168582 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2014-09-06T15:54: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": "74c64e27f... |
aba18614-a40d-4550-be3d-a9c0cadc8df3 | OpenSees/OpenSees | SRC/reliability/analysis/stepSize/ArmijoStepSizeRule.h | /* ****************************************************************** **
** OpenSees - Open System for Earthquake Engineering Simulation **
** Pacific Earthquake Engineering Research Center **
** **
** ... | ALGO | 0.999346 | 6.200445 | {
"github_metadata": {
"branch": "master",
"commit_count": 8721,
"repo_created_at": "2018-09-12T00:49:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 667,
"forks": 719,
"issues": 42,
"pull_requests": 23
},
"file_meta": {
"content_id": "19... |
9db2c34e-41be-4305-8fa8-0f29a1d21d07 | babarkajal/Technical-Languages-Codes | C/Assignments/LinkList2/program/program41.cpp | /*
*
41.Write a program which add new node in singly circular linked list at first position.
Function Prototype : int InsertFirst(
struct node **Head, struct node **Tail, int no
);
Input linked list : |10|->|20|->|30|->|40|->|50|->|60|->|70|
Input data element : 21
Output linked list : |21|->|10|->|20|->|30|->|40|->|... | ALGO | 0.999375 | 4.996807 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-11-24T07:05: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": "2252806025... |
d3da2426-7ff3-4d0d-bfef-93ad4948f7f7 | Purvansha022609/Searching-Algorithms | Exp_21.cpp | /*Name-<NAME>
PRN-22070123088
Exp_21- Searching Algorithms
i) Linear Search
*/
#include <iostream>
using namespace std;
int linearSearch(int arr[], int size, int target) {
for (int i = 0; i < size; i++) {
if (arr[i] == target) {
return i; // Return the index where the target is found
... | ALGO | 0.999236 | 5.561532 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-10-24T06:18: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": "2f76a0391a02... |
f0681bc8-c127-411c-b5fa-8c9e88f2dacf | ishandutta2007/codeforces-c | chemthan/normal/1015/F.cpp | #include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define ... | ALGO | 0.999757 | 3.690701 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed666ff5164a... |
f774607c-417a-4990-80bb-5829ce96a31b | khankuan/UVA | uva/uva821.cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main(void){
int test = 1;
bool exiting = false;
int adjM[100][100];
for (int i = 0; i < 100; i++)
for (int j = 0; j < 100; j++)
adjM[i][j] = 100000000;
while (true){
int from, to;
... | ALGO | 0.992032 | 3.598145 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-03-07T08:34:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "49aa5a8bbc... |
3b5d6aa0-3f64-48d0-b9d3-a891088649fc | tamofplease/atcoder_abc | abc301/a/main.cpp | // "Copyright 2022 tam"
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define Rep(i, n) for (int i = 1; i <= n; i++)
#define ALL(v) v.begin(), v.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define ll int64_t
using P = pair<int, int>;
const... | ALGO | 0.999981 | 4.481915 | {
"github_metadata": {
"branch": "main",
"commit_count": 391,
"repo_created_at": "2020-09-07T13:50: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": "c490e5c12e... |
f17e53d9-9000-4df1-9130-24ae5c4ca257 | Ritapravo/cpp | random/cpp/03.(Lowest Common Subsequence).cpp | //Longest Common Subsequence in C++
#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#include<algorithm>
#define maxv(a) *max_element(a.begin(), a.end())
#define maxa(a) *max_element(a, a+(sizeof(a) / sizeof(a[0])))
#define ll long long int
#define len(a) sizeof(a)/sizeof(a[0])
#define f(i,a,b) for(ll i=a; i... | ALGO | 0.999985 | 4.782249 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2019-10-20T20:58:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2046db225... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.