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 |
|---|---|---|---|---|---|---|---|
d8f9c25c-614f-4389-bd20-f3d747ce3b7d | xdtianyu/android-7.0.0_r1 | external/opencv3/apps/createsamples/utility.cpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | TOOL | 0.984432 | 5.686181 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2016-08-24T08:55:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 47,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a5a397e... |
c297732c-394c-4341-b3c0-f28349014cc9 | FazeelUsmani/Scaler-Academy | 012 Sorting 1/A5_inversionCount.cpp | #include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
int merge(vector<int> &A, vector<int> &temp, int left, int mid, int right)
{
int i, j, k, cnt = 0;
i = left;
k = left;
j = mid;
while ((i < mid) && (j <= right))
{
if (A[i] <= A[j])
{
temp[k+... | ALGO | 0.999955 | 4.968425 | {
"github_metadata": {
"branch": "master",
"commit_count": 795,
"repo_created_at": "2020-01-28T18:13:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 252,
"forks": 172,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2cc4... |
8b453a40-82c1-43a2-af75-8dc8150154a0 | tempbottle/upp | uppdev/ProximityN/ProximityN.cpp | #include <Core/Core.h>
using namespace Upp;
const int N = 1000 * 1000;
int max_sims = 5;
struct Sim : Moveable<Sim> {
int subject;
int points;
};
inline int sPw2(int x)
{
return x * x;
}
struct Subject {
Point data;
Vector<Sim> sim;
int Points(const Subject& b)
{
return sPw2(data.x - b.data.x) + ... | ALGO | 0.996908 | 4.188078 | {
"github_metadata": {
"branch": "trunk",
"commit_count": 7787,
"repo_created_at": "2015-08-21T19:05:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64163b23... |
0a0ebb6e-6e58-400f-9c95-b4c32cc5bd72 | hervature/ORFE | 531/homework5/orflib/pricers/simplepricers.cpp | /**
@file simplepricers.cpp
@brief Implementation of simple pricing functions
*/
#include <orflib/pricers/simplepricers.hpp>
#include <orflib/math/stats/normaldistribution.hpp>
#include <orflib/utils.hpp>
#include <cmath>
BEGIN_NAMESPACE(orf)
/** The forward price of an asset */
double fwdPrice(double spot... | ALGO | 0.970998 | 7.478753 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2017-09-20T17:31:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "68c3dde2a... |
f16fcef0-e18b-4b9b-bd36-0eecef18dc65 | narenderkumarnain/cp-practice | tle-3/binarysearch/LC_4_Median_of_two_sorted_arrays.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
int noOfEleLTE(vector<int>& nums, int val) {
// last when nums[i] <= val
int start = 0;
int end = nums.size()-1;
int ans = -1;
while(start <= end) {
int mid = start + (end-start)/2;
if(n... | ALGO | 0.999995 | 5.755469 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2024-09-02T08:03:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9dad41e925... |
63bdce86-4409-478e-9d4d-0c554e948e08 | MAZHARMIK/Interview_DS_Algo | DP/Profitable Schemes.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=ay3MHrS7YbQ
Company Tags : AMAZON
Leetcode Link : https://leetcode.com/problems/profitable-schemes/
*/
//Approach-1 (Recursion + Memo)
class Solution {
public:
int t[101][101][101];
int thresholdProfit;
... | ALGO | 0.999947 | 5.50716 | {
"github_metadata": {
"branch": "master",
"commit_count": 5946,
"repo_created_at": "2020-07-12T13:13:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2586,
"forks": 1357,
"issues": 7,
"pull_requests": 37
},
"file_meta": {
"content_id": "... |
46c9fadb-c3ea-4cba-928a-3e91741dc19a | archeos/cloudcompare-archeos | CC/triangle/triangle.cpp | /*****************************************************************************/
/* */
/* 888888888 ,o, / 888 */
/* 888 88o88o " o8888o 88o8888o o88888o 888 o88888o */
... | ALGO | 0.999201 | 3.154153 | {
"github_metadata": {
"branch": "master",
"commit_count": 155,
"repo_created_at": "2013-01-13T05:03:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 4,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "51eaa3960... |
08e6e99b-ae64-436b-b0e2-5cde8dff903a | gaoyuu/IE523 | test3/test3/main.cpp | #include <iostream>
#include <deque>
#include <sstream>
#include <cstdio>
using namespace std;
const int MAX_SIZE = 9; // 九宫格
struct Pos {
Pos(int x, int y) : row(x), col(y) {};
int row;
int col;
};
typedef deque <Pos> qpos;
qpos Q; // 记录要放置数字的位置
// 九宫格数组,0表示玩家要放置数字的位置
int sudoku[MAX_SIZE][MAX... | ALGO | 0.999483 | 4.884479 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2017-09-05T16:17:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f0055bdc... |
6046f44b-2d60-47bc-9826-843bb7fdd22f | ssomesh/ParTBC | gpu_parallel_exact/main.cpp | #include <iostream>
#include <stdio.h>
#include <cuda_runtime.h>
#include "utils/timer.h"
#include "graph.h"
#include "approx.h"
// Conditional Compilation for timing the code using #ifdef TIMER.
// Set the macro using -DTIMER from the command line
using namespace std;
void write_output_to_file(const char* filenam... | ALGO | 0.987417 | 3.922966 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-08-24T02:09:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4f08d437b... |
cc138a29-b122-445e-ac73-1042a4632bdb | sraja1114/Seam-Carving-Image-Editor | functions.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <cmath>
#include "functions.h"
using namespace std;
int energy(const Pixel *const *image, int col, int row, int width, int height)
{
// integers created to represent
// change in pixels for each color
int Rx;
int Gx;
int B... | ALGO | 0.99435 | 5.267479 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-05-31T18:53: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": "82d1955679f... |
267681aa-7a6d-4114-8160-a61104cfaff9 | shadow-423/PAI | 数组创建与初始化.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
//int main()
//{
// char arr[]="abcdef";
// int i = 0;
// for (i = 0; i < (int)strlen(arr); i++)
// {
// printf("%c ", arr[i]);
// }
// return 0;
//}
//int main()
//{
// int arr[] = { 1,2,3,4,5,6,7,8,9,0 };
// int sz = sizeof(arr) / sizeof(arr[0]);... | TOOL | 0.926945 | 3.121984 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-05-06T13:59: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": "de5f156454fb... |
32531b95-15b3-448e-9eef-f5fb4769af00 | cmw9957/algorithm-practice- | 0x0D/14499_baek.cpp | #include<bits/stdc++.h>
using namespace std;
int n, m, x, y, k;
int left_right[] = {0, 0};
int box[25][25];
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
deque<int> up_down(4, 0);
void func(int dir){
int pos_x = x + dx[dir-1];
int pos_y = y + dy[dir-1];
if(pos_x < 0 || pos_x >= n || pos_y < 0 || pos_y >= m) r... | ALGO | 0.999932 | 3.858594 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2021-01-12T11:00: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": "7c2fabbb3... |
6993b63e-f773-4d0b-b67d-c995e75d2bcf | Kumarsanj1v/C--Programing | Practice/SpiralMatrix.cpp | #include <iostream>
using namespace std;
void print(int array[3][3]) {
for(int i = 0; i<3; i++) {
for(int j = 0; j<3; j++) {
cout<<array[i][j]<<" ";
}
cout<<"\n";
}
}
void spiralMatrix(int array[3][3],int n,int m) {
int startR = 0;
int startC = 0;
int endR = n-1... | ALGO | 0.999907 | 4.54748 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-10-07T05: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": "9ad0dfe34b3d... |
ee9c5031-7366-4444-8204-b286da1a15a9 | HKUST-Aerial-Robotics/EPSILON | core/common/src/common/idm/intelligent_driver_model.cc | #include "common/idm/intelligent_driver_model.h"
namespace common {
ErrorType IntelligentDriverModel::GetIdmDesiredAcceleration(
const IntelligentDriverModel::Param ¶m,
const IntelligentDriverModel::State &cur_state, decimal_t *acc) {
decimal_t s_star =
param.kMinimumSpacing +
std::max(0.0,
... | ALGO | 0.997646 | 6.575098 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2020-09-20T08:27:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 718,
"forks": 252,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "332a2... |
36d1ff8b-c3a3-4967-86a6-34380ccd69c0 | koushik-us/Braille-Autocorrect | brailleAutocorrect.cpp | #include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <algorithm>
using namespace std;
// QWERTY key to Braille dot mapping
unordered_map<char, int> qwertyToDot = {
{'D', 1},
{'W', 2},
{'Q', 3},
{'K', 4},
{'O', 5},
{'P', 6}
};
// Full Braille encoding for lo... | ALGO | 0.998334 | 5.846369 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2025-06-18T16:53:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4398c3f8a6de... |
d9b85930-c896-4d4e-9244-75d9aa51bff2 | Raikyr4/Estudos_C_plusplus | Exercicios Básicos/Exercício_4_condicional.cpp | //Nome dos integrantes do grupo que participaram da atividade : <NAME>, <NAME>, <NAME>.
#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
int main()
{
int A,B,C; //Variáveis numéricas inteiras utilizadas, A=variável A, B=variável B, C=Variável C.
float X,Delta,X1,X2; //Variáveis numéricas uti... | ALGO | 0.999257 | 3.565742 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-10-06T20:34:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6848c6787a1... |
2c2514c5-d4a0-4545-9092-9e1a2667a8db | TiluramSahu/Data-Structure-and-Algorithms | 09_majority_element.cpp | #include <iostream>
#include <vector>
using namespace std;
int majorityElement(vector<int>& nums) {
// Step 1: Find the candidate using Moore's Voting Algorithm
int candidate = 0, count = 0;
for (int num : nums) {
if (count == 0) {
candidate = num;
}
count += (num == ca... | ALGO | 0.999995 | 6.576269 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2025-01-24T18:41: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": "b1a1abc7800... |
8d3bd11a-37a0-4f11-8bc9-b86fe5adbce9 | tranHieuDev23/solution-spoj-cf | Bài của Lord Hiếu/GRAPH/GRAPH.cpp | #include <bits/stdc++.h>
#define FOR(i, j, k) for (int i = j; i <= k; i ++)
#define FORD(i, j, k) for (int i = j; i >= k; i --)
#define mn 20004
#define maxC 1000000007
#define pb push_back
#define F first
#define S second
#define mp make_pair
using namespace std;
int n, m, num[mn], low[mn], rig = 0;
int numChild[mn],... | ALGO | 0.999944 | 4.36771 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2016-10-25T13:40:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "81828d1b... |
22bb0c47-6f3a-4657-bda6-73438b5aa18f | wldnd9904/Cpp | swea/sw_19.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define MAX_CITY 50001
#define MAX_EDGE 200001
int N, M;
int parent[MAX_CITY];
struct edge {
int A, B, cost;
};
struct cmp {
bool operator()(edge a, edge b) { return a.cost > b.cost; }
};
int main(void) {
std::ios_base::sync_with... | ALGO | 0.999966 | 4.666115 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2021-10-14T15:22: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": "930668b10... |
d2668616-c520-492b-abf8-cb6345cc5c77 | xingshengao/algoModule | others/字符串/Trie(map版).cpp | // https://www.luogu.com.cn/problem/P8306
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
struct Trie {
map<char, Trie*> son;
map<char, int> cnt_pre;
map<char, int> cnt_word;
Trie() {}
void insert(string word) { // 插入word
char c;
Trie* now = this;
for (i... | ALGO | 0.999816 | 4.269235 | {
"github_metadata": {
"branch": "main",
"commit_count": 323,
"repo_created_at": "2023-11-13T06:36:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05d4e68da9... |
f00fea14-c54b-4661-95ac-445f6b207c30 | Alex7Li/ProgrammingContests | Codeforces/Hyperset.cpp | # include <bits/stdc++.h>
//https://codeforces.com/problemset/problem/1287/B
using namespace std;
# define rep(i, a, b) for(int i = a; i < (b); ++i)
# define trav(a, x) for(auto& a : x)
# define all(x) begin(x), end(x)
# define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> ... | ALGO | 0.999917 | 4.291548 | {
"github_metadata": {
"branch": "master",
"commit_count": 84,
"repo_created_at": "2017-08-14T19:06:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "405014fbf... |
69002ff5-1688-4272-9142-4f0a3725543d | EonaCat/EonaCatCipher | C++/EonaCatCipher.cpp | #include <iostream>
#include <stdexcept>
#include <vector>
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
#include <string.h>
/*
* EonaCatCipher - Because security is key!
*
* Copyright (c) 2024 EonaCat (<NAME>)
*
* https://eonacat.com/license
*
* TERM... | ALGO | 0.985276 | 6.309562 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-09-25T17: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": "e23c3fc1ad89... |
a3359532-5680-4976-8e1a-826b72056a9a | ethz-adrl/control-toolbox | ct_core/include/ct/core/geometry/PlaneEstimator.h | /**********************************************************************************************************************
This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
Licensed under the BSD-2 license (see LICENSE file in main directory)
****************... | ALGO | 0.964732 | 7.344228 | {
"github_metadata": {
"branch": "v3.0.2",
"commit_count": 1871,
"repo_created_at": "2019-04-25T21:55:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1596,
"forks": 332,
"issues": 59,
"pull_requests": 4
},
"file_meta": {
"content_id": "ba... |
b074818e-b6d6-45d7-8162-1b375d782712 | jbutner/trilinos-1 | packages/moocho/src/MoochoPack/src/std/MoochoPack_PreProcessBarrierLineSearch_Step.hpp | // @HEADER
// ***********************************************************************
//
// Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
// Copyright (2003) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of thi... | TOOL | 0.908155 | 6.601077 | {
"github_metadata": {
"branch": "master",
"commit_count": 48938,
"repo_created_at": "2013-06-10T20:24:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3a01c7... |
6c0eb383-f1c7-4ef8-8de1-b41a43c34e1a | saffy-embedded-22-study/Study | 손명주/백준_1149_RGB거리.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int N;
int Cost[1000][3];
int dp[1000][3];
int main() {
cin >> N;
for (int i = 0; i < N; i++) {
for (int j = 0; j < 3; j++) {
cin >> Cost[i][j];
}
}
for (int i = 0; i < 3; i++) dp[0][i] = Cost[0][i];
for (int i = 1; i < N; i++) {
dp[i][0] = ... | ALGO | 0.99994 | 4.039035 | {
"github_metadata": {
"branch": "main",
"commit_count": 467,
"repo_created_at": "2023-02-23T03:56:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 5,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "2889f581c95... |
cee84847-0d29-414f-ac97-9117b4107dea | elprogramadorr/ICPC-Teambook-Perritos-Malvados-UMSS- | Geometry/general.cpp | struct Point {
ll x, y;
// Operadores para comparacion
bool operator == (Point b) { return x == b.x && y == b.y; }
bool operator != (Point b) { return !(*this == b); }
bool operator < (const Point &o) const { return y < o.y || (y == o.y && x < o.x); }
bool operator > (const Point &o) const { return y > o.y ... | ALGO | 0.999843 | 4.55693 | {
"github_metadata": {
"branch": "master",
"commit_count": 116,
"repo_created_at": "2024-07-20T21:21: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": "fb8344a9... |
1f7a6631-d555-4209-91eb-9e1cb03ee813 | yashSoni9000/Code_chef_Solutions | Medel.cpp | #define ll long long
#define f(end) for(int i=0;i<end;i++)
#define e '\n'
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t,n;
cin>>t;
while(t--)
{
cin>>n;
int mini=INT_MAX,maxi=INT_MIN,temp,iMin,iMax;
f(n){
cin>>temp;
... | ALGO | 0.999955 | 3.782373 | {
"github_metadata": {
"branch": "master",
"commit_count": 770,
"repo_created_at": "2022-10-26T15:44:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4370290e... |
52da8b17-c33b-42f0-9215-a71240b01db1 | agul/contest-tasks | FNeobichnayaMatritsa.cpp | #include "base/header.hpp"
class FNeobichnayaMatritsa {
public:
static constexpr bool kWriteCaseNumber = false;
static constexpr bool kMultiTest = true;
void solve(std::istream& in, std::ostream& out) {
int n;
in >> n;
std::vector<std::string> a(n), b(n);
in >> a >> b;
auto ... | ALGO | 0.999929 | 5.373168 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-04-26T23:57: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": "dcd6d226e... |
1f753a50-7128-47a3-af68-610251813ea0 | shiziyue/TJU_HOMEWORK | 密码学/实验-1-RSA算法与攻击实现/实验问题-1 设计一个RSA机密算法/rsa.cpp | #include <iostream>
#include <string.h>
#include "rsa_fuc.c"
using namespace std;
int main(){
cout<<"Please select RSA Secret (en) or Decrypt (de):"<<endl;
string model;
cin>>model;
if(model == "en"){
struct encrypt_data en;
cout<<"Please enter a prime number -> p:"; cin>>en.p; c... | ALGO | 0.994442 | 3.365225 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-01-01T11:57:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f88af6463694... |
ffe7f310-7b31-4208-b0e1-78f6ff58ed76 | mohitkadwe19/interviewBit-solution | atoi.cpp | #include <bits/stdc++.h>
using namespace std;
int atoi(const string A)
{
long long ans = 0, flag = 1, space = 0;
for (int i = 0; i < A.size(); i++)
{
if (i == 0 && A[i] == '-')
flag = -1;
else if (i == 0 && A[i] == '+')
flag = 1;
else if (ans == 0 && A[i] == ' ' && i == space)
{
... | ALGO | 0.995919 | 3.931375 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2022-10-16T16:18:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4f22439d32... |
c1c09e2d-89ee-4c6c-b33f-6e968142e0a2 | PFelsen/Bachelor_Thesis_Karlsruhe_2024 | mpp/src/lib3_disc/shapes/RTShapesTriangular.hpp | #ifndef RTSHAPESTRIANGULAR_HPP
#define RTSHAPESTRIANGULAR_HPP
#include "LagrangeShapesTriangular.hpp"
#include "RTNodalPoints.hpp"
#include "RTShape.hpp"
/*
* Based on paper by Ervin
* Computational Bases for RT_k and BDM_k on Triangles
*/
template<uint32_t order, typename T = double, int sDim = SpaceDimension, i... | ALGO | 0.952375 | 6.853069 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2024-06-27T15:14: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": "dcad330bbf4... |
7645a78f-9abb-453a-927a-bc2d22470d5a | Prasad-264/SdeSheetChallenge | Day10_Greedy_Algorithm/Fractional_Knapsack.cpp | /*
Given weights and values of N items, we need to put these items in a knapsack of capacity W
to get the maximum total value in the knapsack.
Note: Unlike 0/1 knapsack, you are allowed to break the item.
Example 1:
Input:
N = 3, W = 50
values[] = {60,100,120}
weight[] = {10,20,30}
Output:
240.00
Explanation: Tota... | ALGO | 0.999994 | 5.530403 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2022-06-05T15:39: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": "12068e825fb... |
174f5d92-d076-4394-9876-58f817a71645 | CSUwangj/LeetCode | 902.numbers-at-most-n-given-digit-set.cpp | /*
* @lc app=leetcode id=902 lang=cpp
*
* [902] Numbers At Most N Given Digit Set
*/
// @lc code=start
#define MOD 1000000007
class Solution {
int dp[11][10] = {};
int nDigits[11] = {};
bool digits[10] = {};
public:
int atMostNGivenDigitSet(vector<string>& ds, int n) {
for(auto &d : ds) {
digits[... | ALGO | 0.999849 | 6.696994 | {
"github_metadata": {
"branch": "master",
"commit_count": 77,
"repo_created_at": "2020-10-10T01:43: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": "7827f04ae... |
f8b077c7-7f3a-42d2-aecf-3f190f19e089 | abhibhatnagar0/Leetcode-Solutions | 201-bitwise-and-of-numbers-range/201-bitwise-and-of-numbers-range.cpp | class Solution {
public:
int rangeBitwiseAnd(int left, int right) {
if(left==0 || right==0) return 0;
//if left right have different bits ...ans=0
//ie all flipped bits
if((int)log2(left)!= (int)log2(right)) return 0;
// 00111001
// 01000000 (this no will be in bt... | ALGO | 0.999965 | 5.658655 | {
"github_metadata": {
"branch": "main",
"commit_count": 1317,
"repo_created_at": "2022-05-20T08:35:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a28d45352... |
b100e562-e206-4668-b282-e180d639b894 | swarmer/algorithms | graphs/bellman-ford/bellman-ford.cpp | #include <iostream>
#include <fstream>
#include <cstdio>
#include <vector>
#include <set>
#include <utility>
#include <algorithm>
#include <map>
#include <climits>
using namespace std;
struct Edge
{
int i1, i2, dist;
Edge(int i1 = -1, int i2 = -1, int dist = -1) : i1(i1), i2(i2), dist(dist) {}
};
const int I... | ALGO | 0.999985 | 4.90713 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2013-02-02T15:21: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": "debb95e69... |
7d016ef5-2803-4a05-81e1-a61085b863a3 | irvinodjuana/acm | archive/2021-02-11-1651/U.cpp | #include <bits/stdc++.h>
using namespace std;
// shortened type names
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
// common utils
vector<vector<char>> read_matrix(int n, int m) {vector<vector<char>> grid(n, vector<char>(m));for (int i = 0; i < n; i++) {string s;cin >> s;for (in... | ALGO | 0.999987 | 4.076527 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-01-09T01:30: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": "70de4a729... |
7c94173a-ac54-4631-a3c1-7e3949e70703 | aarograh/NERS-544 | hw4/p2/p2.cpp | // NAME : <NAME>
// COURSE : NERS 544
// ASSIGNMENT : Homework 4
// PROBLEM : Problem 2
// DATE : April 23, 2015
#define B2 0.079407543572005
#define PI 3.14159265358979323
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<time.h>
#include<cmath>
using namespace std;
// Random numbe... | ALGO | 0.999408 | 4.657182 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2015-01-30T20:48:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b2205c2e... |
321ea5c1-5eb0-4809-a862-08759f67994e | adityaa30/programs | Suffix Array/Fast.cpp | #include <bits/stdc++.h>
using namespace std;
class SuffixArray {
/**
* Preparations Done:
* 1. Add $ to the end of input string (smallest ASCII value
* among all characters of the string)
* 2. Make the length of all the strings the same by writing all
* other characters in the string after $ in a cyc... | ALGO | 0.999539 | 4.235123 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2020-09-15T17:15:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc1d037bb... |
ec268513-bb2a-45c8-a472-d518869dfc00 | Vaa3D/vaa3d_tools | released_plugins/v3d_plugins/celegans_straighten/q_celegans_straighten_bk.cpp | // q_celegans_straighten.h
// by <NAME>
// 2010-08-11
#include <vector>
using namespace std;
#include "../../v3d_main/basic_c_fun/stackutil.h"
#include "../../v3d_main/basic_c_fun/basic_memory.cpp"
#include "../../v3d_main/worm_straighten_c/spline_cubic.h"
#include "q_imresize.h"
#include "q_principalskeleton_detect... | ALGO | 0.984541 | 4.661033 | {
"github_metadata": {
"branch": "master",
"commit_count": 7983,
"repo_created_at": "2016-01-27T18:19:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 110,
"forks": 70,
"issues": 11,
"pull_requests": 12
},
"file_meta": {
"content_id": "36f... |
ab910e05-1d99-4bcf-8554-09d835170670 | akrolik/rNdN | include/SASS/Tree/Instructions/Maxwell/BinaryUtils.h | #pragma once
#include "SASS/Tree/Instructions/BinaryUtils.h"
#include "SASS/Tree/Operands/Composite.h"
#include "SASS/Tree/Operands/Constant.h"
#include "SASS/Tree/Operands/I8Immediate.h"
#include "SASS/Tree/Operands/I16Immediate.h"
#include "SASS/Tree/Operands/I32Immediate.h"
#include "SASS/Tree/Operands/Predicate.... | TOOL | 0.928465 | 7.619232 | {
"github_metadata": {
"branch": "master",
"commit_count": 1221,
"repo_created_at": "2018-04-02T23:54:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b513dc5... |
c7978ccb-5905-4357-b5d4-307a39a9ad2f | aryan04-t/LeetCode | 02_Strings/009_1456. Maximum Number of Vowels in a Substring of Given Length/00_Optimal_Sliding_Window_Approach.cpp | // LeetCode (1456. Maximum Number of Vowels in a Substring of Given Length):
// https://leetcode.com/problems/maximum-number-of-vowels-in-a-substring-of-given-length
#include<string>
#include<limits.h>
#include<algorithm>
using namespace std;
class Solution {
public:
bool isVowel(const char &c){
if... | ALGO | 0.999737 | 6.019508 | {
"github_metadata": {
"branch": "master",
"commit_count": 571,
"repo_created_at": "2023-11-12T04:49: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": "5eebd5db... |
180c9e3e-d1a9-4714-9acb-738f4eedfae3 | JeraKrs/acm | codes/HDU/hdu5296.cpp | #include <cstdio>
#include <cstring>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;
const int maxn = 100005;
typedef set<int>::iterator iter;
set<int> S;
int N, Q, dp[maxn], vis[maxn];
int E, first[maxn], jump[maxn * 2], link[maxn * 2], val[maxn * 2];
int id, idx[maxn], ridx[maxn], dep[max... | ALGO | 0.999947 | 4.19788 | {
"github_metadata": {
"branch": "master",
"commit_count": 163,
"repo_created_at": "2016-05-23T06:40:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "662274f1... |
a3cfe86e-5b95-4a48-868e-cadf8f2a41dd | ra2003/Plagiarism | dataset/test/modification/1623_control_replacement/36/transformation_1.cpp | #include <iomanip>
#include <iostream>
#include"bits/stdc++.h"
using namespace std;
#define pb push_back
#define int long long
#define vi vector<int>
#define ub upper_bound
#define lb lower_bound
#define ins insert
#define ff first
#define ss second
#define check cout<<"Check ";
#define inf 1e18
#define mod 100000000... | ALGO | 0.999806 | 3.909664 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2022-08-06T10:23:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ca244eed663... |
453dfede-905e-4fab-90e9-8aa9d0e97f57 | TosakaUCW/CompetitiveProgramming | 蓝桥杯/2025 省赛/D - 产值调整.cpp | #include <bits/stdc++.h>
using i64 = long long;
#define int i64
#define pb push_back
#define ep emplace
#define eb emplace_back
using namespace std;
template <class T1, class T2> ostream &operator<<(ostream &os, const std::pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ... | ALGO | 0.999827 | 4.056439 | {
"github_metadata": {
"branch": "master",
"commit_count": 506,
"repo_created_at": "2018-09-23T04:02:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df9417bf... |
77e859d0-8f2d-4768-a5e7-29c03df97146 | Gawainus/id2204 | A4/interval.cpp | /*
* Main authors:
* <NAME> <<EMAIL>>
*
* Copyright:
* <NAME>, 2009
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitati... | ALGO | 0.999345 | 6.131482 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2016-03-31T08:22: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": "9bf93cc7a... |
a2a827d8-d22c-43e5-940e-85ce84b26b5c | green-fox-academy/GerBer1234 | week-03/day-2/refactor_maximum/main.cpp | #include <iostream>
void size(int *numb);
void arrays(int array[], int *numb);
void maximum(int array[], int *numb);
int main() {
int number;
size(&number);
int arraye[number];
arrays(arraye, &number);
maximum(arraye, &number);
return 0;
}
void size(int *numb) {
std::cout << "Give me a nu... | ALGO | 0.997926 | 3.825071 | {
"github_metadata": {
"branch": "master",
"commit_count": 138,
"repo_created_at": "2018-11-01T19:44:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c50cd37af... |
ebbb1c01-b072-47dc-bdf8-6490af8e9b5a | morix1500/atcoder | atcoder/ABC131/B/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n, l;
cin >> n >> l;
int sum = 0;
vector<int> aji(n);
for (int i = 0; i < n; i++) {
aji[i] = l + i;
sum += aji[i];
}
int mn = INT_MAX;
int ans = 0;
for (int i = 0; i < n; i++) {
int sm = 0;
for (int... | ALGO | 0.999973 | 3.62212 | {
"github_metadata": {
"branch": "master",
"commit_count": 260,
"repo_created_at": "2019-04-06T07:24: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": "7eebb3c8... |
e59e6d49-0b62-4b2d-ab77-e2ccf7d6ce47 | TimKrause2/gravity-sim | vector.h | #include <math.h>
#include <iostream>
class Vector3
{
public:
double x,y,z;
Vector3( double x=0.0, double y=0.0, double z=0.0 ){
Vector3::x = x;
Vector3::y = y;
Vector3::z = z;
}
double mag(void){
return sqrt(x*x + y*y + z*z);
}
double normalize( void ){
double m = mag();
if(m==0.0){
x=1.0;
y=0... | TOOL | 0.946958 | 4.530348 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-07-03T15:52:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5fcab9661... |
b0b7ccc9-1c68-4328-8ecc-f85e81e06796 | dtegunov/tom | Oscar3/c++Picker/include/arpack++/ardgnsym.h | /*
ARPACK++ v1.0 8/1/1997
c++ interface to ARPACK code.
MODULE ARDGNSym.h.
Arpack++ class ARluNonSymGenEig definition
(dense matrix version).
ARPACK Authors
<NAME>
<NAME>
<NAME>
Dept. of Computational & Applied Mathematics
Rice University
Houston, Texas
*/
#ifnde... | ALGO | 0.975696 | 5.671995 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-01-27T23:22:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8b01c603... |
ad43de19-70f7-4d05-b6c9-342589e56647 | Riddle4045/OpenMP-PageRank---OpenMPI_reducer | OpenMPI-reducer/task2.cpp | #include <iostream>
#include <sstream>
#include <mpi.h>
#include <vector>
#include <map>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
char filename[128];
const int overlap=100;
MPI::File thefile;
MPI::Offset localsize;
MPI::Offset start, end;
char *chunk;
MPI::... | DATA | 0.987602 | 3.895743 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-04-12T18:07:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "763cbd423e... |
1e7bfca1-545f-4a76-a84b-bc00eab5fe16 | afnan47/sem7 | DAA/1_Fibonacci_Numbers.cpp | #include<iostream>
#include<vector>
using namespace std;
//Iteratively using memoization
int iStepFibbonacci(int n){
vector<int> f;
f.push_back(0);
f.push_back(1);
//[]
int cnt = 2;
for(int i = 2; i < n; i++){
cnt++;
f.push_back(f[i - 1] + f[i - 2]);
}
return n;
}
int ... | ALGO | 0.999943 | 4.905865 | {
"github_metadata": {
"branch": "main",
"commit_count": 85,
"repo_created_at": "2022-08-20T07:57:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 64,
"forks": 39,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6d6887e6... |
ca9ee751-ebd9-4d35-944a-ff538499cdcc | Rishikesh9896/CPP | Switch/switchHomework.cpp | #include <iostream>
using namespace std;
int main(){
int amount;
cout << "Enter the number " << endl;
cin >>amount;
int Hundred, Fifty, Twenty, Ten, One;
switch(1){
case 1: Hundred = amount / 100;
amount = amount %100;
cout << "The 100 notes are " << Hundred << endl;
... | ALGO | 0.915176 | 3.22488 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-12-14T06:47: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": "52fb955073e... |
87e56003-42be-485a-87b9-483b669a1432 | ishandutta2007/codeforces-p | purplecrayon/normal/1574/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(v) int(v.size())
#define ar array
typedef long long ll;
const int MAXN = 3e5+10, MOD = 998244353;
template <int MOD_> struct modnum {
static constexpr int MOD = MOD_;
static_assert(MOD_ > 0, "MOD must be positive");
private:
using ll = long long;
int v;
... | ALGO | 0.999826 | 4.315113 | {
"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": "b28917f0e211... |
09a6c6fc-175b-439c-85fe-f44150c128d7 | chenshanzhi/OJ | POJ/2549.cpp | // =====================================================================================================================
// http://poj.org/problem?id=2549
// =====================================================================================================================
#include <algorithm>
#include <iostream>
u... | ALGO | 0.999993 | 4.315952 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-12-28T18:33: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": "0a9754ab678... |
232d2337-ca58-42ea-81cd-b04e3506a934 | andreea-alexandru/swift-private-data-driven-control | optimized-data-driven-control.cpp | /*
* Code for model-free control with behavioral paradigm.
*
* This is the optimized and updated functionality described in the paper "Data-driven control on encrypted data",
by <NAME>, <NAME> and <NAME>.
* Specifically, we reduce the memory from O((S+T)^2) ciphertexts to O((S+T)) ciphertext.
* As a result, th... | ALGO | 0.999304 | 4.516469 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-08-14T19:00: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": "cdac6188a0... |
6dbae91e-d025-4c31-8135-ae8d0c67c054 | sunjq0407/leetcode-cpp | BasicCalculator.cpp | class Solution {
public:
int returnoffset = 0;
int calculate(string s) {
int tmp = 0, cur = 0;
char cal;
for(int i=0; i<s.length(); i++) {
char c = s[i];
if(c==' ') continue;
if(c>='0'&&c<='9') tmp=tmp*10+c-'0';
else if(c=='+'||c=='-') {
... | ALGO | 0.999963 | 4.44729 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2015-10-31T22:37: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": "97b7cef5a... |
c5858c87-0c4d-4b3a-8f4a-057de26c6400 | TAMREF/problem-solving-storage | AutoDownloaded Codes/sshstamref/2415/2415.cpp11.cpp | #include <cstdio>
#include <algorithm>
#include <vector>
#define fst first
#define snd second
#define all(x) x.begin(),x.end()
#define mp make_pair
using namespace std;
typedef long long ll;
const int MX=1505;
const ll INF=1e17;
struct pt{
int x, y;
ll d;
pt(int x=0,int y=0):x(x),y(y){d=(ll)x*x+(ll)y*y;}
... | ALGO | 0.99991 | 3.497692 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2017-01-14T09:27:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc1f8e260... |
8d0417b4-63b3-45c4-89f0-9b1a425d25e8 | reddy-lab-code-research/MuST-CoST | data/transcoder_evaluation_gfg/cpp/FIND_SMALLEST_VALUE_REPRESENTED_SUM_SUBSET_GIVEN_ARRAY.cpp | // Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include... | TEST | 0.999442 | 5.624844 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-02-08T19:28:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b630655da78... |
a9bb21a4-812b-475b-bc9a-e911ac5da5ef | ja-li/mathinterfacelib | tests/sfo_test.cpp |
#define NR_POINTS 5
#define NR_CLUSTERS 3
double points[NR_POINTS][2] = {{0,0}, {5,1}, {3,5}, {15,15}, {2,3}};
size_t queries = 0;
set<vector<double> > queryHist;
bool sfo_clustering_rect(const std::vector<Value *> &inputValues,std::vector<Value *> &outputValues) {
Value_Matrix *inMat= dynamic_cast<Value_Matrix *>(... | ALGO | 0.995958 | 5.061876 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2021-10-31T22:03: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": "601d993bd87... |
4b43e279-5e8b-463d-a9a9-d8a0f5efce8f | Thblaauw/AI-Projects | AI-Projects/GraphSearch_vs_TreeSearch/Node.cpp | #ifndef NODE_CPP
#define NODE_CPP
#include "Node.h"
#include <iostream>
Node::Node(int b[9], int (*heuristic_calc)(int[] , int ), int pc) {
for (int i = 0; i < 9; i++) {
board[i] = b[i];
}
for (int i = 0; i < 4; i++) {
children_nodes[i] = nullptr;
}
heuristic_val = heuristic_calc(b, 9);
path_cost = pc + 1;
... | ALGO | 0.996337 | 6.014494 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-04-09T17:22: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": "f2c1ea8077... |
ee8ecc4f-cf4c-4790-86b7-09f3a164db46 | akamabhoi/neetCode | Arrays and Hashing/ValidAnagram.cpp | class Solution {
public:
// Function to check if two strings are anagrams
bool isAnagram(string s, string t) {
// Create an unordered map to store the frequency of each character in the first string
unordered_map<int, int> mp;
// Count the frequency of each character in the first string
for(auto letter... | ALGO | 0.999929 | 6.136153 | {
"github_metadata": {
"branch": "main",
"commit_count": 189,
"repo_created_at": "2024-02-25T18:15:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5b8096247... |
ca58e738-3060-4507-b886-bc8ed7e68dde | ZhongZeng/Leetcode | lc723cdyCrh.cpp | /*
723. Candy Crush
Related Topics: Array, Two Pointers
Test Cases:
[[110,5,112,113,114],[210,211,5,213,214],[310,311,3,313,314],[410,411,412,5,414],[5,1,512,3,3],[610,4,1,613,614],[710,1,2,713,714],[810,1,2,1,1],[1,1,2,2,2],[4,1,4,4,1014]]
[[1,1,1],[2,1,2],[2,1,2]]
[[1,2,3],[4,5,6],[7,8,9]]
Runtime: 16 ms, faster ... | ALGO | 0.999991 | 6.537522 | {
"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": "659ecab5... |
1277cb17-a718-4d04-81e4-273d4e7dad65 | SharafMohamed/NetworKit | networkit/cpp/matching/PathGrowingMatcher.cpp | /*
* PathGrowingMatcher.cpp
*
* Created on: Jun 13, 2013
* Author: Henning
*/
#include "PathGrowingMatcher.h"
#include "../auxiliary/PrioQueueForInts.h"
namespace NetworKit {
PathGrowingMatcher::PathGrowingMatcher(const Graph& G): Matcher(G) {
if (G.numberOfSelfLoops() > 0) {
throw std::invalid_argumen... | ALGO | 0.999582 | 5.422351 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-04-22T02:38:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58985f16c1... |
91e65716-3419-446c-b5ee-317fc69ffef6 | WaleedAbdelhakim/Competitive-Programming | CodeForces/CF707-D2-D.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
int n, m;
struct node {
int sum;
bool lazy;
node *left, *right;
node(int sum = 0) : sum(sum), left(this), right(this), lazy(0) {}
node(int sum, node *left, node *right) : sum(sum), left(left), right(right), lazy(0) {}
node ... | ALGO | 0.999885 | 4.408474 | {
"github_metadata": {
"branch": "master",
"commit_count": 214,
"repo_created_at": "2019-02-11T00:12:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "19667ad9... |
b232bfb0-fdbc-4a32-96c7-efccddf5d423 | Jaggi0504/BinaryTreeOperations | BinaryTree1.cpp | #include<iostream>
#include<queue>
#include<climits>
#include<bits/stdc++.h>
using namespace std;
template<typename T>
class BinaryTreeNode {
public:
T data;
BinaryTreeNode *left;
BinaryTreeNode *right;
BinaryTreeNode(T data) {
this->data=data;
left=NULL;
right=NULL;
}
~BinaryTreeNode() {
dele... | ALGO | 0.999905 | 3.32018 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-09-18T03:02:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06c02beee9... |
a0d4e683-8c43-443e-9da7-f2ef591fe621 | bamboohiko/problemSolve | codeforce/c552/pd.cpp | #include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
using namespace std;
const double eps = 1e-8;
struct point {
double x,y;
};
int dcmp(double x) {
if(fabs(x) < ... | ALGO | 0.999626 | 3.468916 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2015-12-13T17:03: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": "fff652a2b... |
eeef2156-8cb4-448f-b3da-d588fdfc535a | ib13/Coding-Practice | GFG 2/connect-nodes-at-same-level.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
struct Node *nextRight;
Node(int x)
{
data = x;
left = right = NULL;
nextRight = NULL;
}
};
void connect(struct Node *p);
/* Helper function that allocates a n... | ALGO | 0.999958 | 3.923006 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2019-04-12T11:38:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "503866121... |
68102b3c-f152-452a-b426-35fed798befa | privetetoya/ASD.lab1 | AiSD.lab1/Map.h | #pragma once
#include <iostream>
#include "List.h"
using namespace std;
template<typename TKey, typename TValue>
class Map {
private:
class Node {
public:
Node* parent;
Node* left;
Node* right;
TKey key;
TValue value;
bool color;
Node(Node* parent, Node* left, bool color, Node* right, TKey key, TValue... | ALGO | 0.979985 | 4.225958 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-04-29T18:02: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": "b3d6b6b787... |
9e56fa21-4c3c-4c2f-b2b2-ad6d2428af4b | atailh4n/BDACL_vxproj | BDACL_vxproj/AStar.hpp | #pragma once
#include <iostream>
#include <optional>
#include <vector>
#include <unordered_map>
#include <queue>
#include <functional>
#include <limits>
#include <algorithm>
#include <unordered_set>
namespace KGL
{
template <typename NodeType, typename CostType = float>
class AStar
{
public:
struct PathNode
{
... | ALGO | 0.999365 | 6.669118 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2025-05-17T15:10:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95e97e067... |
f9c3e635-611f-48b7-8cde-a8c4a17ed0bf | towhid1zaman/Categories-problem-solve | Backtracking-Recursion/subsequence using bitmask II.cc | #pragma comment (linker,"/STACK:16777216")
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define all(v) (v).begin(),(v).end()
#define endl "\n"
const int maxn = 200005;
const int mod = 1000000007;
std::vector<int>bn(int n){
std::vector<int>binary;
while(n){
binary.push_back(n%2);
... | ALGO | 0.999196 | 4.363837 | {
"github_metadata": {
"branch": "master",
"commit_count": 545,
"repo_created_at": "2019-10-29T07:45:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "94d0bf0e... |
6cc354c6-31ff-4cd1-a9c9-1a3af61a0815 | abhinav8925/Codeforces-Solutions | CF 800 (Implementation,Brute Force)/509(A) Maximum in Table.cpp | /*
***** !!!!! <NAME> !!!!! *****
Date -> 16th June 2023
Code by - <NAME>
Problem link -> https://codeforces.com/problemset/problem/935/A
*/
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define ll long long int
#define endl "\n"
using namespace std;
int N=1000001;
vector<int> arr(N,tr... | ALGO | 0.999977 | 4.828795 | {
"github_metadata": {
"branch": "main",
"commit_count": 308,
"repo_created_at": "2022-08-07T10:43: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": "08a449c167... |
7038cec6-ee92-4083-b31b-e443739308b1 | MuhtasimTanmoy/playground | leetcode/0576-out-of-boundary-paths/0576-out-of-boundary-paths.cpp | class Solution {
public:
int findPaths(int m, int n, int maxMove, int sr, int sc) {
const int MOD = 1e9 + 7;
auto isIn = [&](int x, int y) {
if (x < 0 || x >= m) return false;
if (y < 0 || y >= n) return false;
return true;
};
vector<pair<int, int>... | ALGO | 0.999971 | 5.55258 | {
"github_metadata": {
"branch": "main",
"commit_count": 3861,
"repo_created_at": "2019-09-04T07:43:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7bc3d1b... |
19d9efb2-3dc8-4f4e-a162-82fe184a2e96 | NamYunje2002/algorithm | Boj_C++/14003.cpp | /* https://www.acmicpc.net/problem/14003 */
#include <iostream>
#include <stack>
using namespace std;
int n, idx, length, mid, arr[1000000], lis[1000000], ans[1000000];
stack<int> S;
int BS(int low, int high, int target) {
while (low < high) {
mid = (low + high) / 2;
if (lis[mid] < target) low = mid + 1;
els... | ALGO | 0.999998 | 4.143532 | {
"github_metadata": {
"branch": "main",
"commit_count": 195,
"repo_created_at": "2024-03-08T07:03: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": "16cd8eb87f... |
9c714b58-1fdc-43c6-a6fc-d7373cf0cd4a | anubansal17/Coding-Career-Journey | RoadMap/11_StockBuyAndSell.cpp | /*
Approach 1: Brute Force: T.C- O(n^2), S.C- O(1)
- For each element check for the highest greater element possible at the right side
Approach 2: T.C- O(n), S.C- O(1)
- Keep track of minimum at the left side
- Calculate the profit while scanning the array from left to right
- Initialise profit as 0, If the profit is g... | ALGO | 0.99998 | 6.065663 | {
"github_metadata": {
"branch": "master",
"commit_count": 901,
"repo_created_at": "2020-02-09T14:11:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b6f8b65... |
9c99aea7-e6ba-4d2d-9dd7-186bac473f26 | isl-org/Open3D | cpp/open3d/geometry/PointCloudCluster.cpp | // ----------------------------------------------------------------------------
// - Open3D: www.open3d.org -
// ----------------------------------------------------------------------------
// Copyright (c) 2018-2024 www.open3d.org
// SPDX-License-Identifier: MIT
// ---... | ALGO | 0.956019 | 7.001393 | {
"github_metadata": {
"branch": "main",
"commit_count": 4194,
"repo_created_at": "2016-12-02T16:40:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12555,
"forks": 2448,
"issues": 1245,
"pull_requests": 37
},
"file_meta": {
"content_id": ... |
a7cc7b76-a7b0-4d4d-bdb3-198c8317a707 | MohamedAliRashad/Social-Media-Analyzer | Betweenness_centrality.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <fstream>
#include <string>
#define INF 99999
using namespace std;
float Betweenness(vector<vector<int>> S, int V)
{
float Result = 0;
for (int i = 0; i < S.size(); i++){
if (S[i][0] == INF)
continue;
... | ALGO | 0.998647 | 4.063657 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-05-10T15:38: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": "29ca27154... |
8ba39f9a-1f18-4411-9f75-c09232a1c804 | leizelaser/Ising | IsingOpenMP/spin.h | #include "ndarray.h"
#define DIM 3
#define DIM2 DIM*2
#ifdef OMP_H
#include "grid_field_virtual.h"
#endif
class IsingModel
{
public:
int L;
int N; // N = L^DIM
double beta;
double Pcluster; // = 1 - exp(-2.0*beta)
int * s;
ndarray<int> NeighborLis... | ALGO | 0.99939 | 5.629149 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-06-09T03:01: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": "918e82ad9712... |
f41c0afd-11f8-4520-af46-14675c63a0d8 | fjunqueira/the-lair-of-the-minotaur | source/pathfinding/pathfinding_graph.cpp | //
// Created by fabio on 12/12/15.
//
#include "pathfinding_graph.h"
pathfinding::PathfindingGraph::PathfindingGraph(const math::Vector2<int>& graph_dimensions) :
graph_dimensions_(graph_dimensions), size_(graph_dimensions.y * graph_dimensions.x), node_comparator_(),
runid_()
{
auto size = graph_... | ALGO | 0.9938 | 6.332043 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2015-12-18T01:25: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": "8f48f51e0... |
33cf85b1-50bf-4133-9a11-f47c0c0659f9 | Nandakumar-Kadavannoore/Data-Structure | countDistinctPairs.cpp | / Function for returning
// sum of digits of a number
int digitSum(int n)
{
int sum = 0;
while (n > 0) {
sum += n % 10;
n = n / 10;
}
return sum;
}
// Function to return the total pairs
// of elements with equal sum of digits
int totalPairs(int arr1[], int arr2[], int n, ... | ALGO | 0.999336 | 5.209274 | {
"github_metadata": {
"branch": "master",
"commit_count": 268,
"repo_created_at": "2017-12-25T11:54: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": "3c1e4029... |
0066ef51-12f4-4e41-95bc-541015c99f18 | ductan2/Algorithm | ChuoiDoiXung.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef unsigned long long ull;
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define ep emplace_back
#define EL printf("\n")
#define sz(A) (int)A.size()
#define FOR(i, l, r) for (int i = l; i ... | ALGO | 0.999999 | 3.155005 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-08-25T15:06: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": "a6eb53f99ac3... |
f6de6f70-4c04-4607-925c-bd838c9bd30c | davidbp/my_own_notes | graphs/Versions_antoni/GPrc4-David-2/wgraphTSP_alumnes.cpp | //
// HAMILTONIAN CYCLES AND TSP
// - Robert and Flores method: backtracking
//
#include "wgraph.h"
#include <cmath>
#include <ctime>
#include <conio.h>
weight
TravellingSalesmanProblem( wgraph &G, ofstream &fout )
{
vertex vn = G.size();
index HCi = 0, HCn = 0;
vector<vertex> HCv( vn );
vector<bool... | ALGO | 0.999836 | 3.635247 | {
"github_metadata": {
"branch": "master",
"commit_count": 37,
"repo_created_at": "2017-12-17T17:51: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": "f164f3283... |
af70531a-7da0-4c07-a228-e0a3b7602edf | GoatGirl98/Walkthrough-of-ACCoding-in-BUAA | 2015级-软件学院-算法分析与设计/C1-2015级算法第一次上机/BUAAOJ445 分块 在线查询.cpp | #include <stdio.h>
#include <math.h>
#include <stddef.h>
#include <stdint.h>
#include <vector>
#include <numeric>
#include <algorithm>
typedef unsigned long long u64;
typedef std::size_t usize;
bool eof_flag;
bool rd(int *s)
{
if (eof_flag)
return 0;
int k = 0, f = 1;
char c = getchar();
while (... | ALGO | 0.999917 | 4.967143 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2020-06-21T03:02:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 313,
"forks": 27,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40d2d2... |
e754aba5-5292-43c3-8621-62cb062c9c57 | ddonix/sfjs2 | 11846/11846.cpp | #include <iostream>
#include <cstring>
using namespace std;
const int maxn = 20;
const int maxk = 26;
int n, g;
char maze[maxn][maxn];
char ans[maxn][maxn];
char t[maxn][maxn];
bool dfs(int p, char ch)
{
if (ans[p/n][p%n] != '.')
{
while(++p < n*n && (ans[p/n][p%n] != '.'))
{}
if (p == n*n)
return true;
... | ALGO | 0.999064 | 3.933653 | {
"github_metadata": {
"branch": "master",
"commit_count": 210,
"repo_created_at": "2019-07-01T07:43:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96bc3f21... |
d49d9d79-7fde-43b5-b93a-be5297242e6f | ZhongTerry/ztrztr | gitcode/Luogu_T_200147.cpp | #include <bits/stdc++.h>
using namespace std;
/*
*/
int main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int V, n;
cin >> V >> n;
vector <int> a[1005], b[1005];
set <int> cnt;
int dp[100005];
for (int i = 1; i <= n; i ++) {
int x, y, z;
cin >> x >> y >> z;
... | ALGO | 0.999604 | 4.090644 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2023-08-07T04:52: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": "2d895072d... |
826d2a94-bc1f-4a48-a4ad-3cf5e844e009 | Damok124/Circle05 | CPP/Module09/ex02/PmergeMe.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PmergeMe.cpp :+: :+: :+: ... | ALGO | 0.99747 | 5.406299 | {
"github_metadata": {
"branch": "master",
"commit_count": 63,
"repo_created_at": "2023-05-07T13: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": "dc798429d... |
804cbf2b-d897-4bd0-986d-896c36402b2e | sdawson167/bpg2 | src/BccPhaseProvider.cpp | #include "BccPhaseProvider.h"
#define _USE_MATH_DEFINES
#include <math.h>
FieldProvider BccPhaseProvider::generateInitialCondition(int gridSize) {
// initialize field provider variables:
const int N = gridSize;
int* gridSizes = (int*) malloc(3 * sizeof(int));
gridSizes[0] = N; gridSizes[1] = N; gridSizes[2... | ALGO | 0.924519 | 4.76851 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2021-06-28T13:29: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": "4a4d630de2eb... |
6d521eb0-acee-4e0c-acb2-c8fb33821602 | SeongmoAhn/ProblemSolving | 1197kruskal.cpp | #include <iostream>
#include <tuple>
#include <algorithm>
#include <vector>
using namespace std;
#define PS_INPUT cout.tie(NULL); cin.tie(NULL); ios_base::sync_with_stdio(false)
#define endl '\n'
#define INF 1e9
#define pii pair<int, int>
#define ll long long
#define SIZE 10001
int V, E;
ll ans;
int parent[SIZE];
vect... | ALGO | 0.999887 | 4.916272 | {
"github_metadata": {
"branch": "main",
"commit_count": 437,
"repo_created_at": "2023-05-17T03:04: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": "4439d5ce38... |
5703a268-72f8-4939-85e2-6bf8ff5eb1e5 | bearomorphism/leetcode-solutions | leetcode/1642.cpp | class Solution {
private:
bool check(vector<int>& heights, int bricks, int ladders, int idx) {
vector<int> v;
for (int i = 0; i < idx; i++) {
int tmp = heights[i + 1] - heights[i];
if (tmp > 0) v.push_back(tmp);
}
sort(v.begin(), v.end(), greater<int>());
... | ALGO | 0.999979 | 5.777548 | {
"github_metadata": {
"branch": "main",
"commit_count": 409,
"repo_created_at": "2022-06-01T03:41: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": "d195833588... |
41501bb1-2c32-44cd-85b5-88b0e64c2f0c | PerfectPan/LeetCode | solution/1483/sol1.cpp | class TreeAncestor {
public:
vector<vector<int>> pa;
TreeAncestor(int n, vector<int>& parent) {
int m = 32 - __builtin_clz(n);
pa.resize(n, vector<int>(m, -1));
for (int i = 0; i < n; ++i) {
pa[i][0] = parent[i];
}
for (int i = 0; i < m - 1; ++i) {
... | ALGO | 0.999988 | 6.172674 | {
"github_metadata": {
"branch": "master",
"commit_count": 666,
"repo_created_at": "2020-09-19T13:37: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": "65806357... |
52d751ac-3e11-4d0a-8f2d-1a44cf98bfb0 | Somashekhar7984/Coding- | 40_Sliding_window_challenges.cpp/2.cpp | #include<iostream>
#include<iomanip>
#include<string>
#include<cmath>
#include<climits>
#include<algorithm>
#include<vector>
#include<stack>
using namespace std;
// Smallest Sub array with sum > X
/*
Problem:
For a given array and an integer X,
find the minimum subarray size for which s... | ALGO | 0.999961 | 4.615715 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2022-10-29T12:59: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": "3769e9ac90e... |
87c5e87c-3af1-4e54-b05e-56f2d48115b5 | PalakDwivedi02/Leetcode-Questions- | Day 31/958.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.99896 | 5.714758 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2023-02-19T16:11: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": "1be90f7f1b4... |
731134cd-aea0-4f27-b8a2-2dba6492f0b6 | shushrutsharma/18CSC304J-CD | 3-NFA to DFA/master.cpp | #include <vector>
#include <iostream>
using namespace std;
int main()
{
vector<vector<int>> nfa( 5 , vector<int> (3));
vector<vector<int>> dfa( 10 , vector<int> (3));
for(int i=1;i<5;i++){
for(int j=1;j<=2;j++){
int h;
if (j == 1){
cout << "nfa [" << i <<... | ALGO | 0.998336 | 3.212298 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2021-01-22T04:47:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 92,
"forks": 72,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "08725e7... |
46b9ccae-fc8c-4412-9c5f-1e38d1abefc5 | TaoSama/ICPC-Code-Library | ACM - Multi-University Training/2015-2/F.cpp | //
// Created by TaoSama on 2016-03-17
// Copyright (c) 2016 TaoSama. All rights reserved.
//
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#i... | ALGO | 0.999983 | 4.130085 | {
"github_metadata": {
"branch": "master",
"commit_count": 191,
"repo_created_at": "2016-03-24T05:56:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe76b15f... |
dfd31693-c0dd-42e5-8920-94b25f8af61e | AmineAroua/Competitive-programming-solutions | CodeForces/GNU C++17/1711B | Party/165570266.cpp | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vl vector<long long>
#define vii vector<pair<int,int>>
#define vll vector<pair<long long,long long>>
#define pb push_back
#define ll long long
#define ld long double
#define nl '\n'
#define boost ios::sync_with_stdio(false)
#define mp make_pai... | ALGO | 0.999994 | 3.496326 | {
"github_metadata": {
"branch": "main",
"commit_count": 677,
"repo_created_at": "2022-08-24T09:37: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": "76b484b19f... |
fdaaeece-e1d2-435e-b030-88e738fdda46 | jk-jung/problem-solving | codeforces/Codeforces Round 75x/R751_div1_B.cpp | #include <string.h>
#include <stdio.h>
#include <math.h>
#include <cassert>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <numeric>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
#defi... | ALGO | 0.999966 | 3.029668 | {
"github_metadata": {
"branch": "main",
"commit_count": 1582,
"repo_created_at": "2021-06-24T13:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d152b3623... |
4155739b-ce67-4944-ae39-cb744403fdbb | dev-cs351/study-data-structure | Chapter3_StackAndQueue/Chapter3_StackAndQueue/eg6_QueueBroadSearch.cpp | #include "Location2D.h"
#include <queue>
/*
using namespace std;
const int MAZE_SIZE = 6;
char map[MAZE_SIZE][MAZE_SIZE] = {
{'1', '1', '1', '1', '1', '1'},
{'e', '0', '1', '0', '0', '1'},
{'1', '0', '0', '0', '1', '1'},
{'1', '0', '1', '0', '1', '1'},
{'1', '0', '1', '0', '0', 'x'},
{'1', '1', '1', '1', '1', '1'... | ALGO | 0.999351 | 4.334831 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-01-03T06:13: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": "0bf8e4b3ddc... |
601d482b-b8d7-4a05-8147-e7c9d180a625 | FreeCAD/FreeCAD | src/Mod/CAM/App/Voronoi.h | /***************************************************************************
* Copyright (c) 2020 sliptonic <<EMAIL>> *
* *
* This file is part of the FreeCAD CAx development system. *
* ... | ALGO | 0.977961 | 6.041317 | {
"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"... |
ea6f5a4c-8969-4957-9236-7f0113e17e2a | ugurinal/Competitive-Programming | Misc/Numbers/piDigit.cpp | /*
Find PI to the Nth Digit
Enter a number and have the program generate PI up to that many decimal places. Keep a limit to how far the program will go.
*/
/*
This program uses Bailey–Borwein–Plouffe formula to calculate the PI num.
*/
// Created by ugurinal
#include <iostream>
#include <stdlib.h>
#include <math.... | ALGO | 0.99995 | 4.89927 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2020-09-04T10:54: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": "e0a7e828e... |
4b92b69f-9850-4cc1-a6a3-6e0bab286e27 | leeseunghyuk0228/Algorithms | 백준/Gold/13460. 구슬 탈출 2/구슬 탈출 2.cc | #include <iostream>
using namespace std;
int N, M, cnt = 0, ans = 21e8, coll[] = { 1,0,3,2 };
int ydir[] = { -1,1,0,0 };
int xdir[] = { 0,0,-1,1 };
struct coord {
int y, x, Enter;
};
coord RED, BLUE;
string MAP[10];
// 입력 함수
void input() {
cin >> N >> M;
for (int i = 0; i < N; i++) {
cin >> MAP[... | ALGO | 0.999955 | 3.858847 | {
"github_metadata": {
"branch": "main",
"commit_count": 215,
"repo_created_at": "2023-03-20T23:15:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "61a1d540b6... |
c02f68a9-3207-41d5-82d9-392f2c988d12 | HamzaAsif2002/Data-Structure | linked_list/Circularly Linked List/Singly Circular Linked List/singlyCircularLinkedList.cpp | #include<iostream>
using namespace std;
class node {
public:
int data;
node* next;
node(int value) : data(value), next(NULL) {}
};
class singlyCircularList {
private:
node* head;
public:
singlyCircularList() : head(NULL) {}
void insertAtPosition(int pos, int value) {
node* newnode = n... | ALGO | 0.999919 | 6.297604 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-23T13:12: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": "eaa6be298591... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.