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 |
|---|---|---|---|---|---|---|---|
f23aa484-d52b-458f-bae4-85c358a6f6cc | niknarra/LeetCode-and-other-solutions | Trees/235_LCA_in_BST.cpp | // Optimal Approach
// TC: O(h); SC: O(1)
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if(root == nullptr) return root;
int curr = root->val;
if(curr < p->val && curr < q->val){ // If current node is smaller than both p and q, as it i... | ALGO | 0.999989 | 6.860105 | {
"github_metadata": {
"branch": "master",
"commit_count": 176,
"repo_created_at": "2024-08-23T04:03: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": "90d3b436... |
109e0fa5-cd7b-44a9-876b-d0bf7f69c4a6 | r-chiba/competitive_programming | aoj/dpl/3_b.cpp | // {{{
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <complex>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>
#include <numeric>
using n... | ALGO | 0.999885 | 4.085401 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2019-02-23T03:20: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": "59816ccafb... |
b4b270c6-9ae5-426a-a372-280b0ba52dbd | AkashSingh3031/The-Complete-FAANG-Preparation | 1]. DSA + CP/2]. Competitive Programming/04]. Coding Ninjas/1]. Practice/2]. Problem Lists/1]. Lists by Experts/1]. Striver SDE Sheet Problems/C++/076]. Implement Trie ii.cpp | struct Node{
Node* link[26];
int count = 0;
int wordEnd = 0;
bool isEnd = false;
};
class Trie{
public:
Node* root;
Trie(){
root = new Node();
}
void insert(string &word){
Node* curr = root;
for(auto &it : word){
if(!curr->link[it - 'a']){
... | ALGO | 0.999955 | 4.538579 | {
"github_metadata": {
"branch": "master",
"commit_count": 1827,
"repo_created_at": "2021-05-29T04:41:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11343,
"forks": 2526,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "... |
11a56bd7-2d92-4dbb-b0a6-43f3b8aab5a1 | al0vya/quant-prep | swe/cpp/multithreading.cpp | #include <queue>
#include <condition_variable>
#include <iostream>
#include <thread>
#include <mutex>
#include <string>
#include <chrono>
#define LOG(x) std::cout << x << "\n";
void func(int x) {
std::cout << "Value for thread is " << x << "\n";
}
void oneThread() {
std::thread t(func, 100);
t.join();
}
... | TOOL | 0.95399 | 5.466377 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2022-08-23T13:34:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d6fb1d91d1... |
545763b4-cd7a-4f1a-a977-258efe97336f | Gojou0/DSA_CB | L6_Arrays_codeforces/5_PashaandString.cpp | #include <iostream>
using namespace std;
int cnt[100005] = {0};
int main(){
string s;
cin >> s;
int n = s.size();
int m;
cin >> m;
int ai;
for (int i = 0; i < m; i++){
cin >> ai;
cnt[ai - 1]++; // konse index swap honge wo cnt array me le liye
}
/... | ALGO | 0.999997 | 4.455121 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-02-27T06:16: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": "62dda5f57b9... |
09916f3f-a9c7-416b-b1ec-6c2d38c6dec6 | Ed-von-Schleck/panda3d | panda/src/linmath/compose_matrix_src.cxx | // Filename: compose_matrix_src.cxx
// Created by: drose (27Jan99)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. Yo... | ALGO | 0.941572 | 5.039046 | {
"github_metadata": {
"branch": "master",
"commit_count": 19417,
"repo_created_at": "2013-03-31T21:55:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 7,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "539be1... |
ded2e2a5-732c-466d-8264-632f742256b0 | leisheyoufu/study_exercise | algorithm/leetcode/66_Plus_One/main.cpp | /*
66. Plus One
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.
You may assume the integer do not contain any leading zero, except the number 0 itself.
The digits are stored such that the most significant digit is at the head of the list.
*/
#include<iostream>
#inclu... | ALGO | 0.999864 | 5.512973 | {
"github_metadata": {
"branch": "master",
"commit_count": 738,
"repo_created_at": "2013-10-13T11:13:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "0ff6a45e... |
6965b87e-8f96-48a6-8f19-44c8b66a3599 | BrynGhiffar/DSATutorClass | session19/sorting.h | #ifndef _SORTING_H_
#define _SORTING_H_
#include <vector>
#include <iostream>
#include <chrono>
int min_index(std::vector<int>& arr, int start, int end);
template <typename T>
void print(const std::vector<T>& arr) {
std::cout << "[ ";
for (T item : arr) {
std::cout << item << " ";
}
std::cout <... | ALGO | 0.998899 | 5.523518 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2022-02-09T13:44: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": "17c3f2d1bba... |
dc3bc991-5f8b-4274-9038-51697e082aac | pika-org/pika-algorithms | include/pika/parallel/algorithms/adjacent_difference.hpp | // Copyright (c) 2015 <NAME>
// Copyright (c) 2021 <NAME>
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/// \file parallel/algorithms/adjacent_difference.hpp
#pragma o... | ALGO | 0.998873 | 7.565414 | {
"github_metadata": {
"branch": "main",
"commit_count": 1416,
"repo_created_at": "2022-11-22T13:26:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b57f844eb5... |
3fc98bb2-3d6d-4672-b0a8-93e97b0c26d9 | saiket-das/DSA | C++/for/diagonal-difference.cpp | #include<bits/stdc++.h>
using namespace std;
int main () {
// Diagonal Difference
// Problem link: https://www.hackerrank.com/challenges/diagonal-difference/problem?isFullScreen=true
int n; // The number of rows and columns in the square matrix
cin >> n;
int arr[n][n]; // Square matric
... | ALGO | 0.999993 | 5.198185 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2023-05-21T04:55: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": "eadfe8a0705... |
db451363-ff39-4c60-a7dc-8364fa0465dd | melode11/Introduction_to_algorithm | heap.h | #ifndef HEAP_H
#define HEAP_H
#include <utility>
#include <algorithm>
#include <cassert>
#include <memory>
#include <cstdlib>
namespace Algo
{
template <typename T>
class Heap
{
public:
Heap(T const* unordered,size_t n);
~Heap();
const T& Max() const;
T ExtractMax();
... | ALGO | 0.951885 | 4.971873 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-05-25T16:30:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccd5278eb... |
a6796327-664a-4f27-8ed8-4b57e70b66a3 | openfheorg/openfhe-serial-examples | src/real_server/real_client.cpp | // @file real-client - code to simulate a client to show an example of encrypted
// server-client processing relationships.
//
// The server serializes contexts, public key and processing keys for
// the client to then load. It then generates and encrypts some data
// to send to the client. The client loads the crypto ... | WEB | 0.909314 | 7.081811 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-26T14:30:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae0750ce44ea3... |
86bfedf6-38b0-4cd6-a919-e058fbc79cad | roman-baldaev/Algorithms-and-DS-Cpp | full class List/full class List/List.cpp | #include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <iostream>
#include <time.h>
#include "List.h"
using namespace std;
List :: List ()
{
head = new Node;
tail = new Node (0, head);
head->Next()=tail;
}
List :: List ( int * keys, int n)
{
head= new Node;
tail= new Node (0, head);
hea... | ALGO | 0.998293 | 3.624803 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2017-04-09T10:21: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": "df3e9a3ec... |
7d62fbd9-051f-46f1-9caf-e41658904d17 | giongto35/CompetitveProgramming | ThreeDiff.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <queue>
using namespace... | ALGO | 0.999924 | 4.210458 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-01-30T17: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": "f2c6e441fb... |
1ccd74ca-8788-4fca-a5ec-7636f71143c9 | fulatin/MyAlgorithmProblemCode | test/2.cpp |
#include <stdio.h>
int ans[10];
int main() {
int arr1[5] = {1, 3, 4, 5, 7};
int arr2[5] = {2, 4, 6, 7, 8};
int i1 = 0, i2 = 0;
int anspos = 0;
while (i1 < 5 || i2 < 5) {
if (i1 > 5) {
for (; i2 < 5; i2++, anspos++) {
ans[anspos] = arr2[i2];
}
} else if (i2 > 5) {
... | ALGO | 0.999962 | 3.652436 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2024-12-09T13: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": "2815ada7fa... |
9e9f0d1c-ab46-4c89-871b-9d098cf9f067 | blaflor1/bohbuobo | LCS.cpp | #include <vector>
#include <list>
#include <string>
#include <deque>
#include <sstream>
#include <iostream>
#include <utility>
#include <fstream>
#include <time.h>
using namespace std;
class LCSTable {
public:
deque<pair<char, int>> xTable;
deque<pair<char, int>> yTable;
string ** directionalTable;
int ** matrix... | ALGO | 0.998394 | 4.092088 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-03-26T22:27:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "14e95970da... |
1b681053-1986-40dd-ae66-e7c332b1f8d7 | wanna175/Algorithm | 백준/Gold/2638. 치즈/치즈.cc | #include <iostream>
#include <vector>
#define pii pair<int,int>
using namespace std;
int N, M,cnt=0;
int board[102][102] = { 0 };
bool cheeze(pii pos) {
int y = pos.first;
int x = pos.second;
int ret = 0;
ret = abs(board[y + 1][x]) + abs(board[y - 1][x]) + abs(board[y][x + 1]) + abs(board[y][x - 1]);
if (ret < 3)
... | ALGO | 0.999988 | 3.765185 | {
"github_metadata": {
"branch": "main",
"commit_count": 316,
"repo_created_at": "2025-01-11T08:01:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba2f688569... |
0d470920-77b9-4e17-aec8-5007b5211f9c | ZoranPandovski/al-go-rithms | data_structures/Arrays/CPP/arrays.cpp | #include<iostream>
using namespace std;
void insert_an_element(int a[],int n){
int pos,no;
cout<<"enter a number which you want to insert";
cin>>no;
cout<<"enter the position where insertion should take place:";
cin>>pos;
for(int i=n;i>=pos;i--){
a[i]=a[i-1];
}
a[pos]=no;
cou... | ALGO | 0.998895 | 3.431682 | {
"github_metadata": {
"branch": "master",
"commit_count": 7457,
"repo_created_at": "2017-06-05T19:20:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1359,
"forks": 1929,
"issues": 20,
"pull_requests": 44
},
"file_meta": {
"content_id": ... |
c23ea3d0-ca4e-41ff-9521-196341ebe6b3 | CarryNotKarry/17thCUGBCPC | OnsiteContest/G.cpp | #include <bits/stdc++.h>
using namespace std;
bool check(string s)
{
for (int i = 0; i < s.size(); i++)
if (s[i] == 'k' || s[i] == 'K')
return false;
return true;
}
int main()
{
string a, b;
int flag = 0, ans = 0, Minute = 0, Second = 0;
int n;
cin >> n;
for (int i = 1... | ALGO | 0.998038 | 4.286384 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-11-21T11: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": "f25528e7bd3... |
754ed236-28fd-4c9a-84de-d78e025ad28b | dugudyoudi/ZLLBM | source/lbm_project/d2q9_model/lbm_d2q9_solver.cpp | // Copyright (c) 2021 - 2025, <NAME>
// All rights reserved
/**
* @file lbm_d2q9_solver.cpp
* @author <NAME>
* @brief alternative functions for LBM simulation using D2Q9 model.
* @date 2023-9-30
*/
#include <string>
#include "lbm_d2q9.h"
#include "io/log_write.h"
namespace rootproject {
namespace lbmproject {
/**
... | ALGO | 0.999957 | 5.880897 | {
"github_metadata": {
"branch": "main",
"commit_count": 76,
"repo_created_at": "2025-05-22T14:25: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": "22534f8ff18... |
9208efc3-258a-4437-95f9-9ce6001c19cd | akamya997/PracticeCode | 201904_practice/ac.cpp | #include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#define N 100001
using namespace std;
int n,m,cnt,sz,head[N],deep[N],son[N],belong[N],pl[N],v[N],ft[N][18];
bool vis[N];
struct seg{int l,r,lc,rc,s,tag;}t[4*N];
struct edge{int to,next;}e[2*N];
void insert(int u,int v)
{
e[++cnt].to=v;e[cnt].ne... | ALGO | 0.999957 | 3.853643 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2019-11-06T07:30:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "947cc239d... |
97135e31-07b7-4511-9f7f-8c51faa5c1f0 | Hung-00/C-plus-plus---BKU | My C++ Code/Extra_Week_7/Hashing_method.cpp | #include <stdio.h>
#include <iostream>
#include <string.h>
using namespace std;
long int midSquare(long int seed)
{
long int result;
long long key = seed;
key = key * key;
long int deleted_2_key = key / 100;
long int deleted_4_key = deleted_2_key / 10000;
deleted_4_key = deleted_4_key * 1000... | ALGO | 0.996604 | 3.609153 | {
"github_metadata": {
"branch": "main",
"commit_count": 93,
"repo_created_at": "2021-12-14T05:01: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": "b6f448387e8... |
c10e7e5f-8bcd-41ed-bf38-f96c7bd0409c | bhagyashribangar/data-structure-algo-practice | src/cows_and_hooks.cpp | // Assign hooks to the cows such that the minimum distance is maximum
// n = hooks or size of array, c = number of cows
// return maximum possible minimum distance
// TC: O(Nlog(M)); M = A[n-1] - A[0], SC: O(1)
// This solution is applicable for sorted input array
#include <iostream>
#include <limits.h>
using namespa... | ALGO | 0.999983 | 5.189984 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-08-15T17:10: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": "130372b7ce2... |
83efee90-c7d2-4163-8ebc-991b35342b85 | RhythmBoys/AlgoContest | USACO/transform.cpp | /*
ID: mail.ji1
PROG: transform
LANG: C++11
*/
#include <cstdio>
#include <cstring>
using namespace std;
char a[10][11], b[10][11], c[10][11];
inline bool Compare(char src[][11], char dst[][11], int n) {
for (int i = 0; i < n; ++i)
if (memcmp(src[i], dst[i], n)) return false;
return true;
}
void Transform(char s... | ALGO | 0.99999 | 3.3908 | {
"github_metadata": {
"branch": "master",
"commit_count": 182,
"repo_created_at": "2022-06-09T17:02: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": "499e0a4c... |
027c3fbe-da4e-4df2-a23a-51439ed7eec2 | nadarb/Competitive-Coding | Old/Watson asks Does Permutation Exist/Watson asks Does Permutation Exist/Watson asks Does Permutation Exist.cpp | // Watson asks Does Permutation Exist.cpp : Defines the entry point for the console application.
// url : https://www.codechef.com/COOK75/problems/PERMEXIS
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
... | ALGO | 0.999802 | 4.541048 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-12-23T14:57: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": "0969d606ac... |
2f7978ea-32ef-4a05-957a-e4bc8a931fa1 | schnyle/ctci | 1-arrays-and-strings/ex7.cpp | // Rotate Matrix
// Given an image represented by an N x N matrix, where each pixel in the image is a represented by an integer, write
// a method to rotate the image by 90 degrees. Can you do this in place?
// I totally misinterpreted what to do but the functionality I made is still solid. probably more complicated t... | ALGO | 0.999511 | 6.373157 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-10T19:59: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": "baf6d55ad8c3... |
1100a487-8082-48fb-a5a7-7d49475e0052 | prayushkale/Robocon-Programs | 2016 Final programs/New Code/image proc programs/imagproc_raspi_modified/imagproc_raspi_modified.ino |
#include <PID_v1.h>
#include <Servo.h>
#define PIN_INPUT 0
#define PIN_OUTPUT 3
//Define Variables we'll be connecting to
double Setpoint, Input, Output;
Servo myservo; // create servo object to control a se-rvo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo po... | ALGO | 0.9134 | 4.54089 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-06-10T05:56: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": "8e711c4fdb... |
ef685d4c-e2ee-4f96-b46c-332dac6f4fa5 | bimdots-dev/DotbimArchicadAddOn | Source/MatrixUtils.cpp | #include <MatrixUtils.hpp>
Quaternion::Quaternion (double qx, double qy, double qz, double qw) :
qx (qx),
qy (qy),
qz (qz),
qw (qw)
{
}
// Without scale
Geometry::Matrix34 ComposeMatrix (const Vector3D& translation, const Quaternion& rotation)
{
double tx = translation.x;
double ty = translat... | ALGO | 0.926802 | 5.868681 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2025-05-09T18:11: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": "8d7bbf3d347... |
2e7f6ac6-e7df-45ba-afaf-52eb60cd9bd6 | ewsnybchan7/Algorithm-Study | AlgorithmStudy/2일차/1918.cpp | #include <iostream>
#include <string>
#include <stack>
using namespace std;
string result;
stack<char> operations;
int main() {
string s;
while (getline(cin, s) && s.length() != 0) {
for (int i = 0; i < s.length(); i++) {
if (s[i] >= 'A' && s[i] <= 'Z') {
result.push_back(s[i]);
}
else if (s[i] == ... | ALGO | 0.999969 | 4.304841 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2021-03-23T01:51:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c494e263d5e... |
50bc01fd-9ed0-4b9d-80ff-c5565829df4d | yezhang159/csc211 | backups/c++folder/Zhang1DArray11.cpp | #include <iostream>
#include <string>
using namespace std;
void arr3(int size1, int arr2[]){
srand(time(NULL));
for(int i=0;i<size1;i++){
arr2[i]=rand()%100+1;
cout<<arr2[i]<<endl;
}
}
void arr4(int size2,int arr5[],int index){
for(index=0;index < size2;index++){
cout<<arr5[index]<<endl;
}
}
in... | ALGO | 0.971856 | 3.871801 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-11-30T05:42: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": "94dc8b02f250... |
33e13ad3-3ae9-4db3-aa32-352d7548a50f | DrSwad/CP | Submissions/ICPC/Collaboratives/9/K_Unique_Activities.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
struct chash {
const int RANDOM = (long long)(make_unique<char>().get())
^ chrono::high_resolution_clock::now()
.time_since_epoch()
.count(... | ALGO | 0.999997 | 4.480944 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2019-10-12T13:53:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "6a08aa31... |
92dadb4f-64a9-4e8a-b606-cfb8f48f0a9b | aau-cns/MSCEqF | source/vision/tracker.cpp | // Copyright (C) 2023 <NAME>.
// Control of Networked Systems, University of Klagenfurt, Austria.
//
// All rights reserved.
//
// This software is licensed under the terms of the BSD-2-Clause-License with
// no commercial use allowed, the full terms of which are made available
// in the LICENSE file. No license in pat... | ALGO | 0.980662 | 6.919266 | {
"github_metadata": {
"branch": "main",
"commit_count": 229,
"repo_created_at": "2023-11-16T15:52:46.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 122,
"forks": 13,
"issues": 3,
"pull_requests": 2
},
"file_meta": {
"content_id": "bc1e95d8... |
c11eae05-75e8-4937-9dee-6ccbd069fde7 | OneZeroAndTwoZero/own-cppfile | 程序/实验舱/class/JiaoLong_6/day_05/作业/#I、Dis.cpp | #include<bits/stdc++.h>
using namespace std;
struct node{
int vi,wi;
};
int n,m;
int u,v,k;
int x,y;
vector<node> a[100005];
int fa[100005];
int h[100005],d[100005];
int st[100005][25];
void erg(int idx,int dep,int step){
//cout << idx << "[][]\n";
h[idx] = dep;
d[idx] = step;
st[idx][0] = fa[idx... | ALGO | 0.999998 | 4.206873 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-10-20T03:01: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": "3cf8cb541008... |
5bd161a2-158c-4c10-a216-18fb5dcbb5ad | kidaa/pyimager | CEP/Calibration/BBSKernel/include/BBSKernel/Expr/EquatorialCentroid.h | //# EquatorialCentroid.h: Compute the centroid of a list of positions in
//# spherical coordinates.
//#
//# Copyright (C) 2009
//# ASTRON (Netherlands Institute for Radio Astronomy)
//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
//#
//# This file is part of the LOFAR software suite.
//# The LOFAR software suite is f... | TOOL | 0.981282 | 7.635617 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-12-27T15:49:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8301639a74... |
5bf8b0b0-ec16-4d4f-8a9e-dd743bbc993f | rosescript/141_projects | project_6/list.cpp | /*list.cpp*/
//
// Originally written by: <NAME>, U. of I. Chicago, Spring 2021
// Author: <NAME>, UIC, Spring 2021
//
// Implements a one-way linked-list with optimized insertion at
// head and tail of list. The nodes contain 2 data values, a string
// and an integer.
//
#include <iostream>
#include <string>
#inclu... | TOOL | 0.965076 | 5.564369 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-05-18T00:32: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": "7f6ed650957... |
218f0daf-8c13-4b7a-b731-eb10626bc249 | rennone/Cpp | Contest/AOZ/0518.cpp | #include<iostream>
#include<string.h>
#include<complex>
#include<map>
#include<vector>
using namespace std;
int n;
int ans;
bool maps[5002][5002];
int vertex[3001][2];
bool range(int x, int y){
if(x>=0 && y>=0 && x<=5000 && y<=5000)
return true;
else
return false;
}
int main(){
while(cin>>n, n){
me... | ALGO | 0.999858 | 3.554073 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2013-11-27T13:17: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": "918be0aab... |
bebb9803-68dc-4f99-93ed-6291969ce2a3 | EJLantigua/cpp-programs | cryptography-messages/MP5.cpp | /*
<NAME>
3/19/2019
<NAME> CPS171 - 01
MP5 - Arrays
*/
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
const int ROW = 5;
const int COLUM = 5;
const char FIRST_CHAR = 'A';
const char LAST_CHAR = 'Y';
const char ENCRYP = 'E';
const char DECRYP = 'D';
string uniqueWordCheck(ifstream& file,... | ALGO | 0.9977 | 3.919729 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2022-05-10T14:24: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": "ae46c553339... |
6240a642-e52b-4504-a027-cb942ceecda0 | arnabs542/lintcode-1 | lintcode-0116.h | #ifndef __LINTCODE_0116__
#define __LINTCODE_0116__
#include "data-types.h"
/*@116. Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if you are able to reach the l... | ALGO | 0.997559 | 5.628133 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-01-21T12:38:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6531ea085a... |
2d6657f3-28f7-4b76-98eb-9c9ff22bd285 | Faisal-hn/Competitive_Programming | Graph_1/GetPathDFS.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> *getpath(int **edges, int n, int sv, int b, bool *visited)
{
// cout<<sv<<"fai"<<b<<endl;
if (sv == b)
{
vector<int> *e = new vector<int>();
visited[sv] = true;
// if(edges[])
e->push_back(sv);
re... | ALGO | 0.999972 | 4.737316 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-01-22T18:56: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": "beaead1daa1f... |
daf58e61-6e03-43b2-bd7e-7e440a19a8cd | ay2306/Competitive-Programming | SPOJ/DQUERY.cpp | #include<bits/stdc++.h>
using namespace std;
const int K = 200, Q_LIMIT =2e5+10, A_LIMIT = 1e6+10, N_LIMIT = 3e4+10;
struct query{
int l,r,ind;
query(){}
bool operator<(const query &rhs)const{
if(l/K != rhs.l/K)return l < rhs.l;
if(l/K&1)return r > rhs.r;
return r < rhs.r;
}
}q[... | ALGO | 0.999929 | 4.170693 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-08-29T14:45:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e745e6ff3... |
f9320662-4740-4d6e-88ca-c33f35586b27 | jigsaw5071/algorithms | Graphs/minimum_spanning_tree_prims.cpp | /**
@<NAME>
Date:12/01/2017
*/
/**
----------------------------------------------------------Prims Minimum Spanning Tree--------------------------------------------------
1. This algorithm is based on the greedy approach.
2. One quality optimization is to initialize the priority queue with the source and till its get ... | ALGO | 0.999993 | 4.949743 | {
"github_metadata": {
"branch": "master",
"commit_count": 203,
"repo_created_at": "2016-08-30T06:34: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": "f32d3d74... |
30d2e28d-783e-49d7-aa66-598f33c0b3fb | PCY00/CPP_Study | Reference/Reference_2.cpp | /*
스왑을 할때 참조와 포인터는 바뀌지만 변수 전달은 바뀌지 않음을 실험함
이유는 참조와 포인터는 실제 메모리 주소에 접근하여 값을 변경하고, 변수만 전달하는 함수는 함수 안에서만 스왑이 일어나고 함수 밖으로 돌아오면
다시 원래 상태로 돌아감
*/
#include <iostream>
using namespace std;
void swapr(int& a, int& b);
void swapp(int* p, int* q);
void swapv(int a, int b);
int main(void) {
int wallet1 = 3000;
int wallet2 =... | ALGO | 0.998118 | 4.972587 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2023-06-26T00:01: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": "b34b3890ec3... |
0acd8e91-bed8-465c-a409-4569b17de382 | MichelleZ/leetcode | algorithms/cpp/minimumNumberofDaystoDisconnectIsland/minimumNumberofDaystoDisconnectIsland.cpp | // Source: https://leetcode.com/problems/minimum-number-of-days-to-disconnect-island/
// Author: <NAME>
// Date: 2021-05-16
class Solution {
public:
int minDays(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
vector<vector<int>> dirs{{1, 0}, {-1, 0}, {0, 1}, {0, ... | ALGO | 0.999866 | 6.067542 | {
"github_metadata": {
"branch": "main",
"commit_count": 290,
"repo_created_at": "2021-01-05T06:12:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c86b17a41d... |
6346e7c7-1f47-42f3-99e8-58a2b9f6d16b | jastinbeaber/OpenScan3D | libs/openMVS/libs/Math/SimilarityTransform.h | /*
* SimilarityTransform.h
*
* Copyright (c) 2014-2022 SEACAVE
*
* Author(s):
*
* cDc <<EMAIL>>
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, o... | ALGO | 0.970525 | 6.296185 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-01-13T16:11:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f57de41c645... |
2f93fac6-4850-4ddc-ab1e-0fae95f7ec5d | MarcusTurnerBSU/LinkedIn-Learning | CodeLab II/C++ Templates and the STL/Transformations/lambda.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
template <typename T>
void disp_v(vector<T>& v) {
if (!v.size()) return;
for (T e : v) { cout << e << " "; }
cout << endl;
}
size_t strsz(string& s) {
return s.size();
}
int main()
{
int accum = 14;
... | ALGO | 0.987913 | 5.052562 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2020-08-06T17:56: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": "45f61ac72... |
1d0d50ce-bada-4d04-80ce-77b5acd53ba5 | xxsds/DYNAMIC | include/dynamic/internal/cw_bwt/DynamicString.h | // Copyright (c) 2017, <NAME>. All rights reserved.
// Use of this source code is governed
// by a MIT license that can be found in the LICENSE file.
/*
* DynamicString.h
*
* Created on: Jun 19, 2014
* Author: nicola
*/
#ifndef DYNAMICSTRING_H_
#define DYNAMICSTRING_H_
#include "dynamic/internal/include... | ALGO | 0.913376 | 5.202574 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2015-10-30T16:20:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 112,
"forks": 22,
"issues": 4,
"pull_requests": 1
},
"file_meta": {
"content_id": "746d8d... |
7f090f9e-1fdb-4910-baa8-fc35c0e49be2 | khangyessir/nodesBetweenCriticalPoints | nodesBetweenCriticalPoints.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution {
public:
vector<int> nodesBetweenCriticalPoints(L... | ALGO | 0.999994 | 5.440086 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-07-05T03:56: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": "eb44f9c774c5... |
33436336-80d9-41bb-84d7-34ea35d1ebfb | kd1978688/DridiKal_CSC5_45562 | Hmwk/Assignment_3/Gaddis_8thEd_Chap4_Prob23_GeometryCalculator/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on July 6, 2017, 4:52 PM
* Purpose: This program displays a menu and should ask
* for the radius of a circle and then displays
* its area.
*/
//System Libraries
#include <iostream> //Input - Output Library
#include <iomanip>
#include <cma... | TOOL | 0.952888 | 3.452219 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2017-06-21T03:46: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": "2bfd1e610... |
f1e8550b-8a7d-4668-86c4-b97e8e103893 | xx-luozi-xx/algorithm-question-warehouse | 113 线性表/P1160队列安排.cpp | #include <bits/stdc++.h>
using namespace std;
const int ios_init = (ios::sync_with_stdio(0), cin.tie(0), cout.tie(0), 0);
const int MAX_N = 1e5+30;
int data[MAX_N], data_size = 1;
int nxt[MAX_N];
int pre[MAX_N];
int head[MAX_N];
int dead[MAX_N];
void add(int a, int b, int num){// a.nxt == b
head[num] = data_s... | ALGO | 0.999991 | 4.422669 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2024-03-28T03:18: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": "3f27831e705... |
d2394f81-baa6-4f75-b217-7cffe5fa4a5d | zhengyhn/leetcode | io/github/zhengyhn/leetcode/trapping_rain_water/trapping-rain-water2.cpp | #include <iostream>
#include <stack>
#include <vector>
using namespace std;
class Solution {
public:
int trap(vector<int>& height) {
int size = height.size();
if (size < 3) {
return 0;
}
int ret = 0;
stack<int> s;
s.push(0);
int i = 1;
while (!s.empty() && i < size) {
wh... | ALGO | 0.999984 | 6.542246 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-06-10T13:26: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": "deb47bbc0... |
89064351-f6dc-4604-a7e0-ce32ef589288 | arunzeon/crawler-c-plus-plus | Search_h.cpp | #include "common.hpp"
#include "Search_h.hpp"
Search_h::Search_h()
{
msg(" Search_h Con");
}
void
Search_h::Run(const vs &qtokens, ResultSet &resultRecord)
{
msg("I am SH RUn process me");
bool flag = false;
// Set all positions
bitset<MAXTEXTLN> tmpbits;
SetAllPositions(tmpbits);
loop(qtokens, it)
... | ALGO | 0.932959 | 3.687852 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-01-12T11:12: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": "3d2b31015f... |
c0ff5ff8-2ff2-4855-a964-cbba7b3f1e9d | ZeroOnePro/PS-Gym | Programmers/level3/algorithm/다단계 칫솔 판매.cpp | #include <bits/stdc++.h>
using namespace std;
/*
중복 판매자가 있을수 있습니다. 문제 조건에서 이부분 놓쳤었네요
seller = (에밀리, 존, 스텔라, 에밀리)
amount = (2,1,1,2)
중복 판매자가 판매시마다 수수료를 소개자한테 주는 방식으로 설계해야 합니다
1번에서 에밀리가 2씩 2번을 판매했다면 판매량을 모두 더한뒤 400원에 대한 수수료
전달이 아닌 200원에 대한 수수료 한번 처리하고 그다음 에밀리 또 만났을때 또
200원에 대한 수수료 올려주는 방식으로
이유 : 만약 에밀리가 10번을 각각 1개씩 팔... | ALGO | 0.999214 | 4.330228 | {
"github_metadata": {
"branch": "main",
"commit_count": 817,
"repo_created_at": "2021-11-10T16:20:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 9,
"pull_requests": 0
},
"file_meta": {
"content_id": "88bfbd6114... |
063a0b72-0f38-49d0-a913-16e94f1cea3f | Priyansi-10/des-programming | des_assign.cpp | #include <bits/stdc++.h>
using namespace std;
#if defined(unix) || defined(__unix__) || defined(__unix)
#define PAUSE "read -p 'Press Enter to continue...' var"
#define CLR "clear"
#endif
/// @brief converts hexadecimal numbers to binary numbers
/// @param const string& str
/// @return binary string
string hex_bina... | ALGO | 0.999329 | 4.060303 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-03-01T23:38: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": "dfa47188891a... |
cee2b966-64e9-411d-9e7c-511d9fcf7ce3 | 3idiots-dalcheon/algorithm | kamothi/2056_작업.cpp | #include<iostream>
#include<vector>
#include<queue>
using namespace std;
int Time[10001];
vector<int> work[10001];
int result[10001];
int degree[10001];
queue<int> q;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
// 그래프 세팅
for(int i=1;i<=... | ALGO | 0.999961 | 3.698194 | {
"github_metadata": {
"branch": "main",
"commit_count": 244,
"repo_created_at": "2024-12-06T12:30:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "372e0237d5b... |
db10b2ec-4c05-4ea5-9bc7-63d0d0509cea | zhaohuanzhendl/algorithm | leetcode/search/Search_a_2D_Matrix.cc | /*
* Filename Search_a_2D_Matrix.cc
* CreateTime 2017-03-30 05:23:52
*
* Copyright (C) <NAME>
* Copyright (C) <EMAIL>
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
bool searchMatrix(vector<vector<int> > &matrix, int target)
{
in... | ALGO | 0.999537 | 5.466689 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2016-12-15T07:18: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": "3ca60c62e... |
209724f1-20fc-4a2a-8c3b-213cf4294cea | alibaba/havenask | aios/network/gig/multi_call/service/SearchServiceReplica.cpp | /*
* Copyright 2014-present Alibaba Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | WEB | 0.939576 | 6.064259 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2022-10-17T03:46:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1698,
"forks": 316,
"issues": 56,
"pull_requests": 8
},
"file_meta": {
"content_id": "8ea6c4... |
5557068a-8835-47d6-a684-a5d3d1277e6d | MingYuanTina/Resource | code_challenge/2C++Lib/HashTable/Problem01.cc | // Question
// 599. Minimum Index Sum of Two Lists
// Suppose Andy and Doris want to choose a restaurant for dinner,
// and they both have a list of favorite restaurants represented by strings.
// You need to help them find out their common interest with the least list index sum.
// If there is a choice tie betw... | ALGO | 0.999852 | 5.98557 | {
"github_metadata": {
"branch": "master",
"commit_count": 137,
"repo_created_at": "2017-05-01T21:16:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e97cd9b6... |
45841802-ab97-4e6d-ace3-6f3741a9359a | davideberly/GeometricTools | GTE/Samples/Physics/RoughPlaneThinRod1/PhysicsModule.cpp | // <NAME>, Geometric Tools, Redmond WA 98052
// Copyright (c) 1998-2025
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
// https://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
// File Version: 8.0.2025.05.10
#include <Mathematics/Integration.h>
#include "P... | ALGO | 0.963674 | 5.558282 | {
"github_metadata": {
"branch": "master",
"commit_count": 562,
"repo_created_at": "2020-09-15T18:45:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1278,
"forks": 234,
"issues": 5,
"pull_requests": 1
},
"file_meta": {
"content_id": "366... |
14da5e3f-aa2d-4450-9ec8-25b87f7dbd44 | uOung/AlgorithmStudy | mergeSort.cpp | #include <iostream>
using namespace std;
int n = 10;
int arr[1000001] = {15, 25, 22, 357, 16, 23, -53, 12, 46, 3};
int tmp[1000001]; // merge 함수에서 리스트 2개를 합친 결과를 임시로 저장하고 있을 변수
// mid = (st+en)/2라고 할 때 arr[st:mid], arr[mid:en]은 이미 정렬이 되어있는 상태일 때 arr[st:mid]와 arr[mid:en]을 합친다.
void merge(int st, int en){
int mid ... | ALGO | 0.999965 | 4.48455 | {
"github_metadata": {
"branch": "main",
"commit_count": 74,
"repo_created_at": "2022-03-11T02:06: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": "6c0b85c039e... |
b8aab53c-3252-4cdf-a4ef-37a5d2e3db94 | nayandeep20028840/CodeforcesProblemSolving | Codeforces_Problem_Solving/D_Problems/D2. 388535 (Hard Version)/1.cpp | #include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
// Policy based data structures(PBDS) C++ STL
// find_by_order(k): returns the iterator of the k-th element in a set (0-index)
//... | ALGO | 0.999969 | 4.683061 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2022-10-25T11:40:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b05a7f9b50... |
1f20d03f-dc26-4b49-b87c-7e850a69f42a | ROCm/OpenFOAM_HMM | src/finiteArea/finiteArea/fac/facD2dt2.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-----------------------------------... | ALGO | 0.992024 | 6.209853 | {
"github_metadata": {
"branch": "suyash/hmm",
"commit_count": 25733,
"repo_created_at": "2022-10-27T12:31:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "44... |
270c67fb-9eaf-4e9a-bdd5-b67ff760e4c0 | Mannan-Ali/C-Learnings | Queue/Queue_LL.cpp | #include <bits/stdc++.h>
using namespace std;
//class Queue;
class Node{
int data;
Node * next;
friend class Queue;
public:
Node(int val){
this->data=val;
next=nullptr;
}
~Node(){
int value = this->data;
if (this->next != NULL)
{
delete next... | ALGO | 0.994127 | 3.81404 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-10-20T07:21: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": "97e80dabfe2f... |
40d5aa25-4a88-461e-ac4d-26f0cf636811 | halterman/CppBook-SourceCode | Chap11/twodimarray.cpp | #include <iostream>
#include <iomanip>
const int ROWS = 3,
COLUMNS = 5;
// The name Matrix represents a new type
// that means a ROWS x COLUMNS
// two-dimensional array of double-precision
// floating-point numbers.
using Matrix = double[ROWS][COLUMNS];
// Allow the user to enter... | TOOL | 0.996855 | 5.337469 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2016-11-30T04:14:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 46,
"forks": 31,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "9a56ac36... |
0e1d6384-ea80-4393-81da-3f159ef4bfc1 | Hossamfc9/Leetcode-Solutions | DCP-01-25/1765-Map-of-Highest-Peak.cpp | class Solution {
public:
int n, m;
bool valid(int i, int j) {
return i >= 0 && i < n && j >= 0 && j < m;
}
vector<vector<int>> highestPeak(vector<vector<int>>& v) {
n = v.size(), m = v[0].size();
vector<vector<int>> ans(n, vector<int>(m, 1e9));
queue<pair<int, int>> q;
... | ALGO | 0.999974 | 5.994093 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2024-05-23T14:46: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": "5729b50af... |
e4fbe3a9-c69f-4d98-b8fd-b37b6edb8309 | UdaySharmaGitHub/DSA-CPP | GFG/Medium Problems/Triplet_Sum_in_Array.cpp | /*
Triplet Sum in Array
Given an array arr of size n and an integer X. Find if there's a triplet in the array which sums up to the given integer X.
Example 1:Input:
n = 6, X = 13
arr[] = [1 4 45 6 10 8]
Output:
1
Explanation:
The triplet {1, 4, 8} in
the array sums up to 13.
Example 2:
Input:
n = 5, X = 10
arr[] = [1 ... | ALGO | 0.999961 | 5.872139 | {
"github_metadata": {
"branch": "main",
"commit_count": 292,
"repo_created_at": "2023-11-19T16:25:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6478c3a617... |
f6056a24-a0d5-43b0-bb3f-13d8111c8ca8 | sanjana098/c-plus-plus-programs | CodeChef/SNCKPB17/sncoup.cpp | #include <bits/stdc++.h>
using namespace std;
int findType(char a, char b) {
if(a == '.' && b == '.')
return 0;
if(a == '.' && b == '*')
return 1;
if(a == '*' && b == '.')
return 2;
return 3;
}
int main() {
// https://www.codechef.com/SNCKPB17/problems/SNCOUP
int t;
cin>>t;
long long int n, i;
char ... | ALGO | 0.999646 | 3.57766 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2016-04-17T09:44: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": "557e2119c... |
eff9d2a6-f664-4af0-b683-80582212b831 | FACOMpetindo/codeforces | Contests oficiais/1026/a.cpp | #include <bits/stdc++.h>
#define FOR(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define F first
#define S second
#define inf 10e9
#define MAX 1e5
#define endl "\n"
#define ll long long
using namespace std;
void solve() {
int n;
... | ALGO | 0.999637 | 4.624279 | {
"github_metadata": {
"branch": "main",
"commit_count": 39,
"repo_created_at": "2024-01-08T04:59:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c4e7cfb3378... |
74f8755a-92c0-4db5-bd97-1b9edabd32b1 | tRowans/JITdecoding-public | src/decoderToric.h | #ifndef DECODER_H
#define DECODER_H
#include "toricCodeSlice.h"
#include "decoderGeneric.h"
#include "PerfectMatching.h"
#include <map>
#include <iostream>
vint taxi(int v1, int v2, int L);
vvint prePath(int v1, int v2, int L);
vint shortestPath(int v1, int v2, int L, vint &syndIndices);
void sweepRule(vint &qubit... | ALGO | 0.998471 | 5.047714 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-01-31T07:34:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba18bc2fec41... |
8f1ad3a8-808c-4c48-a809-09daf63fd2bb | paolosgit/Calculator_cpp | RPN.cpp | //
// Created by <NAME> on 2/15/23.
//
#include "RPN.h"
#include <cmath>
#include <queue>
RPN::RPN() {
}
void RPN::calculate(const std::string &expression) {
for (int i = 0; i < expression.size(); ++i) {
if (is_number(expression.substr(i,1))){
int stringNumasInt = std::stoi(expression.subst... | ALGO | 0.99729 | 5.14045 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-04-14T18:02:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b9adde38c82... |
a246fe1c-3533-4f12-82ea-ebb2e5775ef4 | alexandraback/datacollection | solutions_5646553574277120_1/C++/HolkinPV/main.cpp | #pragma comment(linker, "/stack:128000000")
#include <algorithm>
#include <iostream>
#include <cassert>
#include <iomanip>
#include <climits>
#include <utility>
#include <cstring>
#include <complex>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <bitset>
#include <string>
#include <queue>
#include <st... | ALGO | 0.999869 | 3.23803 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "93fd40465... |
2ad7ef35-d755-4f5b-8b4f-4719ea99c905 | ayushyadu25/oops | Practise/bubbleSortTemplate.cpp | <<<<<<< HEAD
#include<iostream>
using namespace std;
template <class T> void bubbleSort(T a[], int n)
{
for (int i = 0; i < n - 1; i++)
for (int j = n - 1; i < j; j--)
if (a[j] < a[j - 1])
swap(a[j], a[j - 1]);
}
int main(){
int arr[]={1,5,4,3,2};
int n = sizeof(arr)/si... | ALGO | 0.999188 | 4.857466 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2024-12-02T08:23: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": "7fa8730ea50... |
3905f4d0-904d-44cd-9f29-1482d5bfb4df | 8adam95/problems | spiew.cpp | //http://main.edu.pl/pl/archive/oig/6/spi
#include<cstdio>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<cstring>
#include<algorithm>
using namespace std;
#define REP(I, N) for(int I = 0; I < (N); I++)
#define FOR(I, A, B) for(int I = (A); I <= (B); I++)
#define FORD(I, A, B... | ALGO | 0.999789 | 3.138525 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2015-08-26T22:39:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7b3bebb... |
3f2e66ee-5285-4579-b7c1-32df6e90a9f2 | rcxr/problems | codeforces/rcxr/c931D/src/cpp/main.cpp | // http://codeforces.com/contest/931/problem/D
#include "bits/stdc++.h"
#include <unordered_map>
int main() {
// Reading number of branches
int n;
std::cin >> n;
// This stores the distance to the root
std::vector<int> depths(n);
// This counts the instances of the different depths
std::unordered_map<i... | ALGO | 0.99992 | 3.868547 | {
"github_metadata": {
"branch": "master",
"commit_count": 150,
"repo_created_at": "2011-10-21T02:26:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a80df7c1... |
f13eae9c-d149-464c-aa93-7c7cc24920ec | b0ttas/academic-projects-estgp | poo-graphic-plot-app/TP_POO/TP_POO/Internos.cpp | #include "Internos.h"
using namespace std;
LinkedList int_lst;
void Internos::getFunc(int ch, int p, double freq, double a, double vert_off)
{
x = 0; //ponto inicial na escala temporal
double const pi = 3.14;
if (ch == 0) //sin
{
for (int i = 0; i < 114; i++)
{
double ang_freq;
ang_freq = freq * 2 * p... | TOOL | 0.946492 | 4.48254 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-02-09T17:30: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": "f0a95dd56... |
22f48124-e0c1-457b-bfca-cfe78f50766f | raul19ra/Fundamentos-de-Algoritmia | Rescate aereo/Source.cpp | #include <iostream>
#include <vector>
using namespace std;
void resuelve(const vector<int>& a,const int & nav,const int & N, int& ini, int& fin) {
int i = 0;
ini = -1;
fin = -1;
while (a.at(i) < nav && i < N) {
i++;
}
for (int j = i + 1; j < N; j++) {
if (a.at(j) >= nav) {
if ((fin - ini) < (j - i)) { ini... | ALGO | 0.99993 | 3.915175 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-01-30T16:20: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": "c49b0a808191... |
991add1f-d82b-4e8d-b24c-ad074362404a | shybovycha/road-ribbon | road_ribbon/plainroadbuilder.cpp | #include "plainroadbuilder.h"
double sec(double x)
{
return 1.0 / cos(x);
}
PlainRoadBuilder::PlainRoadBuilder(QVector<SkeletonCenter> _centers, float roadWidth)
{
if (_centers.size() < 3)
{
qDebug() << QString("Given %1 centers. That's not good - we can't build road that simple.").arg(_centers.si... | TOOL | 0.940939 | 3.875868 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-01-09T21:38:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed45b5360... |
12e7be61-d0db-47e9-98ae-67baabeab35a | lang710/Ford-Fulkerson | ford_fulkerson.cpp | #include <iostream>
#include <vector>
using namespace std;
void ford_fulkerson(int g_size,int **graph,int s,int t){
//cout<<"start"<<endl;
int **remain,**flow;
remain=new int*[g_size];
flow=new int*[g_size];
int i,j;
for(i=0;i<g_size;i++) {
remain[i] = new int[g_size];
flow[i] =... | ALGO | 0.999858 | 3.612804 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-04-08T15:02: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": "f656010097... |
89289265-5405-401f-b835-4b1b2e03a99a | Adityazero4/CPP-DSA | 4_Array/33_max_sum_of_k.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution
{
public:
// Function to find maximum of each subarray of size k.
vector<int> max_of_subarrays(int *arr, int n, int k)
{
// your ... | ALGO | 0.999825 | 6.303797 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-06-26T09:37: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": "4d264f22fd1d... |
8d8fab1e-3818-43a4-bd37-f60b873f27cb | sammochen/cp-submissions | uva/10721.cpp | /*
Original problem:
Author: sammochen
*/
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define REP(x,l,u) for(ll x = l;x<u;x++)
#define RREP(x,l,u) for(ll x = l;x>=u;x--)
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
string to_string(string s) {return s;}
s... | ALGO | 0.999882 | 4.351308 | {
"github_metadata": {
"branch": "master",
"commit_count": 1396,
"repo_created_at": "2019-07-26T21:44: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": "c359a10... |
e94621f9-e2e8-4561-9040-2c38c408fcbe | Ahad-Rajput/DSA_in_C- | Stack/test_02.cpp | #include <iostream>
using namespace std;
struct node{
int data;
node* next;
};
class stack{
public:
node* head;
stack(){
head = NULL;
}
void push(int data){
node* new_node = new node;
new_node->data = data;
new_node->next = head;
head = new_node;
}
... | ALGO | 0.96335 | 4.844683 | {
"github_metadata": {
"branch": "main",
"commit_count": 70,
"repo_created_at": "2025-01-06T11:48: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": "e97dfed37cf... |
7c605be6-f0e5-4a62-bcb0-0150d405ed6e | gvyogeesh/dsa_2018 | list/single_llist.cpp | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
ListNode *insert(ListNode *head, int ele){
ListNode *tmp=new ListNode(ele);
tmp->next = head;
return tmp;
}
ListNode *insert_end(ListNode *head, int ele){
... | ALGO | 0.999359 | 4.156091 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2018-04-15T16:55:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 18,
"pull_requests": 0
},
"file_meta": {
"content_id": "472f96be... |
db578784-a6cc-40c4-a88f-67d5c923cd83 | lijwen2748/aaltaf | ltlparser/ltlf2ltl/ltlf2ltl.cpp | /*
* added by <NAME> on December 20th, 2014
* translate ltlf formulas to LTL formulas
*/
#include "ltlf2ltl.h"
#include <stdlib.h>
#include <stdio.h>
#include <set>
using namespace std;
using namespace aalta;
#define MAXN 1000000
ltl_formula* ltlf2ltl (ltl_formula *f)
{
if (f == NULL)
return NULL;
ltl_form... | ALGO | 0.994593 | 4.071712 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2018-08-23T22:16:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 6,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "765468a50c... |
0a161566-b1f0-4cdb-899e-d7c64e23417e | Rafiduzzaman/Visualize_NFA_DFA | DFA_Program_code.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
while (true) {
int dfa_current_state;
int dfa_current_input;
cout << "Enter initial state (0-9): ";
cin >> dfa_current_state;
if (dfa_current_state < 0 || dfa_current_state > 9) {
cout << "Invalid initi... | ALGO | 0.99459 | 4.974194 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-10-04T03:50: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": "99e281569027... |
112c8964-38c7-48a9-af0b-5b520de43906 | GovindKumar26/Leetcode_Submissions | Difficulty: Medium/Rod Cutting/rod-cutting.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
int memo(int i, int N, int price[],vector<vector<int>>&dp){
if(i==0) return N*price[0];
if(dp[i][N]!=-1) return dp[i][N];
int notTake = memo(i... | ALGO | 0.999747 | 5.487313 | {
"github_metadata": {
"branch": "main",
"commit_count": 1284,
"repo_created_at": "2024-08-03T13:03: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": "9d7af8736... |
f6da219b-0816-4914-ada4-5f2aee0be2bc | OwaisK4/Competitive-Programming | Codeforces/B_Large_Array_and_Segments.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define all(a) a.begin(), a.end()
#define vi vector<int>
#define seed chrono::high_resolution_clock::now().time_since_epoch().count()
#define file_read(filepath) freopen(filepath, "r", stdin);
#d... | ALGO | 0.999917 | 4.968579 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-04T18: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": "0428b1351374... |
6c800036-9934-4dfa-bf33-6d8c1694ff78 | Bpbishal/Compiler-Design | main.cpp | #include <iostream>
#include <fstream>
#include <stdlib.h>
#include <string.h>
using namespace std;
bool is_keyword(char buffer[])
{
char keywords[32][10] = {"auto", "break", "case", "char", "const", "continue", "default",
"do", "double", "else", "enum", "extern", "float", "for", "got... | ALGO | 0.996973 | 3.409698 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-05-04T12:29: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": "8b29c251c7d6... |
3ba8df5d-8de0-4b29-9506-88ffab7d654d | Vequis/Competitive-Programming | CF/ER86/A2025.cpp | #include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define sz(x) (int)(x).size()
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define all(x) (x).begin() , (x).end()
#define fs first
#define sc second
#define ii pair<int, int>
#define vii vector<ii>
#define ... | ALGO | 0.999893 | 4.152672 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2024-02-01T16:09:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e43f229035... |
46a5e984-35df-4f59-9565-d638d93b97aa | ncbi/ncbi-cxx-toolkit-public | include/algo/phy_tree/tree_to_dist_mat.hpp | #ifndef ALGO_PHY_TREE___TREE_TO_DIST_MAT__HPP
#define ALGO_PHY_TREE___TREE_TO_DIST_MAT__HPP
/* $Id$
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/d... | ALGO | 0.965755 | 6.55961 | {
"github_metadata": {
"branch": "main",
"commit_count": 103944,
"repo_created_at": "2021-07-26T19:41:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 73,
"forks": 35,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e41d1... |
944c611b-8e27-48d1-bdad-dd69a6c368d3 | vanshaj2000/Codeforces | Practice/DP/C1_Skyscrapers_easy_version_.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define int long long int
int getMin(vector<int> &a,vector<int> &t,int ss,int se,int qs,int qe,int index)
{
if(qs<=ss&&qe>=se)
return t[index];
if(se<qs||ss>qe)
ret... | ALGO | 0.999994 | 3.901514 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2021-02-15T20:27: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": "891409b088a... |
a08adabe-745f-40ae-b786-e382b55bbfd3 | YoshiPark/code_exercise | leetcode/127. Word Ladder/127. Word Ladder/Solution.h | #include <iostream>
#include <queue>
#include <string>
#include <unordered_set>
using namespace std;
class Solution {
public:
int ladderLength(string beginWord, string endWord, unordered_set<string>& wordList) {
if (beginWord.size() != endWord.size()) return 0;
if (beginWord.empty() || endWord.empty()) return 0; ... | ALGO | 0.999956 | 5.055059 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2016-09-04T16:48:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8b2119b7d... |
46cf4397-3bc4-4cb0-bd2d-d038f9719cef | rjenez/W266-final-project | data/programming-homework-dataset-plagiarism-detection/src/B2017/Z1/Z4/student4644.cpp | /*B 2017/2018, Zadaća 1, Zadatak 4
NAPOMENA: ulaz/izlaz za zadatke je specificiran
javnim autotestovima. Zalbe za ne analiziranje testova
se ne uvazavaju!
NAPOMENA: nece svi (javni) testovi sa zamgera biti
dostupni na c9.
Za sva ostala pitanja i nedoumice vezane za
autotestove javiti se na email: <EMAIL>.... | ALGO | 0.994446 | 4.011531 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2022-02-09T00:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d366610f1... |
b602e9a1-6898-453d-8b0f-6726376437e2 | wsyzxxxx/LeetcodeGOGOGO | 1428. Leftmost Column with at Least a One - Medium - Pass/cpp.cpp | /**
* // This is the BinaryMatrix's API interface.
* // You should not implement it, or speculate about its implementation
* class BinaryMatrix {
* public:
* int get(int row, int col);
* vector<int> dimensions();
* };
*/
class Solution {
private:
int searchFirstOne(BinaryMatrix &binaryMatrix, int... | ALGO | 0.999678 | 6.13243 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2019-07-06T03:46: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": "4566e434d... |
dc011145-af73-4d9d-9108-3b535910e086 | EfremovEgor/cpp_labs | lab2/utilities.cpp | #include <vector>
#include <stdexcept>
#include <string>
using namespace std;
const vector<string> DEMO_NAMES{"James", "Robert", "John", "Michael", "David", "William", "Richard", "Joseph", "Thomas", "Christopher"};
const vector<int> DEMO_MARKS{45, 16, 87, 7, 79, 3, 7, 87, 82, 66};
const vector<string> NAME_SAMPLE{"Adam... | ALGO | 0.998963 | 5.250398 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-10-22T11: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": "4d831fe70ff2... |
e9e13a32-a272-4a6d-95f6-7aac82042fce | Mulab11/cntt2016-hw1 | TC-SRM-554-div1-500/zzx.cpp | /* Copyright 2016 AcrossTheSky */
#include <iostream>
#include <cstdio>
#include <utility>
#include <cassert>
#include <map>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <ctime>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <sstream>
#include <bitset>
#... | ALGO | 0.99999 | 4.453514 | {
"github_metadata": {
"branch": "master",
"commit_count": 4450,
"repo_created_at": "2016-09-28T13:04:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 28,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "27f9d... |
83eb67f3-0ac5-4ef3-bff6-bebb7b0dcbbf | only1ahmed/OOP-assignment-1 | A1_P1_A_20210046_20210508_20210524.cpp | #include "A1_P1_A_20210046_20210508_20210524.h"
BigDecimalInt ::BigDecimalInt() {}
//--------------------------------------------------------------------------------------------------------------------------------
BigDecimalInt::BigDecimalInt(string value_of_number) // setting the number and its size
{
try
{... | ALGO | 0.982393 | 4.142225 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2022-10-05T17:07:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "2cd2414aaae... |
5d32d71b-cbbb-4f8e-831b-3fd3d69b7cad | TomNewbie/DSA_GroupExercise | Exercise_HashTable/linearProbing.cpp | #include <cmath>
#include <iostream>
#include <list>
#include <string>
using namespace std;
struct phoneData {
string name;
string phoneNumber;
phoneData(string name, string phoneNumber) : name{name}, phoneNumber{phoneNumber} {}
};
template <int N>
class HashMap {
private:
// phoneData data;
phoneD... | ALGO | 0.996032 | 4.140195 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2022-03-07T08:04: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": "adff6312523... |
cff33f3c-02b0-4586-8fec-b122e34dc5e2 | Monam1083/Hotel-Management-system-project-Using-C-with-Data-structure | Hotel management system.cpp | #include<iostream>
using namespace std;
class Hotel{
private:
struct Node
{
int id,date;
string name,roomtype;
Node* next;
};
public:
Node* head = NULL;
void insert();
void menu();
void update();
void search();
void del();
void sort();
void show();
};
void menu()
{
p:
int ch... | TOOL | 0.991389 | 3.088594 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-05-01T08:58: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": "10a0439064b1... |
518568e5-e6e1-4137-a39a-2ff7a882f48f | Prasansa-Mapara/DSA-for-coding-interviews | K largest elements - GFG/k-largest-elements.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to return k largest elements from an array.
vector<int> kLargest(int arr[], int n, int k)
{
priority_queue<int> pq; //max-heap;
for(int i=0; i<n; i++){ //O(... | ALGO | 0.999958 | 6.252999 | {
"github_metadata": {
"branch": "main",
"commit_count": 1432,
"repo_created_at": "2022-03-12T11:28: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": "7b4e647e4... |
d7f84b90-a605-4cbd-86a7-bfb08c7d876f | FattakhovRamil/SmartCalc_v2.0 | src/Model/model.cc | #include "model.h"
namespace s21 {
Model::Model(const std::string expression) {
mathExp = expression;
std::vector<Node> myStack;
std::vector<Node> Ready;
std::vector<Node> Support;
}
int Model::CalceDeposit(double sumVkald, int srok, double procentStavka,
double nalogStavka, int peri... | ALGO | 0.98595 | 4.827033 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-01-09T14:37: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": "e1ef552eb6d0... |
9ec3d769-340e-416b-9349-e34b9e3099b2 | SongHayoung/LeetCode | 0081-search-in-rotated-sorted-array-ii/0081-search-in-rotated-sorted-array-ii.cpp | class Solution {
bool recursiveBinarySearch(vector<int>& nums, int start, int end, int target) {
if(start + 1 >= end)
return nums[start] == target || nums[end] == target;
int mid = (start + end)>>1;
if(nums[start] < nums[mid] && nums[start] <= target && target <= nums[mid])
... | ALGO | 0.999995 | 6.121997 | {
"github_metadata": {
"branch": "master",
"commit_count": 13354,
"repo_created_at": "2021-01-06T12:46:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f23cc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.