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 |
|---|---|---|---|---|---|---|---|
a7839d03-623e-4f6c-a83c-8bcccb052b3a | RebelMoogle/ExperiMoogs | RecirculationSurfaces/src/RecirculationSurfaceUtils.h | #pragma once
#include <future>
#include "AnalyticField.h"
#include "TypesAndStructs.h"
struct RecirculationParameters {
RecirculationParameters()
: InitialIntegrationTime(3.0),
VerticesPerAxis(11),
InitialStepSize(0.001),
MaxError(0.00001),
FieldStart... | ALGO | 0.997405 | 4.693584 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2016-03-07T23:55: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": "c4387da7a... |
0d6d55d0-4468-4a94-a5db-a8919db1a79b | Shikhar-S/Analysis-of-Competitive-Codebase | Data/Contest1245/Standings5/29612991_64015911.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll MOD = 1e9+7;
int main()
{
string s;
cin >> s;
vector <int> cnt;
char last = '?';
ll ans = 1;
vector <int> dp(s.size() + 55);
dp[0] = 1;
dp[1] = 1;
for (int i=2; i<dp.size(); ++i)
{
dp[i] = (... | ALGO | 0.99998 | 3.842777 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2019-11-22T14:40:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d389d3c6e... |
1d3903be-df3b-4fa6-82bb-4759ff10f3ff | BaiChunhui-9803/ofec_code | instance/algorithm/combination/eax_tsp/eax_tsp_origin/cross.h | #ifndef EAX_TSP_CROSS_H
#define EAX_TSP_CROSS_H
#include <vector>
#include <array>
#include "indi.h"
#include "evaluator.h"
#include "randomize.h"
#include "sort.h"
#include <memory>
namespace ofec {
namespace eax_tsp {
class TCross
{
// std::shared_ptr<Random> m_rand;
public... | ALGO | 0.997479 | 4.525524 | {
"github_metadata": {
"branch": "baichunhui",
"commit_count": 20,
"repo_created_at": "2025-02-19T01:49:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72d16... |
bf5123c6-1571-49de-bbb3-b48679e44595 | Kennyarlexy/Hackerrank | HRML_parsing/for_submit.cpp | #include <iostream>
#include <vector>
#include <sstream>
#include <algorithm>
int get_Int(std::string str, int iteration = 1)
{
std::stringstream ss;
ss << str;
char ch;
int number;
if (str.substr(0, 3) != "tag" && str.substr(0, 4) != "<tag" && str.substr(0, 5) != "</tag") {
return 0;
... | ALGO | 0.997709 | 4.288947 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-12-12T13:31: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": "0efde86a68ca... |
ed49bc70-5f6f-4c82-be6d-29c92cf1c102 | xingjing1/Paddle-Lite | lite/kernels/x86/reduce_compute.h | // Copyright (c) 2019 PaddlePaddle 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... | ALGO | 0.997283 | 6.826844 | {
"github_metadata": {
"branch": "develop",
"commit_count": 4933,
"repo_created_at": "2020-12-02T08:57:03.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "PaddlePaddle/Paddle-Lite",
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
... |
5ac58d8c-eaae-4843-b260-f033ba63ea76 | isaaczzzz/_oi | codes/1301.cpp | #include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
struct point {
double x, y;
} a[1005], b[1005], c[1005];
int t, m, n, num;
void read() {
cin >> n;
for (int i = 1; i <= n; i++)
cin >> a[i].x >> a[i].y;
for (int i = 1; i <= n; i++)
c[i] = a[i];
m = n;
}
... | ALGO | 0.999982 | 4.787126 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2018-11-30T08:48:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6dea6256a... |
d9d17556-a29a-408d-9f63-b4d41001199c | borglab/gtsam | timing/timeMatrix.cpp | /* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: <NAME>, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* ------------... | TOOL | 0.984532 | 6.529313 | {
"github_metadata": {
"branch": "develop",
"commit_count": 19360,
"repo_created_at": "2017-03-27T17:12:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3002,
"forks": 845,
"issues": 99,
"pull_requests": 25
},
"file_meta": {
"content_id": ... |
82670194-02af-4c96-9cc7-cf2e34c239e3 | caoleiwuhan/LeetCode | DFS/N-Queens/N-Queens.cpp | //============================================================================
// N-Queens
//
// The n-queens puzzle is the problem of placing n queens on an n×n chessboard
// such that no two queens attack each other.
//============================================================================
#include <iostream>
#... | ALGO | 0.999882 | 5.245739 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2013-08-24T14:17:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fe7ad1eb4c... |
90eb7551-cc5d-4af8-8a1b-94ca2a8de49d | contaconta/neurons | c++/research/steerableFilters2D/tools/imageDerivativesAt.cpp | /////////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or //
// modify it under the terms of the GNU General Public License //
// version 2 as published by the Free Software Foundation. //
// ... | ALGO | 0.989709 | 6.014493 | {
"github_metadata": {
"branch": "master",
"commit_count": 1446,
"repo_created_at": "2015-07-29T07:17:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c8b22fc... |
3c23f44e-a964-47bf-97b0-6feb5b16c1ec | CCsherlock/servoUp | main.cpp | #include <iostream>
#include "serialSend.h"
#include "windows.h"
using namespace std;
SerialInterface serial;
struct servoSendStr
{
// /* data */
uint8_t frameHead = 0xA5;
uint8_t servoCmd[14];
uint8_t frameCheck;
};
servoSendStr sendStr; // 舵机控制结构体
uint8_t sendBuffer[16]; // 串口发送数据
/**
* @brief 串口... | TOOL | 0.906756 | 4.1337 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-11-09T07:16:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "790f6b1a4809... |
4cc48dff-865a-4d2d-91c2-2350080510ca | mahendra150/dsa_with_example | 0968-binary-tree-cameras/0968-binary-tree-cameras.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.999966 | 6.149535 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-01-14T08:15: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": "a9a2e3fb05e7... |
7fc35321-9ed4-4a6c-9cd5-4734de1ede83 | papaboo/Bifrost3D | core/Bifrost/Bifrost/Math/Quaternion.h | // Bifrost Vector abstraction.
// ----------------------------------------------------------------------------
// Copyright (C) Bifrost. See AUTHORS.txt for authors.
//
// This program is open source and distributed under the New BSD License.
// See LICENSE.txt for more detail.
// --------------------------------------... | ALGO | 0.937138 | 7.75459 | {
"github_metadata": {
"branch": "master",
"commit_count": 2535,
"repo_created_at": "2015-11-04T19:59:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 28,
"forks": 6,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "091037... |
3bce6cef-8114-4356-9f20-77d24e422d87 | alexandraback/datacollection | solutions_5688567749672960_0/C++/ADJA/A.cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <cassert>
#include <utility>
#include <iomanip>
using namespace std;
const i... | ALGO | 0.999522 | 4.013941 | {
"github_metadata": {
"branch": "master",
"commit_count": 58,
"repo_created_at": "2017-03-08T11:33:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b3234ee37... |
9ba7cca6-8730-45cc-ba8f-41606ec04cef | nytaoxu/ProjectsBackup | CPP/Infinity/AlienRhyme.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
struct Rhyme
{
int position;
char accentedLetter;
};
void comparingTwoWords(string A, string B, Rhyme &r)
{
int length = (A.length() <= B.length() ? A.length() : B.length());
int position = 1;
while (position <= length)
{
if... | ALGO | 0.999787 | 4.246703 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-07-16T23:36:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 8
},
"file_meta": {
"content_id": "493bb9a3a9... |
38078004-b9d3-4a89-bc45-8b31d76ddad3 | oh980225/Tools_Algorithm | MyAlgor/MyAlgor/16946.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M;
int matrix[1001][1001];
int check[1001][1001];
int zero[1001][1001];
int dY[] = {0, 0, -1, 1};
int dX[] = {1, -1, 0, 0};
struct POS {
int y, x;
};
vector<POS> v;
vector<int> zeroNum;
void input() {
cin >> N >> M;
string inputStr;
for(int i = 0; i < N... | ALGO | 0.999984 | 4.222958 | {
"github_metadata": {
"branch": "main",
"commit_count": 263,
"repo_created_at": "2021-02-01T14:17: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": "7b4d618767... |
aef9919c-cc37-4f25-81ab-f2248f50b386 | Asif-Iqbal-Gazi/LeetCode | bloomberg/easy/tree/100.same_tree.cpp | /*
* @lc app=leetcode id=100 lang=cpp
*
* [100] Same 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(int x) : val(x), left(nullptr), r... | ALGO | 0.999978 | 7.302724 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2022-02-23T19:38: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": "aacc0677cd... |
2aa07190-424e-47c3-a567-8b363c1314ea | joshua-jerred/SignalEasel | src/band_pass_filter.cpp | /// =*============================= SignalEasel ==============================*=
/// A C++ library for audio modulation/demodulation into analog & digital modes.
/// Detailed documentation can be found here: https://signaleasel.joshuajer.red
///
/// @author <NAME>
/// @date 2023-12-05
///
/// @copyright Copyright 202... | ALGO | 0.998413 | 6.768743 | {
"github_metadata": {
"branch": "main",
"commit_count": 201,
"repo_created_at": "2022-12-21T22:51:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "0cc802a5a4... |
55cb32ed-4c1e-440e-8562-1e8049208581 | gk646/cxstructs | include/cxalgos/PatternMatching.h | // Copyright (c) 2023 gk646
//
// 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 limitation the rights
// to use, copy, modify, merge, publish, distrib... | ALGO | 0.99286 | 6.56453 | {
"github_metadata": {
"branch": "master",
"commit_count": 265,
"repo_created_at": "2023-06-01T08:54:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8110e22c... |
538aacaf-638b-4863-8bf9-35089f7d838a | trilinos/Trilinos | packages/kokkos-kernels/batched/dense/impl/KokkosBatched_Trmm_Serial_Impl.hpp | //@HEADER
// ************************************************************************
//
// Kokkos v. 4.0
// Copyright (2022) National Technology & Engineering
// Solutions of Sandia, LLC (NTESS).
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Governmen... | ALGO | 0.996687 | 7.513992 | {
"github_metadata": {
"branch": "master",
"commit_count": 104031,
"repo_created_at": "2015-11-16T19:39:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1299,
"forks": 593,
"issues": 263,
"pull_requests": 61
},
"file_meta": {
"content_id":... |
d1cc8786-0890-4311-aac2-fd32305bed3b | micro-gl/micro-gl | include/microgl/micro-tess/include/micro-tess/fan_triangulation.h | /*========================================================================================
Copyright (2021), <NAME> (<EMAIL>, https://github.com/HendrixString).
All Rights Reserved.
License is a custom open source semi-permissive license with the following guidelines:
1. unless otherwise stated, derivative work and... | ALGO | 0.990442 | 7.36732 | {
"github_metadata": {
"branch": "master",
"commit_count": 793,
"repo_created_at": "2021-02-20T17:08:12.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 343,
"forks": 22,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "bedf15... |
f7371642-e7fe-4799-a7f7-2bbdc8bbfcd9 | tjgykhulj/Pencil-Drawing-Builder | Code/中间步骤实现/stroke/stroke.cpp | #include <opencv2/opencv.hpp>
#include "image.h"
using namespace std;
using namespace cv;
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")
const char *pGrayTitle = "Gray";
IplImage *pGrayImage;
Mat rotateImage(Mat img, double degree)
{
Point2f center = Point2f((img.cols - 1) / 2.0, (img.... | ALGO | 0.999476 | 4.310793 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-02-26T01:40: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": "e7c0ac104... |
882820b6-be16-440e-8022-1a8eaf8d46de | nakaaza/AtCoder | ABC195/C.cpp | #include <bits/stdc++.h>
using namespace std;
long long pow_int(long long base, long long p){
long long ret = base;
for (long long i = 1; i < p; i++) {
ret *= base;
}
return ret;
}
long long count_commas(long long begin, long long end, long long p, long long commas){
// cout << begin << "\t" << end << "\t" << p... | ALGO | 0.99961 | 3.58481 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-02-28T08:18:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd393dac28... |
6a422d72-0b90-42aa-8a0c-7912768e2a9d | godotengine/godot | thirdparty/msdfgen/core/arithmetics.hpp |
#pragma once
#include <cmath>
#include "base.h"
namespace msdfgen {
/// Returns the smaller of the arguments.
template <typename T>
inline T min(T a, T b) {
return b < a ? b : a;
}
/// Returns the larger of the arguments.
template <typename T>
inline T max(T a, T b) {
return a < b ? b : a;
}
/// Returns t... | TOOL | 0.970818 | 7.092976 | {
"github_metadata": {
"branch": "master",
"commit_count": 76043,
"repo_created_at": "2014-01-04T16:05:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 98972,
"forks": 22820,
"issues": 5000,
"pull_requests": 3866
},
"file_meta": {
"content... |
39b2c788-e098-4902-b9b8-559fe1494778 | vucongtuanduong/dsa-codeptit | self/classwork/buoi6/sumSubset/sumSubset_1.cpp | #include <bits/stdc++.h>
using namespace std;
int n, a[101], k, countRes;
int x[101];
void init();
bool isFinal();
void result();
void genNext();
int main () {
init();
while (!isFinal()) {
result();
genNext();
}
result();
cout << countRes;
return 0;
}
void init() {
count... | ALGO | 0.999998 | 3.360108 | {
"github_metadata": {
"branch": "main",
"commit_count": 682,
"repo_created_at": "2023-12-21T11:07:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e5280b6893... |
c8946f2d-51e1-4ed9-9690-94b6dbcb757d | vanshika-angi/dsa | Rat in a Maze Problem - I - GFG/rat-in-a-maze-problem-i.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:
vector<string>ans;
map<char,pair<int,int>>dir;
void solve(int row,int col,string path,vector<vector<int>> &m, int n,vector<... | ALGO | 0.9997 | 5.981483 | {
"github_metadata": {
"branch": "main",
"commit_count": 907,
"repo_created_at": "2023-06-19T11:00: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": "759e4a61aa... |
7ecb3d73-26c8-42e5-8f38-1fb988daa7d6 | sayuriGui/Problem-Solving-HackerRank | Algorithms/Warmup/simple-array-sum/simplearraysum.cpp | #include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(const string &);
int simpleArraySum(vector<int> ar) {
/*
The function simpleArraySum takes a vector of integers as input and returns the sum of all the elements in the vector.
:... | ALGO | 0.998984 | 5.865606 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-09-03T23:50: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": "70e6a429c29... |
7aaa10e5-5084-47ab-a51f-8b10311b313b | usc-csci104-fall2020/resources | hw6/avlbst/hw6_tests/bst_tests/create_bst.h | // Header that implements functions for creating BSTs.
#include "publicified_bst.h"
#include <random_generator.h>
#include <set>
#include <limits>
#include <random>
#include <algorithm>
#ifndef CREATE_BST_H
#define CREATE_BST_H
/* Fills the given bst with one node for each item in the set.
The key and value of... | ALGO | 0.984243 | 5.631467 | {
"github_metadata": {
"branch": "master",
"commit_count": 85,
"repo_created_at": "2020-08-13T03:29:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "caaee9bc9... |
eec712e8-3003-4323-99ff-b8c5a05f28a8 | Pinafore/topicmod | projects/mlslda/src/mlslda.cpp | /*
* ldawn.cpp
*
* Copyright 2007, <NAME>
*
* Class to implement a topic model with a ontological topic distribution over
* words.
*/
#include <string>
#include <vector>
#include "topicmod/projects/mlslda/src/mlslda.h"
DEFINE_bool(regression_only, false,
"Topics ignore response (regression on vanil... | DATA | 0.991389 | 7.381418 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2015-04-11T01:14:56.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "642898691c... |
7346b0da-3cc8-4275-9d58-657310dd2192 | zeusptit/DSA_PTIT | Cây nhị phân/DSA11021_NODE LÁ CỦA CÂY NHỊ PHÂN TÌM KIẾM.cpp | #include <bits/stdc++.h>
using namespace std;
#define quick() ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
using ll = long long;
int mod = 1e9 + 7;
struct Node{
int val;
Node *left, *right;
};
typedef Node* Tree;
Tree createNode(int val){
Tree res = new Node;
res -> val = val;
... | ALGO | 0.999922 | 4.723377 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2023-02-01T06:22:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6532bae4... |
e74b0f00-af61-4c2a-8727-28a972c90ba3 | Elimelec07/car-game | carro.cpp | #include<iostream>
#include<conio.h>
#include<dos.h>
#include <windows.h>
#include <time.h>
#define SCREEN_WIDTH 90
#define SCREEN_HEIGHT 26
#define WIN_WIDTH 70
using namespace std;
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
COORD CursorPosition;
int enemyY[3];
int enemyX[3];
int enemyFlag[3];
char car[4... | ALGO | 0.97398 | 3.311271 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2023-06-07T16:42: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": "95d93c1829e8... |
daf45ae8-dcd2-479d-bf5d-563b78990fe0 | JackSparrow0009/hackerrank | array_manipulation.cpp | /*
* Challenges: https://www.hackerrank.com/challenges/crush/problem
*/
#include <stdio.h>
#include <stdlib.h>
struct Node {
int left_bound;
int right_bound;
long long value;
long long max;
struct Node *lc;
struct Node *rc;
};
struct Tree {
struct Node *root;
int construct(int left_bound, int righ... | ALGO | 0.999932 | 4.959836 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-06-17T06:49: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": "78212632f31b... |
fcce9dbd-bf9c-49fd-9d47-7fd18e3412aa | furkankirac/cs509V-2018-19-spring | app19.cpp | // returning a lambda (function object)
// std::variant, std::any
// RVO: return value optimization
// CRTP: curiously recurring template pattern, singleton pattern example
#include <iostream>
#include <vector>
#include <string>
#include <list>
using namespace std;
// bubblesort programlayalim.
// siralama kriterin... | TOOL | 0.934322 | 4.811655 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2019-04-11T20:43:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c66d6fdb8... |
d3d4d17e-e5fc-4675-bf56-df6880ae1f15 | huonglandoan/BTL_CTRR_K242_hcmut | bellman.cpp | #include "bellman.h"
using namespace std;
void BF(int edgeList[][3], int numEdges, char start_vertex, int BFValue[], int BFPrev[]) {
static int vertexList[100];
static int vertexCount = 0;
static bool initialized = false;
static int G[100][100];
static int v2i[256];
static int i2v[100];
... | ALGO | 0.999994 | 4.904589 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2025-06-26T11:54:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0e4366a383d6... |
bad619a8-d61d-4ca5-9cb7-4e0dd783a0f2 | AuditoryBiophysicsLab/EarLab | tags/release-1.0/SupportClasses/RungeKuttaSolver.cpp | #include "Earlab.h"
#include "EarlabException.h"
#include "RungeKuttaSolver.h"
#include "RungeKuttaEquation.h"
#include "math.h"
#include "memory.h"
#include "stdlib.h"
#define NR_END 1
#define MAXSTP 10000
#define TINY 1.0e-30
#define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))
#define FMAX(a,b) ((a) > (b) ? (a) : (b... | ALGO | 0.999747 | 4.706547 | {
"github_metadata": {
"branch": "master",
"commit_count": 184,
"repo_created_at": "2014-12-03T18:47:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "05a694b56... |
a5d457a4-0436-4db7-9e2d-9e6142fb76a7 | wencanluo/LeetCode | CodeLeet/PartitionList.cpp | /*Partition List Apr 30 '123488 / 10672
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.
You should preserve the original relative order of the nodes in each of the two partitions.
For example,
Given 1->4->3->2->5->2 and x = 3,
return 1->2->... | ALGO | 0.99999 | 5.297926 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2013-07-30T06:56: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": "156696fd... |
018b6e72-dc40-4af3-9b0f-8b4727bd217c | ManaliLikhitkar/Data-Structures | Expression tree Traversals/Assignment4.cpp | /*============================================================================
EXPERESSION TREE
Assignment no. : 4
Roll no. : 23333
Batch : F11
============================================================================*/
#include <iostream>
#include "stack.h"
#include "stack... | ALGO | 0.999784 | 4.486271 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-07-08T15:11: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": "b38415a110... |
5b906dd1-b552-4e5e-8f9d-af5f7f0f5d28 | wulukewu/cp-code | atcoder/abc/abc412/C_Giant_Domino.cpp | #include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <random>
#include <set>
#include <map>
#include <stack>
#include <math.h>
#define int long long
// #define float double
// #define float long double
#define F first
#define S second
#define FOR(i, ... | ALGO | 0.995037 | 3.93741 | {
"github_metadata": {
"branch": "main",
"commit_count": 110,
"repo_created_at": "2025-02-08T11:36: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": "c55a59d0a5... |
43addea9-f490-49e0-9b7e-1c9597c1e6a3 | shariarhossain17/contest_practice | judge/codeforces/div_3/searphimOwl.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define newLine cout << "\n"
#define pb push_back
#define vi vector<int>
#define Yes cout << "YES\n"
#define No cout << "NO\n"
#define array_input_int(a, o, n) \
for (int i = o; i < n; i++) \
{ \
cin >> (a[i]... | ALGO | 0.999982 | 3.738019 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2023-10-01T13:53: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": "0dc984f086... |
6ec549c7-ceb9-47c1-b434-e084e10d1747 | jnorthrup/jmodelica2014 | ThirdParty/CppAD/cppad-20100325/cppad_ipopt/src/hes_fg_map.cpp | /* $Id: hes_fg_map.cpp 1641 2010-02-01 16:39:45Z bradbell $ */
/* --------------------------------------------------------------------------
CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-10 <NAME>
CppAD is distributed under multiple licenses. This distribution is under
the terms of the
... | ALGO | 0.94464 | 5.639489 | {
"github_metadata": {
"branch": "master",
"commit_count": 4876,
"repo_created_at": "2014-03-20T17:20:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ad5622... |
7fca349e-0393-4de2-b565-9ac9444b79d6 | erwincoumans/tiny-differentiable-simulator | third_party/zeromq/src/radix_tree.cpp | /*
Copyright (c) 2018 Contributors as noted in the AUTHORS file
This file is part of libzmq, the ZeroMQ core engine in C++.
libzmq is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation... | ALGO | 0.959605 | 6.916981 | {
"github_metadata": {
"branch": "master",
"commit_count": 718,
"repo_created_at": "2020-05-14T18:04:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1305,
"forks": 134,
"issues": 8,
"pull_requests": 5
},
"file_meta": {
"content_id": "d87... |
602e9566-0437-4b5a-826a-afbabffa34ba | lsils/mockturtle | experiments/rewrite.cpp | /* mockturtle: C++ logic network library
* Copyright (C) 2018-2023 EPFL
*
* 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 limitation the rights... | TOOL | 0.965737 | 5.979191 | {
"github_metadata": {
"branch": "master",
"commit_count": 828,
"repo_created_at": "2018-04-25T12:15:49.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 240,
"forks": 150,
"issues": 9,
"pull_requests": 2
},
"file_meta": {
"content_id": "0d13f... |
020d36c5-606b-496a-834b-c49a07572fb8 | PauloVictorCT3604/AVA_POO_PauloVictor | AVA_Unidade2-PauloVictor/src/main.cpp | #include "../include/Livro.hpp"
#include <iostream>
#include <vector>
#include <algorithm>
void adicionarLivro(std::vector<Livro>& biblioteca) {
std::string titulo, autor, genero;
int ano;
std::cin.ignore();
std::cout << "Título: ";
std::getline(std::cin, titulo);
std::cout << "Autor: ";
s... | TOOL | 0.9914 | 6.289014 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-13T01:58: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": "a054e40a1c0e... |
fc31d263-4b6a-4de7-b72c-d4638dce41d0 | Daggerhub/Data-Structure-Algorithm | recursion/nqueen.cpp | #include<iostream>
#include<string>
using namespace std;
bool isSafe(int chess[][10] , int row , int col ,int n){
for(int i = row - 1 , j = col; i >= 0 ; i--){
if(chess[i][j]==1){
return false;
}
}
for(int i = row - 1 , j = col - 1; i >= 0&&j >= 0 ; i--,j--){
if(chess[i][j]==1){
return false;
}
}
... | ALGO | 0.999889 | 4.585952 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2020-07-03T19:07:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "408e261c6... |
9c85e6db-9fa4-49ad-b31d-52d94eb8ee2a | LokeshBolisetty/DSA | BitManipulation/NumberOf1Bits.cpp | #include<bits/stdc++.h>
using namespace std;
int NumberOf1Bits(int A){
int count=0;
while(A){
int n = A&1;
count+=n;
A>>=1;
}
return count;
}
int Brian_Kernighan(int x){
//This is editorial solution
/*
Subtracting 1 from a decimal number flips all the bits after the r... | ALGO | 0.999928 | 4.913511 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2021-06-19T05:11: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": "d97b822fd45... |
753aee56-2997-42e0-828f-b1031a633b78 | adamehlers/lab1 | lab1Errors.cc | /**
* @file: lab1Errors.cc
* @author: <NAME>
* @date: 05/20/2023
* @brief: This is a fixed version of the lab1Errors.cc file that will take in 3 values (a, b, and c), make a quadratic formula using these values as their constants, and find the quadratic roots
*/
#include <iostream>
#include <iomanip>
#includ... | ALGO | 0.978216 | 3.43056 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-05-20T21:12: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": "ad1fd6e22f1... |
04ad1d9e-e91a-43bb-b489-e58a3df2c686 | junlong-gao/recreations | src/code_practise/leetcode/cpp/01263.cpp | class Solution {
struct P {
int x; int y;
};
int dx[4] = {0, 1, 0, -1};
int dy[4] = {-1, 0, 1, 0};
int invI[4] = {2, 3, 0, 1};
bool canReach(vector<vector<char>>& grid, P cur, P e) {
vector<vector<bool>> visited(grid.size(), vector<bool>(grid[0].size(), false));
visi... | ALGO | 0.999907 | 4.949211 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2017-05-24T05:16:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "2dfa78751... |
a6d10175-5be0-4785-a09b-5ef05cb99a74 | giovanebmr/C-Nave | main/C-Nave 0.0.2.cpp | //Autor: <NAME>, e-mail: <EMAIL>
#include <stdio.h> //para printf
#include <stdlib.h> //para system pause cls e etc
#include <conio.h> //para leitura do teclado kbhit() e getch()
#include <unistd.h> //para sleep (segundos) e usleep (microsegundos)
#include <windows.h> //para sons
//Configuracoes inicia... | TOOL | 0.925931 | 3.386251 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2017-07-10T21:23:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4241fac50... |
00d10981-bba2-4d95-af4b-fbd2fb2935ed | 543877815/algorithm | leetcode/c++/581. Shortest Unsorted Continuous Subarray.cpp | // 快速排序
// 时间复杂度:O(nlogn)
// 空间复杂度:O(n)
class Solution {
public:
int findUnsortedSubarray(vector<int> &nums) {
int n = nums.size();
vector<int> tmp = vector<int>(n);
for (int i = 0; i < n; i++) {
tmp[i] = nums[i];
}
sort(tmp.begin(), tmp.end());
int num... | ALGO | 0.999967 | 5.808515 | {
"github_metadata": {
"branch": "master",
"commit_count": 283,
"repo_created_at": "2019-05-26T12:35:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41b9ccda... |
31ac2c87-4ed9-4cd1-858e-32703eca8bb1 | algorithmlover2016/leet_code | src/main/algorithms/cpp/dynamic-programming/binary_subarrays_with_sum_930/solution.cpp | #include <iostream>
#include <sstream>
#include <string>
class Solution {
public:
int numSubarraysWithSumTimeLimitExceeded(vector<int>& A, int S) {
int ans = 0;
for (int index = 0; index < A.size(); index++) {
int sum = 0;
for (int subIndex = index; subIndex < A.size(); subI... | ALGO | 0.999748 | 5.813316 | {
"github_metadata": {
"branch": "master",
"commit_count": 882,
"repo_created_at": "2019-03-10T08:25:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c10b5722... |
11ca70e0-3fd6-4c8c-9466-09ff160a964f | eitansternlicht/school-cpp-intro-course | ex4/SMatrix.h | /**
* Student Name: <NAME>
* ID: 204070635
* Exercise: 4
*/
#include <string>
#include <iostream>
using namespace std;
#define DEFAULT_VALUE_IN_MATRIX 0
#define ARROWHEAD_MATTYPE "Arrowhead"
#define TOEPLITZ_MATTYPE "Toeplitz"
#define ANY_MATTYPE "any"
#define ERROR_NOT_AVAILABLE "NA"
#define ERROR_EXIT_CODE 1
#... | ALGO | 0.952929 | 4.006841 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2017-10-26T08:36:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8b6fab17... |
e9f0023a-3680-4817-92e8-bbb83f335a0c | Keyur2311/Leetcode23 | 1367-linked-list-in-binary-tree/1367-linked-list-in-binary-tree.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
/**
* Definition for a binary tree node.
* struc... | ALGO | 0.999955 | 5.533151 | {
"github_metadata": {
"branch": "main",
"commit_count": 1837,
"repo_created_at": "2023-01-27T18:01: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": "63effc5fc... |
df80b8d8-5af8-4084-9663-eea1221728e4 | borglab/gtsam | gtsam_unstable/discrete/CSP.cpp | /*
* CSP.cpp
* @brief Constraint Satisfaction Problem class
* @date Feb 6, 2012
* @author <NAME>
*/
#include <gtsam/base/Testable.h>
#include <gtsam/discrete/DiscreteBayesNet.h>
#include <gtsam_unstable/discrete/CSP.h>
#include <gtsam_unstable/discrete/Domain.h>
using namespace std;
namespace gtsam {
bool CSP:... | ALGO | 0.999487 | 6.889945 | {
"github_metadata": {
"branch": "develop",
"commit_count": 19360,
"repo_created_at": "2017-03-27T17:12:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3002,
"forks": 845,
"issues": 99,
"pull_requests": 25
},
"file_meta": {
"content_id": ... |
f804afec-1f22-4f5c-b7f8-c6169ce7fb1a | garciacsci/ECE71 | hw09.cpp | /* Homework 9*/
/*
* Name: hw09.cpp
* Purpose: Calculates the fuel efficiency of a user's car given
* by the number of miles per gallon driven
* Author: <NAME>
* Date: 21 February 2020
*/
// Preprocessor Directives
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <ostream>
usi... | TOOL | 0.951778 | 5.376068 | {
"github_metadata": {
"branch": "master",
"commit_count": 64,
"repo_created_at": "2020-03-28T01:14: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": "850a2bde6... |
4303622b-3866-411a-9fcc-e7300021cbe6 | ishandutta2007/codeforces-i | igorfardoc/normal/1493/B.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int h, m;
unordered_map<int, int> d;
bool validrev(int h1, int m1)
{
if(d[h1 / 10] == -1 || d[h1 % 10] == -1 || d[m1 / 10] == -1 || d[m1 % 10] == -1)
{
return false;
}
int h2 = d[m1 % 10] * 10 + d[m1 / 10];
int m2 = d[h1 % 10] * 10 + d[h1 / 10]... | ALGO | 0.999665 | 3.82817 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39: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": "f57e7f5e5429... |
3ead4d02-0f2c-4b93-81ab-9571b97ce534 | Raemerrr/AlgorithmProblemsSolved | src/BOJ/22/06/BOJ_3176_도로 네트워크_220617.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
const int MAX = 1000001;
int N, M, treeHeight;
vector<vector<pair<int, int>>> nodes, dist;
vector<vector<int>> parents;
vector<int> depth;
void dfs(const int Cur) {
for (const pair<int, int> &p: nodes[Cur]) {
... | ALGO | 0.999995 | 4.737119 | {
"github_metadata": {
"branch": "main",
"commit_count": 174,
"repo_created_at": "2021-12-03T15:00:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dca356677... |
654b8793-62c8-4df0-96fb-1213b31a9dd2 | Utkarsh-code/DSA-Playlist | CP/37.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define pb push_back
#define pi pair<int, int>
int mod=1e9+7;
int inf=1e18;
int ninf=-1e18;
int pown(int x, int y){
int res=1;
while(y){
if(y&1) res=(x*res)%mod;
x=(x*x)%mod;
y>>=1... | ALGO | 0.999986 | 4.38858 | {
"github_metadata": {
"branch": "main",
"commit_count": 32,
"repo_created_at": "2021-04-11T06:31:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7278b7f2b97... |
193966fc-48b4-46a1-bbaa-423b364d655c | mustafabandukwala/CMPE-180A-Data-Structures-and-Algorithms | Practice Problems/Week 4/Problem5.cpp | /*
A LoveBug (google it if you dare) can occupy any floating-point coordinates (x, y). Its initial position is given in the constructor.
Its move member function has another LoveBug as a parameter. If it is closer than 0.1 to that love bug, this love bug's happiness goes
up by 1. Otherwise, it
Moves itself halfway tow... | ALGO | 0.999734 | 4.740303 | {
"github_metadata": {
"branch": "master",
"commit_count": 213,
"repo_created_at": "2018-05-31T19:03:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a33a8ed... |
eef877f8-d3ec-46ca-96ea-6c28f4ce071a | AhmedKamal18/Specialists-Plan-W25 | 2- Digit-Bitmask DP (Additional Problems)/A.cpp | #include <bits/stdc++.h>
#define all(a) begin(a), end(a)
#define sz(x) (int)(x).size()
using namespace std ;
using ll = long long;
const char nl = '\n', sp = ' ';
const int mod = 998244353;
string s; int n , k;
ll memo1 [2][2][18][1 << 10];
ll memo2 [2][2][18][1 << 10];
int add (ll a , ll b){
return ((a % mod)... | ALGO | 0.999804 | 4.591212 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2024-09-15T11:12:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0e3ade8d3... |
427ddb5d-bdb6-4921-bd1d-9ded6d0484bd | u7110834/atcoder | ABCPast/ABC294/D.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <numeric>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;
// 第一引数と第二引数を比較し、第一引数(a)をより大きい/小さい値に上書き
template <typename T> inline bool chmin(T& a, const T& b) {bool... | ALGO | 0.999329 | 4.218122 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2023-11-12T07:16:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fed2995c9b6... |
27442348-91d2-47df-b662-611d4d789f25 | ShreyansGarg/CS556_Assignment1 | Q1/q1.cpp | #include <iostream>
#include <queue>
#include <vector>
#include <random>
#include <cmath>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <numeric>
struct Customer {
double arrivalTime;
double serviceStartTime;
double serviceEndTime;
double serviceTime;
};
struct Period {
doubl... | ALGO | 0.996189 | 6.046231 | {
"github_metadata": {
"branch": "main",
"commit_count": 18,
"repo_created_at": "2025-03-23T17:38: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": "c0922f9ec81... |
278ab3cf-a162-4b58-b0cb-61520120c018 | philko4711/phillib | src/three_lab/src/mathClouds.cpp | #include "mathClouds.h"
Eigen::Vector3f leastSquarePlaneFit(const stdVecEig3f& pointCloud)
{
Eigen::Matrix3f m;
m.setZero();
Eigen::Vector3f c;
c.setZero();
for(auto& iter : pointCloud)
{
m(0, 0) += iter.x() * iter.x();
m(0, 1) += iter.x() * iter.y();
m(0, 2) += iter.x();
m(1, 0) = m(0,... | ALGO | 0.998997 | 4.966275 | {
"github_metadata": {
"branch": "master",
"commit_count": 241,
"repo_created_at": "2020-03-30T13:39:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2de2fd07... |
b00b66d4-e645-42b4-8e4b-f76f80f8f4f9 | AjajAlam1399/data-structure_and_algorithms | Graph-question-striv/10_Number of Distinct Islands.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:
void dfs(vector<vector<int>>& grid,int row,int col ,vector<vector<bool>>&visted,
int row0,int col0,vector<pair<int,int>>&subans){
... | ALGO | 0.999889 | 6.403089 | {
"github_metadata": {
"branch": "master",
"commit_count": 731,
"repo_created_at": "2022-08-13T11:41:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2f286642... |
f604cf85-bee0-4a51-b9b8-fe2be95d890c | ishandutta2007/codeforces-m | matrixcascade_qwq/normal/778/C.cpp | /*
qwq
*/
//#pragma GCC optimize("Ofast", "unroll-loops")
//#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4", "avx")
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define int long long
#define YES puts("YES")
#define NO puts("NO")
#define Yes puts("Yes")
#define No puts("No")
#... | ALGO | 0.999731 | 3.096178 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-06-06T01:03: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": "b87e485f3410... |
87384594-d915-4d25-988d-70fa46a6a5b6 | Chandiharh-university/opps-and-dsa-22BCS10553 | main (21).cpp | #include <iostream>
#include <vector>
using namespace std;
// Function to print a vector
void printCombination(const vector<int>& combination) {
for (int num : combination) {
cout << num << " ";
}
cout << endl;
}
// Recursive function to generate numbers with a given sum
void generateCombinations(... | ALGO | 0.999941 | 5.98333 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-12-19T09:27:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91f21cb8df298... |
56b9e5a9-e80d-4a8d-aae1-b088f0e17cbd | allenanswerzq/byteme | old/codeforces/random/1082a/1082a.cpp | //============================================================================
// Name : 1082a
// Date : Sat May 18 20:25:12 CST 2019
// Author : landcold7
// Description : Actions speak louder more than words
//============================================================================
#include <bi... | ALGO | 0.999768 | 3.821353 | {
"github_metadata": {
"branch": "master",
"commit_count": 810,
"repo_created_at": "2017-06-16T09:27:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "caf4b59a... |
1b9fa909-aa22-4169-9a93-07f92e791af3 | fmi-lab/up-2018-kn-group7-sem | ex6/xmass-tree.cpp | #include <iostream>
using namespace std;
/*
X 1
XXXXX 5
XXXXXXXXX 9
XXXXX 5
XXXXXXXXX 9
XXXXXXXXXXXXX 13
XXXXXXXXX 9
XXXXXXXXXXXXX 13
XXXXXXXXXXXXXXXXX 17
XXX
XXX
XXX
XXX
*/
int main() {
/*
X 1
XXXXX ... | ALGO | 0.998986 | 3.957644 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2018-10-16T13:14:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b74db1c2a9... |
5a78945e-b85b-48cb-bb04-4fce1dfb4293 | colmap/colmap | src/thirdparty/PoissonRecon/MultiGridOctreeData.SortedTreeNodes.inl | /*
Copyright (c) 2006, <NAME> and <NAME>
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
conditions and the following ... | ALGO | 0.933945 | 4.582602 | {
"github_metadata": {
"branch": "main",
"commit_count": 2214,
"repo_created_at": "2014-08-16T00:55:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 8989,
"forks": 1696,
"issues": 1026,
"pull_requests": 34
},
"file_meta": {
"content_id": "... |
edc45ead-a3fd-4119-9444-bbad41fa679c | ACMClassCourses/Compiler-Design-Implementation | testcases/codegen/t3.cpp | /*
Test Package: Codegen
Author: 10' <NAME>
Time: 2020-01-25
Input:
=== input ===
103
=== end ===
Output:
=== output ===
67
=== end ===
ExitCode: 0
InstLimit: -1
Origin Package: Codegen Pretest-525
*/
#include<cstdio>
int N;
int head;
int startx;
int starty;
int targetx;
int targety;
int x;
int y;
int *xlist = new int... | ALGO | 0.999998 | 3.549266 | {
"github_metadata": {
"branch": "master",
"commit_count": 122,
"repo_created_at": "2020-10-29T10:21:44.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 78,
"forks": 22,
"issues": 5,
"pull_requests": 2
},
"file_meta": {
"content_id": "419448c... |
e772ec71-8c7c-40c7-b5fe-df99e7d5f55a | ishandutta2007/codeforces-a | alesyaivanova/normal/1621/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define pii pair<int, int>
#define pb emplace_back
#define pf emplace_front
#define mp make_pair
#define ld long double
#define all(x) x.begin(), x.end()
#define uniq(x) sort(all(x)), x.resize(unique(all(x)) - x.beg... | ALGO | 0.999766 | 3.509865 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f8bc72eef8b... |
5dd2b454-a44f-4eff-b003-27c744b44dcb | Renegade-3863/Hotaru_at_Leetcode | CollectionOfSolutionsCC/_106buildTree.cc | #include "Solution.h"
Leetcode101_200::TreeNode* Leetcode101_200::Solution::buildTree(vector<int>& inorder, vector<int>& postorder)
{
// 和 105 题完全一致的思路,只不过是前序和后序在性质上反过来罢了
/*
返回值为使用 inorder 的 l1 到 r1 之间的元素(从集合的角度讲和 postorder 的 l2 到 r2 之间的元素是相同的)构成的子树的根结点
*/
function<TreeNode*(vector<int>&, int, ... | ALGO | 0.99991 | 5.763124 | {
"github_metadata": {
"branch": "main",
"commit_count": 111,
"repo_created_at": "2024-04-25T06:57:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c34475e6a1... |
0f7cb532-920c-48ec-813a-0b5b77576279 | sunyue89/LeetCodePractice | Mock/RandomSet.cpp | /*Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array.
Note:
The array size can be very large. Solution that uses too much extra space will not pass the judge.
Example:
int[] nums = new int[] {1,2... | ALGO | 0.999748 | 5.607577 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2020-07-07T04:07: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": "0bd33e00c... |
bc029652-7275-4423-a656-056da82d4c4d | santybm/Algorithms | Homework1/Problem4b.cpp | //
// Problem4b.cpp
// Homework1
//
// Created by <NAME>
// Copyright © 2016 <NAME>. All rights reserved.
//
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <map>
using namespace std;
string Analyze(string str, int size);
int main(int argc, const char * argv[]) {
//Check for correct ... | ALGO | 0.999899 | 5.415576 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2016-02-01T01:40: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": "33c670fc5... |
4c586c81-c1a6-423e-a36d-785c37d896de | wirelessUser/DSA_Par_2 | Section-3/Assi-5 Given the head pointer of a singly linked list,convert this into Circular Linked List.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int _data){
data=_data;
next=NULL;
}
};
class LinkedList
{
Node *head;
public:
LinkedList()
{
head = NULL;
}
void Add(int _data)
{
Node *n... | ALGO | 0.982378 | 5.849968 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-07-13T04:53: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": "e631d05b2e8... |
e96e6320-850c-4d44-ac3b-01f303c6fbc8 | Alitaher712/Problem-Solving | CodeForces/1736B/42079823_AC_93ms_19936kB.cpp | #include<bits/stdc++.h>
#define ll long long
#define el '\n'
using namespace std;
#define el '\n'
using namespace std;
const ll N = 1e5 + 5, INF = 1e10, mod = 998244353;
int fact[N], inv[N];
int fp(int b, int p)
{
if (b == 1 || p == 0)
return 1;
int hp = fp(b, p / 2);
int ans = (1LL * hp * hp) % m... | ALGO | 0.999846 | 4.120041 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-05-24T12:40: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": "0bc49e300b48... |
b9760b9d-17d6-4362-a202-ef953dc1acab | Superjomn/Paddle | paddle/fluid/framework/paddle2cinn/cinn_subgraph_detector.cc | /* Copyright (c) 2018 PaddlePaddle 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 by applicable law or agr... | ALGO | 0.97642 | 3.992867 | {
"github_metadata": {
"branch": "develop",
"commit_count": 39623,
"repo_created_at": "2016-08-30T01:45:54.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "PaddlePaddle/Paddle",
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"con... |
920dae7b-8978-44d9-bb80-a93d8f78eefa | kingofamani/Arduino | BlocklyDuino/16for/18Coprime2/18Coprime2.ino | /*
* Generated using BlocklyDuino:
*
* https://github.com/MediaTek-Labs/BlocklyDuino-for-LinkIt
*
* Date: Thu, 17 Mar 2022 00:09:57 GMT
*/
/* 部份程式由吉哥積木產生 */
/* https://sites.google.com/jes.mlc.edu.tw/ljj/linkit7697 */
char key = ' ';
String number1 = "";
String number2 = "";
int factors1[] = {};
int fac... | ALGO | 0.994249 | 3.58861 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2024-11-04T11:18: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": "ca6bd6826... |
2682e495-34c3-41a1-9fa5-8f168a855d26 | amkishkevich/hello | main.cpp | #include<iostream.h>
#include<iomanip.h>
#include<time.h>
class Matrix{
int n,i,j;
double **mas;
public:
Matrix();
Matrix(int x);
Matrix(const Matrix & A);
Matrix operator+(Matrix A);
Matrix operator-(Matrix A);
Matrix operator*(Matrix A);
Matrix& operator =(const Matrix & A){
if(this!=&A)
{delete [] mas;
n=A.n;
... | ALGO | 0.998536 | 3.71164 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2013-09-25T12:51:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "137db58979... |
a646589e-2665-43d4-947a-d2aebe5b0779 | ljpeach/SpecificDifficultyMazeGenerator | code/agent.cpp | #include <iostream>
#include <ctime>
#include "agents.hpp"
int main(int argc, const char *argv[]){
std::srand(std::time(0));
Maze testMaze = Maze(atoi(argv[1]),atoi(argv[2]));
MazeNode* c = testMaze.corner;
std::tuple<int,int> a[] = {std::make_tuple(atoi(argv[1])/2,atoi(argv[2])/2)};//std::make_tuple(0... | ALGO | 0.995975 | 4.215745 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2022-03-04T00:31: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": "7e9d1a4dea7... |
b1458d67-9791-4757-912e-1d03ca05b4ad | anhncs/Probabilistic-Graphical-Models | 3.Markov Networks for OCR/inference/inference-src/libdai/include/dai/mf.h | /* This file is part of libDAI - http://www.libdai.org/
*
* Copyright (c) 2006-2011, The libDAI authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
*/
/// \file
/// \brief Defines class MF which implements the Mean Field algorithm... | ALGO | 0.995368 | 6.450545 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2013-04-21T12:30:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 104,
"forks": 70,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15ffbdf... |
7c0173f7-79c4-4412-9b6c-2b06d3095da7 | beaussan/ia-powerfour | main.cpp | #include <iostream>
#include <string>
#include "Grid.h"
#include "PowerFour.h"
#include "Colors.h"
#include "Utils.h"
#include "IaPLayer.h"
#include "Player.h"
#include "HumanPlayer.h"
#include <typeinfo> //for 'typeid' to work
using namespace std;
Player* createPlayer(int color, const string &printedName);
Player... | ALGO | 0.925216 | 4.489799 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2017-12-14T13:16: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": "9829b30ca... |
b527e62a-f8c9-46de-88e2-c8606b2c48e6 | jfgid/TagSystem | src/genTagSeqAccu.cpp | #include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include "genTag.hpp"
#include "prodRules.hpp"
#include "prodExcep.hpp"
using namespace std;
template<ProdRuleFunc ProdRule, int DelNum, int MinLen>
string genNextTag(const string& curTag, const string&)
{
if (curTag.length() < MinLen) {
... | ALGO | 0.925451 | 4.601874 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2021-12-27T12:05: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": "b7caa1227... |
13ec012f-3ee4-4392-9b58-1301f62c01b9 | quantumsteve/asgard | src/asgard_discretization.cpp | #include "asgard_discretization.hpp"
namespace asgard
{
template<typename precision>
discretization_manager<precision>::discretization_manager(
std::unique_ptr<PDE<precision>> &&pde_in, verbosity_level verbosity)
: verb(verbosity), pde(std::move(pde_in)), grid(*pde), matrices(pde.get()),
transformer(*pd... | ALGO | 0.950647 | 7.053084 | {
"github_metadata": {
"branch": "develop",
"commit_count": 2067,
"repo_created_at": "2020-12-04T20:39:01.000Z",
"is_fork": true,
"is_org_owned": false,
"forked_from": "project-asgard/asgard",
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"co... |
1f879004-6510-41c4-b8a7-b6b2cdd2b399 | MohdImran001/dsa | religious-people.cpp | #include<bits/stdc++.h>
using namespace std;
void dfs(vector< vector<int> > &graph, vector<int> & visited, int x, int &cnt ) {
visited[x] = 1;
cnt++;
for ( auto it : graph[x]) {
if (visited[it]) continue;
dfs(graph, visited, it , cnt );
}
}
long long templeRun( vector< pair<int, int> > &edges, int n, int e,... | ALGO | 0.999874 | 4.521209 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2020-06-08T06:56:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "caa2b5829... |
6fa1573d-8bdb-46aa-8962-240b9e3c864e | Tushar1441/Striver_A2Z_DSA | DP on Subsequences/coin_change2.cpp | #include <bits/stdc++.h>
using namespace std;
long solve(int idx, int* arr, int target) {
if (target == 0)return 1;
if (idx == 0) {
if (target % arr[idx] == 0) return 1;
return 0;
}
//pick
long pick = 0;
if (target >= arr[idx]) pick = solve(idx, arr, target - arr[idx]);
// not pick
long notpick = solve(i... | ALGO | 0.999852 | 4.830408 | {
"github_metadata": {
"branch": "main",
"commit_count": 35,
"repo_created_at": "2023-05-25T16:54: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": "2a099f2da4e... |
8baef744-dde0-4ba1-ba5d-de103b134d44 | jingar/cplusplus | string-lexicographically.cpp | #include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
void print(const std::vector<std::string>& v)
{
for(unsigned int i =0; i < v.size();++i)
{
std::cout << "v[" << i << "]: " << v[i] << '\n';
}
}
std::string lexico_first(const std::vector<std::string>& s)
{
... | ALGO | 0.99951 | 3.672986 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2013-05-04T20:03:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0931dffce... |
1313016c-7ca7-4e42-b500-abf3f2e0abc5 | ROCm/hcc | include/experimental/impl/transform_exclusive_scan.inl | /**
* @file numeric
* Numeric Parallel algorithms
*/
/**
* Effects: Assigns through each iterator i in [result,result + (last - first))
* the value of GENERALIZED_NONCOMMUTATIVE_SUM(binary_op, init, unary_op(*first), ..., unary_op(*(first + (i * - result) - 1))).
*
* Return: The end of the resulting range begin... | ALGO | 0.999646 | 7.627759 | {
"github_metadata": {
"branch": "clang_tot_upgrade",
"commit_count": 7771,
"repo_created_at": "2016-03-22T16:04:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 437,
"forks": 108,
"issues": 101,
"pull_requests": 11
},
"file_meta": {
"cont... |
cf9e3a86-df70-4625-8cc1-41271a1897fc | Douglas10Holanda/CodsED2021.2 | ATIVIDADES/ALGORITIMOS DE ORDENAÇÃO - MERGESORT/figurinhas.cpp | #include <iostream>
#include <vector>
using namespace std;
void ordenaVetor(vector<int> &vetor, int inicio, int meio, int fim){
int x = inicio;
int y = meio + 1;
int z = 0;
vector<int> vet;
vet.resize(fim - inicio + 1);
while (x <= meio && y <= fim){
if (vetor[x] < vetor[y]){
vet[z] = vetor[... | ALGO | 0.999976 | 4.231274 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2021-10-05T22:14:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91bad33b96c... |
83122d16-1526-4e48-bdfb-d34a4294f6c5 | Starrah/THSS-CRACKER | 数据结构/2018Fall_ssj/gui/utils.cpp | #include "utils.h"
bool ischar(wchar_t c)
{
char c1 = (char)c;
if (0 <= c && c < 128)
return true;
else
return false;
}
bool isBlank(wchar_t c)
{
return c == (wchar_t)'\n' || c == (wchar_t)'\r' || c == (wchar_t)'\t' || c == (wchar_t)' ' || c == (wchar_t)'\v' || c == (wchar_t)12288;
}
v... | ALGO | 0.988619 | 3.628902 | {
"github_metadata": {
"branch": "master",
"commit_count": 50,
"repo_created_at": "2020-07-07T13:27:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 111,
"forks": 45,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef29b9... |
2087e1a1-297a-4d9d-8b53-db5a52ddec61 | happyhappyhappyhappy/sakura-cpp | comp_pro/atcoder/DP/E/initial/submit1_NG1.cpp | #ifdef DEBUG
#define _GLIBXX_DEBUG
#endif
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define COUT(x) cout<<#x<< " = " <<(x)<< " (L" <<__LINE__<< ")" <<endl
template<class XXX> inline bool changeMin(XXX& x,XXX y){
if(x>y){
x=y;
return true;
}
r... | ALGO | 0.999997 | 4.218297 | {
"github_metadata": {
"branch": "master",
"commit_count": 981,
"repo_created_at": "2021-05-09T05:29:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37da0cc7... |
eadbfac0-399c-44c3-ab33-0cbde2559b6d | dingyalei/Games101 | pa0/games101-0/main.cpp | #include<cmath>
#include<eigen3/Eigen/Core>
#include<eigen3/Eigen/Dense>
#include<iostream>
int main(){
// Basic Example of cpp
std::cout << "Example of cpp \n";
float a = 1.0, b = 2.0;
std::cout << a << std::endl;
std::cout << a/b << std::endl;
std::cout << std::sqrt(b) << std::endl;
std:... | ALGO | 0.974404 | 3.940115 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-11-22T05:51: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": "267d017be0... |
6b3d30d2-cd62-427a-b8bf-dce30e643b4b | miiitomi/atcoder | miiitomi/20241106/3.cpp | // https://atcoder.jp/contests/abc271/tasks/abc271_d
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint998244353;
const ll INF = 2e+18;
const ll MOD = 998244353;
void solve() {
ll N, S;
cin >> N >> S;
vector<ll> a(N), b(N)... | ALGO | 0.999967 | 3.837584 | {
"github_metadata": {
"branch": "main",
"commit_count": 765,
"repo_created_at": "2021-03-02T13:45: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": "5a8d0e2a0d... |
d793d7be-48f9-4d3a-be65-3716b086642a | Avninder99/LeetCode_GFG_Solutions | 0530-minimum-absolute-difference-in-bst/0530-minimum-absolute-difference-in-bst.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.999921 | 6.448798 | {
"github_metadata": {
"branch": "main",
"commit_count": 2005,
"repo_created_at": "2022-06-04T06:39: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": "2b3e4d9c5... |
da3f6b88-9770-4767-9242-e0b43ebef8b6 | huchengbei/PAT-A | 1134. Vertex Cover (25).cpp | /*
* Problem: 1134. Vertex Cover (25)
* Author: HQ
* Time: 2018-03-13
* State: Done
* Memo: set
*/
#include "iostream"
#include "set"
#include "vector"
using namespace std;
struct Node {
int b;
int e;
};
int N, M, K;
set<int> v;
vector<struct Node> edges;
int main() {
scanf("%d %d",&N, &M);
int x,y;
for (int i ... | ALGO | 0.999974 | 4.462013 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2018-03-05T06:05: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": "3a53a3805... |
d2e5224f-78a5-4f5a-a745-c672b2ef9c67 | W-y-l-t/Algorithms-and-Data-Structures | Search/TernarySearch/TernarySearch.cpp | /*
* Time Complexity: O(2 * log_3 N)
*
* Auxiliary Space: O(1)
*
* !ONLY FOR UNIMODAL FUNCTIONS / SORTED DATA ARRAYS!
*/
#include <iostream>
#include <cinttypes>
int main() {
size_t n;
std::cin >> n;
auto* data = new int64_t[n];
for (size_t i = 0; i < n; ++i) {
std::cin >> data[i];
}... | ALGO | 0.999977 | 5.551899 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2024-01-24T10:02:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f91b652d6b... |
f3d841f4-9bae-41e5-9081-0102e2980f3b | ps-snu/21-book-study | Week05/yks1502/OCR/main.cpp | #include <bits/stdc++.h>
using namespace std;
int m, q, n, first, recInt[100], footprint[100][500];
string words[500], rec[100];
double B[500], T[500][500], M[500][500];
double initP[500][500], cache[101][500];
double initProb(int curr, int target) {
double& c = initP[curr][target];
if (c != -1.0) return c;
... | ALGO | 0.999981 | 3.701267 | {
"github_metadata": {
"branch": "main",
"commit_count": 330,
"repo_created_at": "2021-05-17T05:39:31.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "12fed8f024d... |
6b76ab09-3e7b-403a-8a45-f7fca6a6304b | emakryo/cmpro | src/tenkei90/d025.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
template<typename T>
ostream& operator<<(ostream &os, vector<T> &v){
string sep = " ";
if(v.size()) os << v[0];
for(int i=1; i<v.size(); i++) os << sep << v[i];
return os;
}
template<typename T>
istream& operator>>(istream &is, vector<... | ALGO | 0.999675 | 3.66998 | {
"github_metadata": {
"branch": "master",
"commit_count": 264,
"repo_created_at": "2017-01-24T09:57: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": "dd3eb542... |
fc4ca2f6-4e54-4e29-ad13-2ce415aa5b0b | lundwall/tensor-redistribution | auto/include/send_recv.hpp | #include <mpi.h>
#include <stdlib.h>
#include <cstring>
#include <liblsb.h>
#include <omp.h>
#include <string>
#include <tuple>
#include <cassert>
#ifndef SEND_RECV_HPP
#define SEND_RECV_HPP
using std::size_t;
template <typename T, size_t N>
struct tuple_of {
template <size_t>
using Capture = T;
templat... | TOOL | 0.959532 | 5.613856 | {
"github_metadata": {
"branch": "main",
"commit_count": 164,
"repo_created_at": "2023-03-13T12:49: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": "4f9057bc40... |
d2ef4049-966e-4810-9974-eafbd600cd99 | ishandutta2007/codeforces-a | archuser84/normal/754/E.cpp | ///
/// There's a reason for your defeat, DIO. One simple reason...
/// You pissed me off.
///
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
#define Loop(x,l,r) for(ll x = ll(l); x < ll(r); ++x)
#define LoopR(x,l,r) for(ll x = ll(r)-1; x >= ll(l); --x)
#define Kill(x)... | ALGO | 0.999917 | 4.103448 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ddd436ebe069... |
d02bca61-de1d-4f11-b34f-ac17a589a7ae | mrittickdeb/DSA-NOTES-CPP | heaps/minheapheapfyques.cpp | #include <iostream>
#include <iomanip>
using namespace std;
// Function to swap two integers
void swap(int &x, int &y) {
int temp = x;
x = y;
y = temp;
}
// Min-heapify function to maintain the min-heap property
void minHeapify(int heap[], int size, int i) {
int smallest = i;
int left = 2 * i + 1;... | ALGO | 0.999928 | 6.406791 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-05-12T15:45:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "168f918ffa6e... |
e2bdaeae-9823-43c6-abb6-23d36173d060 | ku-alps/cse17_keunbum | Baekjoon/solved/11053/sol.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int dp[1234][1234];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> a(n), b(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
b[i] = a[i];
}
sort(b.begin(), b.end());
for (int i =... | ALGO | 0.999979 | 3.642253 | {
"github_metadata": {
"branch": "master",
"commit_count": 212,
"repo_created_at": "2019-03-13T15:29:05.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89f223216... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.