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 |
|---|---|---|---|---|---|---|---|
a7abf98b-1c73-42bf-917e-187edab4ca88 | zimpha/competitive-programming | polish-olympiad-in-informatics/xxvii/ukl.cc | #include <cstdio>
#include <algorithm>
using pii = std::pair<int, int>;
const int N = 1001;
bool mark[N][N];
int main() {
int n, m, k;
scanf("%d%d%d", &n, &m, &k);
if (n % 2 == 0 && m % 2 == 0) {
if (k < n + m - 1 || k > n * m - 1) {
puts("NIE");
return 0;
}
} else {
if (k < n + m - ... | ALGO | 0.99971 | 3.606913 | {
"github_metadata": {
"branch": "master",
"commit_count": 352,
"repo_created_at": "2016-08-17T16:37:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 36,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a788b... |
5130dc95-1383-4f56-a42e-a930f9b2a8f8 | AndyChenYH/leetcode | minPathSum.cpp | #include <stdio.h>
#include <algorithm>
using namespace std;
/*
* dp[i][j] denotes min path from (i, j) to (LN - 1, LM - 1)
* dp[LN - 1][LM - 1] = mb[i][j];
* dp[i][j] = mb[i][j] + min(dp[i + 1][j], dp[i][j + 1]);
*/
const int MN = 2000, INF = 1e9 + 10;
int LN, LM, mb[MN][MN], dp[MN][MN];
int main() {
freopen("in"... | ALGO | 0.999905 | 3.918053 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-07-02T18:03: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": "8d8c9e08448... |
7fd23eaf-fbf8-4cd1-beb1-c8c411b2f702 | Zildj1an/Zildj1an_Chess | jugada.h | #ifndef _JUGADA_H_
#define _JUGADA_H_
#define pieza_negra(x,y) \
tablero[x][y].color == NEGRO && tablero[x][y].viva
static inline int invalid_movement(movimiento_t *movimiento, int color){
int x,y,s_x,s_y,d_x,d_y;
s_x = movimiento->s_x;
s_y = movimiento->s_y;
d_x = movimiento->d_x;
d_y = movimiento->d_y;
if... | ALGO | 0.994142 | 5.554312 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-04-24T20:37: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": "b04a7169c8... |
7681755b-7194-45aa-b3ac-2dbf151b703f | nishatrhythm/Data-Structure-Lab | Lec 16.1 (Binary Tree).cpp | #include <iostream>
#include <math.h>
#include <conio.h>
using namespace std;
int n;
int tree[20];
int root(int key)
{
if(tree[1] != '\0') //jodi root value garbage na hoy tobe samne egubo.
{
cout << "Root is already exists." << endl;
}
else
{
tree[1] = key;
}
return 0;
... | ALGO | 0.999812 | 3.621502 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-12-15T09:15:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2fc0fdf11269... |
528f554e-2cf3-4710-af2a-6cace1669d42 | jbsilva/Programming_Challenges | SPOJ_BR/4885-paises_em_guerra.cpp | // ============================================================================
//
// Filename: 4885-paises_em_guerra.cpp (SPOJ BR)
// 01148-paises_em_guerra.cpp (URI)
//
// Description: SPOJ BR 4885 - Países em Guerra
// URI 1148 - Países em Guerra
// Prime... | ALGO | 0.999955 | 4.022738 | {
"github_metadata": {
"branch": "main",
"commit_count": 325,
"repo_created_at": "2016-01-13T18:31:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8fb2b7bb2... |
33779d3a-a4a0-4fba-bc3c-610aeb9be22c | ishandutta2007/codeforces-a | al13n/normal/49/B.cpp | #pragma comment(linker,"/STACK:228000000")
#include <vector>
#include <cstring>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#incl... | ALGO | 0.999674 | 3.381576 | {
"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": "8cb1536338cf... |
1f1fa160-35f2-4ff4-a15c-de991c7e531f | harshit779921/DSA-with-C_Plus_Plus | Sortings/insertion_sort.c++ | #include <bits/stdc++.h>
using namespace std;
void insertion_sort(int arr[], int n)
{
// insertion sort
for (int i = n - 1; i >= n - 1; i--)
{
int j =i;
for (int j = 0; j <= n - 1; j++)
{
while (arr[j] > 0 && arr[j - 1] > arr[j])
{
int temp =... | ALGO | 0.999985 | 5.336761 | {
"github_metadata": {
"branch": "main",
"commit_count": 293,
"repo_created_at": "2024-05-06T10:11: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": "236d2a4f38... |
8f38fc76-fb7b-424d-8f0d-e6bcd84e585d | astikasinha/Cpp-Coding | cpp coding/graph/kruskal.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
struct Edge {
int src, dest, weight;
};
struct Graph {
int V, E;
vector<Edge> edges;
};
struct subset {
int parent;
int rank;
};
int find(subset subsets[], int i) {
if (subsets[i].parent != i)
subsets[i].par... | ALGO | 0.999992 | 5.523527 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-01-23T16:43: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": "dd5f11622026... |
5d1cdb1b-d7dc-425f-aae8-c8e50b21535d | amedhi/SlaveSpinMF | src/ssmf/root_solver.cpp | /*---------------------------------------------------------------------------
* @Author: <NAME>, <EMAIL>
* @Date: 2018-09-18 17:33:36
* @Last Modified by: <NAME>, <EMAIL>
* @Last Modified time: 2020-06-11 00:06:57
*----------------------------------------------------------------------------*/
#include <cassert>
#in... | ALGO | 0.996902 | 4.960325 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2018-09-08T09:30:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a22f31041... |
0f7291c1-e55b-4587-8351-4b89509a11c4 | jesushilarioh/DelMarCSi.cpp | SourceCode/Chapter 10/Pr10-14.cpp | // This program demonstrates a function, countChars, that counts
// the number of times a specific character appears in a string.
#include <iostream>
using namespace std;
int countChars(char *, char); // Function prototype
int main()
{
const int SIZE = 51; // Array size
char userString[SIZE]; // To hold a ... | ALGO | 0.998176 | 5.918658 | {
"github_metadata": {
"branch": "master",
"commit_count": 192,
"repo_created_at": "2016-09-20T01:58:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e45facef... |
0cffdc96-15c5-4a33-adb6-a85e4c471873 | VenkataDurgareddy/owl-progs | Medium/Word Break/word-break.cpp | //{ Driver Code Starts
//Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
// s : given string to search
// dictionary : vector of available strings
class Solution
{
public:
int wordbreak(map<string,int>&m,string &s,int ind)
{
... | ALGO | 0.999629 | 5.011163 | {
"github_metadata": {
"branch": "main",
"commit_count": 717,
"repo_created_at": "2024-01-05T12:12: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": "019e07cf8d... |
a1cf2181-b6fc-4410-9335-3e4033968918 | user992199/Illuminati_Live_Oct2022 | 03-02/rat_in_a_maze_2.cpp | #include<iostream>
using namespace std;
void print(char arr[][10], int m, int n, int sn){
cout<<"Solution "<<sn<<":-\n";
for(int i = 0; i < m; i++){
for(int j = 0; j < n; j++){
if(arr[i][j] == '1')
cout<<arr[i][j];
else{
cout<<" ";
}
}
cout<<endl;
}
}
bool rat_in_a_maze(char arr[][10], int i, ... | ALGO | 0.999894 | 4.19279 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2022-11-01T13:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ccea0d0949... |
3d31f01d-a5d0-4b48-b2b5-d18524c795e0 | nextsimhub/nextsimdg | dynamics/src/include/dgLimiters.hpp | /*!
* @file dgLimiters.hpp
* @date 1 Mar 2022
* @author <NAME> <<EMAIL>>
*/
#ifndef __LIMITERS_HPP
#define __LIMITERS_HPP
#include "dgVector.hpp"
/*
MUST BE NEWLY REWRITTEN FOR THE NEW MESH IF NEEDED
namespace Nextsim {
template <int DGdegree>
class Limiter {
const Mesh& mesh;
Nextsim::DGVector<2> ... | ALGO | 0.994308 | 4.711131 | {
"github_metadata": {
"branch": "develop",
"commit_count": 3969,
"repo_created_at": "2021-08-31T14:02:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 18,
"issues": 118,
"pull_requests": 21
},
"file_meta": {
"content_id": "6f... |
d3adc8f4-5824-4686-8e5d-869da60380ea | Mokuroh54/Comp_Prog | Current/Templates/Graph/HLD.cpp | struct ST {
vector<ll> seg;
ST() {ST(0);}
ST(int n) {seg.resize(1 + 4 * n);}
void update(int a, int v, int cid, int ss, int se)
{
if (ss == se)
{
seg[cid] = v;
return;
}
int mid = (ss + se) / 2;
if (a <= mid) update(a, v, cid * 2, ss... | ALGO | 0.999977 | 3.865293 | {
"github_metadata": {
"branch": "main",
"commit_count": 111,
"repo_created_at": "2022-11-22T15:14: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": "8ab2c5ba5e... |
bb68375b-14a6-4daa-a046-b9328217d643 | Oriburger/problem_solving_1w3solve | BOJ/4179_불!.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct Pos { int y; int x; };
const int INF = 2147000000;
const int dx[4]={1,-1,0,0};
const int dy[4]={0,0,1,-1};
int r, c, answer=INF;
int playerMv[1001][1001], fireMv[1001][1001];
char board[1001][1001];
vector<Pos> fireStPos;
vector<Pos> e... | ALGO | 0.999941 | 4.490744 | {
"github_metadata": {
"branch": "master",
"commit_count": 1652,
"repo_created_at": "2020-06-20T13:15:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bc5889... |
18536ecc-5cc3-4aab-abc0-b41a434ea1b2 | AM-Darshan/Compitaive-Programming | level2/A_Translation.cpp | #include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x,0, size... | ALGO | 0.999994 | 3.994809 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-06-10T02:52: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": "db7885ef04be... |
e77074cd-8799-49a5-ad60-ab4f9bcb7c49 | SiYun916/leetcode | 22_3/22_3_11/k402.c++ | #include <iostream>
#include <algorithm>
#include <stack>
#include <string>
using namespace std;
int main(){
//输入num 以及 k
string num;
int k;
cin>>num>>k;
//创建一个栈,用于存放挑选的数字
stack<char> nn;
//用num_length代替num.size()
int num_length = num.size();
/*第一种情况 当k>=num.size时,返回值为'0'*/
if(n... | ALGO | 0.999982 | 4.257618 | {
"github_metadata": {
"branch": "main",
"commit_count": 81,
"repo_created_at": "2022-03-13T12:08: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": "9fe106a245b... |
03ff3f61-deaa-4d4d-af65-8141f23f1bfa | numpy/numpy | numpy/_core/src/npysort/heapsort.hpp | #ifndef NUMPY_SRC_COMMON_NPYSORT_HEAPSORT_HPP
#define NUMPY_SRC_COMMON_NPYSORT_HEAPSORT_HPP
#include "common.hpp"
namespace np::sort {
template <typename T>
inline bool LessThan(const T &a, const T &b)
{
if constexpr (std::is_floating_point_v<T>) {
return a < b || (b != b && a == a);
}
else if co... | ALGO | 0.999072 | 6.954546 | {
"github_metadata": {
"branch": "main",
"commit_count": 39172,
"repo_created_at": "2010-09-13T23:02:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 29940,
"forks": 11086,
"issues": 2089,
"pull_requests": 227
},
"file_meta": {
"content_id... |
400368b5-914e-4b3e-be44-07eba66aea1e | Nikhil-prog/Competitve-Programming | Data Structures/min_Heap.cpp | /*Nikhil*/
#include <bits/stdc++.h>
using namespace std;
class minHeap
{
// Members of min-heap
int capacity;
int sz;
int *heap;
public:
minHeap(int cap)
{
this->capacity = cap;
this->sz = 0;
this->heap = new int[capacity];
}
int left(int i)
{
retur... | ALGO | 0.999829 | 4.359373 | {
"github_metadata": {
"branch": "main",
"commit_count": 167,
"repo_created_at": "2021-04-19T02:19:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "384cea10e0... |
4ad91d71-733b-48ce-875e-0e70e4d9cf77 | stachick/CS-311-DataStructuresAndAlgorithms | Assignment 3/da3.h | // da3.h (finished)
//<NAME>
//February 28, 2014
//assignment 3
#ifndef FILE_DA3_H_INCLUDED
#define FILE_DA3_H_INCLUDED
#include <iostream> // for std::ostream
#include <string> // for std::string
// *************************************************************** // *
// Begin DO-NOT-CHANGE section ... | TOOL | 0.965254 | 5.770356 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-08-15T02:51:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "46c6ebc621... |
c00cb97f-1131-4cf2-a70a-dac18c33f4a1 | FannyZhao123/leetCode | M_1395.cpp | /*
1395. Count Number of Teams
There are n soldiers standing in a line. Each soldier is assigned a unique rating value.
You have to form a team of 3 soldiers amongst them under the following rules:
Choose 3 soldiers with index (i, j, k) with rating (rating[i], rating[j], rating[k]).
A team is valid if: (rating[i] < ... | ALGO | 0.999986 | 5.830324 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2020-04-27T23:23: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": "8b38f26b... |
c8507de8-75ef-49a9-be66-5ac085f0477d | deanwertz/MindMaster | Answer.cpp | #include "Game.h"
#include <cstdlib>
#include <ctime>
using namespace std;
// Author <NAME>
void Game::answerPrompt() {
//random number generator
srand((unsigned)time(0));
//temporary random variables that will be used to get 2 of the user pins
int tempAnswer1;
int tempAnswer2;
tempAnswer1 = rand()%2... | TOOL | 0.923751 | 3.652789 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2018-02-01T21:08: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": "06c7af3dd... |
f1cbcd35-ba5f-4e05-81a2-acf8640bf64f | TechMe103/DSA---C- | quicksortalgo.cpp | #include<iostream>
using namespace std;
int partition(int arr[], int first, int last) {
int pivot = arr[last];
int i = first - 1;
for (int j = first; j < last; j++) {
if (arr[j] < pivot) { // Fixing the comparison
i++;
swap(arr[i], arr[j]);
}
}
swap(arr[i + 1... | ALGO | 0.999964 | 5.980469 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-23T04:20: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": "e73721015fe6... |
28aac741-3429-4c7d-b0bd-98866510d4de | Raunaq-singh/SudoPlacement2019 | BinarySearchTree/ConstructBSTFromPostOrder.cpp | #include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *left, *right;
};
Node *constructTree (int [], int );
void printInorder (Node* node)
{
if (node == NULL)
return;
printInorder(node->left);
printf("%d ", node->data);
printInorder(node->right);
}
int main ()
{
int t,n;
scanf("%... | ALGO | 0.999993 | 5.261921 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2019-06-12T10:18: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": "713b3c6e1... |
8257ae2d-fb82-4f9e-a575-223e79906ed9 | rafiframadhana/CPP-Mini-programs-list | implement Bubble sort..cpp | #include <iostream>
using namespace std;
void bubbleSort(int arr[], int n) {
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
int temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
}
void printArray(int arr[], ... | ALGO | 0.999856 | 5.173062 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-04-25T11:13:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d9c9525edfe... |
fdda1a32-df21-42fe-8cf8-9ba77192af3c | OsamaMNour/Simulation-of-the-Double-Slit-Experiment- | DobuleSlit.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <vector>
#include <random>
#include <exception>
// Define the number of photons and the width of the slits
const int num_photons = 1000;
const double slit_width = 0.05;
// Define a structure to store the position and intensity of each photon
struct Phot... | ALGO | 0.951789 | 5.259493 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-02-13T23:04: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": "2486dcf3d0b0... |
75d07176-110c-4c41-a530-d67c3b5c4faa | syohex/leetcode | challenge/202310/find_largest_value_in_each_tree_row/main.cpp | #include <cassert>
#include <vector>
#include <queue>
#include <limits>
#include <algorithm>
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {
}
~TreeNode() {
delete left;
delete right;
}
};
std::vector<i... | ALGO | 0.999858 | 6.505375 | {
"github_metadata": {
"branch": "master",
"commit_count": 1794,
"repo_created_at": "2020-06-01T00:08:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c6df19... |
b70c6e14-c8ad-4f8e-843a-87f29d6ad2da | hackereagle/LeetCodePractice | src/LeetCode/0004MedianOfTwoSortedArray/main.cpp | #include <iostream>
#include <vector>
#include "AssertClass.hpp"
#include "VectorMiscs.hpp"
class MedianOfTwoSortedArray
{
public:
MedianOfTwoSortedArray()
{}
~MedianOfTwoSortedArray()
{}
double findMedianSortedArrays(std::vector<int>& nums1, std::vector<int>& nums2)
{
double median = 0.0;
std::vector<int... | ALGO | 0.999899 | 6.218517 | {
"github_metadata": {
"branch": "master",
"commit_count": 272,
"repo_created_at": "2021-02-14T15:00:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e547040... |
3f600022-da35-4c72-be93-d378769a6212 | clarasdfgh/FP | Cortijo/s1/I_Pitagoras.cpp | /***************************************************************************/
// FUNDAMENTOS DE PROGRAMACIÓN
//
// (C) <NAME>
// DEPARTAMENTO DE CIENCIAS DE LA COMPUTACIÓN E INTELIGENCIA ARTIFICIAL
//
//
/* Programa para calcular la hipotenusa de un triángulo.
Implementa el algoritmo de Pitágoras
Entradas: los ... | ALGO | 0.99584 | 4.111989 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2019-11-26T11:48:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "410a3691d... |
05690bb3-3199-4246-9ba0-4560bd213978 | zmiksis/SciComp | Homework 2/hw_2_ex_1.cpp | #include <iostream>
using namespace std;
int main () {
int a, b, c;
cout << "Please enter three integers, separated by spaces: ";
cin >> a >> b >> c;
if (a < b && b < c){
cout << "a = " << a << endl;
cout << "b = " << b << endl;
cout << "c = " << c << endl;
} else if (b < a && a < c){
cou... | ALGO | 0.999545 | 4.03267 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-01-20T19:50: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": "d7015e032b... |
3fdd0885-a941-442f-bf9e-904d917862a9 | Kalabaza/LeetCode | Medium/Problem-48.cpp | #include <gtest/gtest.h>
#include <vector>
/**
* You are given an n x n 2D matrix representing an image.
*
* Rotate the image by 90 degrees (clockwise).
*/
void rotate(std::vector<std::vector<int32_t>>& matrix) {
// this is the maximum index that a value can use
size_t size = matrix.size() - 1;
// will... | TEST | 0.932014 | 6.742797 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2016-05-05T18:00:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "31795f404... |
81712e53-e728-486e-9770-e97505942013 | BonexGoo/Boss2D | Boss2D/addon/wav2letter-0.2_for_boss/src/criterion/backend/cuda/CriterionUtils.cpp | /**
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "criterion/CriterionUtils.h"
#include <flashlight/common/cuda.h>
#include "libraries/crit... | ALGO | 0.996277 | 6.821933 | {
"github_metadata": {
"branch": "master",
"commit_count": 443,
"repo_created_at": "2019-07-18T01:44:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 3,
"issues": 7,
"pull_requests": 2
},
"file_meta": {
"content_id": "1f8d8d9... |
7ba76110-8ddc-4251-98c6-59596805fbb1 | chanhyunPark/Algorithmic-Problem | baekjoon/c++/백트래킹/2580(스도쿠).cpp | #include<iostream>
using namespace std;
typedef struct hAw
{
int x;
int y;
bool visit;
hAw() {}
hAw(int x, int y, bool visit) : x(x), y(y), visit(visit) {}
}hAw;
int game[10][10];
hAw zero[81];
bool height[10][10], width[10][10], ninetable[10][10];
int zerocnt = 0;
bool flag = false;
int getNine(int y, int x)
... | ALGO | 0.999831 | 4.032211 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-08-06T05:52:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "edba0db79... |
643df9f7-65b9-47c7-b768-39f77f2bd78f | kennychavez777/exercises | 4E/main.cpp | /**
** Author: <NAME>
** Desctiption: Ejercicio 4, paga neta de un trabajador
**/
#include <iostream>
using namespace std;
int main()
{
double timeWorked, rate, taxes, discount; // Se declaran todas las variables a utilizar en todo el flujo del programa
// Se piden al usuario todos los datos que se requiere... | ALGO | 0.975346 | 3.435195 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-04-05T21:39: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": "91db48abcd... |
cfcf1a2d-3402-4d2c-b455-e9300627dfab | Enigman2011/policy-based-search | examples/Romania.cpp | /*
Romania.cpp: Loader.
Copyright (C) 2012 <NAME> <<EMAIL>>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later ver... | ALGO | 0.999547 | 5.256501 | {
"github_metadata": {
"branch": "master",
"commit_count": 230,
"repo_created_at": "2015-06-06T21:16: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": "50f91e6d... |
3e522463-3ff3-4f14-aabe-09acc100ae90 | bgd54/cuda_fot | priority_queue.hpp | #ifndef PRIORITY_QUEUE_HPP_VS5TTLHK
#define PRIORITY_QUEUE_HPP_VS5TTLHK
#include <cassert>
#include <map>
template <class Priority> class PriorityQueue {
std::map<MY_SIZE, typename std::map<Priority, MY_SIZE>::iterator>
index_to_priority;
std::multimap<Priority, MY_SIZE> priority_to_index;
public:
void p... | ALGO | 0.991036 | 6.926948 | {
"github_metadata": {
"branch": "merging",
"commit_count": 370,
"repo_created_at": "2017-03-13T23:27:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "25617ac... |
32063b40-9ed8-4605-b123-3ac31cdc6658 | KevinLehman/COSC-1437-Assignment3.1 | Source.cpp | /*
<NAME> - 1463553
Tarrant County College - COSC 1437 - Fall 2017
Assignment 3-1 Source Code
*/
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <iterator>
#include <algorithm>
using namespace std;
void checkSort(vector<string>);
vector<string> split(const string& s, const stri... | ALGO | 0.999399 | 4.467321 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-09-10T15:44:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "266d76de11... |
9737e219-b986-459b-ab16-916ba096027f | xingoxu/leetcode | 81.cpp | // Runtime: 8 ms, faster than 87.33% of C++ online submissions for Search in Rotated Sorted Array II.
// Memory Usage: 9 MB, less than 5.09% of C++ online submissions for Search in Rotated Sorted Array II.
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;
class Solution
{
public:
bool sear... | ALGO | 0.999995 | 5.856058 | {
"github_metadata": {
"branch": "master",
"commit_count": 258,
"repo_created_at": "2019-05-15T12:19:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8365f9d5... |
0663aa40-b64b-45b0-85fb-5215fc9e1880 | Elgrot/Projekty | Proste-dziedziczenie-wielomianu/wielomian.h | //
// Created by emils on 13.12.2022.
//
#ifndef ZADANIE_2A_PROSTE_DZIEDZICZENIE_WIELOMIANU_PRZEZ_JEDNOMIAN_ELGROT_WIELOMIAN_H
#define ZADANIE_2A_PROSTE_DZIEDZICZENIE_WIELOMIANU_PRZEZ_JEDNOMIAN_ELGROT_WIELOMIAN_H
#include <iostream>
#include <string.h>
class Wielomian{
protected:
int st{};
float *wsp{};
publi... | ALGO | 0.947029 | 3.839618 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-19T17:00: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": "5435f7e9906d... |
a1111a78-82e0-45cb-aa09-92d0c1ff7ab7 | keitaroooo/aizu-online-judge-studying | Courses/Lesson/ITP1/6_B.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
bool a[4][13];
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 13; j++)
{
a[i][j] = false;
}
}
cin >> n;
for (int i = 0; i < n; i++)
{
int rank;
char suit;
cin >> ... | ALGO | 0.999152 | 3.111966 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-03-22T06:47:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9c73702887... |
7f15b3a7-ffc4-476f-b456-50d3e5d34dba | VaibhavArora314/Problem-Solving-Practice | Word Ladder I - GFG/word-ladder-i.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
int bfs(string t,queue<string> q,unordered_map<string,vector<string>>& m,set<string>& visited) {
if (q.empty()) return 0;
int ans = INT_MAX;
queue<string> next;
while (!q.empty... | ALGO | 0.999951 | 6.101306 | {
"github_metadata": {
"branch": "main",
"commit_count": 949,
"repo_created_at": "2022-09-02T11:28:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a08d79903... |
9cb21974-5db8-4904-a874-63a497f9e0ae | wuyuhang05/My-OI-Code | Luogu/P5339-2.cpp | /*
* Author: RainAir
* Time: 2019-07-20 18:50:21
*/
#include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <cstdio>
#include <bitset>
#include <vector>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <map>
#include <set>
#define fi fir... | ALGO | 0.999989 | 4.492023 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2018-06-03T12:18:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e82d213... |
7d0befed-6558-4d35-a0e8-887d19e5e36c | rogday/biclustering | library/src/biclustering.cpp | #include <biclustering.hpp>
template <typename T>
void biclustering_solver_t::construct_matrix(matrix_t<T> &mat, std::size_t n,
std::size_t m) {
mat.resize(n);
std::fill(std::begin(mat), std::end(mat), std::vector<T>(m));
}
void biclustering_solver_t::parse(std::string... | ALGO | 0.999332 | 4.684567 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2019-04-18T23:59: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": "7485f5887... |
c6e07977-0cdb-42db-8bf1-d5a29349385d | Ivan122727/Algorithms-solution | 6.cpp | /*
Заданы две строки s, t и целое число k.
Рассмотрим множество всех таких непустых строк, которые встречаются как подстроки в s и t одновременно.
Найдите k-ую в лексикографическом порядке строку из этого множества.
Время: T(s, t) = O(s + t)
Память: M(s, t) = O(s + t)
ID: 68818555
*/
#include <iostream>
#include <map... | ALGO | 0.999993 | 5.110944 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2021-09-29T17:46: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": "2db7b0cf99... |
b300f10f-741e-423e-9a7e-d154f83fddd1 | CppPhil/graph_algorithms | src/dijkstra/algorithm.hpp | #ifndef INCG_GP_DIJKSTRA_ALGORITHM_HPP
#define INCG_GP_DIJKSTRA_ALGORITHM_HPP
#include "../directed_graph.hpp" // gp::DirectedGraph
#include "../shortest_paths.hpp" // gp::ShortestPaths
#include "insert.hpp" // gp::dijkstra::insert
#include "vertex_with_priority.hpp" // gp::dijks... | ALGO | 0.999781 | 7.105475 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-01-16T14: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": "723746a98... |
ef5732b5-7f4b-4996-abe0-85d201334879 | acmeism/RosettaCodeData | Task/Cholesky-decomposition/C++/cholesky-decomposition.cpp | #include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
template <typename scalar_type> class matrix {
public:
matrix(size_t rows, size_t columns)
: rows_(rows), columns_(columns), elements_(rows * columns) {}
matrix(size_t rows, size_t columns, scalar_type value)
... | ALGO | 0.999154 | 5.544777 | {
"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": "0bdb98f... |
68c60e20-f05a-4873-87be-5ecad9cbf601 | seungdo1234/CodingTestPractice | CodeUp/1차원 배열/기억력 테스트 2.cpp | // 맵을 이용한 풀이
#include <iostream>
#include<map>
// https://codeup.kr/problem.php?id=1430&rid=0
using namespace std;
int main() {
int n,m, num;
cin >> n;
map <int, bool> memorys ; // 맵 선언
for (int i = 0; i < n; i++) { // 해당 숫자를 키로 true 저장
cin >> num;
memorys[num] = true;
}
cin >> m;
for (int i = 0; i < m... | ALGO | 0.999932 | 4.455577 | {
"github_metadata": {
"branch": "main",
"commit_count": 249,
"repo_created_at": "2023-10-20T06:43: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": "4c6a077205... |
25d7ba9b-f1ea-4648-bd3c-f41134a6bd83 | imWhS/ProblemSolving | baekjoon_15684/main.cpp |
/*
* 사다리 조작
*/
#include <iostream>
#include <vector>
using namespace std;
int N, M, H; //세로 선의 개수, 가로 선의 개수, 세로 선 마다 가로 선을 놓을 수 있는 위치의 개수
int map[11][31];
int main() {
cin >> N >> M >> H;
for(int i = 0; i < M; i++) {
//H - N
int tmpH, tmpN;
cin >> tmpH >> tmpN;
map[tmpH][t... | ALGO | 0.999948 | 3.449126 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2020-01-04T05:54: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": "cef644e4e... |
162edd28-0eb1-4740-8a75-ea7dc22c235f | mrpawan-gupta/Competitve-Coding | 01. CodeForces/1]. Problem Set/A/A_Required_Remainder.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.99985 | 3.709625 | {
"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": "b491ede... |
fbc2f9eb-a3d9-471e-b76e-ab9cefdefc7d | janvanderkamp/Unreal-Marching-Cubes | Source/MarchingCubes/Public/PolygoniseUtils.h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
// Lookup tables and routine from this article "Polygonising a scalar field":
// (Also see article for an excellent explanation of the approach)
// http://paulbourke.net/geometry/polygonise/
// (Code ... | ALGO | 0.96829 | 3.145785 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2022-08-30T21:41:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e70d7b3e15... |
3bd52562-1c35-4186-bd1f-fa6526640f8d | linaaldryiehem/ParallelSudokuSolver2020 | SodukuSolver2020.cpp | #include <iostream>
#include <ctime>
#include <omp.h>
#include <chrono>
using namespace std;
#define N 20
int zero_counter=0;
int nonzero_counter = 0;
void print(int arr[N][N])
{
for (int i = 0; i < N; i++)
{
for (int j = 0; j < N; j++)
cout << arr[i][j] << " ";
cout << endl;
... | ALGO | 0.999946 | 6.376603 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-11-22T00:40: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": "586abacc0423... |
3ac4b035-e2cc-478d-a194-b576e042cb2a | Kitware/VTK-m | vtkm/filter/scalar_topology/worklet/contourtree_distributed/tree_grafter/PermuteComparator.h | //============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURP... | ALGO | 0.9942 | 7.418655 | {
"github_metadata": {
"branch": "master",
"commit_count": 11681,
"repo_created_at": "2019-06-03T18:26:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 35,
"forks": 17,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9688f... |
da206542-d58c-4978-9809-95fd37e892b7 | StabenE/Lab4 | VectorDriver.h | /* File: VectorDriver.cpp
* Athr: <NAME>
* Date: October 16, 2002
*
* Desc: provides the basic framework and examples for an introduction to
* the STL::vector, iterators, and the algorithms facilities.
*
* Edited by: <NAME>
* Date: October 1, 2017 (the future)
*
*/
// Modified by <NAME>
//10/8/2018
//lab 04
//hea... | ALGO | 0.998046 | 5.772335 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-10-08T22:00: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": "ac2dfc6b59... |
868197b4-0ce3-49d2-b814-f63ea1e7e256 | W-Dominic/LeetCode | easy/floodfill.cpp | #include <queue>
class Solution {
public:
vector<vector<int>> floodFill(vector<vector<int>>& image, int sr, int sc, int color) {
queue<pair<int,int>> q;
pair<int, int> root;
root.first = sr;
root.second = sc;
q.push(root);
int boundaryr = image[0].size();
... | ALGO | 0.999361 | 6.005398 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2022-07-12T22:53:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "def39d01abe... |
ea37318f-137f-48e2-84b5-25e25e753af1 | ishandutta2007/codeforces-p | prabowo/normal/1384/B1.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 300005;
int n, k, l;
int d[N];
int solve() {
scanf("%d %d %d", &n, &k, &l);
for (int i = 0; i < n; ++i) {
scanf("%d", &d[i]);
}
int cur = k, dir = -1;
for (int i = 0; i < n; ++i) {
if (d[i] + k <= l) {
cur = k;
dir = -1;
}... | ALGO | 0.999972 | 3.69508 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:49:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "233fd9ca2ee2... |
2dc0b815-b393-4119-a42d-9426863d04e9 | Qixyimoe/Delta | Luogu/11244/11244.cpp | #include <bits/stdc++.h>
using i64 = long long;
template <typename T> T read() {
T sum = 0, fl = 1;
int ch = getchar_unlocked();
for (; !isdigit(ch); ch = getchar_unlocked()) { if (ch == '-') fl = -1; }
for (; isdigit(ch); ch = getchar_unlocked()) sum = sum * 10 + ch - '0';
return sum * fl;
}
template <typename... | ALGO | 0.999778 | 4.217683 | {
"github_metadata": {
"branch": "master",
"commit_count": 205,
"repo_created_at": "2024-07-30T05:57: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": "5d4b7277... |
6b60da8b-43a6-448f-80a0-9db5f4e0b728 | axzyh/odC- | OD算法答案/A卷/过滤组合字符串/main.cpp | //
// main.cpp
// ODTest3
//
// Created by YuChao on 2023/6/1.
//
#include <iostream>
#include <unordered_map>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <regex>
#include <iomanip>
using namespace std;
// 过滤组合字符串
// 每个数字关联多个字母,关联关系如下:
vector<s... | ALGO | 0.999874 | 5.135099 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-06-07T13:36: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": "138d8a5408... |
88a23064-9c6e-4816-a639-15addf5ec685 | joybhuiya36/Problem-Solving | Leetcode/Programming Skills I/Day 11/232.cpp | /**
* Your MyQueue object will be instantiated and called as such:
* MyQueue* obj = new MyQueue();
* obj->push(x);
* int param_2 = obj->pop();
* int param_3 = obj->peek();
* bool param_4 = obj->empty();
*/
class MyQueue {
public:
stack<int> s1,s2;
MyQueue() {
}
void push(int x) {
... | ALGO | 0.998818 | 5.560896 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-05-16T16:11: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": "d67667ce47... |
2c1af8e8-3add-4a85-b31f-4d8742eb9519 | siriyaoff/sourcebottle | 10825AC.cpp | // #include<cstdio>
// #include<iostream>
// #include<string>
// #include<vector>
// #include<utility>
// #include<algorithm>
// using namespace std;
// typedef pair<string, pair<int, pair<int, int>>> stds;
// bool cmp(stds s1, stds s2){
// if(s1.second==s2.second) return s1.first<s2.first;
// if(s1.second.first==s2... | ALGO | 0.999338 | 3.403524 | {
"github_metadata": {
"branch": "master",
"commit_count": 185,
"repo_created_at": "2020-06-27T14:41:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ac09be8... |
2bd539b4-e81d-494e-8624-5328669e12b4 | gamer-project/gamer | test_problem_deprecated/Model_ParticleOnly/ClusterMerger/Par_Init_ByFunction.cpp | #include "GAMER.h"
#ifdef SUPPORT_GSL
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#else
#error : ERROR : please turn on SUPPORT_GSL for the cluster merger test problem !!
#endif
#ifdef PARTICLE
double MassProf_DM( const double r );
static void RanVec_FixRadius( const double r, double RanVec[] );
extern in... | ALGO | 0.98272 | 4.643966 | {
"github_metadata": {
"branch": "main",
"commit_count": 7047,
"repo_created_at": "2017-12-13T20:44:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 86,
"forks": 70,
"issues": 99,
"pull_requests": 32
},
"file_meta": {
"content_id": "07a49b... |
9687b932-5462-477d-9182-c93f09c45bea | OmarUTEC/Algorithms-data-structure | EstructuraDeDatos/Queue/SimpleQueue.cpp | #include<iostream>
class Queue {
private:
// front_index es un índice que lleva la cuenta del primer elemento en la cola
// rear_index es un índice que lleva la cuenta del último elemento en la cola
int front_index, rear_index;
// q es un arreglo que almacena los elementos en la col... | ALGO | 0.986471 | 5.494473 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2023-02-21T23:56:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8b7b0ac2dd... |
863e024b-c8a0-4dfe-bbcd-e9c1e52f58f3 | Yeti-Spaghetti/topcoder | Reppity.hpp | #include <string>
#include <vector>
using namespace std;
class Reppity{
public:
int longestRep(string input){
vector<string> substrVector;
vector<int> stringStart;
vector<int> stringEnd;
for (int i = 0; i < input.length(); i++){
for (int j = 1; j < input.length()+1-i; j+... | ALGO | 0.999285 | 4.998075 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-07-09T08:17: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": "21ccddee71... |
4a7d8fef-10bb-459e-aebf-ed4643838b1d | keineahnung2345/leetcode-cpp-practices | 1237. Find Positive Integer Solution for a Given Equation.cpp | //Runtime: 0 ms, faster than 100.00% of C++ online submissions for Find Positive Integer Solution for a Given Equation.
//Memory Usage: 8.6 MB, less than 100.00% of C++ online submissions for Find Positive Integer Solution for a Given Equation.
/*
* // This is the custom function interface.
* // You should not imple... | ALGO | 0.99994 | 5.213663 | {
"github_metadata": {
"branch": "master",
"commit_count": 2080,
"repo_created_at": "2018-11-25T06:48:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 284,
"forks": 120,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "5ac... |
69112174-7774-4663-b58c-dbd03bb51fa0 | luckeciano/competitive-programming | 12221.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <cstdio>
using namespace std;
int main() {
int N;
cin >> N;
for (int i = 0; i < N; i++) {
string s = "";
string aux;
scanf ("\n");
while ((cin.peek()!='\n') && (cin >> aux)) {
for (int t = 0; t < aux.... | ALGO | 0.999932 | 3.951081 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-02-05T19:52: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": "d6008b3e3d... |
e9b462df-ec2d-4c27-bc39-0b4ec7ed69dd | skyto0927/Programming-Contest | AtCoder/ACLBC/D.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
#define LINF 1e18
typedef... | ALGO | 0.999919 | 4.733262 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2018-05-31T08:47: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": "26ccfd0c9... |
ecfa59ac-b6da-4008-ab1b-c3178fa68fa8 | aloksingh1st/DSA_QUESTIONS | binary-tree-zigzag-level-order-traversal.cpp | /**
* Definition for a binary tree node.
* 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) : val(x), l... | ALGO | 0.999998 | 6.623082 | {
"github_metadata": {
"branch": "main",
"commit_count": 170,
"repo_created_at": "2023-05-04T17:01:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "92648fa48f... |
be1b7394-e75e-441c-a897-8e5e5e5f784d | thecuongk5hp/ssS6 | ss6-b1.cpp | #include <stdio.h>
#define MAX 100
// Khai báo ngãn x?p
typedef struct {
int arr[MAX];
int top;
} Stack;
// Kh?i t?o ngãn x?p
void initStack(Stack *s) {
s->top = -1;
}
// Ki?m tra ngãn x?p ð?y
int isFull(Stack *s) {
return s->top == MAX - 1;
}
// Ki?m tra ngãn x?p r?ng
int isEmpty(Stack *s) {
r... | ALGO | 0.999625 | 4.293101 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-11T02:09: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": "25ecfaa806a3... |
61f4d524-9b0a-4a0e-942a-4229dae7ff28 | ishandutta2007/codeforces-h | heart_blue/normal/1307/B.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999796 | 3.293554 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f013221070c9... |
b3c5fcee-f2f4-4b06-8422-762126d7bf2b | Dajtbaeva/LEETCODE | 606.cpp | 606. Construct String from Binary Tree
https://leetcode.com/problems/construct-string-from-binary-tree/
Input: root = [1,2,3,null,4]
Output: "1(2()(4))(3)"
Explanation: Almost the same as the first example, except we cannot omit the first parenthesis pair to break
the one-to-one mapping relationship between the input ... | ALGO | 0.997723 | 6.509252 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-09-27T10:23:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13e1690a20d... |
e761daaf-a412-4a5f-a034-cc15ea9a1cd1 | Ansore/sword_offer | code/chapter3/2/SortAge.cpp | #include <iostream>
#include <exception>
using namespace std;
void sortAge(int ages[], int length) {
if(ages == nullptr || length <= 0) {
return;
}
const int oldestAge = 99;
int timesOfAge[oldestAge + 1];
for(int i = 0; i <= oldestAge; i ++) {
timesOfAge[i] = 0;
}
for(int i = 0; i < length; i ++) {
int ... | ALGO | 0.996549 | 4.762254 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-03-16T14:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ddef63fae... |
b5f20a33-c8ab-4951-99e3-432a3cd4fe4a | ishandutta2007/codeforces-y | yosupo/normal/429/D.cpp | #include <vector>
#include <iostream>
#include <map>
#include <algorithm>
#include <random>
#include <complex>
#include <unordered_map>
#include <cmath>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
ll norm(const P &p) {
return 1LL*p.first*p.first + 1LL*p.second*p.se... | ALGO | 0.999821 | 3.835914 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:40:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a1e73b02a2b... |
aafc751c-8556-4327-a51b-8840e14f7f99 | urviiigupta/cpp-practise | linked list/linklistcreation.cpp | //linked list
#include <iostream>
using namespace std;
//self referencial class
class node{
public:
int data;
node *next; //because we want to store something of node type
node(int d){
data=d;
next=NULL;
}};
void insertatfront(node*&head,node*&tail,int d)
{
//case ... | ALGO | 0.999331 | 4.280156 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-03-21T13:36: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": "7f72c053b1c8... |
822971c7-c54d-49ae-a477-e1c7e8dd6d1d | pyordii/NumericalMethods | Dirichlet/method.h | #ifndef SEIDEL_H
#define SEIDEL_H
#include "math.h"
class method{
public:
/*
n - количество узлов по каждой из координат области D.
m - число операций, выполняемых методом для одного узла сетки.
k - количество итераций метода до выполнения условия остановки.
*/
void SolveSystemSeidel(double** u,... | ALGO | 0.99992 | 4.69807 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-09-11T16:44: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": "797407818... |
4b9a613b-7d67-4f6c-8dfa-5fc75b5bf4f6 | IlReSenzaNome/Course-cpp | Lists/Insert-elements-into-a-list.cpp | #include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std;
struct Nodo
{
int dato;
Nodo *siguiente;
};
void insertarlista(Nodo *&, int);
int main()
{
Nodo *lista = NULL;
int dato;
do
{
cout << "Ingrese un dato: ";
cin >> dato;
insertarlista(lista,... | ALGO | 0.9991 | 4.414286 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-04-08T22:37:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41e37c1a283... |
799a9097-24db-4567-bf28-c3f9110752d5 | danielgrier/gridCHPpp | gridCHP++.cpp | /* Copyright 2023 <NAME> and <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, softwa... | ALGO | 0.990742 | 5.659308 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-05-25T04:31:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70363dce6f66... |
e4ccc900-4afe-42ae-91df-d58a4471101b | UMich-CURLY/Lie-MPC-AMVs | casadi-linux-matlabR2014b-v3.5.5/include/casadi/core/casadi_cache.hpp | // NOLINT(legal/copyright)
// SYMBOL "cache_check"
template<typename T1>
int cache_check(const T1* key, T1* cache, int* loc, casadi_int stride, casadi_int sz, casadi_int key_sz, T1** val) { // NOLINT(whitespace/line_length)
char match;
int i, c;
casadi_int k;
T1 *lkey;
// Walk through cache location... | ALGO | 0.99292 | 5.679823 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2023-05-15T16:02:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 49,
"forks": 6,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "538a4cda8f9... |
48c73c9a-d085-455a-bc5a-81b14ffba125 | NVIDIA/AMGX | include/eigensolvers/subspace_iteration_eigensolver.h | // SPDX-FileCopyrightText: 2013 - 2024 NVIDIA CORPORATION. All Rights Reserved.
//
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <eigensolvers/eigensolver.h>
namespace amgx
{
template <class TConfig>
class SubspaceIteration_EigenSolver : public EigenSolver<TConfig>
{
public:
typedef Eig... | ALGO | 0.95739 | 6.418886 | {
"github_metadata": {
"branch": "main",
"commit_count": 265,
"repo_created_at": "2017-10-04T16:12:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 578,
"forks": 157,
"issues": 102,
"pull_requests": 6
},
"file_meta": {
"content_id": "30da9... |
70c36d56-0ba9-47d9-90f3-3a530549bd22 | ldct/cp | TLX/troc-16/D/D.cpp | #include <bits/stdc++.h>
using namespace std;
bool is_bipartite(vector<vector<int>>& neighbours) {
int n = neighbours.size();
vector<int> side(n, -1);
bool is_bipartite = true;
queue<int> q;
for (int st = 0; st < n; ++st) {
if (side[st] == -1) {
q.push(st);
side[st] = 0;
while (!q.empt... | ALGO | 0.999849 | 4.17867 | {
"github_metadata": {
"branch": "master",
"commit_count": 647,
"repo_created_at": "2011-02-20T07:42:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5d047d9... |
577e4e60-00b4-411a-b77f-29782b1527d5 | igor-stefan/prog-comp_solucoes-basico_EE2019-2021 | strategyGame.cpp | #include <bits/stdc++.h>
using namespace std;
const int Nmax = 1e2 * 5 + 3;
int main(){
int j, r;
while(scanf("%d %d", &j, &r) == 2){
vector<int> points(Nmax, 0);
int maxp = INT_MIN;
for(int i = 1; i <= j * r; i++){
int temp;
scanf("%d", &temp);
poi... | ALGO | 0.999932 | 3.153659 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-09-12T17:43: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": "1f34f8837f... |
c7eb4faf-e457-4b63-a5d5-4840dcf22eec | ruc-deke/rucbase-lab | src/index/ix_index_handle.h | /* Copyright (c) 2023 Renmin University of China
RMDB is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRAN... | ALGO | 0.923449 | 5.211696 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2022-09-19T08:22:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 222,
"forks": 54,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0f4baf4e... |
10c088d1-20e5-4f78-89a8-92df0840f63c | Amitpotdukhe/Leetcode-questions | Permutation with Spaces - GFG/permutation-with-spaces.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
void solve(string&s, int idx, vector<string>& ans, string op) {
if(idx == s.length()-1) {
op+=s[s.length()-1];
ans.push_back(op);
return;
}
... | ALGO | 0.993546 | 6.330884 | {
"github_metadata": {
"branch": "main",
"commit_count": 213,
"repo_created_at": "2022-10-22T17:43: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": "b71b99a79e... |
3976e229-b7cb-4216-9917-63b84b58db2b | pderksen98/ConfigParser | src/configParser.cpp | #include "../includes/config.hpp"
// For each server found in the server vector the Config constructor is called
// The constructor sets all the correct values and then the Config object is added to the Config vector
std::vector<Config> setConfigVector(std::vector<std::vector<std::string> > &serverVector)
{
std::vect... | CONFIG | 0.979337 | 3.323259 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2023-01-24T16: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": "ab30039a79... |
3ad63112-66de-43e0-bc2b-d113fcb70359 | abhinavg2002/LeetCode-and-GFG-Solutions | Count of Subarrays - GFG/count-of-subarrays.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
#define ll long long
// } Driver Code Ends
//User function template for C++
class Solution{
public:
#define ll long long
ll countSubarray(int a[], int n, int k) {
int l=0, r=n-1;
ll ans=0;
for(int i=0;i<n;i++){
if(a[i]>k... | ALGO | 0.999287 | 6.394326 | {
"github_metadata": {
"branch": "main",
"commit_count": 1548,
"repo_created_at": "2022-04-12T08:25: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": "c3539e2e7... |
1452c025-e9ac-4b3a-8359-e6e8d719e1ec | SimFlowCFD/RapidCFD-dev | src/sampling/sampledSet/patchSeed/patchSeedSet.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------... | TOOL | 0.911011 | 6.223421 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2015-02-12T11:35:40.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 369,
"forks": 103,
"issues": 69,
"pull_requests": 1
},
"file_meta": {
"content_id": "00a2... |
a31de8d9-73b4-44e2-ae0d-be972e8e38ab | AnonMiraj/Competitive-solving | Codeforces/Codeforces Round 940 (Div. 2) and CodeCraft-23/D. A BIT of an Inequality.cpp | // ﷽
// Contest: Codeforces Round 940 (Div. 2) and CodeCraft-23
// Judge: Codeforces
// URL: https://codeforces.com/contest/1957/problem/D
// Memory Limit: 256
// Time Limit: 2000
// Start: Sun 21 Apr 2024 05:17:41 PM EET
// Reading Time :
// Thinking Time :
// Coding Time :
// Comments :
#include <algorithm>
#include ... | ALGO | 0.999975 | 4.419462 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-03-22T19:36: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": "8bd14c530cbe... |
e8ce51bb-e300-4a35-bcba-a93751a87310 | CERN-PH-CMG/cmg-cmssw | GeneratorInterface/Hydjet2Interface/interface/EquationSolver.h | /*
<NAME>, <NAME>, <NAME> (C) JINR/Dubna
<EMAIL>, <EMAIL>, <EMAIL>
November. 2, 2005
*/
//This equation solver class is taken from GE... | ALGO | 0.999649 | 5.074473 | {
"github_metadata": {
"branch": "heppy_94X_dev",
"commit_count": 185721,
"repo_created_at": "2013-09-25T08:23:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 19,
"forks": 242,
"issues": 16,
"pull_requests": 1
},
"file_meta": {
"content_i... |
907f17d9-bec6-43f3-8903-afa1316a122f | ishandutta2007/codeforces-k | keko37/normal/1491/G.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long llint;
typedef pair <int, int> pi;
const int MAXN = 200005;
int n;
int p[MAXN], pos[MAXN], bio[MAXN];
vector <pi> v;
vector <vector <int> > r;
void f (int a, int b) {
v.push_back({a, b});
pos[p[a]] = b; pos[p[b]] = a;
swap(p[a], p[b]);
}
v... | ALGO | 0.999958 | 4.077673 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06: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": "543af79e9a76... |
6500e90a-06c9-4a7c-87b8-6a78770ffc56 | aaafwd/Online-Judge | Volume 003 (300-399)/373.cpp | /* @JUDGE_ID: 19899RK 373 C++ "By Anadan" */
// <NAME>
// Accepted (0.270 seconds using as much as 388 kbytes)
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#define SIZE 256
inline void swapc(char &a, char &b) { a ^= b; b ^= a; a ^= b; }
int main(){
int i;
char buf[SIZE];
memset(buf, 0, SIZE);
while... | ALGO | 0.999429 | 3.414681 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-04-11T10:48: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": "9e5024642d0... |
9d0a7be4-f2be-427f-99a4-a5eac75d15e2 | ksaveljev/UVa-online-judge | 11559.cpp | #include <iostream>
using namespace std;
int INF = 1000000000;
int main(void) {
int result;
int n, b, h, w;
int p, a;
while (cin >> n >> b >> h >> w) {
result = INF;
for (int i = 0; i < h; i++) {
cin >> p;
for (int j = 0; j < w; j++) {
cin >> a;
if (a >= n && p * n < resu... | ALGO | 0.999813 | 3.441778 | {
"github_metadata": {
"branch": "master",
"commit_count": 788,
"repo_created_at": "2011-04-04T11:43:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 106,
"forks": 69,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "b6b71... |
5cbccafb-35d5-47d4-bee5-65b0178909a4 | Mr-mahato/-100daycodingchallenge | day26/day26.cpp | // THis is the problem soultio of gfg
/*
Tree Node
struct Node {
int data;
Node *left;
Node *right;
Node(int val) {
data = val;
left = right = NULL;
}
};
*/
class Solution
{
public:
//Function to find the least absolute difference between any node
//value of the BST and... | ALGO | 0.999995 | 5.545655 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2023-05-10T16:42: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": "1d6bee3b62... |
4cd8ba3f-29a7-4873-83ba-6cdab0984b6a | MironBaratelia/algorithms | diophantine.cpp | #include <iostream>
#include <vector>
using namespace std;
int gcd(int a, int b, int& x, int& y) {
if (a == 0) {
x = 0;
y = 1;
return b;
}
int x1, y1;
int g = gcd(b % a, a, x1, y1);
x = y1 - (b / a) * x1;
y = x1;
return g;
}
int main() {
int a, b, c;
cin >> a >> b >> c;
int x, y;
int g = gcd(a, b, x... | ALGO | 0.999991 | 4.983321 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-03-21T14:24: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": "f5caa6e30dd... |
d6d126be-0906-4acd-a693-6a7ac18e7928 | Bungmint/competitiveprogramming | contest/codeforces/148/148D.cpp | #pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pi = pair<int, int>;
using vpi = vector<pair<int, int>>;
using pl = pair<ll, ll>;
using vl = vector<ll>;
using vpl = vector<pl>;
using ld = long double;
#define all(v... | ALGO | 0.997169 | 4.31228 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2021-02-28T11:36:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "16b9d8685... |
1c8eb35a-84c8-4f07-96a3-8cc07fe91b8c | wangchengyongnevergiveup/C3_data_structure | 11.cpp | //#include "11-binary _sort_tree.hpp"
//
////创建二叉排序树以及遍历
//void test01()
//{
// PNode root = NULL;
// KeyType nodeArray[11] = { 15, 6, 18, 3, 7, 17, 20, 2, 4, 13, 9 };
//
// //创建二叉查找树
// cout << "正在创建二叉查找树..." << endl;
// createBST(&root, nodeArray, 11);
// cout << "二叉查找树创建完毕!!!" << endl << endl;
//
// //遍历二叉查找树
// cou... | ALGO | 0.999759 | 3.748706 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2024-08-16T01:24: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": "55a2859e9b... |
97bddb28-9e0b-4ec4-9eaf-e510d60bd8ba | ishandutta2007/codeforces-c | chemthan/normal/459/D.cpp | #include <bits/stdc++.h>
using namespace std;
#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 FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define sz(a) int((a).size())
... | ALGO | 0.999711 | 3.659208 | {
"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": "678fbe6e0df9... |
be0d21a3-7c88-4880-b161-b1c7b79201af | rs22shekhawat/DSA-SUPREME-CODES-LOVE-BABBAR | Lecture/9AprilLinkedListL2.cpp | #include<bits/stdc++.h>
#include<limits.h>
using namespace std;
class Node{
public:
int data;
Node* pre;
Node* next;
Node(){
this->data=0;
this->pre=NULL;
this->next=NULL;
}
Node(int data){
this->data=data;
this->pre=NULL;
this->next=NULL;
... | ALGO | 0.999752 | 4.075332 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-20T18:49: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": "2eafcb785d64... |
e1f1f9fb-c421-4303-8c7d-939cc3596fe2 | AlfredooP/Graficacion | Apps/appPunteros/main.cpp | #include <iostream>
using namespace std;
#include <stdlib.h>
#include <time.h>
//void asignarNumeros(int *v);
void asignarNumeros(int *v){
//void asignarNumeros(int v[]){
//void asignarNumeros(int v[5]){
srand(time(NULL));
for(int i = 0; i < 5; i++){
//v[i] = rand()%90+10;
*(v+i) = rand()%90+... | ALGO | 0.96965 | 3.036573 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-01-23T02:43: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": "0718ddcbbf06... |
30ec8352-9a5a-45be-8b90-09a8eb3a0e0e | qpwoeirut/competitive-programming | CSES/Problemset/Graph/building_teams.cpp | //building_teams.cpp created at 12/18/20 15:08:16
#include <bits/stdc++.h>
using namespace std;
const int MN = 200005;
int N, M;
set<int> adj[MN];
bool ok;
int mark[MN];
void dfs(int u, bool x) {
if (mark[u] != -1) {
if (mark[u] != x) ok = false;
return;
}
mark[u] = x;
for (const in... | ALGO | 0.999995 | 4.572142 | {
"github_metadata": {
"branch": "master",
"commit_count": 348,
"repo_created_at": "2020-09-17T05:10:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38c3a3e... |
5a4ab3d2-8e2a-4338-bfb8-5407f17d39ae | pangenome/agc-rs | agc/3rd_party/raduls-inplace/Raduls/small_sort.h | #pragma once
#include "defs.h"
#include "record.h"
#include "sorting_network.h"
#include "comp_and_swap.h"
#include "qsorter.h"
#include <cmath>
#include <vector>
#include <functional>
#include <algorithm>
namespace raduls
{
namespace NAMESPACE_NAME
{
namespace small_sort
{
template<typename T, typename Comp, t... | ALGO | 0.999842 | 6.14032 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2025-07-05T20:48:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "505f0bd06e65... |
15def5e5-9e49-46d7-af91-1c9eb2237bc9 | tiagosenger/ExerciciosVectorEListas | ex6.cpp | #include <iostream>
using namespace std;
int* intercala(int *vet1, int tam1, int *vet2, int tam2) {
int tamanhoResultado = tam1 + tam2;
int *resultado = new int[tamanhoResultado];
int index1 = 0;
int index2 = 0;
int indexResultado = 0;
while (index1 < tam1 && index2 < tam2) {
resu... | ALGO | 0.998953 | 5.642828 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-10-04T16:37: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": "487c1b924e87... |
c6374e00-d70b-4ace-8a62-9b2b0b16726b | rishusingh022/Data-structures_prac | college_assignments/Assignment3/doubly.cpp | #include<iostream>
using namespace std;
struct Node
{
int elem;
Node *next,*prev;
}*head=NULL,*tail=NULL;
Node* createNode(int x)
{
Node* temp = new Node();
temp->elem = x;
temp->next = NULL;
temp->prev = NULL;
return temp;
}
void insertfrombeg(Node* insert)
{
if(head==NULL)
head = t... | ALGO | 0.999675 | 4.682888 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2020-11-05T14:48:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebcf593e2565... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.