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 |
|---|---|---|---|---|---|---|---|
11281b57-2852-44c3-b6fd-f55ba9ddcec4 | FreeCAD/FreeCAD | src/Mod/Mesh/App/WildMagic4/Wm4PolynomialRoots.cpp | // Wild Magic Source Code
// <NAME>
// http://www.geometrictools.com
// Copyright (c) 1998-2007
//
// This library 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 Software Foundation; either version 2.1 of the License, or... | ALGO | 0.99906 | 5.720698 | {
"github_metadata": {
"branch": "main",
"commit_count": 42594,
"repo_created_at": "2012-09-09T08:25:02.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25389,
"forks": 4671,
"issues": 2906,
"pull_requests": 250
},
"file_meta": {
"content_id"... |
fec055b4-95da-4c49-99e4-333fce6e0863 | GrandOichii/cpp-game | src/util.hpp | #pragma once
#include <vector>
#include <fstream>
#include <string>
#include <iostream>
#include <iterator>
#include <math.h>
#include "nlohmann/json.hpp"
using std::string;
using std::vector;
struct Double {
int a[2];
};
bool isNumber(string word);
template<class T>
class CircularBuffer {
private:
int si... | TOOL | 0.917326 | 4.130591 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2022-06-05T11:46: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": "ebf1c48ca... |
44dc9848-0e7c-4870-bca2-c64cdb1b4e00 | abhishekrsingh/GFGProblems | Difficulty: Basic/Smaller and Larger/smaller-and-larger.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
vector<int> getMoreAndLess(vector<int> &arr, int target) {
// code here
int n = arr.size();
// Count of elements less than or equal to t... | ALGO | 0.999713 | 5.86343 | {
"github_metadata": {
"branch": "main",
"commit_count": 1915,
"repo_created_at": "2023-12-18T16:18: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": "f44806ea1... |
c1f1c7a8-b44d-4176-947e-4b72815ea696 | mattangeli/STASH | walker.cpp | #include <iostream>
#include "walker.h"
template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec){
for(auto i : vec){
os<<i<<" ";
}
return os;}
/* Default constructor for a walker, it must be initialized before the
* walker is simulated.
*/
walker::walker():
my_id{0},
... | TOOL | 0.933691 | 3.589066 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2021-02-14T23:17:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d1551c28... |
d2db9bf0-ff3f-41dc-aa00-c324371af394 | wtr0504/ACwing-coding | solution/recursion/soldier_passing_river.hpp | #include "../common.hpp"
vector<pair<int,int>> block = {{1,2},{2,1},{-1,-2},{-2,-1},{-1,2},{2,-1},{-2,1},{1,-2}};
void soldier_passing_river(){
int m,n;
int x,y;
cin>>m>>n>>x>>y;
vector<vector<long long>> dp(m + 1,vector<long long>(n + 1,0));
dp[x][y] = -1;
for(int i = 0;i < block.size();i++)... | ALGO | 0.999925 | 4.957455 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-05-27T10:29: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": "1e1898469628... |
236cdf22-fa33-4feb-9dc4-e549a5431214 | kishorbhandari23/practice | reverse_bit.cpp | // reverse_bit.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <assert.h>
#define SIZE_INT sizeof(0)*8
typedef unsigned int uint;
int swapbits(int num, int i, int j)
{
int a = ((num >> i) & 1);
int b = ((num >> j) & 1);
if (a^b)
num ^= ((1 << i) | (1 << j));
return nu... | ALGO | 0.995241 | 5.017548 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2017-01-28T16:39: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": "4a8d869745... |
ba507e1c-b836-4a24-a5ef-b562ac304aef | kashi-iiitb/C_programs | interview/druva/chk_bst.cpp | #include <iostream>
#include <exception>
#include <set>
#include <climits>
struct node{
int data;
struct node* left;
struct node* right;
};
typedef struct node Node;
Node* create_node(int val){
try{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
return temp;
}catch(const ... | ALGO | 0.99965 | 3.755299 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2016-08-24T07:28: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": "c11e5c2c7... |
0885990f-f7f0-4d71-ade9-b6a4def4536d | thinkphp/computer-science-in-c | algorithms/sorting/bubblesort/bubble2017.cpp | #include <iostream>
#include <fstream>
#include <vector>
#define FIN "algsort.in"
#define FOUT "algsort.out"
using namespace std;
void _swap(vector<int> &vec, int a, int b) {
int aux;
aux = vec[ a ];
vec[ a ] = vec[ b ];
vec[ b ] = aux;
}
void bubblesort(vector<int> &vec, int n) {
int... | ALGO | 0.99952 | 4.914292 | {
"github_metadata": {
"branch": "master",
"commit_count": 2852,
"repo_created_at": "2014-08-20T07:22:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "474ce6e... |
d30ff25e-48b8-4cc2-9472-461e91031eae | ifteher/Lower_Bound-in-Binary-search.cpp | Lower_Bound in Binary search.cpp | ///Lower Bound holo:kono akta array collection er upor akta key val(4) er lower bound function apply korle,oi value ta theke takle tar iterator return korbe,R jodi na theke takee,taholee tar immidiet value ta apnake return korbe.
#include<bits/stdc++.h>
using namespace std;
int main()
{
///sudu vector e noy,set,map,mul... | ALGO | 0.999906 | 4.485284 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-06T13:43: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": "6e8ade32dee3... |
59b96e46-0a1b-4cf9-a26c-9837b33cf81e | Cbeltrami/TDEFII | Código para Arduino/DIP2.ino | //DECLARAÇÕES:
//PARÂMETROS DA DEPOSIÇÃO
int tempob=0, tempoev=0, nciclos=0, accel = -1;
double velocidade0, delaytime = 0.00;
// Dummy variable
int NOP;
//COMUNICAÇÃO SERIAL:
//char Acel_status;
///////////////// Aceleração
double AccelA = 0.00, AccelB = 0.00, AccelC = 0.00;
float PropA = 1.00, PropB = 0.00, PropC =... | TOOL | 0.954291 | 4.657391 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-11-20T13:22: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": "833aa455c... |
9b3e8088-1283-403b-bfa2-b3a1722e24c6 | namitaa15/dsa | graphs/Is Graph Bipartite.cpp | 785. Is Graph Bipartite?
There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1.
You are given a 2D array graph, where graph[u] is an array of nodes that node u is adjacent to. More formally,
for each v in graph[u], there is an undirected edge between node u and node v. The graph... | ALGO | 0.999919 | 6.943695 | {
"github_metadata": {
"branch": "main",
"commit_count": 391,
"repo_created_at": "2025-04-02T15:50:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36f989f805... |
134966ad-e4aa-4286-b343-fde5bdc447dc | zhangpf/topcoder-solutions | srm/Volume1/151/MergeSort.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.999877 | 4.743431 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2015-06-01T20:10:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7888cf5e5... |
25e1deda-5b08-4e74-95bb-0988f79c85d2 | gudwnsgur/Algorithm | BOJ/15665_N과M11.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#define endl '\n'
using namespace std;
vector<int> arr, res;
set<string> s;
void dfs(int length, int n, int m) {
if (length == m) {
string str = "";
for (int i = 0; i < res.size(); i++) str.push_back(res[i] + 48);
if (s... | ALGO | 0.999972 | 3.578879 | {
"github_metadata": {
"branch": "master",
"commit_count": 936,
"repo_created_at": "2019-12-26T10:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06912458... |
a5af5e21-b8e5-4621-bbf8-dd115950de34 | bandhansaha2/XPSC-Level-2 | Week 16/Day 4/Make_same.cpp | #include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define all(x) x.begin(),x.end()
#define Yes cout << "YES" << '\n'
#define No cout << "NO" << '\n'
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t; cin >> t;
while(t--) {
int n; cin >> n;... | ALGO | 0.999665 | 3.995014 | {
"github_metadata": {
"branch": "main",
"commit_count": 100,
"repo_created_at": "2025-01-05T17:07: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": "9357d8b6f7... |
e6dde39c-a8f3-4cc0-afac-e4ae26daa2b5 | Akelouche-cstj/Solution---LaboARemettre01 | Projet - Exercice 2/Vertical.cpp | /*
But: Faire un programme qui prend un nombre de cinq chiffre et affiche chaque chiffre en vertical
Auteur: <NAME>
Date: 2020-09-13
*/
#include <iostream> // permet d'utiliser les périphérique d'entrée et de sortie.
#include <string> // permet d'utilisier la librairie string.
int main() // Début du program... | TOOL | 0.946137 | 3.674235 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-09-13T17:18:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "a8805c07ca... |
a7801427-39e3-44ab-be12-6ae95e699b08 | zjsxzy/algo | Sgu/P230.cpp | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <bitset>
#include <vector>
#include <cstdio>
#include <string>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define MAXN 105
int N, M;
int ... | ALGO | 0.999999 | 4.216204 | {
"github_metadata": {
"branch": "master",
"commit_count": 1296,
"repo_created_at": "2013-05-18T10:52:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b584152... |
b4e56699-8d22-4708-b672-ce3e5cb1a132 | yhshu/Data-Structures-Algorithms-and-Applications-in-cpp | all codes in book/Data Structures, Algorithms, & Applications in C++, 2nd Edition/maxHblt.h |
// height biased leftist tree implementation of a max priority queue
// derives from the ADT maxPriorityQueue
// also derives from linkedBinaryTree<pair<int,T> >
// first component of a pair is the s value and the second is the data
#ifndef maxHblt_
#define maxHblt_
#include "maxPriorityQueue.h"
#include "linkedBina... | ALGO | 0.999848 | 4.61252 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-02T12:05:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 76,
"forks": 26,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d79991b1... |
9dd4d247-25c0-4e29-a3e5-b20747617878 | murthy0x05/CPP-Assignments | Day - 30 Questions - Week-07 (September 25th, 2024)/q1_max_sub_arr_sum.cpp | #include <iostream>
#include <sstream>
#include <algorithm>
#include <climits>
using namespace std;
int maxSubArrSum_KA(int*, int);
int* maxSumSubArr_KA(int*, int, int&, int&);
int main() {
int* arr;
cout << "Enter elements: ";
string line;
getline(cin, line);
int n = count(line.begin(), line.end(... | ALGO | 0.999508 | 4.569434 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2024-08-24T07:44: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": "d0ba2dca621... |
1ae04d80-2eb8-4bf7-aae3-18ee96f8256b | shafayetejaman/CLI-projects | extractText/files/week 05/contest 9/D_CodeChef_Streak.cpp | // https://www.codechef.com/problems/CS2023_STK
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<char> vc;
type... | ALGO | 0.999933 | 4.93508 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2023-04-03T07: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": "4910e7e5fea... |
a67d09a3-8736-4df7-a316-6c1e159ee3df | patelaaniket/csce221 | quiz/guess_sort.cpp | // resize an array
#include <iostream>
using namespace std;
int comp = 0;
struct Array {
int *array;
int size;
Array(int* a, int n) : array(a), size(n) {}
};
ostream& operator<<(ostream& out, Array& A)
{
for (int i=0; i < A.size; ++i)
out << A.array[i] << " ";
out << endl;
return out;
}
void g... | ALGO | 0.999294 | 4.719694 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-12-28T03:04:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff95f978d847... |
944f6c9a-fdd4-4e51-bfea-2cea1b8d2f1e | fireofearth/acm | 2022/cpsc490/attempt1/a2/maxindset.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
template<typename T>
void printv(vector<T> &v) {
for(int i = 0; i < v.size(); i++) {
cout << v[i];
if(i < v.size() - 1)
cout << " ";
}
cout << endl;
}
int max_is(vector<int> a) {
... | ALGO | 0.999986 | 3.839216 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2018-02-11T09:05:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "761a54580... |
9e8a918f-9d5b-46d8-9a0f-d6b98a5664a0 | tranthanhbinh2603/USACO | HSG TIN 9/2019/PRIME/main.cpp | #include <iostream>
#include <cstdio>
using namespace std;
const int ma = 1e6+10;
bool prime[ma];
void sinh_sang(){
prime[1] = false;
for (int i = 2; i <= ma; i++)
prime[i] = true;
for (int i = 2; i <= ma; i++)
if (prime[i] == true)
for (int j = 2 * i; j <= ma; j+=i)
... | ALGO | 0.999997 | 3.836823 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-07-19T10:29: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": "687cb45dc8... |
4b9c6ad0-4664-4fda-954f-85a37419f0c1 | mkiglics/quadtrace | QuadricTrace/CodeGen/Objects/model5.cpp | #define GLM_FORCE_SWIZZLE
#define _USE_MATH_DEFINES
#include "../bounding_opt.h"
#include "../codegen.h"
#include "glm/glm.hpp"
#include <cmath>
#include <fstream>
#include "models.h"
#include <iostream>
using namespace std;
using namespace glm;
MyExpr* wallsModel5(int mat, float wholeXSize, float wholeYSize) {
... | TOOL | 0.931097 | 3.694204 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2020-05-06T12:46: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": "e41a16745... |
d2e06d19-f2d0-45ca-9423-200019af1bd0 | tstanvir/mySolutionRepo | codeforces/1271/C.cpp |
/// <NAME>
#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
#define SET(x) memset(x, 0, sizeof(x))
#define SET2d(x,m,n) memset(x, 0, sizeof(x[0][0]) * m * n)
#define SETBOOL(x) memset(x,false,sizeof(x))
#define CLR(x) memset(x, -1, sizeof(x))
#define mp make_pair
#define PII pair<int, i... | ALGO | 0.999957 | 3.395141 | {
"github_metadata": {
"branch": "master",
"commit_count": 1669,
"repo_created_at": "2021-03-31T23:56: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": "49e9ac4... |
93429d56-2809-4659-92f7-2cfa630b7717 | R2D2ar/IOI_Training | Test.cpp | #include <bits/stdc++.h>
#include <stdint-gcc.h>
#include <xmath.h>
typedef long long ll;
typedef std::vector<int> v;
using namespace std;
const int N = 5;
vector<int> adjacent(vector<pair<int, int>> adj, int num) {
vector<int> output;
for (auto item: adj) {
if (item.first == num) output.emplace_ba... | ALGO | 0.999317 | 3.432658 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2022-08-08T18:54: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": "feb542fb4... |
b93f6320-a11c-4440-be96-8c7e7fa5d900 | itsoulos/OnePC | OnePcClient/myproblem.cpp | #include "myproblem.h"
#include <QDebug>
MyProblem::MyProblem(QLibrary *L,QString s)
{
tempx=NULL;
tempg=NULL;
settings=s;
setLibrary(L);
}
double MyProblem::funmin(Data x)
{
int i;
for(i=0;i<dimension;i++) tempx[i]=x[i];
FUNMIN fmin=(FUNMIN)library->resolve("funmin");
//FOR FORTRAN
... | TOOL | 0.93993 | 3.298784 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-12-13T07:08:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b3bd23da... |
5833fdc3-010f-4ceb-aac6-c7bb0b5b090b | VuXuanBac/AppliedAlgorithm | DP/MaxSUBSEQ.cpp | /// Tìm dãy con (các phần tử liên tiếp) mà tổng các phần tử là lớn nhất
/// -> O(n)
/// sum[i] = max( sum[i - 1] + a[i], a[i] )
/// sum[i]: Tổng lớn nhất của mọi dãy con kết thúc tại a[i].
#include <bits/stdc++.h>
using namespace std;
#define MAX_N 1000000
int a[MAX_N];
int N;
int main()
{
// ios_base::sync_with_st... | ALGO | 0.999932 | 4.340024 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-06-20T06:22:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b38d6baf9... |
4bef2af4-a157-4fed-8026-e573fb1a79e4 | 1ridescent/ACM | CF/529/B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 1e17;
int N;
ll W[1005], H[1005];
ll process(int h)
{
vector<ll> save;
int cnt = 0;
ll width = 0;
for(int i = 0; i < N; i++)
{
if(W[i] > h && H[i] > h) return inf;
else if(W[i] <= h && H[i] > h) // lie down
{
width += H... | ALGO | 0.999975 | 3.92344 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2014-06-05T03:14: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": "51b5a0cd6... |
f6c07f89-986e-4dc3-b362-6832997c92dc | Git-MishRa/DSA_QuestionsPractise | Level1/8_StacksandQueues/11_CelebrityProblem.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
int main()
{
int n;
cin >> n;
string str;
stack<int> st;
int arr[n][n];
// Input
for (int i = 0; i < n; i++)
{
cin >> str;
for (int j = 0; j < n; j++)
{
arr[i][j] = str.at(j) ... | ALGO | 0.999983 | 4.27635 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-05-04T17:39:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "034af6783d77... |
ef40302c-1357-4a78-bcc1-eb3afb31f485 | Superm4n97/competetive-programming | Codeforces vol 01/699D.cpp | #include<bits/stdc++.h>
#define ll long long int
#define show(x) cout << #x << " : " << x << endl
#define maxn 200005
using namespace std;
ll n, A[maxn] , P[maxn], root = 0 , subroot = 0;
ll findParent(ll a)
{
if (P[a] == a)return a;
return P[a] = findParent(P[a]);
}
void makeParent(ll a, ll b)
{
... | ALGO | 0.999975 | 3.651114 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-12-16T18:34: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": "31a68bc4c1... |
e658c046-df44-4261-bad5-c0161b63f0a1 | Smak80/Tree_Full | Для методички - полноее дерево/main.cpp | #include <iostream>
#include <stack>
#include <Windows.h>
#include "tree.h"
using namespace std;
//-------------------------------------------------------------
//Вспомогательные функции
/// <summary>
/// Показ элементов дерева либо в виде древовидной структуры, либо списком
/// </summary>
/// <param name="t">Отобра... | TOOL | 0.976939 | 3.884878 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-02-10T11:46: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": "d50d1139b6... |
a435eb49-341f-444c-8b2a-bcd2e6b62e34 | pkiop/ALGORITHM | BOJ/문제들/b16234.cpp | #include <iostream>
#include <queue>
#include <algorithm>
#include <cstring>
using namespace std;
int map[50][50];
bool visited[50][50];
int dx[4] = { 1,-1,0,0 };
int dy[4] = { 0,0,1,-1 };
int main() {
ios_base::sync_with_stdio(false);
int N, L, R;
bool chk = true;
int ans = 0;
queue<pair<int, int>> q;
... | ALGO | 0.99984 | 3.548148 | {
"github_metadata": {
"branch": "master",
"commit_count": 319,
"repo_created_at": "2017-12-25T16:45:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a14323f4... |
be00b41c-bdd6-4785-8280-70996fd5389a | uxlfoundation/oneDNN | src/common/softmax.cpp | /*******************************************************************************
* Copyright 2016-2025 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.apa... | ALGO | 0.977146 | 7.392724 | {
"github_metadata": {
"branch": "main",
"commit_count": 20051,
"repo_created_at": "2016-05-09T23:26:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3839,
"forks": 1058,
"issues": 35,
"pull_requests": 120
},
"file_meta": {
"content_id": "... |
49a944d2-3555-4269-bb8d-5e94b1d9f16a | mmmim24/Academic | Class Codes/CSE138/20201206_SCC_DAG.cpp | #include<iostream>
#include<vector>
#include<stack>
#define sz 1000
using namespace std;
vector<int> adj[sz], radj[sz], nadj[sz], components[sz];
bool col[sz], vis[sz];
int group_id[sz];
stack<int>stk;
void DFS(int u)
{
col[u] = true;
for (int i = 0; i<adj[u].size(); i++)
if(!col[ adj[u][i] ])
... | ALGO | 0.999975 | 4.961441 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2020-11-13T01:28:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 19,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ff57b307b... |
b984c666-90bc-4e6c-919d-a9e28fb21a53 | 11Tanmay/cses_solutions | Graph Algorithms/Round Trip.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int N=2*1e5+1;
vector<int> graph[N];
vector<int> vis(N);
bool detect_cycle(vector<int> &cycle, int v,int p)
{
vis[v]=1;
cycle.push_back(v);
for(auto e: graph[v])
{
if(e==p)
{
continue;
}
... | ALGO | 0.999985 | 4.251727 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2023-11-02T19:07: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": "f777c65b6... |
74f03e75-a1b0-4cbf-a181-0e3ea605a15a | Dhiru12321/DSA-GFG | linkedList/doubly/reverseTheLinkedList.cpp | #include <iostream>
using namespace std;
struct Node{
int Data;
Node* prev;
Node* next;
Node(int data){
this->Data = data;
this->prev = NULL;
this->next = NULL;
}
};
// insert at any position of the linkedList
Node* insertAtAnyPosition(Node* &head, int data, int pos){
i... | ALGO | 0.999891 | 4.71724 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-12-21T16:22: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": "6c971ee75bab... |
df278656-7566-4982-87df-d9e465d5ef60 | ssonsk92/coding_test | Brute-Force_search_vowel_dic.cpp | #include <iostream>
#include <string>
#include <vector>
#include <stack>
using namespace std;
bool dfs(string combination, const string& word, int vowel_idx, int depth, int& answer)
{
if (depth == 5)
return false;
if (vowel_idx == 5)
{
return false;
}
vector<char> vowels = { 'A',... | ALGO | 0.999716 | 5.520792 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2022-07-18T15:41: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": "ab2fcf0d535... |
509699a9-4881-48ec-b9f9-f94788405fdd | kifah-s/Fundamentals_Of_Programming | Gammal_Tech_Academy/Core_Courses/2_C++_Programming_Language/Les_7_C++_Set/Exercises_2/Pro_3_Set_Of_Floating_Program/Set_Of_Floating_Program_V1.cpp |
//* Set Of Floating Program (Version 1).
/*
* Write a program that uses a set to store and automatically sort a sequence of floating-point numbers,
* Insert the values 3.5, 1.2, 2.8, 4.0, and 1.2 into the set.
! Output:
! Sorted Set Elemets: 1.2 2.8 3.5 4.0
*/
#include <iostream>
#include <array>
#include <vector>... | ALGO | 0.999499 | 4.64305 | {
"github_metadata": {
"branch": "main",
"commit_count": 2110,
"repo_created_at": "2023-04-07T14:22: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": "6090d97a1... |
0a970d2b-b51f-420d-9144-44645788c108 | kt117/ProCom | atcoder/abc/201-210/204/d.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << end... | ALGO | 0.999968 | 4.008027 | {
"github_metadata": {
"branch": "master",
"commit_count": 280,
"repo_created_at": "2020-04-09T05:59:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "c34aba2... |
32423536-dbcf-4160-ab73-a85f2dc64aa6 | DreadArceus/Codeforces | Contests/Mirrors/BOI Day 1/A.cpp | //This one's hard to think about, can't even figure out how to get the N ≤ 64 case
//The logic is trying all 64 possible critical values starting from 1 by running queries
//First to return 1 is the answer. Can't manage to do this without going outside of N.
#include <iostream>
using namespace std;
int main()
{
int t... | ALGO | 0.999829 | 3.127335 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2020-07-06T18:46:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "674fe4dff... |
0b7cda5f-1765-4490-84e8-8abe0f134c61 | karimalami7/MSSD | src/algoglouton.cpp | #include "algoglouton.h"
bool operator<(const DualSpace &a, const DualSpace &b){
if (a.poids < b.poids) return true;
if (a.dom < b.dom) return true;
else return a.equ<b.equ;
}
void listeAttributsPresents(Space subspace, Space d, vector<Space> &result){
/* retourne la liste des attributs d'un sous espace
... | ALGO | 0.991081 | 3.744323 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2019-01-18T11:07:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d0fd194e... |
93672718-15cf-4c2c-919f-64acfc210147 | clw5180/My-Practice-of-C-and-notes | 剑指offer/15.反转链表(代码的鲁棒性)/main.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
ListNode* createLinkList()
{
int num;
ListNode* pHead = NULL;
ListNode* pTemp = NULL;
cout << "please enter a node val:";
cin >> num;
if (num == ... | ALGO | 0.99955 | 4.21626 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2020-01-02T07:50:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "198637d57... |
0f012e00-6b79-4cf3-91ac-5da21b907f01 | aminjonshermatov/competitive_programming | yandex_algo_training/A_31.cpp | #include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...) 42
#endif
using namespace std;
using i64 = ::int64_t;
using ld = long double;
inline constexpr auto inf = numeric_limits<int>::max();
inline constexpr auto ninf = numeric_limits<int>::min();
using pii = pair<int, int>;
inline constex... | ALGO | 0.999907 | 4.298065 | {
"github_metadata": {
"branch": "master",
"commit_count": 1009,
"repo_created_at": "2022-06-30T12:19:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f430838... |
d065c991-bf5d-4130-ada3-1c9716f0f12f | 0Sigma0/algos | irunner/Search Trees/problem01/sol.cpp | #include <fstream>
class Tree {
public:
class Node {
public:
int key;
Node *left;
Node *right;
Node(int key) : key(key) {
left = nullptr;
right = nullptr;
}
};
... | ALGO | 0.99954 | 5.366962 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2022-10-23T13:59: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": "3e95c6b5933... |
573fb616-14ab-4c22-89ed-32e7869e82d6 | wangtaohhh/cpp-primer-plus-6th-answer | unit6/6_6.cpp | #include <iostream>
#include <string>
int main(){
using namespace std;
const int GRAND = 10000;
struct Patron {
string name;
double amount;
};
int contribute_num = 0;
cout << "Enter the number of contributor: ";
cin >> contribute_num;
cin.get();
Patron *contributi... | TOOL | 0.995198 | 4.040435 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-03-11T12:16: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": "3f530914212... |
2bd7aaff-ee54-49b4-910e-efc3d8cc18e1 | albertborges/crackingcodeinterview | 2-3.cpp | //
// main.m
// Executor
//
// Created by <NAME> on 7/19/18.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <iostream>
#include <vector>
#include <list>
using namespace std;
struct Node
{
int value;
Node* next;
};
void printLin... | ALGO | 0.991104 | 4.67986 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-07-27T00:16:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "592ee7938... |
85fd5c1f-fd43-4dda-b825-ed28d2668447 | dalam278/CS111-LAB | Lab10/Lab10a.cpp | #include <cstdlib>
#include <iostream>
#define size 100
using namespace std;
void rowSum(int arr[size][size] ,int m,int n){
int sum;
for(int i = 0; i < n; i++){
sum = 0;
for(int j = 0; j < m; j++){
sum = sum + arr[i][j];
}
cout<<"sum of "<<"row "<<i+1<<" is: " <<sum<<endl;
}
}
void columnSum(int arr[size][size], int m... | ALGO | 0.994647 | 4.059401 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2025-02-07T06:42: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": "88d3f87f3264... |
2f47c6c0-9f19-456c-b4f5-a78df27c038a | Kuglin/SoftwareMatematico-POO-2022 | test/testefuncao.cpp | /*
Author: Guilherme
Date: December, 9, 2022
Version: December, 9, 2022
*/
#include <iostream>
#include <string>
#include <stack>
#include <math.h>
#include <fstream>
using namespace std;
bool verfEmLista(char valor, string valores)
{
for (int i = 0; i < valores.length(); i++)
if (valor == valores[i])... | ALGO | 0.997771 | 4.353255 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-03-09T23:00:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "582b371954c7... |
f9ae3736-d149-4ccf-9306-80e258924766 | KetchuppOfficial/Triangles | include/intersection/space_to_plane.hpp | #ifndef INCLUDE_INTERSECTION_SPACE_TO_PLANE_HPP
#define INCLUDE_INTERSECTION_SPACE_TO_PLANE_HPP
#include <utility>
#include <stdexcept>
#include <cmath>
#include "point.hpp"
#include "segment.hpp"
#include "triangle.hpp"
#include "vector.hpp"
namespace yLab::geometry
{
namespace detail
{
enum class Axes { x, y, z ... | ALGO | 0.932538 | 7.389995 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2023-02-26T12:11: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": "1451970d... |
a21b9529-e8cc-494c-a240-0e004808f6d2 | raincross7/code-similarity | codes/train_code/problem220/problem220_122.cpp | /*
In the name of Allah
<NAME>
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
#define endl '\n'
#define all(a, n) for (int i = 0; i < n; i++) cout << a[i] << " "; cout << endl;
#define IOS ... | ALGO | 0.999934 | 3.078432 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07: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": "af0a41079d1c... |
e8e02dc8-5b54-466c-9584-8a8db1c83627 | szalonahulia/bonbon | cpp/palindromy.cpp | /*
* anagramy.cpp
*
*
*/
#include <iostream>
using namespace std;
void anagramy(char w[], int r) {
int i1 , i2 , i3 ,i4;
i1 = i2 = i3 = i4 = 0;
for (i1= 0; i1 < r; i1++) {
for (i2 = 0; i2 <r; i2++) {
if (i1 == 12) continue;
for ( i3 = 0 < r; i3++) {
... | ALGO | 0.999786 | 3.09836 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2018-09-05T06:37: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": "ee2f81613... |
ffe70988-4483-4b96-99e8-1f5fd12f3dd0 | ImKennyYip/cpp | 4. loops/23_RockPaperScissors.cpp | #include <iostream> //includes cstdlib, which includes rand
#include <string>
#include <ctime>
#include <cstdlib> //include rand()
using namespace std;
int main() {
string player;
string opponent;
int playerScore = 0;
int opponentScore = 0;
string rps[] = {"rock", "paper", "scissors"};
//srand... | ALGO | 0.92174 | 4.218307 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2024-03-11T13:36:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffe0f9163... |
52b167c8-66c6-4598-b877-b28c1a220aa5 | Cu7ious/Cpp_White_Belt | Week-3/004_Names-2/names.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
string FindNameByYear(int year, const map<int, string>& names) {
string name;
for (const auto& itm : names)
if (itm.first <= year)
name = itm.second;
else
break;
return (name);
}
string GetH... | ALGO | 0.942728 | 4.595069 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2018-03-04T11:57:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "642be076... |
675adc75-2b03-49f6-a216-5a5db834716e | GoPink/Baekjoon | DFS/Q2447.cpp | #include <iostream>
using namespace std;
char map[2500][2500];
void star(int size,int w, int h );
int main(void) {
int T = 0;
scanf("%d", &T);
for (int i = 0; i < T; i++) {
for (int j = 0; j < T; j++)
map[i][j] = ' ';
}
star(T,0,0);
for (int i = 0; i < T; i++) {
for (int j = 0; j < T; j++) {
printf("%... | ALGO | 0.999715 | 3.094708 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2017-09-24T04:40: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": "c0d0e1fb9... |
32355525-8c76-4ab7-9496-7d158e5fd2da | Xilinx/merlin-compiler | trunk/source-opt/tools/function_outline/src/function_outline.cpp | // (C) Copyright 2016-2021 Xilinx, Inc.
// All Rights Reserved.
//
// 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 yo... | TOOL | 0.978502 | 3.638181 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-08-03T08:55:11.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 58,
"forks": 17,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "030009e23f... |
c45ee885-fcc0-48f2-a674-3d6247d1f78c | kunidesuyo/competitive-programming | ABC/301~350/308/E.cpp | #include <bits/stdc++.h>
#include <cmath>
#define all(x) (x).begin(), (x).end()
using ll = long long;
const ll INF = 1LL << 60;
const int inf = INT_MAX / 2;
using namespace std;
int c(int i, int j, int k) {
for (int u = 0; u < 3; u++) {
if (u == i || u == j || u == k)
continue;
else
return u;... | ALGO | 0.999838 | 4.288226 | {
"github_metadata": {
"branch": "master",
"commit_count": 332,
"repo_created_at": "2021-05-23T09: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": "710fa7a1... |
9161229a-7ba5-41bf-a51c-4d3bb401706c | detrevni/Timus-OJ | 1590.cpp | #include <iostream>
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <climits>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <utility>
#include <sstream>
#include <num... | ALGO | 0.999951 | 3.376516 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2016-02-24T04:07: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": "587a2f748... |
b865d0df-d914-43b4-b030-ba91fb85194c | annamarieweber/cellularautomataframework | examples/politics_example.cxx | #include "CellularAutomata.h"
#include "ComputeEngine.h"
#include "myutils.h"
#include <iostream>
#include <vector>
#include <map>
int main(void)
{
// Example 1:
// Political Cellular Automata example with majority rule and moore neighborhood made with densities
std::cout << "Creating Political Cellular Au... | ALGO | 0.999415 | 6.127195 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2021-11-08T23:39:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 5,
"pull_requests": 4
},
"file_meta": {
"content_id": "8fcf4d697ce... |
925a612c-d12a-4804-ac35-541d1b17a860 | Harman061/Leetcode | 1325-path-with-maximum-probability/path-with-maximum-probability.cpp | #include <iostream>
#include <queue>
#include <unordered_map>
#include <vector>
class Solution {
public:
double maxProbability(int n, std::vector<std::vector<int>>& edges,
std::vector<double>& succProb, int start, int end) {
std::unordered_map<int, std::vector<std::pair<int, int>>... | ALGO | 0.999915 | 6.79031 | {
"github_metadata": {
"branch": "main",
"commit_count": 1212,
"repo_created_at": "2023-10-13T16:40: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": "f7c0ed4e4... |
dd9d6ef6-b04c-4a14-a1f2-484086ad4ce8 | naturalself/topcoder_srms | topcoder/Taxi.cpp | // BEGIN CUT HERE
// END CUT HERE
#line 5 "Taxi.cpp"
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <fu... | ALGO | 0.999612 | 3.870113 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2009-12-21T13:38:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3c112bd4... |
731191f0-4137-4e93-ad27-f0a188f789a1 | ZhongZeng/Leetcode | lc381insDelRndOII.cpp |
/*
Leetcode 381. Insert Delete GetRandom O(1) - Duplicates allowed
This is not much harder than 380. Insert Delete GetRandom O(1)
Companies
Yelp
Related Topics
Array, Hash Table, Design
Similar Questions
Insert Delete GetRandom O(1)
Next challenges: Implement Queue using Stacks,
3Sum Smaller, Design Hit Cou... | ALGO | 0.987404 | 6.462124 | {
"github_metadata": {
"branch": "master",
"commit_count": 943,
"repo_created_at": "2017-03-03T15:41:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "226d76b9... |
c8ee91d5-4940-4e5d-9e19-8e331f7c9521 | Mr-Jeffery/CppProjects | lab/lab7/ex2/ex2.cpp | #include <iostream>
#include <string>
template <typename T>
int Compare(const T &a, const T &b) {
if (a > b) return 1;
else if (a < b) return -1;
else return 0;
}
// Explicit specialization for struct studentInfo
struct studentInfo {
std::string name;
int age;
};
template <>
int Compare(const stu... | TOOL | 0.938735 | 5.96961 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-03-13T02:58: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": "769e2d0c1ef6... |
b25090d8-a1b0-4b2b-81cd-6160a4550ce4 | DSCmatter/Cplusplus-codes | again/another_.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <ctime>
#include <algorithm>
using namespace std;
class Question {
private:
string question;
vector<string> options;
char correctAnswer;
public:
Question(string q, vector<string> opts, char ans) : question(q), options(opts), correctAns... | ALGO | 0.953407 | 5.581518 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-09-27T11:31: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": "395ea7337e97... |
d3305eb7-4e08-4d72-8dfe-e26b875763ae | minstaar/beakjoon | 2024/32346.cpp | #include <iostream>
#include <string>
#include <cstring>
using namespace std;
const int MOD = 1e9 + 7;
int dp[2010][2010];
int comb(int n, int r)
{
if(r == 0 || n == r) return 1;
int &ret = dp[n][r];
if(ret != -1) return ret;
return ret = (comb(n - 1, r - 1) + comb(n - 1, r)) % MOD;
}
int main()
{
... | ALGO | 0.999994 | 3.933208 | {
"github_metadata": {
"branch": "main",
"commit_count": 826,
"repo_created_at": "2024-04-04T11:03:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d382853fda... |
6e2c00f7-8c07-4c8d-9ced-8000b85f44f3 | daidai21/Leetcode | Algorithms/C++/19-Remove_Nth_Node_From_End_of_List.cpp | // Runtime: 0 ms, faster than 100.00% of C++ online submissions for Remove Nth Node From End of List.
// Memory Usage: 8.4 MB, less than 89.92% of C++ online submissions for Remove Nth Node From End of List.
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* Lis... | ALGO | 0.999975 | 5.88844 | {
"github_metadata": {
"branch": "master",
"commit_count": 416,
"repo_created_at": "2019-01-28T13:40:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b79a6d8... |
6ba6c869-77cd-471a-919f-d96ec7e15e84 | YashviGulati/LeetCode | 14. 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 "".
Example 1:
Input: ["flower","flow","flight"]
Output: "fl"
Example 2:
Input: ["dog","racecar","car"]
Output: ""
Explanation: There is no common prefix among the input st... | ALGO | 0.999961 | 6.468268 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2020-01-13T17:51:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9401df7d... |
20bc66eb-8d7d-41cd-b37a-1fa02c6298e0 | Maham109/aicp-coding-internship | tic tac toe game.cpp | #include <iostream>
using namespace std;
char space[3][3]={{'1','2','3'},{'4','5','6'},{'7','8','9'}};
string n1="";
string n2="";
int row;
int column;
char token='x';
bool tie=false;
void board(){//Board of the game
cout<<"\t\t\t | | \n";
cout<<"\t\t\t "<<space[0][0]<<" | "<<space[0][1]<<" |"<<space[0][2... | ALGO | 0.999756 | 4.054766 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-11-11T13:17: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": "e1698f089c42... |
d70f6f3f-2363-49af-9a35-0b64cdc87f02 | VERBLYUDOK/OS-labs | lab4/program1.cpp | #include <iostream>
#include <vector>
#include "functions.h"
int main() {
std::cout << "Программа №1 (статическая линковка)\n";
while (true) {
std::cout << "\nВведите команду:\n";
std::cout << "1 A deltaX - вычислить производную cos(A) с приращением deltaX\n";
std::cout << "2 N elem1 e... | ALGO | 0.998194 | 4.445197 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2024-09-13T18:48:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8dedffcd1b6... |
d05e352c-9919-440f-838d-2246f008144a | Amoghprakash2k4/LEETCODE | 0031-next-permutation/0031-next-permutation.cpp | class Solution {
public:
void nextPermutation(vector<int>& nums) {
// next_permutation(nums.begin(), nums.end());
int n = nums.size();
int i = n - 2;
// Step 1: Find the first decreasing element from the end
while (i >= 0 && nums[i] >= nums[i + 1]) {
i--;... | ALGO | 0.999987 | 6.38511 | {
"github_metadata": {
"branch": "main",
"commit_count": 812,
"repo_created_at": "2025-04-01T17:23: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": "18fb432142... |
4e57927c-196d-4560-81ff-849935a02e88 | DeniGarnica/Algoritmos2 | 40Problemas/10978LetsPlayMagic.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
int num_cards;
std::cin >> num_cards;
while(num_cards){
int disponibles = num_cards;
string Orden[num_cards]; //En que orden estaban las cartas
int Marcadas[num_cards]; //Ma... | ALGO | 0.99958 | 4.144941 | {
"github_metadata": {
"branch": "main",
"commit_count": 168,
"repo_created_at": "2021-01-18T22:19: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": "f718fd2409... |
97cad2f5-9c79-4cd6-bb82-4e87842cdf82 | fazeisfaze/Competitive-Programming | VanDeTrongTinHoc/Dijkstra's application/SumDuongDiNganNhat.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int,int> ii;
#define FORW(i,a,b) for(int i=a;i<=b;i++)
#define FORB(i,a,b) for (int i=a;i>=b;i--)
#define forw(i,a,b) for (ll i=a;i<=b;i++)
#define forb(i,a,b) for (ll i=a;i>=b;i--)
#define fast {ios::sync_with_stdio(false); cin.tie(0)... | ALGO | 0.999941 | 4.401709 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2022-01-21T10:08: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": "091dac0ee5c... |
e1667bdf-aa67-4fdd-a4eb-25aeb8370377 | AlasdairWJ/AdventOfCode | 2021/03/aoc2021_03b.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm> // std::count_if, std::remove_if,
int parse(const std::string& binary)
{
int total = 0;
for (int i = binary.size() - 1, p = 1; i >= 0; i--, p <<= 1)
{
if (binary[i] == '1')
total += p;
}
return total;
}
int main(int argc, const ch... | ALGO | 0.999916 | 5.740536 | {
"github_metadata": {
"branch": "main",
"commit_count": 185,
"repo_created_at": "2020-12-09T16:09:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dd0c4c4d10... |
f346537a-a018-4245-89bd-0732344426a6 | opencv/opencv_contrib | modules/tracking/src/tldUtils.hpp | #ifndef OPENCV_TLD_UTILS
#define OPENCV_TLD_UTILS
namespace cv {
inline namespace tracking {
namespace impl {
namespace tld {
//debug functions and variables
#define ALEX_DEBUG
#ifdef ALEX_DEBUG
#define dfprintf(x) fprintf x
#define dprintf(x) printf x
#else
#define dfprintf(x)
#define dprintf(x)
#e... | TOOL | 0.911997 | 6.396633 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 4557,
"repo_created_at": "2013-09-11T13:28:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 9757,
"forks": 5828,
"issues": 553,
"pull_requests": 88
},
"file_meta": {
"content_id": "e3... |
f88284b6-4bf2-40c8-a9ea-63cfb863aa1f | pytorch/pytorch | torch/csrc/autograd/autograd.h | #pragma once
#include <torch/csrc/autograd/variable.h>
namespace torch::autograd {
/// Computes the sum of gradients of given tensors with respect to graph leaves.
///
/// The graph is differentiated using the chain rule. If any of ``tensors``
/// are non-scalar (i.e. their data has more than one element) and requir... | ALGO | 0.989087 | 6.977478 | {
"github_metadata": {
"branch": "main",
"commit_count": 90499,
"repo_created_at": "2016-08-13T05:26:41.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 91573,
"forks": 24684,
"issues": 5000,
"pull_requests": 1303
},
"file_meta": {
"content_i... |
d2797db3-b726-4e24-9e38-90a55fcb00f8 | subhash-halder/competitive-programming | leetcode/string-to-int-atoi.cpp | #include <cassert>
#include <cmath>
#include <cstdint>
#include <iostream>
#define assertm(exp, msg) \
cout << "testing: " << msg << endl; \
assert(exp); \
... | ALGO | 0.986804 | 5.107263 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-05-18T02:49: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": "0fec967b7b... |
72e549dc-08f5-4454-a77b-8b89a5a7424d | shauenstein/Anoctua | LOSim/src/Individual.h | /*
* Individual.h
*
* Created on: 31 Mar 2016
* Author: SH
*/
#ifndef INDIVIDUAL_H_INCLUDED__
#define INDIVIDUAL_H_INCLUDED__
#include <math.h>
//[[Rcpp::plugins(cpp11)]]
// [[RCPP::deppends(BH)]]
#include "Environment.h"
#include "RandomGenerator.h"
#include "Solar.h"
#include <boost/math/distributions.hp... | ALGO | 0.952504 | 6.01887 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-08-22T11:41:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa8f943c7... |
eee60390-845a-4cfd-a095-1365cae701aa | firebase/firebase-ios-sdk | Firestore/core/src/immutable/array_sorted_map.h | /*
* Copyright 2018 Google LLC
*
* 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 ... | TOOL | 0.98413 | 7.537314 | {
"github_metadata": {
"branch": "main",
"commit_count": 7964,
"repo_created_at": "2017-04-22T00:26:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6275,
"forks": 1639,
"issues": 357,
"pull_requests": 86
},
"file_meta": {
"content_id": "e... |
685a4ea8-fe8f-4968-abdd-02db20d6ce65 | Bhumika2423/Fretron | Kill_all_and_return_home.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
const int CHESS_BOARD_SIZE = 8;
struct Cell {
int row;
int col;
Cell(int r = -1, int c = -1) : row(r), col(c) {}
};
struct Soldier {
Cell position;
};
struct Castle {
Cell position;
Castle(int r, int c) : positio... | ALGO | 0.99896 | 4.676221 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-08-02T10:49: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": "f2b077827f... |
08153a40-167f-41eb-9be8-c0319ad657ed | aajjbb/contest-files | URI/Efilogue.cpp | #include <bits/stdc++.h>
template<typename T> T gcd(T a, T b) {
if(!b) return a;
return gcd(b, a % b);
}
template<typename T> T lcm(T a, T b) {
return a * b / gcd(a, b);
}
template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; }
template<typename T> void chmax(T& a, T b) { a = (a < b) ? b : a... | ALGO | 0.999684 | 3.840902 | {
"github_metadata": {
"branch": "master",
"commit_count": 892,
"repo_created_at": "2016-03-02T13:05:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b69f4b2... |
dee61cb4-e1a7-4ee9-9369-ce412b13c4e7 | swapnilkant11/leetcode-problem-solutions-in-cpp | Dynamic Programming/IsSubsequence.cpp | // Given a string s and a string t, check if s is subsequence of t.
// You may assume that there is only lower case English letters in both s and t. t is potentially a very long (length ~= 500,000) string, and s is a short string (<=100).
// A subsequence of a string is a new string which is formed from the original st... | ALGO | 0.998251 | 4.64987 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2020-05-09T16:56:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5889dd96... |
5bad6a23-64ac-4b77-9fb4-76993ccda519 | Seon-dongun/2024CppCodingTestPractice | 백준/Gold/20055. 컨베이어 벨트 위의 로봇/컨베이어 벨트 위의 로봇.cc | #include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
using namespace std;
deque<int> belt;
deque<bool> robot;
int check() {
int cnt = 0;
for (int i = 0; i < belt.size(); i++) {
if (belt[i] <= 0)
cnt++;
}
return cnt;
}
void rotate(int n) {
belt.push_front... | ALGO | 0.999992 | 3.610531 | {
"github_metadata": {
"branch": "main",
"commit_count": 376,
"repo_created_at": "2024-02-07T07:09: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": "403313c73e... |
48fbb4c8-2244-4466-8527-c1733a596a29 | topology-tool-kit/ttk | core/base/persistenceDiagramClustering/PersistenceDiagramBarycenter.h | /// \ingroup base
/// \class ttk::PersistenceDiagramBarycenter
/// \author <NAME> <<EMAIL>>
/// \author <NAME> <<EMAIL>>
/// \date September 2019
///
/// \b Related \b publication \n
/// "Progressive Wasserstein Barycenters of Persistence Diagrams" \n
/// <NAME>, <NAME> and <NAME> \n
/// Proc. of IEEE VIS 2019.\n
/// I... | ALGO | 0.979535 | 6.752995 | {
"github_metadata": {
"branch": "dev",
"commit_count": 8465,
"repo_created_at": "2017-03-05T07:41:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 447,
"forks": 129,
"issues": 18,
"pull_requests": 12
},
"file_meta": {
"content_id": "fd60... |
ff793c0a-4f02-4418-98b9-3e794fe041ad | sossos5989/algorithm | algospot/dictionary.cc | #include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
#define fastIO cin.tie(0)->sync_with_stdio(0)
using namespace std;
int main() {
fastIO;
int C;
cin >> C;
while (C--) {
int n;
string prev, now;
vector<vector<int>> alphabet(26); // 그래프
int inDegr... | ALGO | 0.999969 | 4.774492 | {
"github_metadata": {
"branch": "main",
"commit_count": 52,
"repo_created_at": "2024-12-21T15:37:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f1e0fd7c759... |
01a621bd-53fe-475e-ab2f-87faca75c41d | ravi956/dsa-in-cpp | Dynamic Programming (Aditya Verma)/11_coin_change_min_no_of_coins.cpp | // In this problem, you have to calculate the minimum no. of coins required to make the change
#include <bits/stdc++.h>
using namespace std;
int knapsackBU(int coin[], int sum, int n)
{
int dp[n + 1][sum + 1];
//both loops can be combined at one place
for (int i = 0; i <= n; i++) //For handling base case
... | ALGO | 0.999913 | 4.107785 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2020-09-10T17:45:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be772f6b6... |
cd1e0e18-f8d5-4844-9a94-5c3f01c48e93 | olvard/raytracing | camera.cpp | //
// Created by <NAME> on 2024-09-10.
//
#include "camera.h"
#include <vector>
#include <fstream>
#include <future>
#include <iostream>
#include <glm/glm.hpp>
#include <thread>
#include <mutex>
Camera::Camera(const glm::vec3& eye, const glm::vec3& c1, const glm::vec3& c2,
const glm::vec3& c3, const glm::vec... | ALGO | 0.99351 | 6.509453 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-09-10T13:43: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": "74b3b29d9e1... |
ae0b72a3-8fed-4af2-9e26-7703827facee | auroraphtgrp01/C-Project-by-Auroraphtgrp | BINARY_SEARCH_NODEQUY_QUICKSORT.cpp | #include<iostream>
#include<time.h>
#include<stdlib.h>
#include <windows.h>
using namespace std;
void Input(long long A[], int &N,int &X) {
cin>>N;
for(int i=0 ; i<N ; i++ ) {
A[i]=rand()%1000000000;
}
X = rand()%1000000000;
}
void quick_Sort(long long A[200],int l, int r){
if(l>=r) return;
int pivot = A[(l+r... | ALGO | 0.999897 | 3.910887 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-11-19T07:32: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": "8b57c3f1c1ca... |
ff514816-8575-4601-8e8a-a4cbcac8d08c | mdtariqueh007/My_GFG | Difficulty: Hard/Burning Tree/burning-tree.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
Node *buildTree(string str) {
// Corner Case
if (str.length() == 0 || st... | ALGO | 0.999831 | 5.728436 | {
"github_metadata": {
"branch": "main",
"commit_count": 781,
"repo_created_at": "2024-02-26T18:32: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": "94cf288271... |
230c60b6-02f3-45ad-aa4e-e16fab41611f | Sunhare/PigModelProject2021 | Code/2D_Bardia/lib/PIG_TISSUE.hpp | #ifndef PTISSUE__HPP
#define PTISSUE__HPP
#include "pig_ecc_biophysJ2021.hpp"
#ifdef _OPENMP
#include <omp.h>
#endif
class PIG_TISSUE
{
public:
const int NX;
const int NY;
const int NN;
double *tmp;
const double dfu=0.0005;
const double dx=0.015;//0.15 mm
const double dt;
PIG_ECC **tissue = new PIG_EC... | ALGO | 0.967007 | 4.425767 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-02-03T00:25: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": "e96a9a7f78e... |
b3a2c6bc-cd51-4529-9e0f-cbec827d2598 | ishandutta2007/codeforces-r | rfpermen/normal/1293/E.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#define ll long long
#define ull unsigned long long
#define rep(i,n,N) for(int i=n;i<=N;++i)
#define rap(i,n,N) for(int i=n;i>=N;--i)
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#def... | ALGO | 0.995544 | 3.459463 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6b8270804f5b... |
037c03d7-5384-4cd1-90e3-7f7974a86c77 | 1998factorial/CP_pratice | DynamicProgramming/2100_2300/CF623B.cpp | #pragma GCC optimize(3)
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef pair<ll , ll> pll;
typedef pair<int , int> pii;
typedef long double ld;
const int maxn = 1e6 + 10;
const int inf32 = 1e9;
const ll inf64 = 1e18;
int N , A , B;
int... | ALGO | 0.999891 | 3.905365 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2021-04-10T06:23: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": "488bb3b2b83... |
7bd4df03-d927-4d88-ac3d-6f12c4960d1f | ADebnath98/Leetcode-DSA-Problems | 1489. Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree.cpp | Approach
It is an extenstion of Kruskal's Algorithm to find the critical and pseudo critical edges.
Complexity
Time complexity: E^2 + E*logE
Space complexity: V , V is nodes
Neglecting the space required to store answer.
class Solution {
public:
class DSU{
public:
vector <int> parent;
... | ALGO | 0.999969 | 5.615903 | {
"github_metadata": {
"branch": "main",
"commit_count": 433,
"repo_created_at": "2022-02-01T09:14: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": "22bf9c421e... |
9562c049-297d-4ec9-8126-c0b0f876ef19 | ishandutta2007/codeforces-x | xuanquang1999/normal/84/B.cpp | using namespace std;
#include <bits/stdc++.h>
#define fdto(i, r, l) for(int i = r; i >= l; --i)
#define fto(i, l, r) for(int i = l; i <= r; ++i)
#define forit(it, type, var) for(type::iterator it = var.begin(); it != var.end(); it++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define fi first
#define se second... | ALGO | 0.9997 | 3.557614 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31282a8f715c... |
42fa771b-6ca6-473f-a0fb-392589d11774 | shivamofficial/cpp_question | frequency_of_element.cpp | #include <iostream>
using namespace std;
int main() {
int n, count;
//enter the size of the array
cout << "Enter the size of the array: ";
cin >> n;
//declare input and visited array, both of size 'n'
int array[n], visited[n];
//take inputs in the array
cout << "Enter " <... | ALGO | 0.999831 | 3.955323 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-08-17T04:05:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ace02a4a4e27... |
caa959d4-5156-4a5a-bf08-d28c15f31eb0 | mrpawan-gupta/Competitve-Coding | 01. CodeForces/1]. Problem Set/A/A_Vanya_and_Fence.cpp | #include <bits/stdc++.h>
using namespace std;
using l = long;
using ll = long long;
using vb = vector<bool>;
using vvb = vector<vb>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<long>;
using vll = vector<long long>;
using vvl = vector<vl>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs =... | ALGO | 0.999874 | 3.679834 | {
"github_metadata": {
"branch": "master",
"commit_count": 1794,
"repo_created_at": "2021-10-15T13:41:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afd0e2b... |
53ee376d-e56f-4d5c-b3a8-8f5f1ef345c3 | ishandutta2007/codeforces-a | andreikkaa/normal/607/B.cpp | /* ______ INCLUDES ______ */
#include <bits/stdc++.h>
/* _____ NAMESPACES _____ */
using namespace std;
/* ______ TEMPLATE ______ */
typedef long long ll;
typedef long double ld;
inline void _redirect_streams(const string input = "", const string output = "")
{
if(not input.empty())
assert(freopen(input.c_str(... | ALGO | 0.999549 | 3.837742 | {
"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": "4f61d713a446... |
2712ff6d-f3fb-42c8-9d14-3ea519b6baed | Codesmith28/cse205-ds | cp/leetcode_gfg/1707.cpp | #include <bits/stdc++.h>
using namespace std;
/* (╯°□°)╯︵ ┻━┻ */
struct TrieNode {
TrieNode *child[2];
bool isEnd;
TrieNode() {
isEnd = false;
for (int i = 0; i < 2; i++) child[i] = NULL;
}
};
void insert(TrieNode *root, string key) {
TrieNode *node = root;
for (char c : key) {
... | ALGO | 0.999983 | 5.5662 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2023-08-03T15:15: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": "081009fa9f8... |
53916b56-3d88-4267-a587-2c13253e5d0e | raincross7/code-similarity | codes/train_code/problem488/problem488_345.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#define MOD (1000000007)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> tup;
const int MAX = 510000;
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = f... | ALGO | 0.999893 | 4.511516 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07: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": "249384fe0ece... |
cd70890e-02e5-48bc-9c95-10599351abbe | notwatermango/Kattis-Problem-Archive | below2.1/beehives.cc | #include <iostream>
using namespace std;
int main()
{
double dist;
int bee;
while (true)
{
cin >> dist >> bee;
if (bee == 0)
{
break;
}
double arrx[bee];
double arry[bee];
for (int i = 0; i < bee; i++)
{
cin >> arrx... | ALGO | 0.99975 | 3.903736 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2021-05-27T10:52: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": "cf54b6373ed... |
bf7dcb67-2cae-453f-a1df-53b1eee67b04 | emorgan00/notebook | algo/kosaraju_old.cpp | // Accepts an adjacency list, and returns a vector of which component
// each vertex is in. Runs in O(V+E).
void visit(int i, vector<vector<int>>& adj, vector<int>& order, vector<bool>& visited) {
visited[i] = 1;
for (int j : adj[i])
if (!visited[j])
visit(j, adj, order, visited);
order... | ALGO | 0.999879 | 6.271452 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2020-04-11T18:59:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15a59e0e... |
aed46cfe-e9a5-4104-b4e5-fa81643f8740 | sailor-ux/mycodes | leetcode_vscode/leetcode_99/leetcode_99.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode* left;
TreeNode* right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode* left, TreeNode* right... | ALGO | 0.999998 | 5.636777 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2019-10-11T08:27: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": "91fc2ab18b0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.