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 |
|---|---|---|---|---|---|---|---|
207713df-3a23-4904-b1c3-27f818fd075a | emilianozamsan/Corrector | Corrector.cpp | /*****************************************************************************************************************
UNIVERSIDAD NACIONAL AUTONOMA DE MEXICO
FACULTAD DE ESTUDIOS SUPERIORES -ARAGON-
Computadoras y programacion.
(c) Ponga su nombre y numero de cuenta aqui.
<NAME> 322080292
Quiso decir: Programa prin... | ALGO | 0.997742 | 3.82813 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2024-11-25T06:19: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": "223e0134a30... |
192c7547-4536-4a79-859c-07d37502931a | FluidityProject/fluidity | libadaptivity/load_balance/src/formHalo2.cpp | /* Copyright (C) 2006 Imperial College London and others.
Please see the AUTHORS file in the main source directory for a full list
of copyright holders.
Dr <NAME>
Applied Modelling and Computation Group
Department of Earth Science and Engineering
Imperial College London
<EMAIL>
This library is free software... | ALGO | 0.954226 | 4.852346 | {
"github_metadata": {
"branch": "main",
"commit_count": 9330,
"repo_created_at": "2014-05-21T14:00:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 375,
"forks": 117,
"issues": 26,
"pull_requests": 17
},
"file_meta": {
"content_id": "17de... |
3f532f49-0690-436a-a21d-94cea7fbe0db | fahimfarhan/coding-creed-origins | Codes/CodeForces/A/1181A.cpp | #include <bits/stdc++.h>
using namespace std;
#define PI 2*acos(0)
typedef int64_t ll;
// #define ll long long int
// other popular ones=> int64_t, uint64_t => use for 10^18
ll MODULO = 1e9+7;
bool myAssert(bool b);
void testDrivenDevelopment();
int start(int argc=0, char const *argv[] = NULL);
// int n,m;s
vector... | ALGO | 0.999896 | 4.058585 | {
"github_metadata": {
"branch": "dev",
"commit_count": 421,
"repo_created_at": "2018-01-30T13:10:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "add67f1bb7f... |
8e1ce064-c907-424a-9c44-c246262da56a | rakibul23n28/c-cpp | c_c++/Data structures and algorithms/circular_linked_list.cpp | // Singly Linked list Operations
/*
1.appendNode()
2.prependNode()
3.insertNodeAfter()
4.deleteNodeByKey()
5.updateNodeByKey()
6.print()
*/
#include<iostream>
class Node {
private:
int key;
int data;
Node* next;
public:
Node() : key(0), data(0), next(NULL) {}
Node(int k, int d) : key(k), data(d),... | ALGO | 0.999794 | 6.096622 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2023-07-27T21:02:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4c27d1c9... |
80c8c695-81ab-491f-9839-d956c899db66 | wuxx100/hihoEx | a1048/main.cpp | #include <iostream>
#include <math.h>
using namespace std;
#define hereNum 1000000007
int getCakePutNum(int,int);
int getState(int state, int i);
int lastPos(int);
int main()
{
int n,m;
cin>>n>>m;
int r=getCakePutNum(n,m);
cout<<r<<endl;
return 0;
}
int getState(int state, int i)
{
return state%((int)pow(2,i+... | ALGO | 0.999998 | 3.442721 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2017-03-16T21:08: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": "7421f7f78... |
9fd0ca49-6c38-466a-8f96-1cdec4429c12 | sqmedeiros/rouxinol | 1643-Maximum_Subarray_Sum/training-01/1956910.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define REP( i, a, b) for(ll i=a; i<=b; i++)
#define fori(i, b) for(ll i=0;i<b;i++)
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define vi vector<ll>
#define endl '\n'
#define cs(ans) cout<<ans<<' '
#define cn(ans) cout<<ans<<'\n'
#d... | ALGO | 0.999935 | 3.795899 | {
"github_metadata": {
"branch": "main",
"commit_count": 238,
"repo_created_at": "2024-01-31T15:39: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": "0eedfa6fcc... |
e74d22af-d5c9-4b0a-bbf2-540d09022d2e | iDXM/CodingInterview2 | 03_01_DuplicationInArray/Solution.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
bool solution(vector<int> nums, int* res) {
int n = nums.size();
if (n <= 0) return false;
for (auto num : nums) {
if (num < 0 || num > n - 1) return false;
}
for (int i = 0; i < n; ++i) {
while (nums[i] != i) {... | ALGO | 0.999982 | 5.386626 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-05-03T09:07: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": "bbafe912d... |
eaa2849b-cdc5-4efa-8e6a-addea52cdd3e | AayushkumarPathak/C-DSA-OOPs | LinkedList/insertAtTailMiddle.cpp | #include <iostream>
using namespace std;
class ListNode
{
public:
int data;
ListNode *next;
ListNode(int data)
{
this->data = data;
this->next = NULL;
}
};
ListNode *head;
void insertAtTail(int data)
{
ListNode *newNode = new ListNode(data);
if (head == NULL)
{
... | ALGO | 0.99991 | 5.547076 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-08T05:41:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e3fe8693e7d... |
2c002ac4-c79d-4418-9810-821e425e9e12 | samuelpmish/mfem_performance_benchmark | mfem/examples/ex18.hpp | // MFEM Example 18 - Serial/Parallel Shared Code
#include "mfem.hpp"
using namespace std;
using namespace mfem;
// Problem definition
extern int problem;
// Maximum characteristic speed (updated by integrators)
extern double max_char_speed;
extern const int num_equation;
extern const double specif... | ALGO | 0.999892 | 5.436633 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-03-19T18:37: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": "d6333c91f80c... |
7994fe04-d6c8-45b2-87de-336cc428ef80 | Amz42/Competitive-Programming-And-DSA | Competitive Programming/Codeforces/Codeforces Round #696 (Div. 2)/A-Puzzle-From-the-Future.cpp | // Question: https://codeforces.com/contest/1474/problem/A
// Solution: https://codeforces.com/contest/1474/submission/104775926
/* _ _ _ ____
/ \ _ __ ___ ____ | || ||___ \
... | ALGO | 0.999845 | 3.994243 | {
"github_metadata": {
"branch": "master",
"commit_count": 320,
"repo_created_at": "2020-12-31T14:42:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab4d9de0... |
a8adf59a-e630-49f0-bd7a-256d633b11ae | raincross7/code-similarity | codes/train_code/problem337/problem337_24.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
#define fi first
#define se second
#define pb push_back
#define soo(v) sort(v.rbegin(),v.rend())
#define so(v) sort(v.begin(),v.end())
#define lb(v,x) lower_bound(v.begin(),v.end(),x)
#define ub(v,x) upper_bound(v.begin(),v.end(),x)
//#define endl ... | ALGO | 0.999808 | 3.641281 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a05fd706dec4... |
494e3561-03cc-4978-9292-3a44319ba88f | ShaulSalomon/CODeM | core/CODeMDistribution.cpp | /****************************************************************************
**
** Copyright (C) 2012-2015 The University of Sheffield (www.sheffield.ac.uk)
**
** This file is part of Liger.
**
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General
** Public Licen... | ALGO | 0.992397 | 5.160239 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-04-04T10:17:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "665af0c229... |
f8f602b7-2d71-40a7-baf0-41b018a36149 | Harveen19/DSA-Questions-Using-CPP-and-JAVA | LEET CODE QUESTIONS/Integer to Roman.cpp | // 12. Integer to Roman
//Medium
//5K
//4.9K
//Companies
//Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
//Symbol Value
//I 1
//V 5
//X 10
//L 50
//C 100
//D 500
//M 1000
//For example, 2 is w... | ALGO | 0.99978 | 5.975237 | {
"github_metadata": {
"branch": "master",
"commit_count": 378,
"repo_created_at": "2022-10-16T13:13:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f59cef37... |
b963868a-49b1-4b9f-8640-c8cb183d7dd6 | mianfg-DGIIM/SCD | Prácticas/Práctica 1/codigos/examen3.cpp | /**
* @brief Exámenes práctica 1 - Ejercicio 3
* @author <NAME> <<EMAIL>>
*
* Sistemas Concurrentes y Distribuidos
* 3º Doble Grado en Ingeniería Informática y Matemáticas, 2019/2020
*/
#include <cassert>
#include <chrono> // duraciones (duration), unidades de tiempo
#include <iostream>
#include <mutex>
#include... | ALGO | 0.973269 | 4.867464 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-09-02T16:39:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "196bf28892d... |
deeb326d-3b45-4129-ae71-3c04d9c6a107 | ishandutta2007/codeforces-x | xiaowuc1/normal/1397/B.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <vector>
using namespace std;
// BEGIN NO SAD
#define rep(i, a, b) for(int... | ALGO | 0.99977 | 4.117122 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "210eec67992c... |
a5b9b8c8-1ccf-47e0-bedf-6bb00471986b | Shourya-Dubey/LOVEBABBAR_DSA_YOUTUBE | lec22_CharArrya/toLowerCase.cpp | #include <iostream>
using namespace std;
int length(char ch[])
{
int count = 0;
for (int i = 0; ch[i] != '\0'; i++)
{
count++;
}
return count;
}
char toLowerCase(char ch)
{
if (ch >= 'a' && ch <= 'z')
{
return ch;
}
else
{
char temp = (ch - 'A') + 'a';
... | ALGO | 0.997732 | 4.235663 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2024-05-26T03:52: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": "9a3dd1b5a... |
39f8729a-16ce-434d-8ff7-7129778d51a7 | aanu2021/Leetcode-Solutions | Count Total Setbits - GFG/count-total-setbits.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
typedef long long ll;
ll findLargestPower(ll n)
{
ll x = 0;
while ((1LL << x) <= n)
x++;
return x - 1;
}
ll countSetBits(ll n)
... | ALGO | 0.999707 | 5.834906 | {
"github_metadata": {
"branch": "main",
"commit_count": 8709,
"repo_created_at": "2022-05-12T19:00:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a82d3580a... |
5780ae7d-4294-459b-834a-9b159cd9dbb2 | ishandutta2007/codeforces-t | tzc_wk/normal/1517/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define fill0(a) memset(a,0,sizeof(a))
#define fill1(a) memset(a,-1,sizeof(a))
#define fillbig(a) memset(a,63,sizeof(a))
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
templa... | ALGO | 0.999894 | 3.621638 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:27: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": "fd165f288eed... |
beb19a2d-2162-407a-985a-d35caf1943ec | itsdharmxd/Unacademy-codechef-personal | prime_sieve.cpp |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(a, b, c) for (ll a = b; a < c; a++)
#define repr(a, b, c) for (ll a = b; a >= c; a--)
#define fst first
#define snd second
#define pb push_back
#define pii pair<ll,ll>
#define vi vector<ll>
#define all(c) ((c).begin()), ((c).end())
#defi... | ALGO | 0.999709 | 4.567532 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-02-02T14:01: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": "08277ac5985f... |
bc46147c-a413-4c13-8c49-7bb57c91235b | Kitware/VTK | Filters/Modeling/vtkFitToHeightMapFilter.cxx | // SPDX-FileCopyrightText: Copyright (c) <NAME>, <NAME>, <NAME>
// SPDX-License-Identifier: BSD-3-Clause
#include "vtkFitToHeightMapFilter.h"
#include "vtkCellData.h"
#include "vtkGenericCell.h"
#include "vtkImageData.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#inclu... | ALGO | 0.974741 | 6.663644 | {
"github_metadata": {
"branch": "master",
"commit_count": 94968,
"repo_created_at": "2010-04-27T15:12:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2910,
"forks": 1246,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3... |
e673c652-0d51-4280-9d03-2df7aee61136 | raincross7/code-similarity | codes/train_code/problem370/problem370_412.cpp | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#includ... | ALGO | 0.999947 | 4.411901 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3ca45d2942e1... |
81752ab2-14d1-4840-800b-21cc83f6e3a0 | ibudiselic/contest-problem-solutions | tc 160+/Orienteering.cpp | #include <algorithm>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
#inclu... | ALGO | 0.999612 | 3.960625 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2011-08-14T11:43:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c5290da0... |
840ffcda-8622-46c0-a1fd-6c205b480611 | nonaninona/learning-sharing | 러닝앤쉐어링 활동자료/소스코드(이름_문제번호)/9주차/미로찾기_최원민.cpp | #include <iostream>
#define M 5
#define N 10
#define SIZE (M)*(N)+2
using namespace std;
char map[M][N];
class Point {
public: //좌표들
int xpos;
int ypos;
void Init() //초기화
{
this->xpos = 0;
this->ypos = 0;
}
};
class Stack {
private:
Point sPos;
int arr[SIZE][2]; //스택 배열 x,y값 저... | ALGO | 0.999884 | 3.347205 | {
"github_metadata": {
"branch": "master",
"commit_count": 55,
"repo_created_at": "2020-04-18T13:48:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb4d2250e... |
2afe8726-fa01-4066-a49b-0885ffacf35e | fcnoronha/competitive-programming | Codforces/catParty(easy).cpp | //codeforces.com/contest/1163/problem/B1
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define fr(i, n) for(int i = 0; i < n; i++)
#define frr(i, n) for(int i = 1; i <= n; i++)
#define dbg(x) cout << #x << " = " << x << endl
#define all(x) x.begin(),x.end()
#define ms(x, i) memset(x, i, sizeof(x... | ALGO | 0.99997 | 3.616418 | {
"github_metadata": {
"branch": "master",
"commit_count": 289,
"repo_created_at": "2018-07-05T22:15: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": "071f926a... |
e8aadf5e-4607-4c56-8ff7-eacc7cd18461 | ArdxWe/leetcode | medium/889-Construct-Binary-Tree-from-Preorder-and-Postorder-Traversal.cpp | /*
* Given two integer arrays, preorder and postorder where preorder is the
* preorder traversal of a binary tree of distinct values and postorder is the
* postorder traversal of the same tree, reconstruct and return the binary tree.
* If there exist multiple answers, you can return any of them.
*/
#include <algo... | ALGO | 0.999966 | 6.265117 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2021-08-21T06:25:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e99c98f0... |
c8876e89-a234-48ae-a761-12df56de317d | IBM/hartigan-kmeans | src/hkmeans/c_package/hkmeans_optimizer.h | /*
*
* Copyright 2021- IBM Inc. All rights reserved
* SPDX-License-Identifier: Apache2.0
*
*/
#ifndef HKMEANS_OPTIMIZER_H
#define HKMEANS_OPTIMIZER_H
#include <stdint.h>
class HKMeansOptimizer {
public:
HKMeansOptimizer(int32_t n_clusters, int32_t n_features);
virtual ~HKMeansOptimizer();
... | ALGO | 0.96302 | 6.860442 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2021-12-25T19:15:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "838309d83c... |
df18fe00-1143-4856-a9c7-dad6343a1435 | zinsmatt/Programming | LeetCode/easy/Add_Binary.cxx | class Solution {
public:
string addBinary(string a, string b) {
int r = 0;
int i = a.size() - 1;
int j = b.size() - 1;
std::stringstream ss;
for (int k = 0; k < std::max(a.size(), b.size()); ++k)
{
int aa = 0, bb = 0;
if (i >= 0)
... | ALGO | 0.999953 | 6.229031 | {
"github_metadata": {
"branch": "master",
"commit_count": 1349,
"repo_created_at": "2019-05-27T18:51: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": "89e1523... |
12ce6958-1e2f-4feb-ae7b-a18b10197ce0 | marioyc/Online-Judge-Solutions | TJU/2085 - Candy Sharing Game.cpp | #include <cstdio>
#include <cstring>
using namespace std;
int check(int n, int *a){
int mn = a[0],mx = a[0];
for(int i = 1;i<n;++i){
if(a[i]<mn) mn = a[i];
if(a[i]>mx) mx = a[i];
}
if(mn!=mx) return -1;
return mn;
}
int main(){
int n,a[1000],b[1000];
while(t... | ALGO | 0.99996 | 3.104517 | {
"github_metadata": {
"branch": "master",
"commit_count": 364,
"repo_created_at": "2010-09-24T16:07:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 603,
"forks": 359,
"issues": 1,
"pull_requests": 9
},
"file_meta": {
"content_id": "2ca2... |
6be03b0a-8419-4cea-ba4b-3688ee0aae12 | LARG/HFO | src/bhv_set_play_indirect_free_kick.cpp | // -*-c++-*-
/*
*Copyright:
Copyright (C) <NAME>
This code 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, or (at your option)
any later version.
This code is distributed in the hope t... | ALGO | 0.94543 | 6.019891 | {
"github_metadata": {
"branch": "master",
"commit_count": 542,
"repo_created_at": "2015-02-17T19:35:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 233,
"forks": 94,
"issues": 40,
"pull_requests": 0
},
"file_meta": {
"content_id": "896a0... |
f90692ec-fcb3-4904-a458-518656363e68 | ewfuentes/robot | domain/kuhn_poker.cc |
#include "domain/kuhn_poker.hh"
#include <algorithm>
#include <random>
#include <sstream>
namespace robot::domain {
namespace {
bool is_showdown(const std::vector<KuhnAction> &actions) {
if (actions.size() == 2 && actions.at(0) == actions.at(1)) {
// Both players passed or bet
return true;
} ... | ALGO | 0.998475 | 5.912163 | {
"github_metadata": {
"branch": "main",
"commit_count": 431,
"repo_created_at": "2022-08-10T19:18:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 0,
"issues": 0,
"pull_requests": 6
},
"file_meta": {
"content_id": "5e75c21081... |
f8c649ac-b3e1-47c4-8765-ee2f4b51cb81 | zeroli/code | MyLinkedQueue.cc | template <T>
class LinkedQueue {
public:
LinkedQueue() {
front = rear = 0;
}
~LinkedQueue();
bool IsEmpty() const {
return ((front)? false : true);
}
bool IsFull() const;
T First() const;
T Last() const;
LinkedQueue<T>& Add(const T& x);
LinkedQueue<T>& Delete(T& x);
private:
Node<T>* front;
Node<T... | TOOL | 0.901728 | 5.170364 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2012-06-01T09:41:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b7c3feec22... |
d317d143-d9a1-46b4-adcc-33acd381e94f | kaldi-asr/kaldi | src/latbin/lattice-add-nnlmscore.cc | // latbin/lattice-add-nnlmscore.cc
// Copyright 2009-2011 Microsoft Corporation
// 2014 Johns Hopkins University (author: <NAME>)
// 2021 Johns Hopkins University (author: <NAME>)
//
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache Licen... | TEST | 0.926219 | 6.109626 | {
"github_metadata": {
"branch": "master",
"commit_count": 9405,
"repo_created_at": "2015-04-20T17:23:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 14986,
"forks": 5368,
"issues": 189,
"pull_requests": 63
},
"file_meta": {
"content_id":... |
46062509-f01c-42e0-a733-5b064372187d | szhu7927/portfolio-diversifier | source/diversify.cpp | #include "diversify.h"
void areatest() {
std::vector<std::pair<double, double> > vec;
vec.push_back(std::make_pair(0, 0));
vec.push_back(std::make_pair(0, .5));
vec.push_back(std::make_pair(1, 1));
vec.push_back(std::make_pair(1, 0));
std::cout << "Area 1: " << area(vec) << " (Should be 0.75) ... | ALGO | 0.997646 | 5.278187 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2020-11-25T21:33:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1752e0d9a31... |
793c8692-028a-4cc1-8d6e-3e1ff2b8a4c8 | ishandutta2007/codeforces-a | amshz/normal/154/A.cpp | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author <NAME>
*/
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long int ll;
... | ALGO | 0.999855 | 3.998589 | {
"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": "1229f6f20b07... |
7be65545-57d7-4382-a1cb-d0c2adc50c22 | bruceSz/understanding_dl_framework | simpleNN/network.cc | #include "net.h"
namespace simpleNN
{
void Network::initNet(std::vector<int> layer_neuron_num_)
{
// init each layer size.
layer_neuron_num = layer_neuron_num_;
layer.resize(layer_neuron_num.size());
for(int i=0; i<layer.size(); i++) {
layer[i].create(layer_neuron_num[i], 1, CV_32FC1);
... | ALGO | 0.956757 | 3.940973 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-05-17T08:46: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": "99a963034c... |
55f00444-042a-4197-bc8f-a45359869a60 | Subio-yng/my-projects | acmp/task-1412/code.cpp | #include <stdio.h>
#include <vector>
#include <algorithm>
// Time complexity: O(nV^3)
// Space complexity: O(nV^2)
struct Cell {
int val;
int id;
};
int dfs(int curV, std::vector<bool> &visited, const std::vector<std::vector<bool>> &edges) {
visited[curV] = true;
int count = 0;
for (i... | ALGO | 0.999977 | 5.248704 | {
"github_metadata": {
"branch": "master",
"commit_count": 1354,
"repo_created_at": "2021-06-05T16:59:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 4
},
"file_meta": {
"content_id": "d50a0e0... |
6fd757b6-e52b-49f8-9e47-42be9a11f840 | SweetestRat/Algorithms-and-Data-Structures | 9 lab/F_game.cpp | #include <iostream>
#include <fstream>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;
class Way
{
public:
int vertex;
int distance;
Way() {}
Way(int _vertex, int _distance) : vertex(_vertex), distance(_distance) {}
};
bool compare(Way& l, Way& r)
{
if (l.distance < ... | ALGO | 0.999968 | 3.926159 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2020-02-16T10:27:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f9114c6a... |
66093297-169d-47cc-8e4a-993ddd830a92 | julanu/uni-labs-compsci-2 | lab9_pb1/lab9_pb1/lab9_pb1_JulaMarius.cpp | /*
Author: <NAME>
Date: 3/5/18
Description: Starting with the 4-th example, verify/resolve the following tasks:
a. reading/writing a matrix with dimensions from KB;
b. test all the overloaded operators;
c. display the elements located on both diagonals
*/
//4. Implementarea clasei Matrix pt. efectuarea unor operatii c... | ALGO | 0.934127 | 4.567369 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2018-02-26T15:02:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d27014aa... |
896477d3-24e1-4415-bb71-84fb0e1ecb9d | Ganadalam/codetree-TILs | 240914/배열의 특정 위치 찾기 3/find-specific-location-fo-array-3.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> numbers;
int num;
// 정수를 입력받아 벡터에 저장
while (cin >> num) {
numbers.push_back(num);
// 입력이 0이면 종료
if (num == 0) {
break;
}
}
// 0의 위치 찾기
int zeroIndex = -1;
... | ALGO | 0.999881 | 5.539936 | {
"github_metadata": {
"branch": "main",
"commit_count": 109,
"repo_created_at": "2024-08-01T15:50: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": "bfd3cf624b... |
6127da55-b6e7-492c-b5b2-8cc3c0c9424d | tansontww/IoT_Mini_Smart_Greenhouse_System | IoT_Smart_Agriculture.ino | #define BLYNK_TEMPLATE_ID "TMPL5QnD7wJfZ"
#define BLYNK_TEMPLATE_NAME "IoT Mini Smart Greenhouse System"
#define BLYNK_AUTH_TOKEN "<KEY>"
#define BLYNK_PRINT Serial
// Global variables that needs to be replaced with your values!
char ssid[] = "SOTON-IoT"... | TOOL | 0.914961 | 4.727316 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-02T17:00:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb95eaba5d56... |
9599ebb2-c314-450b-b698-83d458d86aaf | Neon17/DSAPrograms | sumSubsetProblem.cpp | #include<bits/stdc++.h>
using namespace std;
//sum of subset problem solved via backtracking
//but any integer it works but don't put -500 in array
//because -500 is used to break one subset from another in vector in this program
void display(int arr[], int length);
void printSubset(int arr[], int length, int targetS... | ALGO | 0.999757 | 4.725908 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2024-01-12T03:03:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6570cb7aa... |
8e91e714-8d5f-42e9-ba9d-545cb0ca1865 | bayesianlab/CodeProjects | CProjects/hackerrank/linkedlist/nthfromend.cpp | #include <stdio.h>
#include <stdlib.h>
struct Node
{
int data;
struct Node *next;
} * start;
int getNthFromLast(struct Node *head, int n)
{
int c = 0;
struct Node *nth = head;
struct Node *otherhead = head;
while (head != NULL)
{
++c;
if (c > n)
{
nth =... | ALGO | 0.999438 | 3.700865 | {
"github_metadata": {
"branch": "master",
"commit_count": 1253,
"repo_created_at": "2017-01-02T02:52:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cecc3d3... |
0f3bf92b-0b64-4c10-871b-18ced35ed800 | mehulbakhshi02/HDG_ML_Git | HDG/Assembly/solvelocalsystem.h | template <int D, int COMP, class Model>
void UnifyingFramework<D, COMP, Model>
::SolveLocalSystem(const int i, vector<double> & vecQ, vector<double> & vecW, Residual & res) {
ElementData<D, COMP> & ed = *eldata[i];
int ndof_q = ed.ndof_q;
int ndof_w = ed.ndof_w;
int ndof_lt = ed.ndof_lt; // Contains the a... | ALGO | 0.999967 | 4.941454 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2024-11-01T12:56: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": "cb3df1d42dc... |
0480a714-d58d-4763-81f4-090899d59160 | HaoXuAI/CS244b_final_project | libbyz/Node.cc | #include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include "crypt.h"
#include "rabin.h"
#include "th_assert.h"
#include "parameters.h"
#include "Messag... | TOOL | 0.921699 | 3.704269 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2017-11-04T18:12:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d380062f... |
45e04049-97e0-4e38-ab81-f59aa59dbb0b | Dan-Tel/leetcode | Easy/1207. Unique Number of Occurrences/1207. Unique Number of Occurrences.cpp | /*
Given an array of integers arr, return true if the number of occurrences of each value in the array is unique or false otherwise.
*/
#include <bits/stdc++.h>
using namespace std;
bool uniqueOccurrences(vector<int>& arr) {
map<int, int> occurrences;
map<int, int> unique_occurrences;
for (auto n : arr) ... | ALGO | 0.999447 | 6.322467 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2024-05-22T10:36:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6d1a494d213... |
803373aa-33a0-41ff-8b3b-a4682775fec5 | keithyin/draft_gen | poa_cpp_code/src/Integrator.cpp | // Author: <NAME>
#include <cassert>
#include <cmath>
#include <exception>
#include <limits>
#include <numeric>
#include <utility>
#include <pacbio/consensus/AbstractMatrix.h>
#include <pacbio/consensus/Integrator.h>
#include <pacbio/data/Sequence.h>
#include <pacbio/exception/InvalidEvaluatorException.h>
#include "... | ALGO | 0.940426 | 6.76382 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-07T13:52: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": "a6a0494af739... |
d59211d6-dacc-4d0e-b306-f5122310dfb5 | Simranjakhodia/DSA | Trie/ImplementTrie.cpp | // https://leetcode.com/problems/implement-trie-prefix-tree/
class Trie {
struct TrieNode {
TrieNode *child[26];
int word_cnt;
int prefix_cnt;
TrieNode(){
memset(child, 0, sizeof(child));
word_cnt = 0;
prefix_cnt = 0;
}
};
TrieNod... | ALGO | 0.999245 | 5.931304 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2021-06-28T18:07:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5e074d81cbf... |
b9a6a015-fa7d-4ce3-b8b7-a86bbe22ef08 | sadeeabdullah/Practice-at-home | Practice Sheet 2(loop) Problems in CodeForces/X_Convert_To_Decimal_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
for (int i = 1; i <= t; i++)
{
int n;
cin >> n;
char binary[32]; // enough for 32 bits integers
//initializing index here so that we can increase and keep value into it
int idx = 0;
... | ALGO | 0.999934 | 4.591426 | {
"github_metadata": {
"branch": "main",
"commit_count": 80,
"repo_created_at": "2025-05-28T23:13: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": "2c203619108... |
ffd5215b-0e39-4c99-8b9c-936dd68956e3 | changelonger/lanqiao | c++/分巧克力/分巧克力/源.cpp | #include <iostream>
using namespace std;
#include<vector>
#include<algorithm>
void lmax(int arr[2])
{
int temp;
if (arr[0] < arr[1])
{
temp = arr[0];
arr[0] = arr[1];
arr[1] = temp;
}
}
bool com(int arr1[2], int arr2[2])
{
return arr1[0] < arr2[0];
}
int main()
{
// 请在此输... | ALGO | 0.999974 | 3.712823 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-03-01T12:56: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": "7b8a9d2fb23... |
47b096bd-345e-41a9-9dac-8408120718b4 | kkj-100-010-110/sorting | sorting/bubble.hpp | /**
* @file bubble.hpp
* @author <NAME> (https://github.com/kkj-100-010-110)
* @brief bubble sort
*/
/*
* 1. find the largest number in an array [0..n] and move to the last
* 2. find the largest number in an array [0..n-1] and move to the last
* 3. ...
*/
#pragma once
#include <array>
#include <vector>
#includ... | ALGO | 0.99733 | 5.966232 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-11-07T15:21: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": "b6613be26412... |
6d144c4c-dd66-4dc9-b082-b951f9f53f93 | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1244/all/28899058_62500296.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
///assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
typedef long long int ll;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
typedef vector<char> VEC1D;
... | ALGO | 0.999969 | 3.672697 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40: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": "595f05c1a... |
f9175c23-a61c-4cdf-b301-3c9207fd9ec4 | NASA-AMMOS/VICAR | vos/mars/src/sub/pig/PigSurfacePlane.cc | ////////////////////////////////////////////////////////////////////////
// PigSurfacePlane
//
// Surface model for a flat, tilted plane going through the origin.
// The constructor takes the Normal to this plane.
////////////////////////////////////////////////////////////////////////
#include "PigSurfacePlane.h"
#i... | TOOL | 0.909865 | 6.658758 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2020-10-15T23:32:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 52,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b243172... |
aab1a66b-c7d0-4dd0-9252-8b79c66d2e19 | VitalyProlomov/B-Contest12 | main.cpp | #include <iostream>
#include <algorithm>
#include <vector>
double findLeastPossibleSum(int numbers_amount) {
auto *all_numbers = new std::vector<int>();
if (numbers_amount == 1) {
std::cin >> numbers_amount;
return 0;
}
int input = 0;
for (int i = 0; i < numbers_amount; ++i) {
... | ALGO | 0.99983 | 4.672379 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-12-16T17:17: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": "6d1033bc6e... |
4038e684-1315-4bc6-bc65-b4af53666894 | dani-tro/DAA_practicum_23_24 | Exam-3-prep/sequences.cpp | # include <bits/stdc++.h>
using namespace std;
long long p, n, s;
long long counter = 0;
void bruteforce(long long num, long long sum){
if (num == n){
if (sum < s) counter ++;
return ;
}
for (long long i = 0; i < p; i++){
if (sum + i < s)
bruteforce(num+1, sum + i);
}... | ALGO | 0.999827 | 3.998803 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2024-02-16T11:05:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d218eecec3... |
8522b3f1-3861-4998-8a84-12754f8dd5df | mrinal-mann/GeeksforGeeksproblems | Difficulty: Medium/Largest subarray with 0 sum/largest-subarray-with-0-sum.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
/*You are required to complete this function*/
class Solution {
public:
int maxLen(vector<int>& arr, int n) {
map<long long,int> mpp;
long long sum=0;
int maxL=0;
... | ALGO | 0.999548 | 5.763495 | {
"github_metadata": {
"branch": "main",
"commit_count": 97,
"repo_created_at": "2024-08-12T14:41:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc3ed4b7ef5... |
e6610f68-3d45-4329-abd8-d1afbb9d3c9a | AbhiArya20/practice-language-or-technology | c++/dsa/147coinExchangeDP.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 3;
int dp[N][N];
//tabulation
void coinExchange(int n, vector<int> &arr, int x)
{
vector<vector<int>> dp1(n + 1, vector<int>(x+1, 0));
dp1[0][0] = 1;
for (int i = 1; i < n + 1; i++)
{
for (int j = 0; j < x + 1; j++)
{
... | ALGO | 0.999974 | 4.688034 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2025-03-16T16:46: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": "7dcdd7349903... |
211960f6-7157-4443-8bf5-45fb0c33166d | RoyKashob/Lightoj | 1059 - Air Ports.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
struct Edge
{
ll w , v, u;
} e;
ll parent[200000];
vector< Edge > vt;
ll n , m , A;
bool operator < ( Edge a , Edge b)
{
return a.w<b.w;
}
ll find_parent( ll x)
{
if(parent[x] == x)
return parent[x];
return parent[x] = find_... | ALGO | 0.999845 | 3.509742 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2017-03-27T19:04:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e88c6468... |
928290b6-7d57-4e77-9697-0d80bd0bb4a8 | Itsme-Parth/Data-Structures-and-Algorithms | SearchingAndSorting/Binary Search Questions/firstAndLastOccurence2.cpp | /*implemented with binary search */
#include <bits/stdc++.h>
using namespace std;
int firstBinSearch(int arr[], int n, int num)
{
int start = 0, end = n - 1, res = -1;
while (start <= end)
{
int mid = start + (end - start) / 2;
if (arr[mid] == num)
{
res = mid;
... | ALGO | 0.999966 | 4.932275 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2020-10-19T18:22: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": "f706cd30... |
7ee07e6f-d36e-4bcc-a93c-85a352b36c9a | ishandutta2007/codeforces-f | freak93/normal/1220/D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
using namespace std;
int main() {
ios::sync_with_stdio(false);
int N; cin >> N;
vector<int64_t> V(N);
for (int i = 0; i < N; ++i)
cin >> V[i];
vector<int64_t> answer = V;
vector<int64_t> aux;
int64_t ... | ALGO | 0.999972 | 3.769275 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "a0eea1a02c92... |
ba6146de-b317-48d5-941e-d4a79edfcb35 | syuriKR/AtCoder | ABC/201-250/248/b.cpp | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& ... | ALGO | 0.999962 | 3.402777 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-11-13T13:35: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": "f698d303e... |
ea2acc1e-9605-4c17-8b1e-8664f087f42e | DavideGargiulo/Laboratorio-Algoritmi-E-Strutture-Dati | exercise2/container/linear.cpp | #include <algorithm>
namespace lasd {
template <typename Data> bool
LinearContainer<Data>::operator==(const LinearContainer<Data>& container) const noexcept {
if (size != container.size) {
return false;
}
for (unsigned long i = 0; i < size; ++i) {
if ((*this)[i] != container[i]) { //... | TOOL | 0.941648 | 6.145245 | {
"github_metadata": {
"branch": "main",
"commit_count": 47,
"repo_created_at": "2024-03-26T10:10:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "96d66082e57... |
4ee33b48-3126-459b-8df2-aae6b45b5fdb | raincross7/code-similarity | codes/train_code/problem189/problem189_102.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#defin... | ALGO | 0.999984 | 4.606063 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-03-06T05:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32512927bfda... |
598bbdff-aa6b-444a-a24b-99258946c299 | SongMinQQ/BaekJoon-legacy | 그래프 탐색/5567.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> v[502];
bool visited[502];
int n, m, a, b, cnt = 0;
void bfs(int start) {
queue<pair<int, int>> q;
visited[start] = true;
q.push({start, 0});
while (!q.empty()) {
int s = q.front().first;
int depth = q.front().second;
q... | ALGO | 0.999828 | 3.650613 | {
"github_metadata": {
"branch": "master",
"commit_count": 68,
"repo_created_at": "2023-08-12T05:37: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": "5efdf8938... |
e0472fc6-b984-4a87-a9c5-ab6649399e8d | kartikkk12/EliteCode | BitMask/526_BeautifulArrangements.cpp | /*
Link : https://leetcode.com/problems/beautiful-arrangement/description/
*/
class Solution {
public:
int countArrangement(int n) {
//bitmask se aise hoga
//assume ki u have a mask with all bits set to 0 first which refers the whole array
// if we want to choose one bit first we set that b... | ALGO | 0.999997 | 5.7905 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2023-04-14T10:05:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6125fe4fc8... |
b612cdba-cb0b-4b1b-883d-13e69ae94add | ahenches/puissance4 | src/algo_ia/learning.cpp | #include "boardGame.hpp"
#include "graphAI.hpp"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
int lnPlayer1Wins = 0, lnPlayer2Wins = 0, lnStaleMate = 0;
/*/////////////////////////////////////////////////////////////////////////////
Fonction doG... | ALGO | 0.992499 | 3.446361 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2023-03-30T13:42: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": "ac929b0c8... |
12e1c90e-37ee-4c93-9e12-8acfeb9468c7 | Mackenzie-98/Solutions | AtCoder/ABC/177/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#defin... | ALGO | 0.999582 | 4.330301 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-08-24T01:41: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": "d5f51c814aeb... |
d5a978bd-a06c-4bf4-87f7-9a7560fb7468 | l-jhon/C-Plus-Plus | Huffman/Huffman/Huffman.h | #pragma once
#include <iostream>
#include <fstream>
#include <string>
#include "Smbolo.h"
#include <vector>
#include <algorithm>
using namespace std;
class Huffman
{
public:
vector<Simbolo> *lista;
void adicionarLista(Simbolo*);
vector<Simbolo> ordenarLista(vector<Simbolo>*);
void AlgoHuffman(vector<Simbolo>*);
... | ALGO | 0.997949 | 3.847044 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2018-01-26T20:03: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": "bf754f4228... |
484f3730-6d48-4db5-bd35-fe85da8af16f | wcysai/CodeLibrary | Atcoder/Contests/CADDi 2018/F.cpp | /*************************************************************************
> File Name: F.cpp
> Author: Roundgod
> Mail: <EMAIL>
> Created Time: 2018-12-23 12:23:22
************************************************************************/
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#define MAXN 1... | ALGO | 0.99994 | 4.191333 | {
"github_metadata": {
"branch": "master",
"commit_count": 1109,
"repo_created_at": "2018-05-21T06:39:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a79ea41... |
f997080d-85fe-4e18-816a-84a8e1f2084a | HamiltonCollegeCS/cs102-fall2021 | lectures/lecture13/fibonacci.cpp | /**
* Iterative vs. recursive Fibonacci number computation
* @file fibonacci.cpp
* @author <NAME>
* @collaborators CS 102, Fall 2021
* @date October 7, 2021
*/
#include <iostream>
/**
* Recursively compute the Fibonacci number
* NOTE: This is SLOW.
* @param input the input integer from which to compute
* @re... | ALGO | 0.999812 | 6.448889 | {
"github_metadata": {
"branch": "master",
"commit_count": 61,
"repo_created_at": "2021-08-26T19:59: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": "2ceaaad67a... |
3fa27e16-0f81-4c82-a4ca-214f48f6d97b | ZeHongHe/data-structure | Sort/heap_sort.cpp | #include <iostream>
void swap(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
void build_max_heap(int *arr, int len)
{
for (int i = len / 2; i > 0; i--)
{
adjust_root(arr, i, len);
}
}
void adjust_root(int *arr, int root, int len)
{
arr[0] = arr[root];
for (int i = 2 * root... | ALGO | 0.999724 | 4.491725 | {
"github_metadata": {
"branch": "main",
"commit_count": 160,
"repo_created_at": "2022-02-17T06:28:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30ae7f7bae... |
32336087-557b-405b-8f1a-a560b18df26a | Shark-ML/Remora | include/remora/kernels/vector_max.hpp | /*!
*
*
* \brief Kernel for calculating the maximum element of a vector
*
* \author <NAME>
* \date 2016
*
*
* \par Copyright 1995-2015 Shark Development Team
*
* <BR><HR>
* This file is part of Shark.
* <http://image.diku.dk/shark/>
*
* Shark is free software: you can redistribute it... | ALGO | 0.955688 | 6.352879 | {
"github_metadata": {
"branch": "master",
"commit_count": 378,
"repo_created_at": "2017-01-05T07:25:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15,
"forks": 0,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "6892c4c3... |
b2a23d48-646b-4ced-8890-3500e2ebcfec | prerna1124/uber-frequent-52-leetcode-premium | Cpp/MinWindowSubstring.cpp | #include <iostream>
#include <string>
#include <unordered_map>
#include <climits>
using namespace std;
class MinWindowSubstring {
public:
static string minWindow(string s, string t) {
unordered_map<char, int> tFreq;
for (char ch : t) {
tFreq[ch]++;
}
int start = 0, mat... | ALGO | 0.999978 | 7.133148 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2023-04-20T10:44: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": "154b55579a91... |
8c0fbb9d-75d0-46c9-92de-02e7a8fe7173 | cmv5885/cmv5885.github.io | game.cpp | /*************************************************/
/*** Title: Tic Tac Toe Game ***/
/*** Developer <NAME> ***/
/*** Description: Creates Tic Tac Toe Game ***/
/*************************************************/
#include <iostream>
#include <iomanip>
#include <cmath>
#include <ct... | ALGO | 0.995787 | 4.181158 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2017-12-09T07: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": "02dee87db... |
57fdd1dd-cef7-418b-857e-eba762a9a68b | PrinceCuet77/Codeforces | C++/B/1353B Two Arrays And Swaps.cpp | /*************************************************
* Author : <NAME> *
* Institution : CUET *
*************************************************/
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n, k;
cin >> n >> k;
int a[n], b[n];
... | ALGO | 0.99996 | 3.733078 | {
"github_metadata": {
"branch": "master",
"commit_count": 247,
"repo_created_at": "2019-08-03T14:38:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "776e95d7... |
9c2093c1-37fe-4b23-8822-889b67127bc2 | Epefaniov/Chap-7-Rock-Paper-Scissors-GameVincent-Epefanio | main.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
const int NUM_GAMES = 5;
void playGame(int& playerScore, int& computerScore);
int getComputerChoice();
void displayChoice(int choice);
void displayMenu();
string getWinner(int playerChoice, int computerChoice);
int main() {
srand(sta... | ALGO | 0.999928 | 6.032232 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-12-13T14:20: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": "252eb4b90383... |
52fcb3d9-bb6b-4e9a-96a8-c1400714cfe2 | 0x9576/PS | psps/p60059.cpp | #include <string>
#include <vector>
using namespace std;
vector<vector<int>> rot(vector<vector<int>>& key) {
vector<vector<int>> newkey;
vector<int>nv;
for (int i = 0; i < key.size(); i++) {
for (int j = key.size() - 1; j >= 0; j--)
nv.push_back(key[j][i]);
newkey.push_back(nv);
nv.clear();
}
return new... | ALGO | 0.999947 | 5.54179 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2021-02-09T10:13: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": "3603fc015d... |
e141bdef-8a79-41f7-9e80-9629a93f6c31 | jeremiahs1079/CPP | Object Oriented Programming/Lab_6/lab6.cpp | // CS 271 - lab assignment #6
// Lab6.cpp
// implmentation for lab6
// <NAME>
// 3/2/2015
#include <iostream>
#include <iomanip>
using namespace std;
// write the prototype for a function called swap that accepts two
// integer pointers as parameters. The function will swap the contents
// of the two addresses. The ... | ALGO | 0.978249 | 4.377449 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-04-26T19:30: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": "3893002013... |
62ba4eed-f7ab-4c50-93e9-0bc1921805c9 | ZeevSuprun/Autonomous_Connect4_Robot | line_followerOld/line_followerOld.ino | /******************************************************************
*******************************************************************
Function declarations
*******************************************************************
*******************************************************************/
//T... | ALGO | 0.990337 | 3.912064 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2015-04-04T14:04:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "558e80267... |
8f5850de-ca50-4b62-b715-0f6ab104bda6 | kenrick95/code-archive | 2015-05-10/uva11909.cpp | #include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
//#include <bits/stdc++.h>
#define INF 1000000007
#define PI 3.14159265358
#define INFLL 9223372036854775807LL
typedef long long int64;
typedef unsigned long long qword;
using namespace s... | ALGO | 0.997297 | 3.384529 | {
"github_metadata": {
"branch": "master",
"commit_count": 30,
"repo_created_at": "2016-09-27T02:55: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": "c6a26ab80... |
5cdcd4e3-a015-46fd-9a7e-3a50b72acf9e | VarickQ/ACM | TrainData/常用模板/计算几何学/geometry.h | /* 计算几何学 */
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
const double INF = 1e10; // 无穷大
const double PI = 3.1415926535897932384626433832795;
const double EPS = 1e-9; // 计算精度
const int LEFT = 0; // 点在直线左边
const int RIGHT =... | ALGO | 0.999402 | 3.484479 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2013-03-01T12:13:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "304e0d9901... |
113cba29-86bb-4bba-8e32-2c2815a21e4c | vigente/gerardus | cpp/src/third-party/scipoptsuite-3.0.2/scip-3.0.2/src/cppad/local/for_two.hpp | /* $Id: for_two.hpp 1598 2009-12-03 02:59:52Z bradbell $ */
# ifndef CPPAD_FOR_TWO_INCLUDED
# define CPPAD_FOR_TWO_INCLUDED
/* --------------------------------------------------------------------------
CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-09 <NAME>
CppAD is distributed under multiple licenses. T... | ALGO | 0.990504 | 6.909299 | {
"github_metadata": {
"branch": "master",
"commit_count": 3429,
"repo_created_at": "2015-04-07T14:27:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 223,
"forks": 74,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "47781... |
7712eb38-2604-45df-856a-b4c3abc6801c | Hjyheart/Project-for-dataStruct | Project4_N皇后问题/Project4_N皇后问题/Project4_N皇后问题.cpp | /*名称:N皇后问题
*概要:编写一个程序输出N皇后的阵列
*作者:洪嘉勇
*日期:2015.10.10
*/
#include <iostream>
#include <string>
#define INFORMATION "现有N * N 的棋盘,放入N个皇后,要求所有皇后不在同一行,列和同一斜线上!"
#define INPUT "请输入皇后的个数(输入“0”退出程序):"
using namespace std;
/*----全局变量----*/
static int N; //皇后数量
static int solutionCount = 0; //解决方案计数器
static... | ALGO | 0.999245 | 3.96666 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2016-01-25T11:22:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c95676870a... |
6649976d-6873-4c34-a9e9-01f2ecafa2c3 | cowtony/ACM | LeetCode/0001-0099/0019. Remove Nth Node From End of List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n) {
ListNode* dummy_head = new ListNode;
dummy_head->next = head;
... | ALGO | 0.999982 | 5.651144 | {
"github_metadata": {
"branch": "master",
"commit_count": 1420,
"repo_created_at": "2020-03-07T18:10:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3051863... |
69685d4f-aac4-41ad-9b0c-5c80e12ba860 | IsaacAsante/HackerRank | C++/Attribute Parser/attribute parser.cpp | /* Author: <NAME>
* HackerRank URL for this exercise: https://www.hackerrank.com/challenges/attribute-parser/problem
* Original video explanation: https://www.youtube.com/watch?v=w8gEr1VEvbc
* Last verified on: April 17, 2021
*/
/* IMPORTANT:
* This is the full code for the solution.
* Some headers were added... | ALGO | 0.979784 | 4.442074 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2021-02-16T14:57:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 193,
"forks": 44,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "99a082b8... |
4d3dc0a7-1c2c-46a6-870e-7ac1f077c8f8 | lanl/EGG | egg/gpmmcmc/serial/LAmodel.h | /*
* LAmodel.h
* gpmsa
*
* Created by gatt on 4/2/08.
* Copyright 2008 LANL. All rights reserved.
*
*/
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <gsl/gsl_sf_bessel.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_blas.h>
#include ... | DATA | 0.965024 | 4.965119 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-04-15T15:50:25.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11,
"forks": 3,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "130a8897d1... |
f7ab18e7-64a7-4b7c-ab75-264d60d67666 | GitProger/lksh | lksh_sch/day1/strs_mo.cpp | #include <bits/stdc++.h>
using namespace std;
#define int ll
typedef long long ll;
typedef long double ld;
typedef long long var;
typedef pair<int, int>prii;
typedef pair<ll, ll>prll;
typedef vector<int>veci;
typedef vector<ll>vecl;
typedef vector<veci> graph;
typedef map<int, int> mapii;
typedef set<int> seti;
typedef... | ALGO | 0.999852 | 4.057985 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-08-12T10:03:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02b74b551b... |
c3e1c0c4-3991-4908-851f-872a5c1e5367 | nayanghosh-2002/LeetCode | 2509-minimize-xor/minimize-xor.cpp | class Solution {
public:
int minimizeXor(int num1, int num2) {
int c2 = __builtin_popcount(num2);
int x = 0;
// Traverse bits of num1 from most significant to least significant
for (int i = 31; i >= 0 && c2 > 0; i--) {
if (num1 & (1 << i)) { // If bit i in num1 is set
... | ALGO | 0.999931 | 5.815628 | {
"github_metadata": {
"branch": "main",
"commit_count": 472,
"repo_created_at": "2025-01-07T14:39:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "52bd29ef73... |
b5df289f-72f7-467a-94d2-54044b601fd6 | Zobio/atCoder-works | work/tenkei79.cpp | #include <bits/stdc++.h>
using namespace std;
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, n) for (long long i = 0; i < n; i++)
#define reps(i, n) for (long long i = 1; i <= n; i++)
#define rrep(i, n) for (long long i = n - 1; i >= 0; i--)
#define r... | ALGO | 0.999969 | 4.21871 | {
"github_metadata": {
"branch": "master",
"commit_count": 731,
"repo_created_at": "2020-10-01T07:51: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": "41c16e3a... |
14347681-baae-4508-a3f8-558839805e5b | trilinos/Trilinos | packages/stk/stk_search/stk_search/morton_lbvh/MortonLBVH_ParallelConsistencyUtils.hpp | #ifndef MORTONLBVH_PARALLELCONSISTENCYUTILS_HPP
#define MORTONLBVH_PARALLELCONSISTENCYUTILS_HPP
#include "stk_search/BoxIdent.hpp"
#include "stk_search/HelperTraits.hpp"
#include "stk_search/morton_lbvh/MortonLBVH_Tree.hpp"
#include "stk_search/morton_lbvh/MortonLBVH_Search.hpp"
#include "stk_search/Box.hpp"
#include ... | ALGO | 0.998352 | 7.265642 | {
"github_metadata": {
"branch": "master",
"commit_count": 104031,
"repo_created_at": "2015-11-16T19:39:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 593,
"issues": 263,
"pull_requests": 61
},
"file_meta": {
"content_id":... |
58494354-50e7-408f-bd99-0ff8ac91950a | wenzheli/BigLearning | src/network.h | #ifndef NETWORK_H
#define NETWORK_H
#include "mini_batch.h"
#include "edge.h"
#include <fstream>
#include <assert.h>
#include <algorithm>
using namespace std;
class Network
{
public:
int N; // total number of nodes
int total_num_linked_edges; // total number of edges
double held_out_ratio; /... | DATA | 0.96883 | 4.400511 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2014-08-18T03:09:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a93781a406... |
326f3c1a-fd06-4874-abc8-34407cd67921 | tahmid-saj/system-design-and-dsa-content | algorithms_and_data_structures/questions_and_solutions/leetcode/cpp/0111_minimum_depth_of_binary_tree.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.999927 | 6.736562 | {
"github_metadata": {
"branch": "main",
"commit_count": 705,
"repo_created_at": "2024-04-05T09:05:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ebcb838b9d... |
478306a2-fbf4-415b-a92a-7e1ebaa47c3d | bigkwii/loggas-t1 | alg3/respaldo.cpp | #include "gen.hpp"
#include "matrix.hpp"
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
//Variable globales dos arreglos.
int min_3(int x, int y, int z) {return std::min({x, y, z});}
int editDist(string str1, string str2,int m1[], int m2[]) {
// tamaño matriz
int m = str1.length();
int n... | ALGO | 0.999931 | 4.957077 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2022-09-25T18:51:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cafc9c91c4b... |
f9cffcbc-c0a4-4f93-a104-08c8ed158085 | PingYangChen/milr | src/getMilrProb.cpp | #include "common.h"
#include <RcppParallel.h>
struct Worker_getMilrProb: public RcppParallel::Worker {
const arma::uvec& bag2;
const arma::uvec& uniBag;
const arma::mat& X;
const arma::vec& beta;
arma::vec& prob;
Worker_getMilrProb(const arma::uvec& bag2, const arma::uvec& uniBag,
co... | ALGO | 0.99636 | 5.925045 | {
"github_metadata": {
"branch": "master",
"commit_count": 154,
"repo_created_at": "2016-07-11T08:38:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60572c... |
7a00272f-dca6-4eaa-885a-3e0a1a09f802 | Cola0165/shiyanlou | leetcode-链表/21. 合并两个有序链表.cpp | #include "iostream"
using namespace std;
#include "algorithm"
#include "vector"
#include "queue"
#include "set"
#include "map"
#include "cstring"
#include "stack"
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };... | ALGO | 0.999993 | 5.437251 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2022-04-18T13:55:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "8bcbd94e1... |
aba76f03-69d3-456d-a139-beaff7da9c43 | KunalNarkhedePatil/LogicBuilding | SearchingTechniques/FindFirstOccurrence.cpp | /*
CASE1:
Input:
Enter the size of array
5
Enter the elements in the array:
1 2 3 4 3
Original Array
1 2 3 4 3
Enter the Number to search
3
Output:
First Occurrence of 3 is present at 2 index
-----------------------------------------------------
CASE2:
Input:
Enter the size of array
5
Enter the elements in the array:
... | ALGO | 0.999947 | 5.374124 | {
"github_metadata": {
"branch": "main",
"commit_count": 258,
"repo_created_at": "2023-06-25T07:44: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": "2531da4a23... |
c970f0d0-5a04-400d-a46d-799d4a26def1 | tawhidmonowar/problem_solving | B (143) Help Kingdom of Far Far Away 2.cpp | #include <bits/stdc++.h>
using namespace std;
void solve()
{
string inputStr,finalStr;
cin >> inputStr;
bool dotFound = false;
if(inputStr[0]=='-')
{
finalStr.push_back('(');
finalStr.push_back('$');
for(int i=1; i<inputStr.length(); i++)
{
if(inputStr[i... | ALGO | 0.990933 | 3.799193 | {
"github_metadata": {
"branch": "main",
"commit_count": 327,
"repo_created_at": "2021-10-07T15:25:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba684d7c1f... |
4c46770d-c3c7-4ec7-b577-0377b5b03015 | BloodAxe/opencv-ios-template-project | externalLibs/opencv/include/opencv2/features2d/features2d.hpp | /*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.946572 | 4.835493 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2011-03-24T10:38:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 198,
"forks": 53,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a99bf5... |
b182976a-c8d6-4dda-b753-ec30ab4b6842 | ernestvw/Implementations-for-IOI-training | Trees/LCA/ancestorPointerLCA.cpp | //source: some CF blog (http://codeforces.com/blog/entry/22325)
//this technique can be used as an alternative to heavy-light decomposition or other decomposition of a tree
#include <iostream>
#include <vector>
using namespace std;
//max number of ancestors noted
const int maxp = 20; //2^20= large number
vector<vect... | ALGO | 0.999977 | 5.093871 | {
"github_metadata": {
"branch": "master",
"commit_count": 112,
"repo_created_at": "2017-06-30T13:28:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8235850... |
07059a5c-376c-48df-8d10-b744537ffce1 | zhbbbbbb/trading-system | HW1/Q1/main.cpp | #include <iostream>
#include "LinkedList.hpp"
template <typename T>
std::ostream& operator << (std::ostream& os, LinkedList<T>& list)
{
for (int i = 0; i < list.Size(); ++i)
{
os << list.Get(i) << " ";
}
return os;
}
int main()
{
LinkedList<int> list;
std::cout << "Size: " << list.Size() << std::endl << std::... | TOOL | 0.975693 | 5.082011 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2022-11-17T21:58:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5432a226740... |
d6cb58c1-1baf-4da6-9d4a-72044d7414ce | gabrielvlad/Daily-Algorithms | 9/#3978 sabc.cpp | /******************************************************************************
Created by Gabe on 28/03/2023.
If x and y are two natural numbers with x ≤ y, then we note with s(x,y) the sum of natural numbers between x and y. E.g, s(3,6) = 3+4+5+6 = 18, and s(7,7) = 7.
Requirement
Natural numbers are given a, b and ... | ALGO | 0.999921 | 4.41647 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2023-03-14T10:58:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e7f77914a9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.