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 |
|---|---|---|---|---|---|---|---|
9bfd300b-bb2d-4065-8560-1c1ad4a1e424 | SharpyTeam/math | src/sw/math/simd.hpp | //
// Created by selya on 06.10.2019.
//
#ifndef SANDWICH_MATH_SIMD_HPP
#define SANDWICH_MATH_SIMD_HPP
#ifdef __clang__
#pragma clang attribute push (__attribute__((target("avx"))), apply_to=function)
#elif defined(__GNUC__)
#pragma GCC push_options
#pragma GCC target ("avx")
#pragma GCC optimize ("O3")
#pragma GCC t... | ALGO | 0.980059 | 6.203336 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2019-10-03T20:01:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9856b5aec79... |
60010d63-40ab-4c87-97dc-2fc388e308eb | Tarunagg1/competitive_programing | gfg-problemsoftheday/Eulerian Path in an Undirected Graph.cpp | // Eulerian Path in an Undirected Graph
// Easy Accuracy: 67.21% Submissions: 2194 Points: 2
// Given an adjacency matrix representation of an unweighted undirected graph named graph, which has N vertices. You have to find out if there is an eulerian path present in the graph or not.
// Note: The graph consists of a s... | ALGO | 0.999963 | 5.666131 | {
"github_metadata": {
"branch": "master",
"commit_count": 1108,
"repo_created_at": "2021-02-09T15:02:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "e20c963... |
a0ceb562-3296-441b-8ca1-5830781f41eb | kaidul/Data_Structure_and_Algorithms_Library | algorithms/primality_test.cpp | // optimized school method O(sqrt(n))
// observation: all primes are of the form 6k ± 1, with the exception of 2 and 3
bool isPrime(int n) {
if(n <= 1) return false;
if(n <= 3) return true;
if(n % 2 == 0 or n % 3 == 0) {
return false;
}
int sqrtN = sqrt(n);
for(int i = 5; i <= sqrtN; i +... | ALGO | 0.998936 | 5.023935 | {
"github_metadata": {
"branch": "master",
"commit_count": 53,
"repo_created_at": "2015-05-28T16:42:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 198,
"forks": 78,
"issues": 2,
"pull_requests": 1
},
"file_meta": {
"content_id": "f7213d... |
86863a16-8dc9-4bf1-ab2f-d5bf319c9aef | Hybbon/spc | roteiro02/uri_1472/victor.cpp | // Dada a circunferência, é sabido que, para que possa haver um triângulo equi-
// látero formado por vértices situados na mesma, é necessário que a distância
// entre vértices adjacentes seja de circunferência/3.
// Portanto, após calcular o valor da circunferência total, o programa itera
// pelos vértices e verifica ... | ALGO | 0.999874 | 4.816389 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2016-03-16T23:29: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": "8ad679c8... |
89671d97-7928-48a8-b701-38b9df6115e1 | haveneer/cpp-training | src/operator_conditional.cpp | //#region [Declarations]
#include <iostream>
// Global definitions for a smart main body
int a = 0, b = 0, a_value = 0, b_value = 0, ab_value = 0;
int f(int) { return 0; }
int g(int) { return 0; }
//#endregion
int main() {
// TODO: How to you do the same (with const) without a conditional operator ?
const int v1... | ALGO | 0.971913 | 3.600248 | {
"github_metadata": {
"branch": "master",
"commit_count": 302,
"repo_created_at": "2019-12-18T21:08:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30b7912e8... |
da4c2df2-5420-451d-96b9-2f1ff0aecd04 | google/monster-mash | third_party/libigl/include/igl/octree.cpp | #include "octree.h"
#include <vector>
#include <queue>
namespace igl {
template <typename DerivedP, typename IndexType, typename DerivedCH,
typename DerivedCN, typename DerivedW>
IGL_INLINE void octree(const Eigen::MatrixBase<DerivedP>& P,
std::vector<std::vector<IndexType> > & point_i... | ALGO | 0.992254 | 5.916261 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2021-01-28T21:04:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1312,
"forks": 182,
"issues": 24,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c2aa6... |
9cb07ea0-3318-4784-900a-6821950d20d0 | 2532779/RosalesJerson_CSC5_43952 | Lab/Finance/main.cpp | /*
* File: main.cpp
* Author: <NAME>
* Created on April 20, 2015, 9:05 AM
*/
//System Libraries
#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
//User Libraries
//Global Constants
//Function Prototype
float blnPmnt(float,float,int,float);//For-Loop
//Execution Begins here
int ma... | ALGO | 0.990151 | 4.136117 | {
"github_metadata": {
"branch": "master",
"commit_count": 92,
"repo_created_at": "2015-02-25T18:13: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": "3f86969ac... |
eecccdc0-fb57-45b8-9782-229c7fa0519f | parikshit223933/Coding-Ninjas-Competitive-Programming | Segment Tree/Sum_Of_Squares.cpp | /* Segment trees are extremely useful. In particular "Lazy Propagation" (i.e. see here, for example) allows one to compute sums over a range in O(lg(n)), and update ranges in O(lg(n)) as well. In this problem you will compute something much harder:
The sum of squares over a range with range updates of 2 types:
1) incre... | ALGO | 0.997373 | 4.580877 | {
"github_metadata": {
"branch": "master",
"commit_count": 677,
"repo_created_at": "2020-03-09T07:20:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 555,
"forks": 299,
"issues": 4,
"pull_requests": 7
},
"file_meta": {
"content_id": "63cc... |
9dd25aa9-46c1-4cd3-a452-4ef63feef078 | Eradax/cp-solutions | baltic-oi/2016/day2/A/A.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define check(a, b) ((a >> b) & 1)
#define sz(c) ((int)c.size())
#ifdef DBG
#define dbg(expr) cerr << "[" << __FUNCTION__ << ", " << __LINE__ << "] " << #expr << ": " << expr << endl;
#else
#define dbg(...)
#endif
using ll = long long;
#defi... | ALGO | 0.999934 | 4.054505 | {
"github_metadata": {
"branch": "main",
"commit_count": 112,
"repo_created_at": "2024-08-23T20:31:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ae6e0ea600... |
a91f5822-86b6-40ac-94f5-c9e20d05a06c | rebrikartem/ITMO-algorithms-and-data-structures | lab12/taskF.cpp | #include <iostream>
#include <fstream>
#include <vector>
using namespace std;
void dfs
(
vector<vector<int> >& arr,
vector<vector<int> >& dp,
vector<bool>& used,
int root
)
{
used[root] = true;
for(int i = 0; i < arr[root].size(); i++){
int to = arr[root][i];
if(!used[to]){
... | ALGO | 0.999768 | 3.869696 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-06-29T15:07: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": "859cbcd5bdbf... |
8dd55595-6a53-4e35-aa77-264b5e837ccc | ortemx/university | term6/OS/lab2/task6/other/ex2.cpp | #include <iostream>
#include <iomanip>
#include <windows.h>
#include <ctime>
using namespace std;
// Функция вывода матрицы
void PrintMatr(int **mas, int m) {
for (int i = 0; i<m; i++) {
for (int j = 0; j<m; j++)
printf("%4d", mas[i][j]);
printf("\n");
}
}
// Получение матрицы без i-... | ALGO | 0.999882 | 4.413485 | {
"github_metadata": {
"branch": "main",
"commit_count": 324,
"repo_created_at": "2022-11-15T19:12: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": "47135e5dc7... |
d6fb7e9e-41ef-4673-a8d7-f02218dd3b35 | gokulmaran/SDE | DSA/03) Strings/Basics/ReverseWords3.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
//link: https://leetcode.com/problems/reverse-words-in-a-string-iii/description/
class Solution {
public:
string reverseWords(string s) {
int i = 0;
for (int j = 0; j < s.size(); j++) {
if (s[j] == ' ') {
... | ALGO | 0.999972 | 6.175677 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2024-08-05T16:30: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": "fa536d686241... |
cc6da047-9179-4dbb-8359-a701bbf2b8fc | Sum1t01/DSA | llbinarysearch.cpp | #include <bits/stdc++.h>
using namespace std;
class node
{
public:
int data;
node *next;
node(int key)
{
data = key;
next = NULL;
}
};
void display(node *&head)
{
if (head == NULL)
{
return;
}
node *temp = head;
while (temp != NULL)
{
cout <... | ALGO | 0.999956 | 4.564342 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-05-23T19:48: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": "f0005f5dc397... |
75bc2217-1a53-425e-8044-b2b0f147c71a | SEEWON/Algorithm | BOJ/2747.cpp | // 피보나치 수는 0과 1로 시작한다. 0번째 피보나치 수는 0이고, 1번째 피보나치 수는 1이다. 그 다음 2번째 부터는 바로 앞 두 피보나치 수의 합이 된다.
// 이를 식으로 써보면 Fn = Fn-1 + Fn-2 (n ≥ 2)가 된다.
// n=17일때 까지 피보나치 수를 써보면 다음과 같다.
// 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597
// n이 주어졌을 때, n번째 피보나치 수를 구하는 프로그램을 작성하시오.
#include <iostream>
using namesp... | ALGO | 0.99957 | 4.475234 | {
"github_metadata": {
"branch": "master",
"commit_count": 82,
"repo_created_at": "2021-09-02T02:05: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": "19173f199... |
a1bf379b-7bc9-4ceb-8dde-e1567ead776f | mollnn/XCPCHandbook | _old/template_v1/数学/lucas_ext.cpp | // ExLucas
// input n,m,p to get C(m,n) mod p
// p is not limited to prime
// Test: 666 233 123456 -> 61728
#include<bits/stdc++.h>
#define rg register
#define int long long
using namespace std;
inline void exgcd(int a,int b ,int &x,int &y){
if(!b){x=1,y=0;return;}
exgcd(b,a%b,x,y);
int t=x;
x=y,y=t-(... | ALGO | 0.999982 | 4.516984 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2021-01-22T13:21: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": "54b7bee0484... |
0c04c915-b7f9-490b-b405-77c0e5b1d21d | JanaSabuj/cpmaster | HackerEarth/Segment T/GSS1.cpp | /*--------------------------"SABUJ-JANA"------"JADAVPUR UNIVERSITY"--------*/
/*-------------------------------@greenindia-----------------------------------*/
//
// _____ _ _ _
// / ____| | | (_) | |
// | (___ __ _| |__ _ _ _ | | __ _ _ __ __ _
// \___ \ / _... | ALGO | 0.999976 | 5.816734 | {
"github_metadata": {
"branch": "master",
"commit_count": 166,
"repo_created_at": "2018-08-28T16:38:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ccdc6c02... |
426edc2b-dcb9-4fd8-b634-09aff42c7180 | timi-liuliang/echo | thirdparty/mlpack/methods/hmm/hmm_regression_impl.hpp | /**
* @file hmm_regression_impl.hpp
* @author <NAME>
* @author <NAME>
* @author <NAME>
*
* Implementation of HMMRegression class.
*
* mlpack is free software; you may redistribute it and/or modify it under the
* terms of the 3-clause BSD license. You should have received a copy of the
* 3-clause BSD license ... | ALGO | 0.986329 | 7.048034 | {
"github_metadata": {
"branch": "master",
"commit_count": 3016,
"repo_created_at": "2018-03-10T04:07:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 971,
"forks": 116,
"issues": 254,
"pull_requests": 0
},
"file_meta": {
"content_id": "6... |
fe026d11-ae9a-4e70-b6f7-046657ce5c33 | Liu-Cheng/bfs-using-vivado-hls | adm7v3/bfs_4pipeline_wide_data/src/bfs.cpp | #include <hls_stream.h>
#include <ap_int.h>
#include <stdio.h>
#define BUFFER_SIZE 16
typedef ap_uint<1> uint1_dt;
typedef ap_int<128> int128_dt;
typedef ap_int<64> int64_dt;
typedef ap_int<32> int32_dt;
// load depth for inspection
static void read_depth(
int128_dt *depth,
hls::stream<int128_dt> &depth_inspect... | ALGO | 0.995964 | 3.524296 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2018-01-27T02:01:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a5a23dfd... |
c660dd42-c2d9-415e-9b87-f13672a51eee | Tora416/MultiCodeEmbed | dataset/dataset_raw/gcj_cpp/jasonwang924/3264486_5736519012712448_jasonwang924.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int T;
cin >> T;
for (int i = 0; i < T; ++i) {
string s;
int k;
int count = 0;
cin >> s >> k;
for (int j = 0; j < s.size() - k + 1; ++j) {
if (s[j] == '-') {
++count;
s[j] = '+';
for (int l ... | ALGO | 0.999296 | 4.054418 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2025-07-10T08:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fddf4bbb... |
15950dc9-49cc-45a6-b8fd-feae13ba8397 | sarnapiotr/ProjektMD | ProjektMD.cpp | //#include "backtrackGraphColoring.h"
//#include "DSATUR.h"
//#include "T-DSATUR.h"
#include <iostream>
#include <vector>
#include <stack>
#include <unordered_set>
#include <string>
#include <sstream>
#include <algorithm>
void chooseGraphMatrix(int**& graphMatrix, int& vertexCount) {
std::cout << "Wybierz graf do ... | ALGO | 0.997898 | 3.56525 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-07T16:50: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": "417e7ea09c32... |
e6253f7a-2fe1-42e9-82e6-a2bb390a27e6 | jiaaaaaaaqi/ACM_Code | Kattis/stopcounting/22865977_AC_100ms_0kB.cpp | /***************************************************************
> File Name : J.cpp
> Author : Jiaaaaaaaqi
> Created Time : Thu 14 Nov 2019 03:51:13 PM CST
***************************************************************/
#include <map>
#include <set>
#include <list>
#include <ctime>
#include <cmath>
#include <... | ALGO | 0.999745 | 3.369172 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-05-11T16:04: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": "4cd4d6addf... |
4a3f8f26-abf4-4931-b472-8dca3b2e0b83 | blurgyy/templates | Aho-Corasick Automaton/hdu 5880/1.cpp | //很奇怪,有字典树的代码一用g++编译就会MLE
//C++又不能用bits头文件...
//AC自动机...水题吧
//不算g++的MLE和C++的bits编译错误的话,可以说是1A了
//...
//HDU 5880
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<malloc.h>
#include<queue>
using namespace std;
const int maxn = 1000010;
struct Trie
{
Trie *nxt[26], *fail;
//bool finish;
int len;
... | ALGO | 0.999874 | 3.384095 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-11-15T16:43: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": "1692efb7d... |
639003bf-dc87-4a55-bd33-e3617b51db04 | kxingit/LeetCode | Binary_Tree_Right_Side_View.cpp | /*
* Given a binary tree, imagine yourself standing on the right side of it,
* return the values of the nodes you can see ordered from top to bottom.
*/
class Solution {
public:
vector<vector<int>> levelOrder(TreeNode* root) {
vector<vector<int>> result;
if(!root) return result;
vector<Tree... | ALGO | 0.999943 | 6.077024 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2015-05-06T21:10:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1555d5315... |
f5237d30-62a7-4c0f-8d17-0b0c42630cf3 | MisterTea/MAMEHub | Sources/Emulator/src/mame/machine/kaneko_hit.h | /* Kaneko Hit protection */
struct calc1_hit_t
{
UINT16 x1p, y1p, x1s, y1s;
UINT16 x2p, y2p, x2s, y2s;
INT16 x12, y12, x21, y21;
UINT16 mult_a, mult_b;
};
struct calc3_hit_t
{
int x1p, y1p, z1p, x1s, y1s, z1s;
int x2p, y2p, z2p, x2s, y2s, z2s;
int x1po, y1po, z1po, x1so, y1so, z1so;
int x2po, y2po, z2po, ... | ALGO | 0.923904 | 6.48132 | {
"github_metadata": {
"branch": "master",
"commit_count": 362,
"repo_created_at": "2013-03-06T23:02:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 125,
"forks": 29,
"issues": 85,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d43... |
d585dc95-6e08-4e9b-82b7-e5dd401bc8e4 | Mohammad-Imran01/Data-structures-and-Algorithms | DSA Udemy/08. Sparse list/01SparseUsinglist.cpp | #include <iostream>
#include <math.h>
using namespace std;
class Node{
public:
int ceoff;
int pow;
Node* next;
Node() : ceoff {}, pow {}, next { } {}
Node(int ce, int po, Node* nex=nullptr) {
ceoff = ce;
pow = po;
next = nex;
}
};
class poly{
private:
Node* exp;
pu... | ALGO | 0.971163 | 4.36824 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-08T19:03: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": "c35d29c44576... |
e98102ef-170c-42c9-a3c5-07ed5ad24b9f | flexible-collision-library/fcl | include/fcl/narrowphase/detail/traversal/octree/distance/octree_distance_traversal_node.h | /*
* Software License Agreement (BSD License)
*
* Copyright (c) 2011-2014, <NAME>, Inc.
* Copyright (c) 2014-2016, Open Source Robotics Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditio... | ALGO | 0.96404 | 7.13648 | {
"github_metadata": {
"branch": "master",
"commit_count": 863,
"repo_created_at": "2012-09-19T16:50:51.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1572,
"forks": 437,
"issues": 205,
"pull_requests": 36
},
"file_meta": {
"content_id": "2... |
a4f8023a-fb44-4d8f-be85-bb13b6a734cb | sdycxx2279/myAlgorithm | 25.cpp | //
//@author <NAME>
//@create 2018-05-17 10:40
//Reverse Nodes in k-Group
//通过讨论区学习了反转k个节点的方法
//
#include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {}
};
class Solution {
public:
ListNode* reverseKGroup(ListNode* head, int k) {
... | ALGO | 0.999974 | 5.040839 | {
"github_metadata": {
"branch": "master",
"commit_count": 110,
"repo_created_at": "2018-03-21T01:15: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": "99fca75c... |
22a01348-788a-4e89-9fa8-03561429b7f2 | Jzackiewicz/42-Cpp | module08/ex01/Span.cpp | #include "Span.hpp"
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <climits>
#include <vector>
#include <iterator>
Span::Span(unsigned int n) : _maxSize(n) {}
Span::Span(const Span &other) : _numbers(other._numbers), _maxSize(other._maxSize) {}
Span &Span::operator=(const Span &other)
{
i... | ALGO | 0.993453 | 5.434118 | {
"github_metadata": {
"branch": "main",
"commit_count": 78,
"repo_created_at": "2025-05-19T11:22: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": "5c92d8c97fa... |
1510ba27-7e0c-451e-95ef-5f67ce659ad8 | CL221046-PrayagChoudhary/CL221046-PrayagChoudhary | cpp2/assignmentsheet2.cpp | #include <iostream>
#include <vector>
#include <cstdlib>
#include <climits>
#include <unordered_map>
using namespace std;
int largestSub(vector<int> &arr,int n){
int max=0;
for(int i=0;i<n-1;i++){
int sum=0;
for(int j=i;j<n;j++){
sum = sum+arr[j];
if(sum>max){
... | ALGO | 0.999829 | 4.337751 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-09-26T07:56: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": "71a7912a4f61... |
6442c4b6-30f6-47f8-a310-7d9f07337ecc | alvintang0925/GNQTS_RSI | main.cpp | //
// main.cpp
// GNQTS RSI
//
// Created by 唐健恆 on 2021/4/9.
// Copyright © 2021 Alvin. All rights reserved.
//
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <sstream>
#include <filesystem>
#include <string>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>... | DATA | 0.981272 | 4.117515 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2021-04-10T16:00: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": "ae43b5670... |
3088d2f9-f192-4632-ac7c-a19ca35147a3 | jackdpartridge/Connect-4-Code | Source.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
//Define the rows/columns for the martix
#define ROW 6
#define COLUMN 7
//Function called before main.
void DisplayMatrix();
void PlayerPlacement(int player);
bool DiagnolWinLeftRight(int x, int y, int player);
bool DiagnolWinRightLeft(int x, int y, int pla... | ALGO | 0.998664 | 4.104873 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-10-09T12:59: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": "4fd1b22b9dda... |
f395937e-75cc-4cb0-9e9e-35c944b89060 | luam0oliveira/competitive_programming | codeforces/216b.cpp | // https://codeforces.com/contest/216/problem/B
// Grafos - Bicoloracao
// Quando se controi um grafo bipartido, eh a mesma coisa que estar separando o
// grafo em dois grupos (os coloridos e os nao-coloridos)
#include<bits/stdc++.h>
#define ll long long
#define pi pair<int,int>
#define QUAT(x) x*x;
using namespace st... | ALGO | 0.999845 | 4.095423 | {
"github_metadata": {
"branch": "main",
"commit_count": 125,
"repo_created_at": "2023-11-14T15:01: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": "2477dbcbe7... |
d816b314-60b6-4f95-9433-b8b27db8cfcc | Acytoo/leetcode | c++/50pow.cc | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <climits>
#include <stack>
#include <algorithm>
#include <cmath>
#include <set>
using namespace std;
static int x = [] () {ios::sync_with_stdio(false); cin.tie(0); return 0;} ();
class Solution {
public:
double myPow(double x, int n) ... | ALGO | 0.99949 | 4.605196 | {
"github_metadata": {
"branch": "master",
"commit_count": 417,
"repo_created_at": "2018-11-01T11:52:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eabb1bed... |
158f2cbe-bf92-4cf7-9d4b-b898cabd429f | FabriceScoupe/ProjectEuler | 204/Problem204.cc | #include <iostream>
#include <cstdlib>
#include <set>
using namespace std;
/***
A Hamming number is a positive number which has no prime factor larger than 5.
So the first few Hamming numbers are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15.
There are 1105 Hamming numbers not exceeding 10^(8).
We will call a positive number a... | ALGO | 0.999699 | 4.929922 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2012-05-11T14:42:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7edcfdcbe... |
eba893da-9d3d-47fc-af77-7251e03bec4d | ishandutta2007/codeforces-b | brovko/normal/1706/C.cpp | #include <bits/stdc++.h>
//#define int long long
#define pb push_back
using li = long long;
using namespace std;
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
vector <int> a(n);
f... | ALGO | 0.999709 | 4.4468 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-04-11T01:05:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "813c6b623329... |
ba47dc90-2f6f-4c47-b273-6f3bde545e38 | wtz19945/Digit_Main | src/mpc_solver.cpp | #include "mpc_solver.hpp"
using namespace Eigen;
using namespace std;
MPC_Solver::MPC_Solver(int Cons_Num, int Vars_Num){
Cons_Num_ = Cons_Num;
Vars_Num_ = Vars_Num;
QP_initialized_ = 0;
hessian_.resize(Vars_Num_,Vars_Num_);
linearMatrix_.resize(Cons_Num_,Vars_Num_);
gradient_ = VectorXd::Zero... | ALGO | 0.995442 | 4.71103 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2023-11-26T19:58: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": "a755aff2297... |
019b49a0-abb4-434e-8837-bca5a3801e2c | Prajjwal-5432/Leetcode-Solutions | BIt Manipulation/52.Score After Flipping Matrix(imp).cpp | //Link: https://leetcode.com/problems/score-after-flipping-matrix/
//We should turn every value of the first col 1 to get the maximum sum
class Solution {
public:
int matrixScore(vector<vector<int>>& grid) {
int n = grid.size(), m = grid[0].size();
for(int j = 0; j < m; ++j) {
... | ALGO | 0.999978 | 6.142738 | {
"github_metadata": {
"branch": "main",
"commit_count": 339,
"repo_created_at": "2022-02-20T20:20:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dc3ab86884... |
6cf6b0f9-f14d-4982-8ef9-d4d55083c33b | Junyi-Liu/PolyTSS | benchmarks/src_FSME/motion_accel.cpp | /*
* motion_accel.cpp
*
* Created on: 26 Aug 2017
* Author: jl12013
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "motion_accel.h"
/* Begin Extra Functions Definition */
inline int min(int a, int b) { return (a<b) ? a : b;}
inline int max(int a, int b) { return (a>b) ? a : b;}
/* ... | ALGO | 0.974758 | 4.3273 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-07-03T22:35:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "492f40ac30... |
ebe98707-f02b-4fad-9a5c-0527340169c7 | MishkatIT/others-oj-submissions | Toph/An Obvious Interactive Problem/sol.cpp | /*
author : MishkatIT
created : Saturday 2023-09-30-19.17.42
*/
#include<bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define debug(_) cout << #_ << " is " << _ << '\n';
using namespace std;
using ll = long long;
using ld = long double;
const ll mod = 1e9... | ALGO | 0.999944 | 3.65146 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2024-07-05T15:12: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": "6fb607ae60d... |
049c0c50-e75b-4351-b4c9-4159c3a911f1 | Sid-bit28/Competitve-Programming | Leetcode/Striver Stacks and Queues/Queue using Linked List.cpp | /* Structure of a node in Queue
struct QueueNode
{
int data;
QueueNode *next;
QueueNode(int a)
{
data = a;
next = NULL;
}
};
And structure of MyQueue
struct MyQueue {
QueueNode *front;
QueueNode *rear;
void push(int);
int pop();
MyQueue() {front = rear = NULL;}
}... | ALGO | 0.999175 | 4.099306 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-06-01T17:44:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "054be2ee4f0... |
cb435337-0508-439a-8eef-4202ff4927b9 | zhuzhuc/Algorithm | 【算法1-1】模拟与高精度/P1786.cpp | #include<bits/stdc++.h>
using namespace std;
int n;
struct node {
string na, zw, xzw;
long long bg;
int le, h;
} ab[115];
int change(string a) {
if (a == "BangZhu") return 0;
if (a == "FuBangZhu") return 1;
if (a == "HuFa") return 2;
if (a == "ZhangLao") return 3;
if (a == "TangZhu") ... | ALGO | 0.998699 | 3.294946 | {
"github_metadata": {
"branch": "main",
"commit_count": 233,
"repo_created_at": "2024-06-19T13:35:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4dc8843a02... |
cf414af5-9885-499f-99c9-15fe951bb014 | leeeyupeng/leeeyupeng.github.io | project/algorithm/leetcode/src/39.combinationSum_2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include<string>
#include<map>
#include<unordered_map>
using namespace std;
#define MAX 505
class Solution {
private:
bool dp[MAX];
vector<pair<int, int>> path[MAX];
vector<int> vsums;
vector<vector<int>> ans;
void d... | ALGO | 0.99998 | 5.48462 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2020-02-12T02:05:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8231fc54ea... |
77718d8c-b388-4d0c-b667-af8a72a619fb | moukayz/AlgorithmTraining | leetcode/test2.cpp | #include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "header.h"
using namespace testing;
class Solution {
public:
int NumberOfMountainSeen(const std::vector<int>& height)
{
if (height.size() == 1) {
return 0;
}
auto len{height.size()};
auto count{0U};
... | TEST | 0.998361 | 6.383943 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2018-12-12T02:59: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": "0fd471c47... |
0447367a-11c9-4c56-a6ef-862df732da97 | o3de/o3de | Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Converters/FIR-Weights.h | /*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include "FIR-Windows.h"
namespace ImageProcessingAtom
{
/* ##################... | TOOL | 0.971021 | 6.852892 | {
"github_metadata": {
"branch": "development",
"commit_count": 26515,
"repo_created_at": "2021-04-05T06:38:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8421,
"forks": 2320,
"issues": 3293,
"pull_requests": 98
},
"file_meta": {
"conten... |
d724f6eb-4bb0-47f4-9ae5-924a071b1422 | scanstatistics/satscan | calculation/loglikelihood/OrdinalLikelihoodCalculation.h | //******************************************************************************
#ifndef __OrdinalLikelihoodCalculation_H
#define __OrdinalLikelihoodCalculation_H
//******************************************************************************
#include "LikelihoodCalculation.h"
/** Representation of ordinal categories... | ALGO | 0.983869 | 7.84446 | {
"github_metadata": {
"branch": "b_10_3_2",
"commit_count": 4413,
"repo_created_at": "2025-04-01T13:34:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c52ebf... |
87d39456-bc1b-43b0-bb1c-0bac746956cb | starFalll/WDB-Sort | main/Sort.cpp | #include "Sort.h"
#include <algorithm>
SortPlan::SortPlan (Plan * const input) : Plan(input->GetSize()), _input (input)
{
} // SortPlan::SortPlan
SortPlan::~SortPlan ()
{
delete _input;
} // SortPlan::~SortPlan
Iterator * SortPlan::init () const
{
//TRACE (TRACE_SWITCH);
return new SortIterator (this);
} // SortP... | ALGO | 0.98969 | 5.217164 | {
"github_metadata": {
"branch": "main",
"commit_count": 154,
"repo_created_at": "2023-09-23T20:49:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a196003aa3... |
a5401f35-ada4-4439-957b-34c5b5afcf95 | cmperdomo17/Analisis-Numerico | Primer Corte/menuRaices_cmperdomo/secante.h | #ifndef SECANTE_H
#define SECANTE_H
#include <string>
#include "Expression.h"
#include "solucion.h"
using std::string;
using raices::solucion;
using raices::calcular_erp;
using raices::es_cero;
namespace raices {
/**
* @brief Implementacion del metodo de la Secante
*/
class secante {
public:
/**
* @brief C... | ALGO | 0.999951 | 5.183906 | {
"github_metadata": {
"branch": "main",
"commit_count": 26,
"repo_created_at": "2023-09-08T20:41: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": "51bb04ea259... |
fe56a6ab-33a6-4986-a693-51793168b410 | sean-purcell/lfc | reconstruction/reconstruction.cpp | // https://oi.edu.pl/en/archive/pa/2008/odb
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
int N;
cin >> N;
// Split into 6 * 5 / 2 regions, plus N for individuality
vector<ll> P;
P.push_back(2);
ll R = min(N, 5);
if (N == 7) {
R = min(N, 6);... | ALGO | 0.99978 | 3.533453 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-12-26T19:17: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": "516666698... |
f5f7e2dc-5fce-4a4c-8e0c-62bd25e64f23 | KimYeonJun/ProblemSolving | SWEA/보호 필름/보호 필름.cpp | /*
SWEA 2112번 : 보호 필름
문제유형 : 시뮬레이션(DFS)
1. DFS 조합으로 막을 선택하고, 약품 A를 넣을지 B를 넣을지 정함.(DFS의 반복문)
(1) 막과 약품을 선택했으면 해당 막에 약품을 투여함(Change(x,med,true))
(2) 재귀가 return되었으면, 해당 막을 복구 시킴(Change(x,med,false))
2. 성능검사(Check())
<!-- 조심할 것 -->
D의 범위가 최대 13이라서, 시간초과 발생.
DFS에서 약을 투여하는 막을 선택한 횟수(cnt)가 result보다 커지면 해당 재귀는 멈춰야함.
(최소... | ALGO | 0.99994 | 4.429238 | {
"github_metadata": {
"branch": "master",
"commit_count": 204,
"repo_created_at": "2019-12-23T13:36: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": "67487061... |
0eecd39e-a49b-4ef5-b005-c54b07424d85 | modulexcite/cpp-code-snippets | src/code/iterators/stream_iterators/count_chars.h | #include <iostream>
#include <sstream> // istringstream
#include <iterator>
#include <algorithm>
void count_all_chars_skip_whitespaces() {
std::istringstream in{"ab c d !? &*"};
// istream_iterator<char> will iterator through every char in the stream, except
// white spaces.
using Iterator = std::istream_ite... | ALGO | 0.926853 | 6.491069 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2015-11-11T12:17: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": "fb7b187925... |
4a61243c-9715-4a71-b571-ca54ffba0b53 | prabhxjottsingh/leetcode-practise-problems | Dynamic Programming/0647 - Palindromic Substrings.cpp | // Problem Link: https://leetcode.com/problems/palindromic-substrings/
// Time Complexity: O(N * N)
// Space Complexity: O(N * N)
class Solution
{
public:
int countSubstrings(string s)
{
int n = s.size();
int dp[n][n];
memset(dp, 0, sizeof(dp));
int gap = 0;
int resCoun... | ALGO | 0.999996 | 6.461642 | {
"github_metadata": {
"branch": "master",
"commit_count": 300,
"repo_created_at": "2021-11-27T09:11:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4bd5292e... |
67ea7f09-5a78-40b5-a536-d197799f1f27 | msu-evrl/AMAND | DriveForwardFor3Sec.cpp | // Include the servo library and create a Servo object (for steering)
#include <Servo.h>
Servo myservo;
// Program options
#define MEASURE_TIMING 0 // Measure and display pulse timing
#define SWEEP_STEERING 0 // Sweep the stearing back and forth
#define DRIVE_FORWARD 0 // Drive forward at a given speed
#de... | TOOL | 0.920828 | 6.36776 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-06-26T20:22:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0bf0f347def... |
eb00705a-b578-4059-b361-89cb4dcbc818 | x1aotian/efmi-omni-sinusoid | include/fmiRegistration.hh | #ifndef _FMI_REGISTRATION__HH__
#define _FMI_REGISTRATION__HH__
#include "fmiImage.hh"
#include "fftMath.hh"
#include <vector>
#include <numeric>
#include <opencv2/opencv.hpp>
#define ONLY_TRANS 0
namespace jacobs_robotics {
struct FMIResult;
class FMIRegistration {
public:
FMIRegistration(co... | TOOL | 0.969181 | 6.380932 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-11-02T01:02: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": "03ec08ccfa... |
90489c4d-2ee0-4e5f-bacb-c8b032602ab0 | khu-kimjunseo/DPO_for_CodeGen | codes/golden/cpp/HumanEval_130_tri.cpp | #include<assert.h>
#include<bits/stdc++.h>
#include<vector>
#include<sstream>
#include<regex>
#include<map>
#include<set>
std::vector<long> tri(long n) {
if (n == 0) {
return {1};
}
std::vector<long> my_tri = {1, 3};
for (long i = 2; i <= n; ++i) {
if (i % 2 == 0) {
my_tri.pu... | ALGO | 0.999465 | 4.467155 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-12-12T11:58: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": "7444849b7bbb... |
dd26ed83-0253-481b-a0b3-c80038c36c25 | AndrewFITE/TIMPUSHECHKA_2 | Task2/modAlphaCipher.cpp | #include "modAlphaCipher.h"
using namespace std;
Cipher::Cipher(wstring & ws_key)
{
colum = getValidKey(ws_key);
}
void Cipher::set_key(wstring & ws_key)
{
colum = getValidKey(ws_key);
}
void Cipher::set_tableform(const wstring& open_text)
{
len_text = open_text.size();
if (len_text>colum) {
num = len_text/colum... | ALGO | 0.966684 | 4.443541 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-11-28T02:41: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": "5351d0b0bfd5... |
690f5def-4c57-48d0-bac1-26ae7e912a0d | jauvariah/RandomCode | SYDE121/Lab 4/Lab0401.cpp | //*********************************************
// Student Name: Shuai (<NAME>
// Student Number: 20339943
//
// SYDE 121 Lab: 04 Assignment: 01
//
// Filename: Lab0401.cpp
// Date submitted: October 9, 2013
//
// I hereby declare that this code, submitted
// for credit for the course SYDE121, is a product
// of my own... | ALGO | 0.996066 | 5.033592 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-07-07T17:45: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": "d2cbc8f06... |
1fe09e45-3db2-402a-9ec9-7693e632b959 | werner291/Multigoal-Orchard-Drone-Planning-Library | src_old/PathLengthPredictor.h | //
// Created by werner on 25-3-23.
//
#ifndef NEW_PLANNERS_PATHLENGTHPREDICTOR_H
#define NEW_PLANNERS_PATHLENGTHPREDICTOR_H
#include <geometric_shapes/bodies.h>
#include <utility>
#include <json/value.h>
#include "procedural_tree_generation.h"
#include "AppleTreePlanningScene.h"
#include "utilities/enclosing_sphere... | ALGO | 0.991325 | 6.660788 | {
"github_metadata": {
"branch": "main",
"commit_count": 1146,
"repo_created_at": "2021-08-11T14:52:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3acf14342... |
ff56de06-24b2-4417-8927-feaeb765f339 | zeusptit/CPP_Code.ptit | CPP0225_BIẾN ĐỔI MA TRẬN.cpp | #include <bits/stdc++.h>
using namespace std;
#define quick() ios_base::sync_with_stdio(false); cin.tie(0);
using ll = long long;
int main(){
quick();
int t;
cin >> t;
while (t--)
{
long n;
cin >> n;
long i,j,tmp;
long a[n][n];
long h[n],c[n];
fill(... | ALGO | 0.999985 | 3.609735 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-11-21T12:05:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2161509f966b... |
87792788-8345-4db9-82ab-d56a0c80bcad | nkb02/leetcode | Shortest Source to Destination Path - GFG/shortest-source-to-destination-path.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:
int shortestDistance(int N, int M, vector<vector<int>> A, int X, int Y) {
// code here
if(A[0][0] != 1) return -1;
... | ALGO | 0.999963 | 5.739739 | {
"github_metadata": {
"branch": "main",
"commit_count": 880,
"repo_created_at": "2023-06-27T10:06: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": "0ccddb11b5... |
ab8cfd2c-fdf6-41fa-910b-07eed63a9761 | hushpe/leetcode | Num_033_search-in-rotated-sorted-array.cpp | #include<iostream>
#include<vector>
// https://leetcode-cn.com/problems/search-in-rotated-sorted-array/
using namespace std;
class Solution {
public:
int search(vector<int>& nums, int target) {
if(nums.empty()) return -1;
if(nums.size() == 1) return (target == nums[0])? 0: -1;
int left = 0... | ALGO | 0.99997 | 5.636024 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-04-12T12:30: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": "a92d61bebc... |
f7a2ea38-3a2f-42f7-a834-a84bedc15d34 | Shoyeb45/CompetitiveProgramming | Codeforces/Contest/GroupPracticeConstes/contest2/F.cpp | #include<bits/stdc++.h>
using namespace std;
#define range(x) (x).begin(), (x).end()
#define NFS ios_base::sync_with_stdio(false); cin.tie(NULL);
typedef long long ll;
const ll mod = 1000000007;
string s, t;
void solve() {
cin >> s >> t;
int i = 0, j = 0;
while(i < s.size() && j < t.size()) {
if(s... | ALGO | 0.999967 | 4.444669 | {
"github_metadata": {
"branch": "main",
"commit_count": 1085,
"repo_created_at": "2024-01-22T14:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7007e4973... |
f873fa3f-b743-4f23-80b9-ea50ad26d5be | nawngs/CompetitiveProgramming | Codeforces/1550b.cpp | #include <bits/stdc++.h>
using namespace std;
int ntest;
int main(){
cin >> ntest;
while(ntest --){
int n, a, b;
string s;
cin >> n >> a >> b >> s;
if(b >= 0){
cout << a * n + b * n << '\n';
continue;
}
char ch = s[0];
int cnt1 = 0;
int cnt0 = 0;
s[n + 1] = '2';
for(int i = 1; i <= n; i++... | ALGO | 0.997174 | 3.22087 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2021-06-19T07:51: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": "8f3bcf76816... |
ab4c101e-97ba-4c36-96a1-994c31ed0929 | abhishek18008/leetcode_problems | 108.convert-sorted-array-to-binary-search-tree.cpp | /*
* @lc app=leetcode id=108 lang=cpp
*
* [108] Convert Sorted Array to Binary Search Tree
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(... | ALGO | 0.999982 | 6.94086 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-10-20T16:23:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "933f402ce7bc... |
8d5843b9-bf36-461e-b65d-5df40b6eda01 | Angshuman032001/Topic-Wise-CP-Problems | DP on Trees/Alternating Edges (codechef).cpp | //https://www.codechef.com/SPY22022/problems/CP_04
/*#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")*/
#include "bits/stdc++.h"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define fo(i,n) for(int i=0;i<n;i++)
#defi... | ALGO | 0.999944 | 5.303901 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2021-08-03T07:04:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c05c4cae7... |
5eb79280-4a6f-4e87-8fa3-04a0b3e7b3b3 | Siddharth-G06/Data-Structures-LAB | Lab Exercise 6/conversion.cpp | #include "Stack.h"
int precedence(char op) {
if (op == '+' || op == '-') return 1;
if (op == '*' || op == '/') return 2;
return 0;
}
string infixToPostfix(const string& infix) {
Stack s;
string postfix;
for (char ch : infix) {
if (isalnum(ch)) { // Operand
postfix += ch;
... | ALGO | 0.999194 | 5.959312 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2025-04-26T13:04: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": "81a776d9372... |
d2e30ab0-c78b-46aa-9fcc-8fa8e8a75736 | rikuTanide/atcoder_endeavor | dwacon6th-prelims/dwacon6th_prelims_a.cpp | #include <bits/stdc++.h>
#include <cmath>
using namespace std;
typedef long long ll;
//typedef unsigned long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
//typedef pair<int, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e1... | ALGO | 0.999807 | 4.899679 | {
"github_metadata": {
"branch": "master",
"commit_count": 4423,
"repo_created_at": "2020-12-05T04:36: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": "3e30ada... |
ab906ba5-3288-45f3-b6fa-9a8161592b7c | mukel/ProgrammingContests | OldStuff/SPOJ/new10/temptisl.cpp | /*
<NAME> (mukel)
SPOJ #4179 "Temptation Island"
22 - 5 - 2009
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
#define REP( i, n ) for ( int i = 0; i < (n); i++ )
typedef long long int64;
const int MAXN = 100;
int N, K, A, B;
int64 dp[2][MAXN];
int main() {
while (1) {
scanf(... | ALGO | 0.999962 | 3.371917 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2013-10-16T00:48:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 12,
"forks": 16,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b989d9... |
c7edadb4-12b1-4cd7-a60a-d143bb86bfef | GarageGames/Torque3D | Engine/source/collision/convex.cpp | //-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// 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 restrictio... | TOOL | 0.97752 | 5.122472 | {
"github_metadata": {
"branch": "development",
"commit_count": 3540,
"repo_created_at": "2012-09-18T20:33:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3358,
"forks": 1193,
"issues": 309,
"pull_requests": 64
},
"file_meta": {
"content_... |
161df5e9-e32a-4902-9ad9-6fc688100c9b | navneetk2001/CPP_Programs | Geeks for Geeks/Problem of the Day GFG/92. Move all zeros to the front of the linked list_GFG.cpp | Given a linked list, the task is to move all 0s to the front of the linked list. The order of all another element except 0 should be same after rearrangement.
Example 1:
Input: 0 -> 4 -> 0 -> 5 -> 0
Output: 0 -> 0 -> 0 -> 4 -> 5
Explanation: After moving all 0s of the given list to the front, the list is: 0 -> 0 -> 0... | ALGO | 0.999895 | 6.083829 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-02-14T06:01:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cde515759f... |
85cb2389-b912-4678-944e-b315b67a6dc3 | hoa-nguyen-bk/DSA_ThayDuy_233 | lab/week4/cau2_insert.cpp | /*In this question, you have to perform add on AVL tree. Note that:
- When adding a node which has the same value as parent node, add it in the right sub tree.*/
int BalanceFactor(Node* pNode){
if(pNode==NULL) return 0;
return getHeightRec(pNode->pRight) - getHeightRec(pNode->pLeft);
}
Node* LLRotation(Node* pN... | ALGO | 0.999908 | 5.523653 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-06-26T11:14: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": "c9b4b0242e7... |
5436c458-75c9-44ff-9a57-251e1a2beb56 | tongninghu/My-Leetcode | 309.cpp | Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one and sell one share of the stock multiple times) with the following restrictions:
You may not engage in multiple transac... | ALGO | 0.999959 | 5.753511 | {
"github_metadata": {
"branch": "master",
"commit_count": 335,
"repo_created_at": "2015-08-25T21:47: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": "8767e1a5... |
be4f75a5-640d-4aed-97c2-436f5c6859f0 | Mahathi1992/hyproOld | test/benchmark/hyproBenchmark/box/computeSupport.cpp | #include "benchmarkBox.h"
namespace benchmark {
namespace box {
Results<std::size_t> computeSupport( const Settings& settings ) {
Results<std::size_t> ress;
hypro::Box<::benchmark::Number> box;
box.insert( carl::Interval<::benchmark::Number>( -1, 1 ) );
// initialize random number generator
std::mt19937 generat... | ALGO | 0.963909 | 6.757017 | {
"github_metadata": {
"branch": "master",
"commit_count": 5231,
"repo_created_at": "2022-08-03T08: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": "940a6a0... |
ae462870-5a8b-4e8b-a741-67e28c5c11b0 | rayy1218/ClassWork | archieve/OOP class/T8/Q1.cpp | #include <iostream>
#include <cmath>
class Geometry {
private:
float PI, height, radius;
public:
friend class Cylinder;
friend class Cone;
Geometry(float height, float radius);
~Geometry();
};
class Cylinder {
private:
float vol;
public:
void calcVol(Geometry *g);
};
class Cone {
private... | TOOL | 0.994603 | 5.070273 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2021-08-11T13:07:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1e81c45c... |
1ddd2431-8307-4d89-b6ce-cd121ab7b09a | flk91/LabCpp | Operazioni/03-Operazioni.cpp | /*
Presi in input due numeri, mostrare a video il risultato delle 4 operazioni aritmetiche fondamentali.
*/
#include <iostream>
using namespace std;
int main()
{
int a, b, somma, differenza, prodotto, quoziente1, resto;
float quoziente2;
cout << "Digitare il primo numero: ";
cin >> a;
cout << "... | ALGO | 0.997196 | 4.147858 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-02-17T21:46: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": "b43f6ead13... |
1a493c00-8f3c-4c0a-af31-444958328a5b | mikhaylova-daria/associative_array | RBTree.h | #ifndef RBTREE_H
#define RBTREE_H
#include <algorithm>
#include <set>
#include <stdexcept>
using namespace std;
template <typename T, typename U, typename Compare = std::less<T> >
class RBtree
{
Compare comp;
struct Node;
Node NIL;
Node * root;
struct Node
{
bool colour; //true - черный,... | ALGO | 0.994175 | 4.477907 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2013-05-18T18:54: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": "6a1277588... |
d60a5d34-5ff1-416a-b992-5a149e8d0053 | DarkSideMandrillo/C_CPP | 125_STL_TemplateClass/main.cpp | #include <iostream>
#include <string>
#include <vector>
/*
Template classes are typically completly contained in header file
so, we would have the template class in item.h and no item.cpp file
*/
template <typename T>
class item
{
private:
std::string name;
T value;
public:
item(std::string name, T value... | TOOL | 0.931937 | 4.780268 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-28T15:06: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": "fa442c2f8f46... |
41ba2311-ce17-4edf-865a-9427ac8bcecc | dillonhuff/clockwork | static_quad_value_bit_vector.h | #pragma once
#include <algorithm>
#include <bitset>
#include <cassert>
#include <iostream>
#include <stdint.h>
#include <type_traits>
// This is a comment
typedef int8_t bv_sint8;
typedef int32_t bv_sint32;
typedef uint8_t bv_uint8;
typedef uint16_t bv_uint16;
typedef uint32_t bv_uint32;
typedef uint64_t bv_uint... | TOOL | 0.964526 | 5.648884 | {
"github_metadata": {
"branch": "master",
"commit_count": 6305,
"repo_created_at": "2020-03-02T23:33:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 59,
"forks": 12,
"issues": 20,
"pull_requests": 3
},
"file_meta": {
"content_id": "1661... |
758912a4-adff-4bb6-8c2c-f4711f97d5fe | InwooLeeme/Algorithm | Boj/23288.cpp | #pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
usin... | ALGO | 0.999973 | 4.227311 | {
"github_metadata": {
"branch": "main",
"commit_count": 2142,
"repo_created_at": "2021-03-08T04:16: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": "1ec7303a8... |
b43fa267-c835-40a7-a74c-22b2ed80a939 | calmh/pre-git | Unix/tavling2001/rings/rings.cc | #include <iostream>
using namespace std;
struct Ring {
double x, y, r;
int group;
};
/*
** Kolla om två ringar överlappar: tillräckligt nära men inte helt inuti varandra.
*/
bool overlaps(Ring* a, Ring* b) {
double dist = (a->x - b->x) * (a->x - b->x) + (a->y - b->y) * (a->y - b->y);
double rads = (a->r + b->r) *... | ALGO | 0.998667 | 4.104102 | {
"github_metadata": {
"branch": "master",
"commit_count": 312,
"repo_created_at": "2016-08-12T10:55: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": "bd905349... |
c56bc010-1008-45bb-a977-3df8fd12b14f | Hermera/OI | Code/BZOJ/2324.cpp | #include <queue>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 505;
const int INF = 1e9;
int n, m, v, s, t, flow, cost;
int dis[maxn], iter[maxn], w[maxn][maxn];
struct Edge { int to, rev, cap, cost; };
vector <Edge> G[maxn];
bool vis[maxn];
queue <int> q;
bool spfa(... | ALGO | 0.999862 | 3.916337 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2017-06-07T14:16: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": "1eebbe94c... |
2ef52ece-22bf-408f-8dbb-e7a3a6ffa686 | 1802802/SwordOffer_UML_DesignPattern | Sword_OFFER/面试题46—把数字翻译成字符串.cpp | // 面试题46—把数字翻译成字符串
// 题目:给定一个数字,我们按照如下规则把它翻译为字符串:0翻译成"a",1翻
// 译成"b",……,11翻译成"l",……,25翻译成"z"。一个数字可能有多个翻译。例
// 如12258有5种不同的翻译,它们分别是"bccfi"、"bwfi"、"bczi"、"mcfi"和
// "mzi"。请编程实现一个函数用来计算一个数字有多少种不同的翻译方法。
#include <queue>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
//1.... | ALGO | 0.999645 | 4.93392 | {
"github_metadata": {
"branch": "master",
"commit_count": 52,
"repo_created_at": "2019-03-28T06:10:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ee12d991e... |
84f681aa-e009-46d2-aa9d-2586087a0e74 | ElSennio/Interpolation | src/Splines.cpp | #include <fstream>
#include <vector>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <limits>
#include <memory>
#include "Splines.h"
using namespace std;
/**
* @brief Construct a new Cubic Splines:: Cubic Splines object
*
* @param x_vector
* @param y_vector
*/
CubicSplines::CubicSplines(const vec... | ALGO | 0.999577 | 5.090361 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-01-25T18:05: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": "bb3fc800b402... |
e7fd0625-39a3-4691-86ae-09710372a9e1 | Musfiqshohan/My-Code-Library | DATA STRUCTURES/LCA.cpp | #include<bits/stdc++.h>
#define pb push_back
#define ms(a,b) memset((a),(b),sizeof(a))
//#define clear(v,n) for(_typeof (n) i=0;i< (n) ; i++) { v.clear(); }
#define i64 long long
#define pii pair<i64,i64>
#define inf 100000000000
#define in(a) freopen(a,"r", stdin)
#define out(a) freopen(a,"w",stdout)
#define rep(i,n)... | ALGO | 0.99998 | 3.911409 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2017-07-28T06:53:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a495d6ddb... |
f63e83bb-f507-4d7c-ac6f-cd0f6f20480f | raj-prince/geeks | gas_station_circuit.cpp | #include <cstdio>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <bitset>
#include <list>
#include <set>
#include <map>
using namespace std;
// here we have to find first station to complete the tour.
// gas[i... | ALGO | 0.999944 | 3.865146 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2016-08-27T20:07:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8e372b2c9... |
215c06ea-5bc5-4b6b-9708-7f1d79187de5 | daodaoawaker/DataStructure-and-Algorithm | JZOffer/Solution01/链表/002. 反转链表/solution00.cpp |
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {}
};
/**
* 解题思路:
*
* 使用递归的思路先到达链表的末尾结点(在这个过程中需要创建局部变量用来保存前驱结点和当前结点),
* 然后从后往前依次改变当前结点和前驱结点之间的连接关系,实现结点指向的反转。
*
*/
class Solution {
public:
Solution() : preHead(new ListNode(0)), newHead(new ListNode(0)) {}
... | ALGO | 0.999994 | 5.592901 | {
"github_metadata": {
"branch": "master",
"commit_count": 69,
"repo_created_at": "2021-11-09T16:47: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": "75ac82f3f... |
7147ec13-ef88-42c2-bcfe-c7278b175885 | sandstorm666/offer | 二叉树展开为链表.cpp | // 给你二叉树的根结点 root ,请你将它展开为一个单链表:
// 展开后的单链表应该同样使用 TreeNode ,其中 right 子指针指向链表中下一个结点,
//而左子指针始终为 null。 展开后的单链表应该与二叉树 先序遍历 顺序相同。
class TreeNode
{
public:
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullpt... | ALGO | 0.999958 | 4.902071 | {
"github_metadata": {
"branch": "master",
"commit_count": 80,
"repo_created_at": "2022-05-08T11:49: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": "88ae4a0ef... |
d448472d-d33b-44c6-acc2-d79248a0cb62 | jpdotcom/comp_prog-archive | Auto_Upload_Codeforces/Codeforces_Round_779_Div_2/C_Shinju_and_the_Lost_Permutation.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define FOR(b) for(int i=0;i<b;i++)
typedef std::vector<int> vi;
typedef std::pair<long long,long long> pi;
#define mp(a,b) make_pair(a,b)
typedef long long ll;
typedef std::priority_queue<int> pq... | ALGO | 0.999825 | 4.61914 | {
"github_metadata": {
"branch": "main",
"commit_count": 3908,
"repo_created_at": "2022-09-25T03:06:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30605ad18... |
77e20bca-5c9d-48d4-a798-cf3b998dee30 | phamT1042/DSA-PTIT | Advanced Graph/DSA10011.cpp | #include<bits/stdc++.h>
using namespace std;
int dx[4] = {0, -1, 1, 0};
int dy[4] = {-1, 0, 0, 1};
int Dijkstra_Matrix (vector<int> a[], int n, int m) {
int p[n][m], d[n][m];
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++) {
p[i][j] = 0;
d[i][j] = INT_MAX;
}
... | ALGO | 0.999984 | 4.018908 | {
"github_metadata": {
"branch": "main",
"commit_count": 603,
"repo_created_at": "2023-01-30T03:31:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f534eeb3b... |
95d7109a-14ae-4d6a-9558-404a5e2cbf23 | greatyao/facealignment | esr/src/ESRFern.cpp | #include "ESRFern.hpp"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <fstream>
#include <math.h>
#include <vector>
#include "ESRUtils.hpp"
#include "ESRCommon.hpp"
using namespace cv;
namespace ESR
{
void Fern::loadModel(std::ifstream& fin)
{
loadVal(fin, n... | DATA | 0.980381 | 4.76605 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-06-23T15:31:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9f4111f24... |
6b64b757-444a-426a-87de-96d372a21813 | xyjzhao/hw3 | heap.h | #ifndef HEAP_H
#define HEAP_H
#include <functional>
#include <stdexcept>
#include <vector>
template <typename T, typename PComparator = std::less<T> >
class Heap
{
public:
/**
* @brief Construct a new Heap object
*
* @param m ary-ness of heap tree (default to 2)
* @param c binary predicate function/func... | ALGO | 0.997999 | 6.975475 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-06T01:08: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": "e6b3a372e6c5... |
7a098fb3-b38f-4eb1-adc9-f94fbdcb30b1 | hyz317/Computational-Graphics-THU-2020 | bigWork/src/photon_tracer.cpp | #include "photon_tracer.hpp"
#include <iostream>
PhotonTracer::PhotonTracer(std::vector<Light*>& l, int e, int d, float tm) : lights(l) {
iteration = 0;
photonmap = nullptr;
hitpointMap = nullptr;
emit_photons = e;
max_depth = d;
tmin = tm;
}
bool PhotonTracer::PhotonDiffusion(Ray& ray, Hit& hit, Photo... | ALGO | 0.994684 | 4.572931 | {
"github_metadata": {
"branch": "master",
"commit_count": 39,
"repo_created_at": "2020-03-01T03:18:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5f2e6325... |
f8e23785-39e1-4643-b5e1-49522fd5839d | nafi103/Solved-Problems | CSES/Subarray_Divisibility.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
/****************************************************************/
#define int long long
#define pi acos(-1.0)
#define mod 998244353
#define inf... | ALGO | 0.999878 | 4.311535 | {
"github_metadata": {
"branch": "main",
"commit_count": 224,
"repo_created_at": "2024-09-04T14:52: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": "4bdfa71acd... |
49d6603f-dfdd-4fef-91d7-08c00005f9d2 | nucleargezi/acm-icpc | codeforces/div2/2109 cf1025 -F/2109D.cpp | #include "MeIoN_Lib/Z_H/MeioN.hpp"
#include "MeIoN_Lib/MeIoN_all.hpp"
#include "MeIoN_Lib/IO/fmt.hpp"
#include "MeIoN_Lib/graph/Apck/Basic.hpp"
#include "MeIoN_Lib/graph/Apck/bfs1.hpp"
#define tests
void Yorisou() {
LL(n, m, sz);
VEC(ll, a, sz);
VEC(PII, e, m);
ll s = SUM(a);
ll O = 0, E = 0;
(s & 1 ? O : ... | ALGO | 0.999943 | 4.041096 | {
"github_metadata": {
"branch": "master",
"commit_count": 264,
"repo_created_at": "2024-10-29T13:52:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa65575e... |
375a40a4-e303-4460-924b-5b0fda47a5e2 | luyiming112233/PatCodeRepo | PatCodeRepo/PatAdv/A1091.cpp | #include<cstdio>
#include<queue>
using namespace std;
#define maxM 1290
#define maxN 130
#define maxL 62
struct da {
int Li, Mi, Ni;
};
int mat[maxL][maxM][maxN] = {0};
int M, N, L, T, sum = 0;
void search(da d) {
queue<da> q;
int tsum = 0;
q.push(d);
da dt,cdt;
mat[d.Li][d.Mi][d.Ni] = 2;
while (!q.empty()) ... | ALGO | 0.999963 | 3.615922 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2019-08-01T07:37:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e638856c6... |
912fdb5a-37d6-41f8-8baf-d4bc498b5c63 | wuxingyu1983/HackerRank | KingdomDivision/main.cc | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
#define DEBUG 0
#define MOD 1000000007
#define MAX_N 100001
class node
{
public:
long long sum[4... | ALGO | 0.999925 | 4.018992 | {
"github_metadata": {
"branch": "master",
"commit_count": 452,
"repo_created_at": "2017-02-13T06:00: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": "c57a5b5f... |
5016cc51-1e16-4927-93e4-8d1a0cf823eb | memo735/e-olymp | 1000-1999/1522 - Optimal Binary Search Tree - Оптимальное бинарное дерево поиска - Оптимальне бінарне дерево пошуку.cpp | #include <iostream>
#include <string.h>
using namespace std;
#define MAX 250
#define INF 0x3F3F3F3F
int i, n, m[MAX], sum[MAX];
int t[MAX][MAX];
//Входные частоты элементов храним в массиве m, в массиве sum будут храниться частичные суммы частот :
//sum[i] = sum(k=1..i) f(e[k]). Значения Ti, j будут раниться в масс... | ALGO | 0.999957 | 3.635679 | {
"github_metadata": {
"branch": "master",
"commit_count": 4186,
"repo_created_at": "2015-06-14T13:00:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 112,
"forks": 70,
"issues": 1,
"pull_requests": 4
},
"file_meta": {
"content_id": "37e8... |
473eb29a-4449-4fc5-b057-93cb01afa655 | ChromiumWebApps/chromium | win8/metro_driver/file_picker_ash.cc | // Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "stdafx.h"
#include "win8/metro_driver/file_picker_ash.h"
#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop/messa... | TOOL | 0.918803 | 7.120437 | {
"github_metadata": {
"branch": "master",
"commit_count": 260366,
"repo_created_at": "2014-02-21T14:19:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 231,
"forks": 307,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "11... |
39ee8e4a-1de0-48fb-9dea-b9043910c434 | himangshunits/DynamicProgrammingCodes | himangshu_optimal_printing.cpp | /*
Course: Design and Analysis of Algorithms CSC 505 ( 001 )
Instructor: <NAME>
Description: Fall 2015, Homework 3 Solutions.
Student Name: <NAME>
Student ID: 200105222
Unity ID: hborah
Matrix Multiplication Code, Printing the Parenthesiz
*/
#include <chrono>
#include <iostream>
#include <algorithm>
using n... | ALGO | 0.9994 | 4.188503 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2016-05-27T01:29: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": "3e910dc8c0... |
39ff3c09-194b-4f1a-a844-e3de30bb5373 | leek018/Algo | baekjoon/baekjoon/baekjoon_11404.cpp | #include <iostream>
#define INF 100000000
using namespace std;
int edge[101][101];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int N;
cin >> N;
int M;
cin >> M;
for (int i = 1; i <= N; i++)
{
fill_n(edge[i], N + 1, INF);
edge[i][i] = 0;
}
for (int i = 0; i < M; i++)
{
int from, to, cost;
cin... | ALGO | 0.99999 | 3.823601 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2020-02-01T08:37:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26140ccfb... |
0933c7bf-b500-40dd-826b-d608a42d8185 | Kaashish1111/cpp-basics | basics/lecture17/second_max.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter the number of elements: ";
cin >> n;
int arr[n];
cout << "Enter the elements: ";
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int max_1 = -1;
int second_max = -1;
for (int i = 0; i < n; i++... | ALGO | 0.999942 | 4.446344 | {
"github_metadata": {
"branch": "main",
"commit_count": 83,
"repo_created_at": "2024-05-28T18:20:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5cbc005f9e5... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.