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 |
|---|---|---|---|---|---|---|---|
a625baea-973f-483b-aa8b-7b108b3cf8d9 | tupieurods/SportProgramming | Div1/CR223/CR223_C/main.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
using namespace std;
struct node
{
int answer, outOpen, outClose;
};
int len, m;
char str[1000009];
node tree[(1 << 21) + 9];
node empty;
void ReadData()
{
scanf("%s%*c", str);
len = strlen(str);
scanf("%d", &m);
}
node update(... | ALGO | 0.999967 | 3.822842 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2014-01-10T11:56: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": "492032c96... |
2ae821b4-78cd-44ab-91ef-4d959f527376 | rohitkotha10/CC | codeforces/1800A.cpp | /*
author: rohitkotha10
created: 04.03.2023 01:33:23
*/
#include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0)
#define int long long
const int MAX = 2e5 + 5;
const int MOD = 1e9 + 7;
void solve() {
int n;
cin >> n;
string s;
cin >> ... | ALGO | 0.999934 | 5.242718 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2022-12-23T23:59: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": "5a0e4d7a61a... |
7736be35-0db8-49f3-99fc-21820e9e0c0d | strin/sorv | sorv.cpp | #include "sorv.h"
#include "stdio.h"
#include "math.h"
double sorv(int n, Oracle oracles[], int C, double epsilon) {
if(n == 0) return -1;
double Q = 1+epsilon/n;
/* compute \Delta */
double delta = 1;
for(int i = 0; i < n; i++)
delta *= (*oracles[i])(0,0);
int s = ceil(log(1/delta)/log(Q));
double *T[n];
f... | ALGO | 0.999996 | 3.973734 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-02-07T03:39: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": "5fbef85479... |
b87c268c-23d3-4596-8e49-a23fefae5591 | wkdgns135/Algorithm | 백준/Gold/20040. 사이클 게임/사이클 게임.cc | #include <bits/stdc++.h>
using namespace std;
// Union-Find 자료구조를 위한 parent와 depth 배열
vector<int> parent, depth;
// Find 연산 (경로 압축 적용)
int Find(int x) {
if (parent[x] != x) {
parent[x] = Find(parent[x]);
}
return parent[x];
}
// Union 연산
bool Union(int x, int y) {
int rootX = Find(x);
int... | ALGO | 0.999977 | 4.542698 | {
"github_metadata": {
"branch": "main",
"commit_count": 549,
"repo_created_at": "2024-08-15T07:32: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": "2bb82126f6... |
0399db9d-edd6-4111-978f-d821e6492c44 | harsh-solanki21/SI21-CP-MERN | CP (GFG, Leetcode, CodeChef, CSES, etc.)/sleepCycle.cpp | #include<bits/stdc++.h>
using namespace std;
bool sleepCycle(vector<int> v, int h) {
for(int i=0; i<v.size(); i++) {
if(h-v[i] <= 0)
return true;
else
h = pow(2,i+1)*(h-v[i]);
}
return false;
}
int main() {
ios_base::sync_with_stdio(false);
... | ALGO | 0.999921 | 3.885994 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2021-06-03T11:23: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": "59936b049... |
9ce34b94-0d05-4e05-a3e1-17177a93c90a | ArtistDeveloper/ALSS | sangyu/baekjoon/DataStructure2/7662.cpp | //#include<iostream>
//#include<queue>
//#include<algorithm>
//using namespace std;
//
//int main()
//{
//
// ios_base::sync_with_stdio(false); cin.tie(0);
// int n;
// cin >> n;
//
// for (int i = 0; i < n; i++)
// {
// // 테스트케이스
// vector<long long> vec1;
// vector<long long> vec2;
// int cnt = 0;
//
// pri... | ALGO | 0.999822 | 4.68849 | {
"github_metadata": {
"branch": "main",
"commit_count": 265,
"repo_created_at": "2022-06-04T14:03:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a605e36d9b... |
1c5f3ae3-01d3-43ed-b72e-9560b3585e69 | mohammedjasam/Technical-Interview-Guide | LeetCode/leetcode_relative-ranks.cpp | /*
*
* Tag: Data Structure
* Time: O(nlogn)
* Space: O(n)
*/
class Solution {
public:
vector<string> findRelativeRanks(vector<int>& nums) {
vector<string> ans;
if(nums.size() == 0)
return ans;
map<int,int> rank;
ans.resize(nums.size());
int rank_val = nums.size();... | ALGO | 0.999974 | 5.764853 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2017-04-01T19:15:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 110,
"forks": 34,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "475ae1... |
efd256ae-63aa-49b7-926d-fda4eac51476 | LuigiAltamura/qmaestro | cost-model/include/dataflow-analysis/DFA_cluster-unit.hpp | /******************************************************************************
Copyright (c) 2019 Georgia Instititue of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restricti... | ALGO | 0.931647 | 6.596364 | {
"github_metadata": {
"branch": "create-custom-accelerator-per-layer",
"commit_count": 156,
"repo_created_at": "2024-04-16T10:11:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": ... |
58d90ca9-8d86-410a-b2e6-3187b66c202f | markods/MyFilesystem | source/traversal.cpp | // _____________________________________________________________________________________________________________________________________________
// TRAVERSAL...TRAVERSAL...TRAVERSAL...TRAVERSAL...TRAVERSAL...TRAVERSAL...TRAVERSAL...TRAVERSAL...TRAVERSAL...TRAVERSAL...TRAVERSAL...TRAVERSAL
// ___________________________... | ALGO | 0.996996 | 4.988086 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2020-04-19T20:30: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": "90c394f4986... |
6c80774a-5a14-498f-a771-78489f7c98cd | ahmadradmehr/Assorted-CPP-Problems | ValidateBinarySearchTree.cpp | /* Validate Binary Search Tree
*
* Given a binary tree, determine if it is a valid binary search tree (BST).
* Assume a BST is defined as follows:
* The left subtree of a node contains only nodes with keys less than the node's key.
* The right subtree of a node contains only nodes with keys greater than the node'... | ALGO | 0.999995 | 7.022999 | {
"github_metadata": {
"branch": "master",
"commit_count": 229,
"repo_created_at": "2020-05-03T18:19: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": "dc52f501... |
ddcfcf98-a362-45bd-979f-33017736a633 | ay2306/Competitive-Programming | codeChef/INT_XOR.cpp | /*
____________________________________________________________
| |
| Author: ay2306 |
|____________________________________________________________|
*/
#include <bits/stdc++.h>
#define MOD 1000000007
#define test i... | ALGO | 0.999777 | 3.064347 | {
"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": "dac5944f0... |
346d2bfa-dcc1-490b-a52f-c7120843c9bf | Bogdanisar/TO-MatrixOps-SimplexAlgorithm | common/simplex.cpp | #include "simplex.h"
#include <limits>
#include <set>
using ld = long double;
using namespace std;
const long double EPS = 1e-10;
const long double LARGE_VALUE = 1e4;
enum class PivotResult {
NO_SOLUTION, OPTIMAL_SOLUTION, INFINITE_SOLUTION, FOUND_PIVOT
};
// metode comune si pentru simplex primal si pentru... | ALGO | 0.999931 | 4.426886 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2020-04-24T20:32: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": "1475202f4... |
08690981-8e36-45ce-8711-7d7fe0e29cb7 | bqmnhat/CompetitiveProgramming | CSES/EditDistance/main.cpp | #include <iostream>
#include <bits/stdc++.h>
#define MaxN 5000
using namespace std;
int t, dp[MaxN+1][MaxN+1];
string A, B;
int Solution() {
dp[0][0] = 0;
int lenA = A.length(), lenB = B.length();
for (int i=0; i<=lenA; i++) {
for (int j=0; j<=lenB; j++) {
if ((i == 0) && (j == 0))
... | ALGO | 0.99998 | 4.397902 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-10-28T06:45: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": "b271b6eb454... |
89404ec5-8a3c-4598-a131-1c52d8ec826b | n3rm4121/DSA-in-Cpp | binary_trees/binarySearchTree/deletionOperation.cpp | #include <iostream>
#include <queue>
using namespace std;
class Node {
public:
int data;
Node* left;
Node* right;
Node(int data) {
this->data = data;
left = nullptr;
right = nullptr;
}
};
Node* minNode(Node* root) {
Node* temp = root;
while (temp->left != nullptr) ... | ALGO | 0.999994 | 4.89098 | {
"github_metadata": {
"branch": "main",
"commit_count": 64,
"repo_created_at": "2023-10-02T10:35: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": "9e6a057d9b2... |
e91ea486-18d8-4d45-8efa-ed0f5137bef6 | edisonhello/waynedisonitau123 | Contest/AsiaPacific/Singapore2018/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int magic = 15;
const int maxn = 1e6 + 5;
int a[maxn], n, k;
bool check2(int x) {
for (int i = 0; i < n; ++i) {
int c = 0, s = 0;
for (int j = i, k = 0; k < n; ++k, j = (j + 1) % n) {
c |= a[j];
if ((c & x) == x) {
... | ALGO | 0.999965 | 3.908885 | {
"github_metadata": {
"branch": "master",
"commit_count": 411,
"repo_created_at": "2017-08-26T10:17:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bef8b8... |
5f0dad25-11c0-4355-a566-290979786ea0 | rHermes/contests | codeforces/1935/c1935pC.cpp | #include <iostream>
#include <map>
#include <set>
#include <vector>
#include <cinttypes>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <queue>
using UT = std::uint64_t;
using ST = std::int64_t;
void solve() {
UT N = 0;
UT L = 0;
std::cin >> N >> L;
std::vector<std::pair<UT,UT>> ... | ALGO | 0.99995 | 4.527189 | {
"github_metadata": {
"branch": "master",
"commit_count": 416,
"repo_created_at": "2018-03-10T19:49:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0ae69088... |
db7b2a0e-6fd8-464d-a7fd-f90376362623 | garimasrivastavaa/dsaqueens | Contests/11.cpp | //Number of Operations to make network connected
#include <iostream> #include <iostream>
#include <vector>
class UnionFindAns {
public:
std::vector<int> parent, rank;
UnionFindAns... | ALGO | 0.999581 | 5.42021 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2023-11-19T17:42: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": "ce07c60fe85... |
3ec22f11-00e1-4211-8168-0342b131e422 | danielf/lib-puc-icpc | karatsuba.cpp | #include <string.h>
int aux[16][3][100010]; // First dimension should be log_2(MAX_DEGREE)
// third should be (2 * MAX_DEGREE)
int MOD; // All operations are done % MOD. Define the MOD
const int LIM = 35; // Magical constant, in case of TLE try playing with it
// It assumes that r[] is initial... | ALGO | 0.999973 | 4.341256 | {
"github_metadata": {
"branch": "master",
"commit_count": 35,
"repo_created_at": "2011-10-18T22:30:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6e62d3fd9... |
7386037c-08c2-4d93-ab05-7e80d5c18c8d | PaoPaoRobot/ygz-slam | src/visual_odometry.cpp | #include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <boost/format.hpp>
#include "ygz/system.h"
#include "ygz/visual_odometry.h"
#include "ygz/optimizer.h"
#include "ygz/memory.h"
#include "ygz/ORB/ORBExtractor.h"
#include "ygz/tracker.h"
#include "ygz/feature_detector.h"
#include "y... | TOOL | 0.978737 | 5.898334 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2016-10-31T09:49:38.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 255,
"forks": 110,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f2034... |
7cd1b168-4eab-4f4d-8974-6e84b34e0d1b | eliottham/actor_bst | BST.hpp | /*
* Overview of code: This is the BST class in which we implement the functions
* to insert nodes of the BST, find specific nodes, find the size of the BST,
* find the height of the BST, and to check if it is empty.
*/
#ifndef BST_HPP
#define BST_HPP
#include "BSTNode.hpp"
#include "BSTIterator.hpp"
#include <ios... | ALGO | 0.997788 | 5.358023 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-12-03T01:41: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": "493629f46c... |
1602712e-7633-47f2-9125-2cb204145859 | deciduously/SDEV340 | Week5/pc1.cpp | /*
* SDEV 340 Week 5 Problem 1
* Write an iterative factorial function and demonstrate with user-given input
* <NAME>
*/
#include <iostream>
class IterativeFactorial
{
// Value to compute
unsigned int n;
// Maximum value user can input
static const unsigned int MAX;
public:
// Default constructor... | ALGO | 0.999741 | 6.059866 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-08-29T00:03: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": "75e121d34... |
686dd66f-fc71-4249-80fc-c4a3c835ad66 | Transurgeon/Euler-JaneStreet | Jane-Street/2023-06/June-2023.cpp | // code for the June 2023 Jane Street puzzle
#include <iostream>
#include <utility>
#include <stack>
#include <vector>
#include <array>
#include <queue>
#include <numeric> // For gcd function
using namespace std;
typedef std::array<std::array<int, 5>, 5> grid;
const std::vector<int> col_gcds = {1, 1, 5, 4};
const st... | ALGO | 0.999302 | 6.305066 | {
"github_metadata": {
"branch": "master",
"commit_count": 89,
"repo_created_at": "2021-08-26T03:28:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c66f0423... |
1440c943-4c7b-4e55-a583-dedbca2a9949 | Lyq322/Coding-Solutions | USACO/Old Silver/2007-2008/Feb/dine.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
vector<int> arr;
cin >> N;
int a;
for (int i = 0; i < N; i++) {
cin >> a;
arr.push_back(a);
}
int dp1[30001][4];
int dp2[30001][4];
for (int i = 0; i <= N; i++) {
for (int j = 0; j < 4; j++) {
dp1[i][j] = -1;
dp2[i][j] = -1;
}
}
... | ALGO | 0.999984 | 3.871719 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2022-05-31T20:18:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9bb02a9ba8... |
4ae1bcc5-c168-4a6c-8ac8-5707007a3d40 | abdirakhman/Olymp | Codeforces/507/B/typa_main.cpp | /**
<KEY>
*/
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue... | ALGO | 0.999979 | 3.122643 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-10-02T05:57: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": "3da974d2d... |
be966ec8-d99a-4bcd-b941-700776a12cab | doublechenching/UltrasondConfienceMap | cpp/ConfidenceMapCpp/RandomWalks2D.cpp | #include "RandomWalks2D.h"
void RandomWalks2D::setMatrix2D(const std::vector<double> * matrix, int rows, int cols)
{
this->matrix = matrix;
this->rows = rows;
this->cols = cols;
this->numel = rows*cols;
}
void RandomWalks2D::assembleLaplacianEdges()
{
//const T epsilon = std::numeric_limits<T>::epsilon(); // Num... | ALGO | 0.998576 | 5.334806 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-10-17T07:25:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 4,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "985a7c269... |
14180abe-9811-4355-998d-52e9da63fe09 | ycui1/python_how_to | taskier_app/taskier-env/lib/python3.10/site-packages/pyarrow/include/arrow/compute/exec/key_compare.h | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... | TOOL | 0.9204 | 7.253542 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2022-05-13T00:09:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 23,
"forks": 17,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "f7899a0... |
6e2f30c6-30aa-4972-b436-e1b86897c7f6 | AngryCaveman/C-Struct | 01顺序线性表/listSort/listSort/listsort.cpp | /*线性表顺序结构*/
#include"listsort.h"
#define Max 10 //顺序表最大长度
#define Ok 1;//操作成功
#define Error 0;//操作失败
typedef int Statu;//顺序表操作状态回复
typedef int ElemType;//typedef 声明一个int类型
typedef struct
{
ElemType data[Max];//数据
int length;//长度
}SqList;
//输入顺序表
void ListPrint(SqList l)
{
int i;
for (i = 0; i<l.length; i++)
{
co... | ALGO | 0.960971 | 3.891638 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-05-27T13:25:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb69ecf6a... |
10efe69f-fa59-4c12-9b90-11401fbb4e54 | ermolaevv/ppc-2024-autumn | tasks/seq/dormidontov_e_min_value_by_columns_seq/src/ops_seq.cpp | #include "seq/dormidontov_e_min_value_by_columns_seq/include/ops_seq.hpp"
#include <climits>
#include <thread>
bool dormidontov_e_min_value_by_columns_seq::TestTaskSequential::pre_processing() {
internal_order_test();
rs = taskData->inputs_count[0];
cs = taskData->inputs_count[1];
input_.resize(rs, std::vect... | TEST | 0.968241 | 6.904955 | {
"github_metadata": {
"branch": "master",
"commit_count": 440,
"repo_created_at": "2024-10-04T18:18:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 157,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1df2e7... |
3b2ec9f0-2b24-4282-b05b-e55214beb62d | Seathe14/IPC-Lab-Operating-Systems | Mailslots/MailslotServer/MSlotServer/MSlotServer.cpp | // MSlotServer.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <windows.h>
#include <vector>
#include <ctime>
#include <thread>
#include <mutex>
HANDLE g_hSlot;
HANDLE g_hChildSlots[2];
HANDLE g_hMutex;
LPCTSTR SlotName = TEXT("\\\\.\\mailslot\\mym... | TOOL | 0.981279 | 4.234602 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-11-12T16:38: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": "956969d425... |
7da3a6af-fbd9-4189-89d6-38c272f65da2 | TeshShin/Algorithm_solved | 백준/Gold/1043. 거짓말/거짓말.cc | #include <iostream>
using namespace std;
// 자신의 그룹이 어디에 속해있는지 리턴
int find_p(int parent[], int x){
if(x != parent[x])
return parent[x] = find_p(parent, parent[x]);
else
return parent[x];
}
// x와 y를 같은 그룹으로 만들어줌
void mer(int parent[], int x, int y){
int px = find_p(parent, parent[x]);
int ... | ALGO | 0.999803 | 3.377923 | {
"github_metadata": {
"branch": "main",
"commit_count": 167,
"repo_created_at": "2024-03-06T07:54: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": "873f9beb74... |
2978cb2f-3b32-4971-ac94-0a3365967aa1 | erf-model/ERF | Exec/DryRegTests/ParticlesOverWoA/ERF_Prob.cpp | #include "ERF_Prob.H"
#include "ERF_EOS.H"
#include "ERF_TerrainMetrics.H"
using namespace amrex;
std::unique_ptr<ProblemBase>
amrex_probinit(
const amrex_real* /*problo*/,
const amrex_real* /*probhi*/)
{
return std::make_unique<Problem>();
}
Problem::Problem()
{
// Parse params
ParmParse pp("prob");... | ALGO | 0.995446 | 6.176736 | {
"github_metadata": {
"branch": "development",
"commit_count": 4057,
"repo_created_at": "2020-10-21T21:05:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 40,
"forks": 52,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "a... |
a134c283-9258-4dc5-8723-4b43b7228379 | prashobh4657/Learning_Coding | AV/Recursion/print_subsets.cpp | #include<bits/stdc++.h>
using namespace std;
/* if in this program we have a string having duplicate characters like bbcc then its subsets will be printed
as if there are four distinct characters like b1 , b2, c1, c2 and hence its some subsets will printed more than once
to avoid this thing please another progra... | ALGO | 0.999895 | 3.938823 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2022-12-18T03:56:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a160733e94... |
a51bd073-7058-4020-aa57-ad8a29133d19 | rtreale/Problemas-Beecrowd | 1 - INICIANTE/C++17/1548.cpp | #include <iostream>
using namespace std;
int main() {
int casosdetestes;
cin >> casosdetestes;
cin.ignore();
while(casosdetestes!=0) {
int alunos;
cin >> alunos;
int vetornotas[alunos];
int vetoraux[alunos];
for(int i=0;i<alunos;i++) {
cin >> vetornotas[i];
vetoraux[i] = vet... | ALGO | 0.999093 | 3.639174 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2023-08-19T00:39: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": "84640bafa8... |
124ef922-9d83-400a-818c-36f3e3e1fd98 | pipo-chen/mooc-datastruct | data-struct/04-树7 二叉搜索树的操作集/main.cpp | #include <iostream>
typedef int ElementType;
typedef struct TNode *Position;
typedef Position BinTree;
struct TNode{
ElementType Data;
BinTree Left;
BinTree Right;
};
void PreorderTraversal( BinTree BT ); /* 先序遍历,由裁判实现,细节不表 */
void InorderTraversal( BinTree BT ); /* 中序遍历,由裁判实现,细节不表 */
BinTree Insert( Bi... | ALGO | 0.999986 | 3.98491 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2021-07-20T01:38: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": "cb3bfdf67... |
22630a04-ce6f-4ec6-8f8a-473dc78ce360 | openmm/openmm | platforms/reference/src/SimTKReference/ReferenceProperDihedralBond.cpp |
/* Portions copyright (c) 2006-2016 Stanford University and Simbios.
* Contributors: <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without l... | ALGO | 0.988843 | 6.690632 | {
"github_metadata": {
"branch": "master",
"commit_count": 7207,
"repo_created_at": "2013-05-20T17:42:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1644,
"forks": 558,
"issues": 408,
"pull_requests": 22
},
"file_meta": {
"content_id": "... |
edbf6ae8-8776-4d7a-8d67-f39e59fec938 | lballabio/quantlib-old | QuantLib/ql/pricingengines/vanilla/fdshoutengine.hpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2005 <NAME>
Copyright (C) 2009 StatPro Italia srl
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free softwar... | ALGO | 0.910424 | 7.508215 | {
"github_metadata": {
"branch": "master",
"commit_count": 18714,
"repo_created_at": "2013-06-06T07:47:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 473,
"forks": 399,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4... |
a954b7d1-1698-4483-8845-6f72e20b094c | fbens47/torcs_cpp | carrier.cpp | //
// Created by <NAME> on 2018-12-15.
//
#include "carrier.h"
#include "math.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <armadillo>
// http://www.cplusplus.com/reference/cmath/
// http://arma.sourceforge.net/armadillo_nicta_2010.pdf
// https://solarianprogrammer.com/2017/03/24/getting-starte... | ALGO | 0.995502 | 5.451419 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2018-12-17T13:14: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": "ae5ce3e0e7... |
718459a9-28ca-440e-98b6-20aea77c75dc | Cross-bit/web-crawler | crawler/crawler_engine/src/LinkSearch/algorithms/SimpleHrefSearchAlgorithm.cpp | //
// Created by kriz on 14.08.2022.
//
#include "SimpleHrefSearchAlgorithm.h"
#include <regex>
#include "../../Utils/TrimHelper.h"
using namespace std;
SimpleHrefSearchAlgorithm::SimpleHrefSearchAlgorithm(const std::string& hostDomain) : _hostDomain(hostDomain) {}
string SimpleHrefSearchAlgorithm::ProcessExtracted... | ALGO | 0.94612 | 4.732699 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2022-06-17T18:58:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "a7cbba2a... |
5504de00-fb7e-45f4-a475-b0c9c8be962d | mongodb/mongo | src/third_party/mozjs/extract/modules/fdlibm/s_expm1.cpp | /* @(#)s_expm1.c 5.1 93/09/24 */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided t... | ALGO | 0.999686 | 4.375134 | {
"github_metadata": {
"branch": "master",
"commit_count": 90314,
"repo_created_at": "2009-01-15T16:15:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 27329,
"forks": 5655,
"issues": 0,
"pull_requests": 82
},
"file_meta": {
"content_id": ... |
af647099-d516-4d54-8553-7740f5557526 | LostDit/9.7 | Длинное вещественное число.cpp | /*Использован строковый тип данных для считывания чисел.
Решение на примерах из условия выдаёт правильный результат.*/
#include <iostream>
#include <string>
using namespace std;
int main() {
setlocale(LC_ALL, "Russian");
string stroka;
bool chek=true,final = true;
while (final) {
int a = 0, b = 0, c = 0;
chek... | ALGO | 0.949218 | 3.196934 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2024-09-28T09:13: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": "88e4572315d6... |
16825d47-a0b9-4794-8a7f-c644a06b6e43 | abhikumr7248/CodeInCpp | A_Boring_Apartments.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cstdio>
#include <algorithm>
#include <algorithm>
#include <cmath>
#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define ll signed long long
#define ld long double
/*---------------------------------------------------------... | ALGO | 0.999557 | 3.61125 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2023-04-15T11:52: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": "7e74fbe5f... |
c288558a-d5ae-4c44-89ac-d522fe9032b4 | sando1998/Atividades-Grafos | Prim algorithm/Prim.cpp | #include<bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
typedef pair<int,int> Pair;
void addEdge(vector <pair<int, int> > adj[], int vertex1, int vertex2, int weight)
{
adj[vertex1].push_back(make_pair(vertex2,weight));
adj[vertex2].push_back(make_pair(vertex1,weight));
}
void Prim(vector<pair<int,int>... | ALGO | 0.999999 | 4.392197 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2021-04-12T23:05: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": "9550bb16bf8... |
e58ee323-b588-4e1d-9bf5-30cce648afd4 | haolian123/myTinyRedis | StressTest/LinkedList/LinkedList.h | #ifndef LINKEDLIST_H
#define LINKEDLIST_H
#include<iostream>
#include<vector>
#include<memory>
#include<random>
#include<cstring>
#include<string>
#include<fstream>
#include<mutex>
template<typename T,typename U>
struct LinkedNode{
T key;
U value;
std::shared_ptr<LinkedNode<T,U>>next;
LinkedNode(T key,... | TOOL | 0.997787 | 4.418751 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2024-02-13T05:23:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbe725fa8f... |
26f5abd9-dbe1-4652-9964-a986eb7e1fa2 | manavroX/codeforces-problem-solutions | Power Sequence.cpp | #include <bits/stdc++.h>
using namespace std;
#define ios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define ll long long
#define mp make_pair
#define INF 1000000007 // 10^9+7
#define EPS 0.000001 //10^-6
#define int long long
#define mINF -1000000007 //-1*10^9-7
#define endl "\n"
#define bn ... | ALGO | 0.999657 | 3.429207 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-05-13T13:44:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03798a34f74d... |
6e5d611d-054b-404b-ad98-a4128154bba9 | splguyjr/Baekjoon | 백준/Gold/16438. 원숭이 스포츠/원숭이 스포츠.cc | #include <iostream>
#include <algorithm>
using namespace std;
int n;
int print_cnt = 0;
char arr[8][100];
void dq(int st, int ed, int depth) {
print_cnt = max(print_cnt, depth);
if (st >= ed || depth == 7) return;
int mid = (st + ed) / 2;
for (int i = st; i <= ed; i++) {
if (i <= mid) arr[depth][i] = 'A'... | ALGO | 0.999814 | 3.315903 | {
"github_metadata": {
"branch": "main",
"commit_count": 623,
"repo_created_at": "2023-02-01T09:59: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": "b4d076d3ac... |
17009dfd-3313-477e-9324-2638d5c10d62 | TheUnpunished/mpi | Task9/main.cpp | #include <iostream>
#include <ctime>
#include <thread>
#include "mpi.h"
int main(int argc, char* argv[]) {
int n;
MPI_Init(&argc, &argv);
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
int size;
MPI_Comm_size(MPI_COMM_WORLD, &size);
double * x_temp;
double * x;
if(rank == 0){
... | ALGO | 0.999807 | 4.098122 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-09-06T11:29:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cd7287a682... |
5715ed89-754f-4b37-b50c-157809d0e730 | SummerZheng/LeetCode | P221_Maximal_Square.cpp | #include<iostream>
#include<vector>
#include<random>
#include"print.h"
using namespace std;
int construct_DP_bottom_up(vector<vector<int> >& matrix) {
int max_size = 0;
int R = matrix.size(), C = matrix[0].size();
vector<vector<int> > DPmat(R+1, vector<int>(C+1, 0));
for (int i = 1; i <= R; ++i) {
for (in... | ALGO | 0.999775 | 5.360445 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2017-01-12T21:03: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": "2ebce3b4c... |
5de8a0d7-6824-4a6b-929f-ddc99c6bc617 | superkunn/My-ACM-Template | 04_Graph Theory/06_Depth-First Traversal/01_Biconnected-Component.cpp | //UVALive - 3523
#include<bits/stdc++.h>
using namespace std;
#define clr(a,x) memset(a,x,sizeof(a))
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define mp make_pair
#define fi first
#define se second
#define pb push_back
typedef pair<int,int> pii;
typedef vector<int> vi;
const int MAXV=1e3+10;
const int MAXE=1e6+10;
int ... | ALGO | 0.999909 | 3.907379 | {
"github_metadata": {
"branch": "master",
"commit_count": 253,
"repo_created_at": "2018-08-03T06:16:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e8c4945... |
f3c6b9cb-6d08-447c-a561-0f43a4a8e002 | middleprince/AlgorithmNotes | chapter4/1-CP-Iranking.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
using std::vector;
using std::map;
struct StudentGrades
{
char sno[22];
int tests[12];
int grades = 0;
};
int main()
{
int N, M, grade_line;
map<int, int> question_grades;
StudentGrades elem;
//vecto... | ALGO | 0.998222 | 3.136343 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2019-05-31T12:05: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": "928282945... |
b31d0b8d-afee-4dd2-9ef7-c22709cdd4c3 | Neokoldstudio/RigidSim | include/collision/CollisionDetect.h | #pragma once
#include <Eigen/Dense>
#include <vector>
class Contact;
class RigidBody;
class RigidBodySystem;
//
// The main collision detection class,
// it will test the geometries of each pair of rigid bodies
// and populate an array with contacts.
//
class CollisionDetect
{
public:
// Constructor.
//
... | ALGO | 0.978746 | 6.875475 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-06-13T19:11:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5730dba38bc... |
700e3967-7c00-4a4c-ae26-fd536a240c82 | NVIDIA/tensorflow | tensorflow/contrib/boosted_trees/lib/utils/random.h | // Copyright 2017 The TensorFlow Authors. All Rights Reserved.
//
// 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 b... | TOOL | 0.921822 | 5.598342 | {
"github_metadata": {
"branch": "r1.15.5+nv23.03",
"commit_count": 64202,
"repo_created_at": "2020-05-13T21:34:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1146,
"forks": 178,
"issues": 41,
"pull_requests": 9
},
"file_meta": {
"conten... |
9c937485-4b19-4860-bb62-7aa60a78eeec | thirofoo/atcoder-archives | abc161/abc161_e_44137012_WA.cpp | /*
* Author: through
* Submission URL: https://atcoder.jp/contests/abc161/submissions/44137012
* Submitted at: 2023-07-31 19:16:48
* Problem URL: https://atcoder.jp/contests/abc161/tasks/abc161_e
* Result: WA
* Execution Time: 294 ms
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P... | ALGO | 0.999939 | 3.373864 | {
"github_metadata": {
"branch": "main",
"commit_count": 5513,
"repo_created_at": "2022-12-17T09:45:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "5b703ba56... |
95fb6f7f-00e8-48f7-8829-791ad0df0b97 | sujkovic/leetcodes | medium/1233-Remove-Sub-Folders-from-the-Filesystem.cpp | // Given "/a", "/a/b", "/c/d", "/c/d/e", "/c/f"
// if you sort it lexicographically, parents will always come before children
// so insert the first string into the result vec, then
// for folder in folders
// if the last folder in result has same prefix
// continue
// else
// push cur f... | ALGO | 0.998117 | 5.718514 | {
"github_metadata": {
"branch": "main",
"commit_count": 196,
"repo_created_at": "2023-10-09T19: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": "002b53259d... |
8e9c63ce-f8f9-4ab7-af51-2a39b85c0890 | stamhoffman/algorithms | bst.cpp | #include "bst.h"
namespace bst {
BST::BST(int key) {
root_node_ = new TreeNode(key);
size_ = 1;
}
void BST::Insert(int val) {
TreeNode *curr = root_node_;
while (curr != nullptr && curr->val_ != val) {
if (curr->val_ > val && curr->leftChild == nullptr) {
curr->leftChild = new TreeNode(val);
+... | ALGO | 0.999648 | 4.587615 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-01-24T12:10: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": "2a72760354... |
e51e0153-13d6-4d09-a2a9-bcedd3159cd9 | roycordero1/RoyCordero-IA-117 | ejercicio/bfsshortreach/bfsshortreach.cpp | #include <cmath>
#include <iostream>
#include <vector>
#include <set>
#include <list>
#include <algorithm>
#include <cstdio>
using namespace std;
set<int>::const_iterator pos; //Iterador utilizado para recorrer y simular las aristas del grafo
int main() {
int q; //Cantidad de grafos
cin>>q;
w... | ALGO | 0.999793 | 3.8544 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2017-02-27T00:21: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": "2a4766c48... |
2e0ff653-58c5-40af-8fc0-4a32dd8455de | vukanoa/Coding_Problems | 4_N_539/Heap/1834_Single-Threaded_CPU/single_threaded_cpu.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
/*
==============
=== MEDIUM ===
==============
===========================
1834) Single-Threaded CPU
===========================
============
Description:
============
You are given n tasks labeled f... | ALGO | 0.999998 | 6.633128 | {
"github_metadata": {
"branch": "main",
"commit_count": 2647,
"repo_created_at": "2022-10-27T12:00: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": "53884d538... |
d0ab7088-360d-492b-8761-b2fdd5881c8c | Andycode3759/competitions | 2023_Q2/YZOJ.C1397_6.17/B/B.cpp | // AC
#include <cstdio>
#include <utility>
using namespace std;
const int MAXN = 1000006;
struct BigInt
{
int data[MAXN];
int digit = 0;
void clearAndRead()
{
char c = getchar();
digit = 0;
while (c < '0' || c > '9')
c = getchar();
while (c >= '0' && c <= '9... | ALGO | 0.999956 | 3.556567 | {
"github_metadata": {
"branch": "main",
"commit_count": 60,
"repo_created_at": "2022-11-26T07:14:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "83d725be9f0... |
673a0218-9b5e-48cd-b434-511fcdf71aae | SaminRahman1/DSA | Introduction to Algorithms/Assignment-01/Can_Go.cpp | #include<bits/stdc++.h>
using namespace std;
char grid[1005][1005];
bool vis[1005][1005];
vector<pair<int,int>> d = {{-1,0},{1,0},{0,-1},{0,1}};
int n,m;
int si = 0,sj = 0,di = 0,dj = 0;
bool valid(int i, int j){
if(i<0 || i>=n || j<0 || j>=m)
return false;
return true;
}
void bfs(int si, int sj){
q... | ALGO | 0.999804 | 3.879151 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-03-20T17:51:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "774228380c86... |
f7d60f82-b213-4bd8-b493-7bc630291a9a | achellies/DuiBrowser | Duibrowser/src/EAWebkit/Webkit-owb/BAL/WKAL/Concretizations/Graphics/WK/BCGradientWK.cpp | /*
* Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2007 <NAME> <<EMAIL>>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must reta... | TOOL | 0.921171 | 6.465461 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-08-14T14:28:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 51,
"forks": 31,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3d47646... |
e8e04c5b-893a-406e-a108-41a5942905f9 | dtungz/THCS2-CodePTIT | TST016.cpp | #include <stdio.h>
#include <string.h>
int main()
{
char s[205];
scanf("%s",s);
int n = strlen(s);
int a = 0,b = 0, c = 0,d = 0,e = 0;
for(int i = 0; i < n; i++)
{
if(s[i] == '{') a++;
else if(s[i] == '[') b++;
else if(s[i] == '(') c++;
else if(s[i] == '}') a--;
... | ALGO | 0.999708 | 3.406221 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-06-05T12:29: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": "1b6ca91e5b01... |
8969c617-b67f-410a-ad52-3e4ba8ef0453 | metehkaya/Algo-Archive | Problems/LeetCode/Solutions/1286.Iterator_for_Combination.cpp | class CombinationIterator {
public:
int n,k;
string str;
bool isFirst;
vector<bool> used;
CombinationIterator(string str, int k) {
isFirst = true;
n = str.length();
used.resize(n, false);
this->str = str;
this->k = k;
}
string next() {
string a... | ALGO | 0.999963 | 5.312509 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2023-04-04T19:44:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "482544f66ac... |
8a13163b-0813-4b4e-add1-6a15ecd389bf | yaqoobcs/evosnns | Evosnn/Individual.cpp | #include "stdafx.h"
#include "Individual.h"
#include <time.h>
using namespace std;
Individual::Individual(void)
{
fitness=0.0, reward=0.0; penalty=0.0, rewardn=0.0, penalty=0.0;
rank=0;
absWeightSum=0.0;
noOfNodesInNetwork=0;
inputNeurons.clear();
interNeurons.clear();
outputNeurons.clear();
gaussNoiseVector.c... | ALGO | 0.949972 | 3.337068 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-03-12T16:15:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02aed2df60df... |
39bd6ebc-032e-47b3-b1a0-6100a4d4bfda | krbyhome/MemPoolsAlloc | MemPoolsAllocator/MemPoolsAlloc.h | #pragma once
#include <algorithm>
#include <cassert>
#include <cstdlib>
#include <utility>
#include <iostream>
#include <vector>
const size_t kByte = 8;
std::vector<std::pair<size_t, size_t>> config;
namespace PoolAlloc {
void set_config(const std::vector<std::pair<size_t, size_t>>& cfg) {
config = cfg;... | TOOL | 0.952924 | 4.761009 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-02T12:36:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "61a31e421546... |
849a6b25-f856-4fb9-b4af-8b929cca0900 | Sujitmaurya123/Data_Structures | Queue in c++/arrayque.cpp | #include<bits/stdc++.h>
using namespace std;
class Queue
{
int *arr;
int qfront;
int rear;
int size;
public:
Queue()
{
size = 100001;
arr = new int[size];
qfront = 0;
rear = 0;
}
/*----------------- Public Functions of Queue -----------------*/
bo... | ALGO | 0.998564 | 3.676963 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2023-08-09T18:15: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": "5a55befb8b... |
ef0352ed-95b8-4d41-b872-67766c23a24d | CYACN/NOIP | Class/NOIP/ISBN.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main(int argc, char const *argv[]) //加的神秘参数,,那个*是cpp指针
{
char chA[9982], chB[10031], chVeriCode1, chVeriCode2; //misakamikoto
int iVeriCode22 = 0;
freopen("isbn.in", "r", stdin);
freopen("isbn.out", "w", stdout);
scanf("%c-%c%c%c-%c%c%c%... | ALGO | 0.999845 | 3.111237 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-07-15T07:01: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": "49231d5e3... |
83b6336f-1e1f-4a88-a586-9293d89cba4c | code-cp/leetcode | solutions/202/main.cpp | #include <unordered_set>
#include <gtest/gtest.h>
using namespace std;
class Solution {
public:
int getSum(int n) {
int sum = 0;
while (n > 0) {
sum += (n%10) * (n%10);
n /= 10;
}
return sum;
}
bool isHappy(int n) {
unordered_set<int> ... | TEST | 0.999639 | 6.203258 | {
"github_metadata": {
"branch": "main",
"commit_count": 294,
"repo_created_at": "2022-05-22T08:48: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": "9b8c3cebf9... |
9759086e-47f6-4db6-ae42-057765628e0f | sajjanjyothi/monstergame | main.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <sstream>
#include <random>
#include "main.hpp"
using namespace std;
//Load the city from file to map
int loadMap(vector<City> &mapVector)
{
string line;
std::ifstream infile("map.txt");
while (getline(infile, line))
... | TOOL | 0.981841 | 3.266906 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-05T07:55: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": "e840e4e704... |
23106972-f143-4307-9e1e-845df37b3281 | NVIDIA/OptiX_Apps | apps/rtigo9/dp/math/src/Trafo.cpp | // Copyright (c) 2002-2015, NVIDIA CORPORATION. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of con... | ALGO | 0.958564 | 7.007604 | {
"github_metadata": {
"branch": "master",
"commit_count": 129,
"repo_created_at": "2020-02-10T16:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 322,
"forks": 49,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "735597... |
5ef7d8e9-7b9b-4aa8-b2e2-c67e1d86ff76 | andrewzolotukhin/codeforces | 2074/C/solution.cpp | #include <bits/stdc++.h>
using namespace std;
int solve(int x) {
int answer = -1;
for (int i = 0; i <= 30; i++) {
for (int j = 0; j <= 30; j++) {
if (i == j)
continue;
int y = 0;
y = (1 << i) | (1 << j);
if ((y < x) && (x + y > (x ^ y)) && ((x ^ y) + y > x)) {
answer = y... | ALGO | 0.999959 | 5.066206 | {
"github_metadata": {
"branch": "master",
"commit_count": 283,
"repo_created_at": "2024-11-24T12:17: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": "d815070b... |
edd9e0da-cdbd-4bbc-86ca-303c67bd09e9 | Maladawy10/Maze-Runner | maze runner/src/bestFirstSearch.cpp | #include "bestFirstSearch.h"
#include "mazeFactory.h"
#include<vector>
#include<queue>
#include <stack>
#include <string>
#include <math.h>
using namespace std;
bestFirstSearch::bestFirstSearch()
{
Visited = new bool[mazeFac->height*mazeFac->width + 1];
for (int i = 1; i <= mazeFac->width*mazeFac->height; i++)
{
... | ALGO | 0.999922 | 3.855863 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-04-01T22:13:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e614beb387... |
780f3950-1cad-4d93-be68-f87d4e6d48d7 | utkarshmaken/cp | inter iit 2020/106.cpp | #include<bits/stdc++.h>
using namespace std;
class TreeNode{
public:
int data;
int color;
static TreeNode* orig_root;
TreeNode *left;
TreeNode *right;
TreeNode *parent;
bool nil;
TreeNode(int x){
data = x;
color = 1;
left = NULL;
right = NULL;
pa... | ALGO | 0.999988 | 5.090633 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-06-28T05:46:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34fa03b6ae71... |
c39a89dc-ef6f-4e51-aabc-5c89e86c586e | JolyneFr/myLSM | include/global.h | #pragma once
#include <utility>
#include <cstdint>
#include <string>
#include <vector>
#include <sstream>
/* ----- Global constant value for SSTable ----- */
const uint64_t MAX_BYTE_SIZE = 1 << 21;
const size_t FILTER_BIT_SIZE = 10 * (1 << 13);
const size_t FILTER_BYTE_SIZE = 10 * (1 << 10);
/* ----- key-value pair ... | TOOL | 0.914282 | 6.394538 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2021-04-14T09:14: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": "917973ca8... |
7e708f5d-1f7a-40ac-b369-657d74f0bc11 | IshanManchanda/competitive-cpp | GoC/Weekly Contest 2/H - Grid 1.cpp | #pragma GCC optimize("O3,unroll-loops")
//#pragma GCC optimize("O2,unroll-loops")
//#pragma GCC target("avx,avx2,fma,tune=native")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
... | ALGO | 0.999893 | 4.339198 | {
"github_metadata": {
"branch": "master",
"commit_count": 144,
"repo_created_at": "2019-04-29T11:25:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dabbe6f5... |
9ec3942c-0fbd-4d81-b3ec-0080700b2d50 | KRSSG/robocup | mSc_planner/src/planners/scurve.cpp | #include "planners/scurve.h"
#include <cstdlib>
#include <cstdio>
#include <cmath>
namespace Navigation
{
SCurve::SCurve() :
threshold(0),
startx(0),
starty(0),
total_node(0),
length(0)
{ }
SCurve::~SCurve()
{ }
int SCurve::Connect(Vector2D<float> Start, Vector2D<float> End, obstacle*... | ALGO | 0.997768 | 3.99041 | {
"github_metadata": {
"branch": "fsm",
"commit_count": 235,
"repo_created_at": "2017-08-07T18:56:33.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 20,
"forks": 27,
"issues": 11,
"pull_requests": 9
},
"file_meta": {
"content_id": "cbeffe13c... |
1a903a21-1a5a-4044-befd-a242a9d18cb9 | descrip/competitive-programming | codeforces/716/b.cpp | #include <bits/stdc++.h>
using namespace std;
string S;
int A[300];
bool check() {
for (int i = 'A'; i <= 'Z'; ++i)
if (A[i] > 1) return false;
return true;
}
void fill(int pos) {
queue<char> Q;
for (int i = 'A'; i <= 'Z'; ++i)
if (A[i] == 0)
Q.push((char)i);
for (int i = pos-25; i <= pos; ++i)
if (S[i... | ALGO | 0.999918 | 3.680762 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-01-19T05:35:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "447c129641... |
e0ebcf01-cc7d-457a-ae0e-796c68201ab2 | Fraunhofer-AISEC/ReCFI | llvm/lib/CodeGen/MachineScheduler.cpp | //===- MachineScheduler.cpp - Machine Instruction Scheduler ---------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | ALGO | 0.95128 | 7.678352 | {
"github_metadata": {
"branch": "main",
"commit_count": 316383,
"repo_created_at": "2021-11-12T14:37:22.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "bed1b105... |
40cc6b69-9655-41b4-a15f-8fad0ff5a8ce | jeontigger/CodingTest | 0076-minimum-window-substring/0076-minimum-window-substring.cpp | class Solution {
public:
bool IsInclude(unordered_map<char, int>& m1, unordered_map<char, int>& m2) {
for (auto iter = m2.begin(); iter != m2.end(); ++iter) {
if (m2[iter->first] > m1[iter->first]) {
return false;
}
}
return true;
}
unordered_... | ALGO | 0.999941 | 6.384609 | {
"github_metadata": {
"branch": "main",
"commit_count": 743,
"repo_created_at": "2023-10-10T07:18: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": "526bb40629... |
f37e6168-cf11-43ee-a883-a6a5ae9f524c | NuoJohnChen/C2HLS | program_source/mac_accel/mac_accel_slow.cpp | #include <stddef.h>
#define DATA_SIZE 12
// Maximum Array Size
#define MAX_SIZE 12
//TRIPCOUNT identifier
const unsigned int c_dim = DATA_SIZE;
void mac_accel(
const int *a, // input A flattened (row-major)
const int *b, // input B flattened (row-major)
int *c, // output C flattened (row-maj... | ALGO | 0.999446 | 4.352041 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-05-15T06:51:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "343b9479986d... |
fd862cdd-fd48-490d-a97e-49dd081ec1df | ishandutta2007/codeforces-g | gtrhetr/normal/1172/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,int>
vector<int> v[400010];
vector<pii> g[400010];
ll c[400010],now=0;
int fat[400010],col[400010],n,m;
bool bo[400010];
inline int rd()
{
int x=0;char ch=getchar();
for (;ch<'0'||ch>'9';ch=getchar());
for (;ch>='0'&&ch<='9';ch... | ALGO | 0.999869 | 3.726476 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:55: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": "baa25724fc7e... |
9f403d9d-5393-4295-ac1b-55c347807819 | DKPanov/2_sem | Lab2/Рекурсивная функция суммирования(double),.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
double mean(double psi[], double pdf[], double const dv, unsigned size)
{
if (size == 1)
{
return psi[0] * pdf[0] * dv;
}
else
{
return mean(psi, pdf, dv, size / 2) + mean(psi + size / 2, pdf + size/2, dv,... | ALGO | 0.999952 | 4.451576 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2022-02-10T12:18:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e469e23b8f... |
b02674b1-3d3b-4a5c-bea3-147354a5ef4b | strands-project/strands_perception_people | mdl_people_tracker/include/Kalman.h | /*
* Copyright 2012 <NAME>
*
* Authors: <NAME>
* Computer Vision Group RWTH Aachen.
*/
//#include <QObject>
#include "Matrix.h"
/***********************************************/
/* y - the observation at time t */
/* H - jacobian Observation Model */
/* F - jacobian Dynamic Model ... | ALGO | 0.983993 | 6.10939 | {
"github_metadata": {
"branch": "kinetic-devel",
"commit_count": 668,
"repo_created_at": "2013-08-05T22:41:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 98,
"forks": 70,
"issues": 30,
"pull_requests": 3
},
"file_meta": {
"content_id": ... |
dbb54eae-406a-4a22-b4ad-55270226a47c | jaiminocha/LeetCode-Solutions | 606-construct-string-from-binary-tree/606-construct-string-from-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.999905 | 5.888963 | {
"github_metadata": {
"branch": "main",
"commit_count": 611,
"repo_created_at": "2022-09-01T09:44: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": "95ac3df64f... |
a549d2ac-63d3-4652-9337-ac9512b50dca | dosomethingbyme/408 | 数据结构/严版教材/数据结构第2版-书中算法(C语言版)/第6章/6.4.cpp | //算法6.4 深度优先搜索遍历非连通图
#include <iostream>
using namespace std;
#define MVNum 100 //最大顶点数
typedef char VerTexType; //假设顶点的数据类型为字符型
typedef int ArcType; //假设边的权值类型为整型
//-------------图的邻接矩阵-----------------
typedef struct{
VerTexType vexs[MVNum]; //顶点表
ArcType arcs[MVN... | ALGO | 0.99981 | 3.720232 | {
"github_metadata": {
"branch": "main",
"commit_count": 140,
"repo_created_at": "2021-12-01T06:04:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 4,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "c93e1f9dc... |
68e9a9be-085c-451d-9eff-b7a17d67e500 | qhungbui7/dictionary-dsaproj | dictionary-dsa/hashTable.cpp | #include"hashTable.h"
int hashingFunction(wstring keyword, int modu) {
int accumulator = 777;
for (int i = 0; i < keyword.length(); i++)
accumulator += int(keyword[i])*10;
return accumulator % modu;
}
Node* newNode(hashElement element) {
Node* p = new Node;
p->element = element;
p->next = nullptr;
return ... | ALGO | 0.999519 | 4.19311 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2021-07-05T10:24:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97a373a55... |
99f6cce0-3d77-444f-b7bf-4f97d5483f6a | icizay/cp | dump/cses/Game_Routes.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
const int mod = 1e9+7;
vector<vector<int>> adj, t_adj;
vector<int> in_degree;
vector<int> dp;
void kahn(vector<int> &order){
priority_queue<int, vector<int>, greater<int>> pq;
for(int i = 0; i < n; ++i)
if(in_degree[i] == 0) pq.push(i);
while(!pq.em... | ALGO | 0.999782 | 4.551453 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2021-02-01T10:35:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b97aa0123af... |
5fdf16ad-6b1b-4a94-b954-8f05284ad02e | pulkitgarg2020/DSA_PROBLEMS | Difficulty: Hard/Aggressive Cows/aggressive-cows.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:
bool possibleSolution(vector<int> &stalls, int cows, int min) {
int c = 1;
int pos = stalls[0]; // first cow ... | ALGO | 0.999978 | 6.124577 | {
"github_metadata": {
"branch": "main",
"commit_count": 302,
"repo_created_at": "2024-08-08T19:56: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": "bffadab90e... |
1bfe0efd-844a-466b-a29a-b95f37031314 | Ayushiverma844/Learning_Cpp_and_Dsa | DSA/10_STACK/3_Valid_Parenthesis.cpp | #include<iostream>
#include<stack>
using namespace std;
// function to check is the string contain valid parentheses
bool isValid(string str){
stack<char> s;
// iterate through each character in the string
for(char c : str){
// if the character is an opening parenthesis, push it onto the stack
... | ALGO | 0.991025 | 6.576452 | {
"github_metadata": {
"branch": "main",
"commit_count": 313,
"repo_created_at": "2024-12-03T05:20: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": "caede0b6e0... |
ac24f589-71c7-4e91-a621-f4f886f57b25 | pickkk12345/Praktikum_SDAA | Posttest_SDAA_5/2309106114_TaufiqurrahmanAlBaihaqi_POSSTEST5.cpp | #include <iostream>
#include <string>
using namespace std;
// Struktur Node untuk varian sarung
struct VarianNode {
string varian;
VarianNode* next; // Pointer ke node varian berikutnya
};
// Struktur Sarung
struct Sarung {
string merk;
VarianNode* headVarian; // Pointer ke linked list varian
};
//... | ALGO | 0.995758 | 4.522274 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-09-16T23:46: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": "917d42747ad9... |
74629e20-bcc9-482f-96a9-d836413ea039 | sigma425/library | math/Comb_modM.cpp | /*
任意mod での a choose b
mod はでかくてもいい
X! までの各素数でのorder(acc_order_p)とそれ以外(other)の部分を前計算しておいてやる
orderはX/p + X/p^2 + .. で求まるのでメモリ減らしたいなら前計算消した方がいいかも
これでa,bもでかかったらLucas?
純粋にさらにクエリを早くしたいなら、累乗を前計算
verified at CF/896/D
*/
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int... | ALGO | 0.999898 | 4.215706 | {
"github_metadata": {
"branch": "master",
"commit_count": 390,
"repo_created_at": "2016-12-07T15:50:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 3,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "502bef92... |
83ddd747-46c2-4830-b5bc-caaa7a9f09a6 | Dhirajpt1234/codeforces-solved-problems | 2022.05.19/4findTheArray.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<v... | ALGO | 0.999838 | 4.107505 | {
"github_metadata": {
"branch": "master",
"commit_count": 47,
"repo_created_at": "2022-05-17T04:31:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c7131f7b... |
7bfddaeb-5ea8-4f71-b828-540586daf94f | ganeshskudva/Algorithms | HackerEarth/Palindrome_Permutation.cpp | /*
* AUTHOR: <NAME>
* https://www.hackerearth.com/problem/algorithm/palindrome-check-2-1/
*
*/
#include <bits/stdc++.h>
typedef long long int ull;
#define MEM(a, b, c, d) memset(a, (b), c * sizeof(d))
#define CLR(a) memset(a, 0, sizeof(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) ... | ALGO | 0.999972 | 3.821338 | {
"github_metadata": {
"branch": "master",
"commit_count": 883,
"repo_created_at": "2014-10-11T23:07:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "253fc590... |
82290873-ac53-4601-8a9e-406cf0a71f5f | opencv/opencv | samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp | /**
* @function cornerSubPix_Demo.cpp
* @brief Demo code for refining corner locations
* @author OpenCV team
*/
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
/// Global variables
Mat src, src_gray;
int maxCorners = 10;
int maxTrackbar ... | ALGO | 0.999534 | 6.847684 | {
"github_metadata": {
"branch": "4.x",
"commit_count": 35401,
"repo_created_at": "2012-07-19T09:40:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 83079,
"forks": 56217,
"issues": 2595,
"pull_requests": 138
},
"file_meta": {
"content_id"... |
4bb2f721-f2ae-4be2-ac58-4558e4243dd2 | allanwlz/SNO3LeetCode | Problemset/multiply-strings/multiply-strings.cpp |
// @Title: 字符串相乘 (Multiply Strings)
// @Author: user3919vu
// @Date: 2020-06-28 00:06:32
// @Runtime: 8 ms
// @Memory: 6.5 MB
class Solution {
public:
string multiply(string num1, string num2) {
if (num1 == "0" || num2 == "0") return "0";
int n1 = num1.size(), n2 = num2.size();
string ans(... | ALGO | 0.999925 | 5.604703 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2020-06-22T16:51:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c71f970d50... |
825c3586-86c5-46a0-a156-6ee63367a515 | Yingyan-Xu/AlgoLab-AS19-ETH | week5/planks/algorithm.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <limits>
#include <stdexcept>
using namespace std;
void print(const vector<vector<int>> &v)
{
for(int i=0; i<v.size(); i++) {
for(int j=0; j<v[i].size(); j++) {
cout << v[i][j] << " ";
}
cout << endl;
}
}
void assign(in... | ALGO | 0.999806 | 4.323349 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2020-02-17T22:37: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": "1e98a627fa... |
811b186f-1d68-45b9-9ed2-e83c76f2a9d4 | side-projects-all/works | Leetcodes/hash_map_set/q_170.cpp | /*
Design a data structure that accepts a stream of integers and checks if it has a pair of integers that sum up to a particular value.
Implement the TwoSum class:
TwoSum() Initializes the TwoSum object, with an empty array initially.
void add(int number) Adds number to the data structure.
boolean find(in... | ALGO | 0.999253 | 6.525857 | {
"github_metadata": {
"branch": "main",
"commit_count": 41,
"repo_created_at": "2025-01-03T05:24: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": "eaafd7e53ad... |
d2926153-bdbc-4502-9ed9-25920b8c2b4d | orionmel/Coding2-Weekly-Project-advanced-framework | ❤️week3_boids/week3_boids_homework_final/src/boid.cpp |
#include "boid.h"
#include "ofMain.h"
Boid::Boid()
{
separationWeight = 0.9f;
cohesionWeight = 0.3f;
alignmentWeight = 0.2f;
separationThreshold = 100;
neighbourhoodSize = 100;
//设置开始的位置
position = ofVec3f(ofRandom(-10, 20), ofRandom(-10, 20));
velocity = ofVec3f(ofRand... | ALGO | 0.994133 | 4.222485 | {
"github_metadata": {
"branch": "main",
"commit_count": 118,
"repo_created_at": "2022-02-05T14:02: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": "8cd57f4d9b... |
c25b90ca-0a10-4465-b09d-8e4cf0b9526b | rolandjansky/athena | Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/jJetSort.cxx | /*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
// jJetSort.cxx
// TopoCore
// algorithm to make sorted jJets lists
//
#include "L1TopoAlgorithms/jJetSort.h"
#include "L1TopoEvent/TOBArray.h"
#include "L1TopoEvent/jJetTOBArray.h"
#include "L1TopoEvent/GenericTOB.h"
#include <algorithm... | ALGO | 0.996467 | 5.649334 | {
"github_metadata": {
"branch": "master",
"commit_count": 100549,
"repo_created_at": "2022-08-07T05:54:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "13288... |
c39f1e69-b03a-43cb-bf41-ff55379d5a96 | locherli/algorithm | 树-节点个数&深度&高度&平衡.cpp | #include <iostream>
#include <algorithm>
#include <queue>
using namespace std;
typedef struct TreeNode {
int val;
struct TreeNode* left = nullptr;
struct TreeNode* right = nullptr;
} TreeNode;
TreeNode* createNode(int value)
{
TreeNode* newNode = new TreeNode;
newNode->val = value;
newNode->left = nullptr;
new... | ALGO | 0.998169 | 4.186645 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-06-03T13:46: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": "071cdb977c56... |
258970a8-864d-4556-90eb-c2eaeae7da9c | fonte-nele/Jogos-Console | JogoDaVelha/main.cpp | #include "jogo_da_velha.h"
#include<cstdlib>
int main()
{
int i,x,y,jogadas=0;
string nome1,nome2;
char jog1,jog2,m[n][n];
criar_matriz(m);
cout<<"Digite o nome do jogador 1:\n"<<endl;
getline(cin,nome1);
cout<<"\nJogador "<<maiusculo(nome1)<<", escolha a peca que deseja jogar: X ou O"<<endl<<endl;
cin>>jo... | ALGO | 0.997666 | 3.841029 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-06-22T18:30: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": "4622cba749... |
3198c6c7-41ba-4b69-beae-03bebf0f5113 | Byeong-Chan/ByeongChan_PS_Note | C:C++/2667.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
int ans[1010];
int o[25][25];
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int n;
int flood(int x, int y) {
if(x < 0 || y < 0 || x >= n || y >= n) return 0;
if(o[x][y] == 0) return 0;
o[x][y] = 0;
int tmp = 0;
for(int i = 0; i < 4;... | ALGO | 0.999946 | 3.570771 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-05-29T07:57:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "740fe2670d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.