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 |
|---|---|---|---|---|---|---|---|
e33d6b27-7f9e-48b9-96af-386cb04261df | aryangupta02092002/December-Challenge | 876_MiddleOfTheLinkedList.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode
{
int data;
struct ListNode* next;
ListNode(int x){
data = x;
next = NULL;
}
};
void printList(ListNode* node)
{
while (node != NULL) {
cout << node->data <<" ";
node = node->next;
}
co... | ALGO | 0.999935 | 5.046105 | {
"github_metadata": {
"branch": "master",
"commit_count": 38,
"repo_created_at": "2022-12-01T16:13:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b97c9259b... |
19eecf48-8064-4304-9a85-2ae1b81c25a4 | wwyqianqian/CCNU-Algorithm | unit7-贪心/huffmanCoding.cpp | #include <bits/stdc++.h> // use g++
using namespace std;
struct MinHeapNode {
char data;
unsigned freq;
MinHeapNode *left, *right;
MinHeapNode(char data, unsigned freq) { // struct class
left = right = NULL;
this->data = data;
this->freq = freq;
}
};
struct compare {
bool operator()(MinHeapNo... | ALGO | 0.999996 | 4.66833 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-03-10T01:51: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": "e77ebc2ee... |
80b5fdc7-2acb-41ad-b75f-8b2031431d76 | ishandutta2007/codeforces-nonalphabetic | __math/normal/438/C.cpp | #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include ... | ALGO | 0.999873 | 4.236048 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:49:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "73df1dc62daa... |
e1b306be-8ca6-486b-aa83-03ac301a8eea | szabiyako/ParallelProgrammingLabs | ParallelProgramming02/ParallelProgramming02/Solve/CpuOpenMP/solveCpuOpenMP.cpp | #include "solveCpuOpenMP.h"
#include "omp.h"
void Solve::cpuOpenMpStatic(int64_t* res, const char* matrix, const int64_t sideSize)
{
#pragma omp parallel for schedule(static)
for (int64_t col = 0; col < sideSize; ++col) {
for (int64_t row = 0; row < sideSize; ++row) {
const int64_t elemIdx... | ALGO | 0.999625 | 4.938905 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2021-09-22T15:19: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": "77c739fce0... |
3c3684ed-ca2f-407f-adaf-151480a9f7f8 | AliAsbahi/FreeCAD | src/Mod/Sketcher/App/planegcs/GCS.cpp | /***************************************************************************
* Copyright (c) 2011 <NAME> <<EMAIL>> *
* *
* This file is part of the FreeCAD CAx development system. *
* ... | ALGO | 0.98664 | 5.122969 | {
"github_metadata": {
"branch": "master",
"commit_count": 19749,
"repo_created_at": "2020-02-28T11:03: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": "3428d9... |
b6a255ff-ddb9-4109-b350-4e7a9d2b5036 | Mayank1909/C-- | Stack/Largestrectanglearea.cpp | // #include <iostream>
// #include <stack>
// using namespace std;
// int NextSmaller(int arr[], int n)
// {
// stack<int> s;
// s.push(arr[n - 1]); //pushng last element
// for (int i = n - 2; i >= 0; i--)
// {
// while (s.empty() == false && s.top() >= arr[i])
// s.pop();
// ... | ALGO | 0.999915 | 6.08632 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-01-09T12:28: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": "0ac44a01ab... |
9e76e159-49bb-4fac-b967-c737a5486ae2 | PauloMiranda98/Solutions-To-Competitive-Programming-Problems | 2017 Benelux Algorithm Programming Contest (BAPC 17)/G.cpp | #include <bits/stdc++.h>
#define F first
#define S second
#define EB emplace_back
#define all(x) x.begin(),x.end()
#define endl '\n'
#define W(x) cerr << "\033[31m"<< #x << " = " << x << "\033[0m" << endl;
using namespace std;
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
usi... | ALGO | 0.999936 | 3.8943 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2020-04-30T13:45:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f022eb80a... |
677555fc-e67b-4c0d-baec-5e6bc4d550b7 | AdmiJW/CPP | LeetCode/Binary Tree Right Side View.cpp |
#include <vector>
#include <queue>
using namespace std;
//https://leetcode.com/problems/binary-tree-right-side-view/
/*
* This is a recursion - DFS/ BFS Level order traversal problem.
*
* First let's talk about recursion. How can we solve in recursion?
* In normal preorder traversal, the ordering is always ro... | ALGO | 0.999935 | 6.250632 | {
"github_metadata": {
"branch": "master",
"commit_count": 513,
"repo_created_at": "2020-09-22T14:44:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03e6f019... |
ba53105e-b8ac-477b-9c27-cc06d9116bc5 | Ascnbeta/oi_code | luogu/P2044.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef __int128 i128;
ll mod,a,c,x,n,g;
struct matrix {
ll a[3][3];
int n,m;
inline void init(int _n,int _m) {
memset(a,0,sizeof(a));
n = _n,m = _m;
}
inline void reset() {
for (int i = 1; i <= n; i++) a[i][... | ALGO | 0.999919 | 4.053412 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2025-01-08T11:30:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8cc0839223... |
bfbc2741-3117-4d6c-be6c-563309ec0766 | OgLocGreen/implementacion_de_sistemas_de_controll | material_auxiliar/clase2/MySignal/source/test.cpp | #include <vector>
#include <string>
#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
//#include <iterator>
using namespace std;
class MySignal
{
private:
vector<float> data; //implementar en tarea
int nmax; //implementar en tarea
string name;
public:
MySignal(int i_nmax);
... | ALGO | 0.937765 | 3.772803 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-09-19T19:19: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": "1ad260654f0... |
2ef72f38-3bf7-4d34-a69d-5a33416c8500 | funyarinpa01/time-tracking-report | src/main.cpp | #include "ThreadSafeQueue.h"
#include "time_measurement.h"
#include <boost/date_time/gregorian/parsers.hpp>
#include <boost/functional/hash.hpp>
#include <boost/program_options.hpp>
#include <array>
#include <iostream>
#include <fstream>
#include <string>
#include <thread>
#include <tuple>
#include <vector>
#include ... | TOOL | 0.921902 | 6.125231 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2022-01-03T21:24: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": "cf726958e1... |
4820a8d9-2906-4df8-8d8a-001c18d7fabc | ishandutta2007/codeforces-r | rajat1603/normal/121/E.cpp | #include "bits/stdc++.h"
using namespace std;
const int N = 1e5 + 5;
const int M = 1e4 + 4;
const int SN = 1 << 18;
const int precalc[] = {4 , 7 , 44 , 47 , 74 , 77 , 444 , 447 , 474 , 477 , 744 , 747 , 774 , 777 , 4444 , 4447 , 4474 , 4477 , 4744 , 4747 , 4774 , 4777 , 7444 , 7447 , 7474 , 7477 , 7744 , 7747 , 7774 , ... | ALGO | 0.999515 | 5.104171 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T15:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "01e9e082ab14... |
b225bdc3-fdd6-48ca-92ba-d53c22123cf7 | HanbiJang/CodingTestStudy | Other_Problem/백준/단계별로 풀어보기/14888 연산자 끼워넣기/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int N;
int minA=2147000000;
int maxA=-2147000000;
vector<int> tmp; //+, -, *, /
vector<int> op_tmp; //op에 남은수 카운트
void BackTR(int n, vector<int> &arr, vector<int> &op){
if(n==N-1){
int res = arr[0]; //첫수
//값계산
for(int i=1; i<=N-1; i++){
if... | ALGO | 0.999975 | 4.246091 | {
"github_metadata": {
"branch": "main",
"commit_count": 189,
"repo_created_at": "2022-04-16T10:09: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": "8bd6c9ba61... |
2d357fe8-020b-4b30-badd-c655672ecb11 | Casterial/AVL-Tree | AVL Tree/AVLTree.cpp | #include "AVLTree.h"
/*
* Height of AVL Tree
*/
int avlTree::height(Node *temp)
{
int h = 0;
if (temp != NULL)
{
int l_height = height(temp->left);
int r_height = height(temp->right);
int max_height = std::max(l_height, r_height);
h = max_height + 1;
}
return h;
}
/*
* Height Difference
*/
int avlTree::... | ALGO | 0.998171 | 4.49144 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-02-10T02:10: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": "47f67f84cc... |
fc11d497-8ca2-4070-a54a-144a300c82db | Aryan-Raj-12/OATCP | 12_FindingMaximumFlow/source.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
long long int mod = 1e9+7;
bool bfs(vector<vector<int>>& residual_g, int n, int src, int sink, vector<int>& parent)
{
vector<bool> visited(n, 0);
queue<int> q;
q.push(src);
visited[src] = true;
parent[src] = -1;
while(!q.empty())
{
i... | ALGO | 0.999898 | 4.66609 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2024-03-12T08:55: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": "c6e14f3fcbc... |
993b9bb3-2f2b-41ef-888c-6d4a545e08e8 | JasonZhangjc/Requirements-Checking-for-Bidirectional-Reconfiguration | coreach.cpp | #include "coreach.h"
// This actually checking requirement 4 for nonblockingness.
// The essence of this part is to check coreachability.
// The reachability has been checked when creating the state predicates.
void looseCoreach(ads& a, vector<set<string>>& states,
vector<vector<st... | ALGO | 0.999651 | 3.265821 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2019-03-03T04:42:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aad1d93263... |
d9009a36-c25b-4c71-a5dc-b92b9579b55c | RitterAntoine/fdm_aa_cpp | src/cglib/cycle.cpp | #include <cycle.h>
// Constructor
Cycle::Cycle(Graph list_point_adjacency,
Eigen::Array<bool, Eigen::Dynamic, 1> visited_points,
Eigen::ArrayX3i cycle_points_data,
Eigen::ArrayX2i cycle_data,
int cycle_count)
: list_point_adjacency_(list_point_adjacency), visited_... | ALGO | 0.949346 | 3.892505 | {
"github_metadata": {
"branch": "main",
"commit_count": 111,
"repo_created_at": "2024-01-23T09:31: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": "c82dfd8f86... |
d178a409-9dbc-483d-8324-bfdf438f02e2 | Samsonroyal/Scpel-1.0.0 | gcc/config/i386/x86-tune-sched-core.cc | /* Scheduler hooks for IA-32 which implement bdver1-4 specific logic.
Copyright (C) 1988-2022 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; eithe... | ALGO | 0.908419 | 6.574094 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-07-19T12:25: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": "0398ceb0a180... |
6c78f06b-b2ff-4433-9ff5-2aa31b5bdb8e | shengren/Practice | leetcode/Number_of_Digit_One.cc | class Solution {
public:
int countDigitOne(int n) {
int step[10]; // 1, 10, 100, 1000, ...
step[0] = 1;
for (int k = 1; k < 10; ++k)
step[k] = step[k - 1] * 10;
int sum[10]; // sum[k]: Number of 1 between 0 and step[k] - 1 (inclusive)
sum[0] = 0;
for (int k = 1; k < 10; ++k)
su... | ALGO | 0.999683 | 5.910961 | {
"github_metadata": {
"branch": "master",
"commit_count": 164,
"repo_created_at": "2012-04-18T21:04:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33ab3112... |
f148feaf-0cbc-40ea-8c12-eef762a3a1a1 | aria-systems-group/berry-er | include/impl/LPSolver_impl.hpp | #pragma once
#include "LPSolver.h"
#include "Time.h"
#include "berry/Options.h"
#include <ortools/linear_solver/linear_solver.pb.h>
BRY::LPSolver::LPSolver(const std::string& solver_id)
: m_solver(ort::MPSolver::CreateSolver(solver_id))
, m_constraints_set(false)
{
if (!m_solver) {
LOG(FATAL) <... | ALGO | 0.952051 | 7.007308 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2024-04-01T01:41:57.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ce85335c658... |
5794f699-cb6e-4444-b446-da2448b9ccc9 | khyu2/Baekjoon | 백준/Gold/12015. 가장 긴 증가하는 부분 수열 2/가장 긴 증가하는 부분 수열 2.cc | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class SegmentTree {
private:
vector<int> tree;
vector<pair<int, int>> a;
int query(int node, int s, int e, int l, int r) {
if (s > r || e < l) return 0;
if (l <= s && e <= r) return tree[node];
return ... | ALGO | 0.999964 | 4.94216 | {
"github_metadata": {
"branch": "main",
"commit_count": 155,
"repo_created_at": "2024-02-27T14:40: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": "4f62c2944d... |
fc31ccda-06bd-4761-b0bf-f3d0799e0a78 | ishandutta2007/codeforces-k | krijgertje/normal/1515/F.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
#include <list>
#include <cassert>
#include <climits>
#inclu... | ALGO | 0.999982 | 3.725941 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "df865415f07b... |
3b615478-82de-41da-91ae-359f9ba60bc7 | JackNguyen1209/ICPC_TryHard_ | DP/Bai015.cpp | /*
<NAME> Phuc_Jacke
*/
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<pll, ll>plll;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
ll n;
cin >> n;
vect... | ALGO | 0.999946 | 3.798582 | {
"github_metadata": {
"branch": "main",
"commit_count": 51,
"repo_created_at": "2021-05-15T15:21: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": "05893c75346... |
fda22956-5152-4c4e-8dca-9f7502c48a7c | DharmaTejaNaishadham/DataStructuresAndAlgorithms | DataStructuresAndAlgorithms/DataStructuresAndAlgorithms/BT_RecursiveTraversals.cpp | #include <iostream>
using namespace std;
#include "BT.h"
void PreOrderRec(BinaryTreeNode *root)
{
if (root != NULL)
{
cout << "Address = " << root << " Data = " << root->getdata() << "\t" << " left = " << root->getleft() << "\t" << "right = " << root->getright() << "\n";
PreOrderRec(root->getleft());
PreOrder... | ALGO | 0.994445 | 4.822388 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-07-29T19:47:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b65efbb856... |
af751c75-932a-4ec3-9ed9-a0c7fadf76af | purdue-cap/DryadSynth | dryadsynth/StarExec/src/z3/src/sat/sat_parallel.h | /*++
Copyright (c) 2017 Microsoft Corporation
Module Name:
sat_parallel.h
Abstract:
Utilities for parallel SAT solving.
Author:
<NAME> (nbjorner) 2017-1-29.
Revision History:
--*/
#ifndef SAT_PARALLEL_H_
#define SAT_PARALLEL_H_
#include "sat/sat_types.h"
#include "util/hashtable.h"
#include "util/m... | ALGO | 0.999629 | 6.82528 | {
"github_metadata": {
"branch": "master",
"commit_count": 628,
"repo_created_at": "2020-02-24T07:23:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 28,
"forks": 6,
"issues": 1,
"pull_requests": 7
},
"file_meta": {
"content_id": "18012141... |
56495452-061f-4639-b00c-04a6b6ea0e24 | umaidansari12/CP_Backup | previous_codes/diagonal_traverse.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
class Solution {
public:
vector<int> findDiagonalOrder(vector<vector<int>>& a) {
int m = a.size(), n = a[0].size(), flag = 0;
vector<int> res;
for (int i = 0; i < n; i++)
{
if (flag)
{
int j = 0, k = i;
while (j < m && k >= 0)
... | ALGO | 0.999994 | 4.385943 | {
"github_metadata": {
"branch": "main",
"commit_count": 1213,
"repo_created_at": "2021-06-27T07:26:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48fbafd4d... |
33cc35ab-d3f4-4757-aa8b-3cf2a51c4077 | HaojiongZhang/Flight-Path-Centrality-Project | hz49-junjieg2-youfuq2-cyin9-main/Route.cpp | #include "Route.h"
#include "Airport.h"
#include <cmath>
// define pi 3.14159265358979323846
long double toRad(const double degree) {
double d1 = (M_PI) / 180;
return (d1 * degree);
}
Route::Route() {
}
Route::Route(const Airport & a1, const Airport & a2) {
source = a1;
destination = a2;
calcD... | TOOL | 0.92616 | 4.913551 | {
"github_metadata": {
"branch": "main",
"commit_count": 6,
"repo_created_at": "2022-01-04T22:58: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": "27b7147be2fb... |
9f236529-a4fe-4331-b21a-0b0a7f9f3e7a | Cheonilyeong/Baekjoon-Programmers | 백준/Silver/15723. n단 논법/n단 논법.cc | #include <bits/stdc++.h>
using namespace std;
int n, m, a, b;
string s;
vector<int> v[30];
int check(int a, int b) {
int cnt = 0;
for(int i : v[a]) {
if(i == b) {
cnt++;
break;
}
cnt += check(i, b);
}
return cnt;
}
int main(void) {
ios_base::sync_... | ALGO | 0.999919 | 4.706293 | {
"github_metadata": {
"branch": "master",
"commit_count": 610,
"repo_created_at": "2024-01-19T04:47: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": "f2330141... |
3d6df156-dbf7-4e76-ab95-3d5669c3f796 | anhtuta/c-cpp | PERMUTATIONGEN.cpp | /*
Sinh hoan vi thu k cua 1 tap n phan tu
VD:
Input: n=3, k=2
Output:
1,3,2
*/
#include<stdio.h>
#include<stdlib.h>
#include <iostream>
#define MAX 10000
#define INF 1000000000
int a[MAX+1];
int n;
using namespace std;
void output() {
for(int i = 1; i <= n; i++) {
cout << a[i] << " ";
}
}
void swap(int *x, int... | ALGO | 0.999979 | 3.734125 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-11-09T18:13:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "652f648b05... |
536f1e37-5e60-4b32-864d-0e7566bc609f | ryancoleman/lotsofcoresbook1code | Pearls1_Chapter21/Pearl/embree-source-2.3.3/kernels/xeonphi/bvh4mb/bvh4mb_traversal.h | // ======================================================================== //
// Copyright 2009-2014 Intel Corporation //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// y... | ALGO | 0.999811 | 5.599537 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2015-08-30T03:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d2789fd4... |
68f3aa17-2ffa-4e7f-9472-d410e9760c38 | devraghav14/DSA | Arrays/Integer Array Questions/OddOcurringElement.cpp | // Similar Problem : Leetcode Question No 540 :Single Element in a Sorted Array(Medium)
/*
You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once.
Return the single element that appears only once.
Your solution must run in... | ALGO | 0.999906 | 5.867741 | {
"github_metadata": {
"branch": "main",
"commit_count": 131,
"repo_created_at": "2025-02-18T05:32: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": "338ed814e2... |
a9c5a403-a820-48e5-8e51-2625d7d61276 | hiteshtheone/integerInWords | main.cpp | //
// main.cpp
// intToStr
//
// Created by hambarkh on 24/03/15.
// Copyright (c) 2015 Akola. All rights reserved.
//
#include <iostream>
#include "Header.h"
using namespace std;
void stringing(int aInNum,int aInPlace);
int main(int argc, const char * argv[]) {
// insert code here...
std::cout << "Hell... | ALGO | 0.996843 | 4.107843 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-03-29T10:34: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": "9ebb537d75... |
03989202-5b3b-41bd-9f87-0bef0d9b9a39 | Anshikaa-agarwal/striver | binarySearch/1d/lowerBound.cpp | // Problem Statement: Given a sorted array of N integers and an integer x, write a program to find the lower bound (ceiling) of x.
// arr[index] >= target
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int lowerBound(vector<int> arr, int target) {
int low = 0, high = arr.size()-1;
... | ALGO | 0.999965 | 5.488643 | {
"github_metadata": {
"branch": "main",
"commit_count": 176,
"repo_created_at": "2024-11-09T18:14: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": "75fc060bee... |
2d5a6862-c8be-41fb-ad32-14d7bb10f982 | omarElsherief/ECPC-Train | CF 800/A_Odd_Set.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MOD 1000000007
#define L list
#define V vector
#define D deque
#define ST set
#define MS multiset
#define M map
#define UM unordered_map
#define pb push_back
#define pf push_front
#define MM multimap
#define f first
#define s second
#define PLL... | ALGO | 0.999823 | 4.035313 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2025-03-27T21:10: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": "eec8b0fc753... |
06d813eb-279d-487f-9006-92b1e53042f3 | mochaulia/Wall-Following-Robot-using-Arduino | G_Kiri.ino | void deteksi_kiri1() {
if (cm3 >= 2 && cm3 <= 60 && cm4 >= 2 && cm4 <= 60) {
rem();
delay(300);
kiri_150();
delay(300);
rem();
posisi = 25;//25
}
}
void ref_kiri1() {
if (cm3 > 150 || cm3 == 0) {
rem();
delay(300);
posisi = 26;
}
}
void ref_kiri2() {
if (cm1 > 150 || cm1 ==... | ALGO | 0.938461 | 4.264706 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2019-09-03T15:19:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8afa56caf1... |
b1ed66c1-e381-4286-8ac3-6cb4596caa58 | ldxdudu/DataStructure_C-- | 链表/循环链表/main.cpp | /*
* @Description: 循环链表
* @Version: 1.0
* @Autor: LDX
* @Date: 2021-04-22 21:53:10
*/
#include "./include/CircleLinKList.h"
class Person {
public:
CircleLinkNode Node;
string m_Name;
int m_Age;
int m_Score;
public:
Person(string name, int age, int score) {
this->m_Name = name;
... | TOOL | 0.998496 | 5.152708 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-04-23T03:03:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62fae9ea20... |
5eb8b4ab-52f3-4ae7-aa21-35914d4d280c | Rishi-11-2/CP | D_Square_Pair.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using namespace chrono;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define debug(x...) { cout << "(" << #x << ")" << " = ( "; PRINT(x); }
tem... | ALGO | 0.999988 | 3.636096 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-10-19T06:20: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": "ff7530e9dda... |
d0b95225-8fe9-4572-9dfa-5d07866fceeb | SH-anonta/Competitive-Programming-Solutions | LightOJ/LOJ 1354 - IP Checking.cpp | #Name <NAME> #Problm
#include bitsstdc++.h
using namespace std;
FOLD ME
namespace{
typedef long long LL;
typedef vectorint vint;
typedef pairint,int pint;
typedef unsigned long long ULL;
Macros
int CC_;
#define sf scanf
#define pf printf
#define PP cin.get();
#define NL coutendl;
#define all(container) container.beg... | ALGO | 0.999302 | 3.748003 | {
"github_metadata": {
"branch": "master",
"commit_count": 286,
"repo_created_at": "2016-04-01T13:24:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 22,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d7fa67... |
d269571d-0850-4a62-a5c3-1d6d0b7d4c91 | aadityaraj7769/Competitive-Programming | C_Double_Sort.cpp | #include <bits/stdc++.h>
using namespace std;
// Macros
#define ll long long
#define vb vector<bool>
#define vl vector<long long>
#define vi vector<int>
#define vvl vector<vector<long long>>
#define vpl vector<pair<long long, long long>>
#define ml map<long long, long long>
#define mpl map<pair<long long, long>, pair... | ALGO | 0.999971 | 3.895973 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2022-11-18T16:19: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": "d3d1b725192b... |
927efa13-a11e-4d9d-a7be-0bb421951e3c | aaclvc/acm | week02/numbersetseasy.cpp | /* <NAME>
*
* Kattis Problem : Number Sets
* Problem ID : numbersetseasy
* CPU Time limit : 1 sec
* Memory limit : 1024 MB
* Difficultiy : 4.4
*
*/
#include <iostream>
#include <cmath>
#include <vector>
#include <set>
int find (std::vector<int> &d, int n)
{
if(d[n] == -1)
{
... | ALGO | 0.999819 | 5.302994 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2022-01-26T17:17: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": "3e24f02a50e... |
20df247e-a100-4098-b197-ace3670f76bb | kishanrajput23/Wipro-Unix-CPP-Systems | Data Structures/Stack/03/03.cpp | /*
Implement a stack with operations push() and pop()
push() will push data onto the stack.
pop() will remove data from the stack. The data retrieved from the stack must be returned to the calling function
Data to be pushed onto the stack is read from a file and the file name is passed as a command line argument to ... | ALGO | 0.970553 | 4.671975 | {
"github_metadata": {
"branch": "main",
"commit_count": 231,
"repo_created_at": "2023-01-12T09:29:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d68b22b50... |
ebb18961-3518-4836-8458-b1bd022d2e74 | blender/blender | extern/Eigen3/Eigen/src/Core/SolveTriangular.h | // This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008-2009 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mo... | ALGO | 0.984675 | 7.258275 | {
"github_metadata": {
"branch": "main",
"commit_count": 152123,
"repo_created_at": "2019-10-09T12:47:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 15670,
"forks": 2395,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8... |
a132cde2-4539-45fc-a4d3-faead60270a6 | minhnguyent546/cses-problem-set | advanced-techniques/cses_2111_apples_and_bananas.cpp | /**
* author minhnguyent546
* created_at Sat, 2024-10-05 00:09:42
**/
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "cp/debug.h"
#else
#define debug(...)
#define cerr if (false) cerr
#endif
const double PI = acos(-1);
using Comp = complex<double>;
int rev_bit(int ... | ALGO | 0.999979 | 3.586298 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2024-08-11T17:51: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": "f3cfadbf6... |
cc12dbae-e067-41ef-a66a-c5b300f6a5db | XDarkCoder/nipper-ng | libnipper-0.12.6/Juniper-ScreenOS/authentication.cpp | /***************************************************************************
* Nipper - The network infrastructure parser *
* Copyright (C) 2006 - 2008 by <NAME> *
* <EMAIL> *
* ... | TOOL | 0.92376 | 3.644561 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2015-07-15T15:20:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "7e0daa0719... |
37538e1d-37ba-4af1-8cb0-1ca6b438ddb4 | ssk4988/Coding | UCFPT/22locals/practice/jedi.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using pd = pair<ld, ld>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<ld>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vpd = vector<pd>;
using vv... | ALGO | 0.999824 | 3.819286 | {
"github_metadata": {
"branch": "main",
"commit_count": 189,
"repo_created_at": "2021-11-02T23:44:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c8c2dd37f... |
9a41c132-3879-4bdc-9ef6-618676e5da1c | sergev/4.4BSD-Lite2 | usr/src/contrib/libg++-2.3/libg++/gperf/src/list-node.cc | /* Creates and initializes a new list node.
Copyright (C) 1989 Free Software Foundation, Inc.
written by <NAME> (<EMAIL>)
This file is part of GNU GPERF.
GNU GPERF is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Found... | ALGO | 0.946422 | 5.607776 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2014-04-23T03:30:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 388,
"forks": 135,
"issues": 2,
"pull_requests": 0
},
"file_meta": {
"content_id": "195f11... |
013100c2-7d8d-48f8-833a-2b89bc854228 | Gaspard--/ultra-ninja_VS_falling_zombies | source/Physics.cpp | # include "Physics.hpp"
# include "Entity.hpp"
const double Physics::_G = 6.67384 * pow(10.0, -11.0);
bool Physics::haveCollision(const Fixture& a, const Fixture& b) const
{
return (a.pos - b.pos).length2() < CAR(a.radius + b.radius);
}
bool Physics::move(Fixture& fixture) const
{
double... | ALGO | 0.940742 | 4.658104 | {
"github_metadata": {
"branch": "master",
"commit_count": 410,
"repo_created_at": "2017-04-22T04:27:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2815ed1... |
9151aef9-d675-421c-bebc-83f8944566ac | OpticalSpring/ProjectPOCU | Lab4/PolyLine.cpp | #include <cstring>
#include <cmath>
#include "PolyLine.h"
namespace lab4
{
PolyLine::PolyLine()
{
mSize = 0;
for (size_t i = 0; i < 10; i++)
{
mPointLine[i] = nullptr;
}
}
PolyLine::PolyLine(const PolyLine& other)
{
mSize = other.GetSize();
for (size_t i = 0; i < 10; i++)
{
mPointLine[i] = nu... | TOOL | 0.906645 | 4.038348 | {
"github_metadata": {
"branch": "master",
"commit_count": 268,
"repo_created_at": "2019-09-02T13:56:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c91f11c1... |
78a22a3e-58bc-4c4b-9012-b2196ea1faf2 | JianHangChen/LeetCode | 829. Consecutive Numbers Sum.cpp | // k = 3
// 9: 3, 4, 5
// x, x+1, x+2
// x+0, x+1, x+(k-1)
// k = 1
// n = x
// k = 2
// n = x + (x + 1)
// k = 3
// n = x + (x + 1) + (x + 2)
// n = sum( x, x+1, ..., x+(k-1))
// = kx + (k-1)*k/2
// !!!sol1, O(sqrt(N)), O(1)
class Solution {
public:
int consecutiveNumbersSum(int N) {
... | ALGO | 0.999978 | 5.404711 | {
"github_metadata": {
"branch": "master",
"commit_count": 842,
"repo_created_at": "2019-02-15T05:09:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "338bf1c0... |
a1b94bb3-5e60-481f-9cd5-d22e3bf9ad3e | davidcGIThub/curvature_constraints | PathObjectivesAndConstraints/src/RectPrismCollisionChecker.cpp | #include "RectPrismCollisionChecker.hpp"
#include <iostream>
template <int D>
RectPrismCollisionChecker<D>::RectPrismCollisionChecker(){}
template <int D>
double RectPrismCollisionChecker<D>::getDistanceToObstacle(Eigen::Matrix<double,D,1> obstacle_center,
double obstacle_radius, Eigen::... | TOOL | 0.949673 | 5.910721 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2022-07-11T22:25:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b71c8899... |
e9d6173a-8624-46b0-8a41-99c7d4f57fc8 | eidoom/new-world | main.cpp | #include <iostream>
#include <string>
//#include <array>
#include <vector>
using std::cout;
using std::endl;
using std::cin;
using std::string;
//using std::to_string;
//using std::array;
using std::vector;
//struct line {
// string mesg;
// string *var;
//};
void print(const string mesg) {
cout << mesg << en... | TOOL | 0.965389 | 3.015663 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2019-12-03T10:10:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bd374c9496... |
55588533-a4aa-4951-9e3d-aea7b0ef1a91 | AshfaqueSami2/problem-solving | Codeforce rating based/Following the String.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dbl;
//shortcut
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl
#define no cout << "no" << endl
#define minus_one cout... | ALGO | 0.999894 | 3.873066 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-09-13T11:07:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e6d107cc4750... |
bfe0498c-c11f-4db7-9095-2e29ac08e45b | Tarequl-islam/Programming-competition | Codeforces/1395 a.boboniu likes to.cpp | #include<bits/stdc++.h>
using namespace std;
#define fo(i, n) for (i = 0; i < n; i++)
#define ll long long
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define ss(s) scanf("%s", s)
#define pi(x) printf("%d\n", x)
#define pl(x) printf("%lld\n", x)
#define ps(s) printf("%s\n", s)
#define pb push_back
#de... | ALGO | 0.999327 | 3.587156 | {
"github_metadata": {
"branch": "master",
"commit_count": 207,
"repo_created_at": "2020-02-04T18:15:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0246397... |
011710d3-f295-4f37-85a8-be55f04b9b5e | revue-starlight/Algorithm | levoj/1746_2.cpp | #define _for(i, x, y) for (int i = (x); i < (y); ++i)
#define _rep(i, x, y) for (int i = (x); i <= (y); ++i)
#define _dep(i, x, y) for (int i = (x); i >= (y); --i)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
const int MAXN =... | ALGO | 0.999987 | 3.674341 | {
"github_metadata": {
"branch": "main",
"commit_count": 30,
"repo_created_at": "2021-07-05T13:17:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e20d082df96... |
49dac026-03a6-407d-b989-8f5f2dbf030c | MuzzamilBukhari/CompleteDSA-using-Cpp | Trees/ExpressionTree/postfixEvaluation.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
struct StNode
{
int value;
StNode *next;
};
StNode *top = NULL;
void push(int value)
{
StNode *ptr = (StNode *)malloc(sizeof(StNode));
ptr->value = value;
ptr->next = top;
top = ptr;
}
int pop()
{
if (top == NULL)
{
return -1;
}
in... | ALGO | 0.99991 | 4.122756 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2024-04-26T16:56:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5a91967f9d5... |
d51f80ae-3437-4174-b762-344b6666cdb9 | aSongDai/AlgorithmPractice | cs_view/code/RotateRight.cpp | #include <iostream>
struct ListNode
{
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode* next):val(x), next(next){}
};
class Solution
{
public:
ListNode* rotateRight(ListNode* head, int k)
{
if (head == nullptr) return head;
... | ALGO | 0.999897 | 5.722777 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2024-02-22T14:07:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "373ac2b92... |
ec11f498-2e78-4afe-a844-fc4da6372cd1 | ZhengMingpei/pat_problemset_basiclevel | 1062.cpp | #include<iostream>
#include<vector>
#include<string>
#include<sstream>
using namespace std;
void trans(string &a, int &x, int &y)
{
int i = 0; int t = a.size();
int lastindex = 0;
while(i<t){
if(a[i]=='/')
{
string s = a.substr(lastindex,i-lastindex);
x = atoi(s.c_str());
lastindex = i+1;
break;
}... | ALGO | 0.998997 | 3.775863 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2019-01-10T15:36: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": "4dea86f9c... |
d3b8e600-0aa5-47d2-9ccd-f3a8eb93bd92 | mave89/CPlusPlus_Random | BinarySearchTree/main.cpp | #include <iostream>
#include <vector>
#include "BST.cpp"
int main()
{
int array[16] = {50, 76, 21, 4, 32, 64, 15, 52, 14, 100, 83, 2, 3, 70, 87, 80};
BST obj;
for (int i = 0; i < 16; i++)
obj.AddLeaf (array[i]);
std::cout<<"Inorder traversal\n";
obj.PrintInOrder();
std::cout<<std::endl;
std::cout<<std::e... | ALGO | 0.999834 | 4.460885 | {
"github_metadata": {
"branch": "master",
"commit_count": 447,
"repo_created_at": "2016-01-20T03:33: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": "01fbec61... |
6081b083-8343-4845-a956-1d577da49666 | danielcaicedoj/POO2021_DCJ | casino/Model/masCercano.cpp | #include "masCercano.h"
float masCercano::jugar( float gonzosApostar ){
srand(time(NULL));
/*
El que se acerce más al número gana el doble
Si es empate, no se gana ni pierde
El numero objetivo es del 1 al 10
*/
this->numero = 1+rand()%11; //Numero del 1 al 10
this->numero... | ALGO | 0.992044 | 3.854651 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2021-02-16T02:23: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": "b7f5a88a6... |
9787a5ff-fc0c-40db-9592-2c733721fa91 | Domina718/OOP_lab_exercise | Vjezba3/Zad4/Zad4.cpp | // Zad4.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <vector>
using namespace std;
void inputVector(vector <int>& v, int n)
{
int e;
for (int i = 0; i < n; i++)
{
cout << "\nUnesite " << i + 1 << ". element ";
cin >> e;
v.push_back(e)... | ALGO | 0.986471 | 3.551515 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-10-19T21:00: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": "3b915752eee... |
064c9760-c61e-4793-b87d-dc4c91041fb1 | sanzanga/C- | Algorithm/leetcode/2022_11_10.cpp | /*
给定一个非空特殊的二叉树,每个节点都是正数,并且每个节点的子节点数量只能为 2 或 0。如果一个节点有两个子节点的话,那么该节点的值等于两个子节点中较小的一个
给出这样的一个二叉树,你需要输出所有节点中的 第二小的值
如果第二小的值不存在的话,输出 -1 。
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(n... | ALGO | 0.999977 | 4.958081 | {
"github_metadata": {
"branch": "main",
"commit_count": 215,
"repo_created_at": "2022-01-05T11:20: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": "63b9b87146... |
f98d7635-2233-41d7-8e85-e7316a49502f | conan-io/conan-center-index | recipes/pagmo2/pre_2.11/test_package/test_package.cpp | // From first_udp_ver0.cpp in tutorials of pagmo2
#include <pagmo/problem.hpp>
#include <pagmo/types.hpp>
#include <cmath>
#include <initializer_list>
#include <iostream>
#include <utility>
// Our simple example problem, version 0.
struct problem_v0 {
// Implementation of the objective function.
pagmo::vecto... | ALGO | 0.9642 | 5.682239 | {
"github_metadata": {
"branch": "master",
"commit_count": 22676,
"repo_created_at": "2019-08-27T09:43:58.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1060,
"forks": 1999,
"issues": 1682,
"pull_requests": 344
},
"file_meta": {
"content_id... |
2e6d2ca1-ce08-4571-a62a-1cd363c718f7 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Mixtral/top0-100/find-the-shortest-superstring-Solution.shortestSuperstring/177831_nan.cpp | mcid_char_imp(fz_context *ctx, pdf_filter_processor *p, tag_record *tr, int uni, int remove)
{
if (tr->mcid_obj == NULL)
/* No object, or already deleted */
return;
if (remove)
{
/* Remove the expanded abbreviation, if there is one. */
pdf_dict_del(ctx, tr->mcid_obj, PDF_NAME(E));
/* Remove ... | ALGO | 0.997517 | 4.763563 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-22T14:39:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d5b0cb3b6e7c... |
ea0ba83a-8d21-4114-8e29-5ea6c2f24aab | a4org/A4 | LeetCode/LinkedList/RemoveDuplicatesfromAnUnsortedLinkedList.cpp | /*
* LeetCode 1836 Remove Duplicates From an Unsorted Linked List
* Medium
* <NAME>
* 2021 11.12
*/
#include <unordered_set>
using namespace::std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), nex... | ALGO | 0.999985 | 6.175603 | {
"github_metadata": {
"branch": "main",
"commit_count": 492,
"repo_created_at": "2021-05-11T18:19:59.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f91f9dc073b... |
1dac8ba7-c460-4e3a-bd54-dbd5f89a5a00 | coldtea4/collegeAssignments | LAB5.cpp | #include <iostream>
using namespace std;
enum action {ROCK, PAPER, SCISSORS};
void displayRules();
action retrievePlay(char);
bool validSelection(char&);
bool validSelectionWelcome(char);
void convertEnum(action);
action winningObject(action, action);
void gameResult(action, action, int&);
void displayResults(int, int... | TOOL | 0.966874 | 4.147289 | {
"github_metadata": {
"branch": "main",
"commit_count": 14,
"repo_created_at": "2024-11-15T04:20:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb3ab413cf9... |
f0532c53-336b-4654-928b-a3896c4b0bda | ishandutta2007/codeforces-z | zeronumber/normal/1434/D.cpp | #include<bits/stdc++.h>
#define pb push_back
#define F first
#define S second
using namespace std;
typedef pair<int,int>pi;
typedef long long ll;
const int M=998244353;
const int maxn=2e6+12;
vector<pi> h[maxn];
int n,r1,r2,dis[maxn],m,U[maxn],V[maxn],f[maxn],l[maxn],r[maxn],tot;
struct seg{
int L[maxn],R[maxn],dep... | ALGO | 0.999983 | 4.956077 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:43:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0a510b5d744... |
e9c28052-3b2e-48d8-b63d-54fab2c2fee2 | rubikshift/MACD | MACD/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <locale>
#include <cmath>
#include "investor.h"
#define PERIOD12 12
#define PERIOD26 26
#define PERIOD9 9
#define SIZE 1000
void generateWeights(double* weights, const unsigned int period)
{
double w, alpha = 2.0 / (period - 1.0);
w = 1;
for (unsig... | ALGO | 0.999844 | 4.812397 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-02-25T14:16: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": "a1ce124614... |
a79bef9b-b05b-400a-a5a9-5b2b1624dc54 | Swapnil67/dsa | Binary-Search/01-easy/06-first-and-last-occurence-a.cpp | /*
* First and Last Position of an Element In Sorted Array
* You have been given a sorted array/list 'arr' consisting of ‘n’ elements. You are also given an integer ‘k’.
* Now, your task is to find the first and last occurrence of ‘k’ in 'arr'.
* Note :
* 1. If ‘k’ is not present in the array, then the first and ... | ALGO | 0.999931 | 6.39493 | {
"github_metadata": {
"branch": "main",
"commit_count": 425,
"repo_created_at": "2023-12-17T23:44: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": "f8fef158ce... |
bc4a70ce-98d9-4f50-92b8-a4237a174eb2 | rameem2003/OOP-CPP-Resources | triangle/main.cpp | #include <iostream>
using namespace std;
class triangle
{
int length, height;
public:
// triangle(int l, int h)
// {
// length = l;
// height = h;
// }
void display_triangle_area()
{
int area = 0.5 * length * height;
cout << "The area of the triangle is " << a... | TOOL | 0.987366 | 5.131553 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2024-10-26T14:13: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": "030fc34fb9e... |
b1498642-c892-46ad-87f9-45e8d78f00f0 | MilonChandraDas/CP | lightOJ/1_Hex-a-bonacci.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr char nl = '\n';
#define fastio() ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define MOD 10000007
int dp[100012];
int a, b, c, d, e, f;
ll fn(ll n) {
if (n == 0) return a;
if (n == 1) return b;
if (n == 2) return c;
... | ALGO | 0.999864 | 4.255785 | {
"github_metadata": {
"branch": "main",
"commit_count": 20,
"repo_created_at": "2025-01-25T07:19:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8d90988fb41... |
a2c68fc1-190d-4d4f-bfd1-f7fc790c378b | yourpunk/openmp | vector_sum.cpp | #include "vector_sum.h"
#include <omp.h>
#include <numeric>
#include <algorithm>
#include <random>
// Parallel sum computation within each vector
// Suitable for a small number of long vectors
void vector_sum_omp_per_vector(const InputVectors& data, OutputVector& solution, size_t min_vector_size) {
#pragma omp pa... | ALGO | 0.999964 | 6.061965 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-06-10T17:13: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": "d3cd1a7576c... |
5512f5a7-3b3d-4576-bfee-ac9adad26742 | labmec/neopz | Material/needrefactor/REAL/pzartdiff.h | /**
* \file
* @brief Contains the TPZArtDiff class which implements a numerical diffusivity coefficient.
*/
#ifndef TPZARTDIFF_HH
#define TPZARTDIFF_HH
#include "pzvec.h"
#include "pzfmatrix.h"
#include "pzdiffmatrix.h"
#include "pzstring.h"
#include "TPZCompElDisc.h"
#include "TPZSavable.h"
#include "fadType.h"... | ALGO | 0.985838 | 4.964478 | {
"github_metadata": {
"branch": "main",
"commit_count": 10847,
"repo_created_at": "2015-04-03T02:18:47.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 35,
"forks": 11,
"issues": 17,
"pull_requests": 3
},
"file_meta": {
"content_id": "e016f8... |
b75e79a8-dbe4-496d-8277-731e39a83fd1 | mugen1337/procon | DataStructure/BinaryTrieMonoid.hpp | template<typename BitType,int MAXLOG,typename Monoid>
struct BinaryTrieMonoid{
private:
struct Node{
Node *nxt[2];
Monoid val;
Node(Monoid val):nxt{nullptr,nullptr},val(val){}
};
Node *root;
using F=function<Monoid(Monoid,Monoid)>;
F f;
const Monoid e;
Monoid q... | ALGO | 0.999637 | 4.86711 | {
"github_metadata": {
"branch": "main",
"commit_count": 464,
"repo_created_at": "2021-01-01T13:57:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "127badc738... |
fc3ee7a2-b19a-4396-8ad4-770691fe5546 | zakriyamalik/DSA-Part-2 | DS_Ass_3_1.cpp | //#include <iostream>
//#include <ctime>
//using namespace std;
//
//template <typename T>
//class Node {
//public:
// T data;
// Node<T>* next;
//};
//
//template <typename T>
//class Queue {
// Node<T>* front;
// Node<T>* rear;
// int totalSoldiers;
//
//public:
// Queue() {
//... | ALGO | 0.997741 | 3.885628 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-22T16:07: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": "c8fa47a80925... |
e684c5d9-1fe4-4a57-944d-6e5aac687f91 | HuangShiQ/MATLAB2 | ErnestoCode/Tools/MESHES/IntersectMeshes_EZ.cpp | #define real double
#define mxREAL_CLASS mxDOUBLE_CLASS
#include "myMEX.h"
#include "MESH2vtkPolyData.h"
#include "vtkPolyData2MESH.h"
#ifndef _COMPILE_FILE_C
#define REAL double
extern "C" {
#define ANSI_DECLARATORS
#include "triangle.h"
}
#else
#define NO_TIMER
#define ANSI_DECLARATORS
#define T... | ALGO | 0.975572 | 4.281633 | {
"github_metadata": {
"branch": "master",
"commit_count": 41,
"repo_created_at": "2019-11-14T11:20: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": "e64ee0d34... |
8ddffec1-c4af-4878-bb21-9e5eaabc2f47 | wenischlab/MicroSuite | src/SetAlgebra/intersection_service/service/helper_files/client_helper.h | #ifndef __CLIENT_HELPER_H_INCLUDED__
#define __CLIENT_HELPER_H_INCLUDED__
#include "protoc_files/intersection.grpc.pb.h"
typedef long long Docids;
struct IntersectionSrvTimingInfo {
uint64_t create_intersection_srv_request_time = 0;
uint64_t unpack_intersection_srv_req_time = 0;
uint64_t calculate_inters... | TOOL | 0.90907 | 5.143396 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-08-29T20:13:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 43,
"forks": 19,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0453cc66... |
1a01e6cd-91f0-483e-93ea-78d4d1f52e73 | vineeths96/LeetCode-Solutions | 37-sudoku-solver/sudoku-solver.cpp | class Solution {
bool canPlace(const std::vector<std::vector<char>> &board, char k, int i, int j) {
if (board[i][j] != '.')
return false;
for (int val = 0; val < 9; val++)
if (board[i][val] == k || board[val][j] == k)
return false;
for (int x = (i /... | ALGO | 0.999602 | 6.380907 | {
"github_metadata": {
"branch": "main",
"commit_count": 1622,
"repo_created_at": "2023-04-16T04:52: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": "f82f3ef92... |
f3af99a2-91aa-4e93-8c57-86b34f6d1b1c | chen1474147/patchall | src/patch/genimagel.cpp |
#include "patch.h"
Vec3b patch::GeneratePixel(Mat Dst, Mat Src, Mat Mask, Mat Off, int row, int col, int odd)
{
Mat DstSize = GetPatch(Dst, row, col);
int window_length = DstSize.rows*DstSize.cols;
float *a = new float[window_length];
float *sim = new float[window_length];
float *w = new float[window_length];... | ALGO | 0.998133 | 4.314816 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2015-01-15T08:23: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": "4048d58ee9... |
04bdd569-4a70-44c7-949b-6d16d2537698 | alimran-dev/problem-solving | Contests/XPSC mock/Find_the_Maximum_even.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
sort(arr, arr + n, greater<int>());
bool flag1 = false;
bool flag2 = false;
int cntEven = 0, cntOdd = 0;
for (int i = 0; i < n; i++)... | ALGO | 0.999985 | 4.015787 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-04-19T07:02: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": "e396d4f6de35... |
6da8e958-1969-4684-b756-f9da9619fffc | WebKit/WebKit-http | Source/ThirdParty/libwebrtc/Source/webrtc/modules/audio_processing/agc2/rnn_vad/spectral_features.cc | /*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | ALGO | 0.970366 | 7.667139 | {
"github_metadata": {
"branch": "master",
"commit_count": 231005,
"repo_created_at": "2011-01-11T13:50:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4992,
"forks": 1983,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "... |
49250b64-6c19-489b-b2f6-bf11f2cf46a0 | wangyw15/study | data_structure_2/chapter6/src/headers/UFSets.hpp | #ifndef UFSETS
#define UFSETS
#include <memory>
#include <stdexcept>
#include <vector>
#include <iostream>
#include <ios>
#include <map>
template <typename T> struct Node
{
T Data;
int Parent;
Node<T>() { Parent = -1; }
};
template <typename T> class UFSets
{
protected:
std::shared_ptr<Node<T>[]> ... | ALGO | 0.987835 | 5.240301 | {
"github_metadata": {
"branch": "main",
"commit_count": 482,
"repo_created_at": "2022-06-19T09:49:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d31478561e... |
daf4442d-a32d-4075-ad88-c0e82aefbc53 | xinghun0525/R2LP | R2LP_exp/full_bash/topk_query/gt_sort.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <sstream>
#include <cstdlib>
#include <vector>
#include <fstream>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <sys/time.h>
#include <sys/resource.h>
#include <unistd.h>
#include <assert.h>
#include <stdio.h>
#include <... | ALGO | 0.996012 | 3.89857 | {
"github_metadata": {
"branch": "main",
"commit_count": 104,
"repo_created_at": "2023-03-31T13:32:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5b8e730c60... |
d241cd11-3fe3-4208-b5a1-9826d7be0532 | Sandeepkumarc23/Emertxe | C++/17class.cpp | #include<iostream>
using namespace std;
class Length
{
private:
int feet;
int inches;
public:
Length(int f = 0, int i = 0) : feet(f), inches(i) {}
void displayLength()
{
cout << "F: " << feet << " I: " << inches << endl;
}
Length operator +(int var)
{
Length obj;
obj.feet = feet + var;
o... | TOOL | 0.902312 | 4.52147 | {
"github_metadata": {
"branch": "main",
"commit_count": 65,
"repo_created_at": "2022-03-17T17:22:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8817a32d59f... |
f76661a2-3074-4aff-a09f-245a06a2f82d | gafeol/competitive-programming | Contests/IEEExtreme12/xplore.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
template <typename T> ... | ALGO | 0.998871 | 3.518359 | {
"github_metadata": {
"branch": "master",
"commit_count": 406,
"repo_created_at": "2016-09-11T01:55:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1778e1b... |
35442b22-5b2f-4401-951d-6b6f4ec24f61 | ishandutta2007/codeforces-k | kimden/normal/1098/C.cpp | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
vector<ll> v;
ll n, s;
ll getans(ll ra) {
v.clear();
v.resize(n, 0);
v[0] = 1;
ll cur = n - 1;
ll ans = 1;
for (int i = 1; i < n; ++i) {... | ALGO | 0.999964 | 3.213064 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:06:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d66a4930ab76... |
4e2aae21-ee9a-40f0-87fa-c6fec598df12 | rdholder/FeetWetCoding | exercises/C01-Beginner_Exercises/S04-Expressions_Syntax/040_OrderOfOperations.cpp | // copyright (c) 2011 <NAME>, <NAME>.
// See HELP.html included in this distribution.
#include <exercises/C01_S04.h>
void OrderOfOperations::runExercise()
{
// Read:
// http://www.cplusplus.com/doc/tutorial/operators/
// "The C Programming Language", Kernighan & Ritchie, page 200 Section A7, "Expressions"... | ALGO | 0.999024 | 4.595685 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2012-01-28T21:42:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9aae74d... |
f4c84d90-9c87-461c-baf2-35d962d5b80d | ongyiumark/programming-problems | Atcoder/ABCs/001 - 099/ABC082/ABC082C.cpp | /*
Use a map to count the number of times an integer occurs.
Remove all if the count is less than the integer.
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
ty... | ALGO | 0.999958 | 3.541449 | {
"github_metadata": {
"branch": "main",
"commit_count": 227,
"repo_created_at": "2020-10-09T05:36:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3e53e87fed... |
a195f980-3659-475f-91b8-0b596e81407f | leeeyupeng/leeeyupeng.github.io | project/algorithm/leetcode/src/148.sortList.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include<string>
#include<map>
#include<unordered_map>
#include<stack>
using namespace std;
// Definition for singly-linked list.
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), ... | ALGO | 0.999974 | 5.435245 | {
"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": "ed842299fb... |
ece37153-7d46-487c-80a7-adb0e775ab50 | mattJS17/AlgoStudy | JLIS/JLIS/main.cpp | //
// main.cpp
// JLIS
//
// Created by ShimJaeHoon on 2018. 1. 18..
// Copyright © 2018년 ShimJaeHoon. All rights reserved.
//
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <climits>
using namespace std;
int n, m;
int a[101], b[101];
int dp[101][101];
int solve(int aPos,... | ALGO | 0.999986 | 3.961981 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-01-11T06:47: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": "d499e8941... |
5f2a82a4-7f4f-4160-8aff-795d4b586269 | cvanaret/Uno | uno/ingredients/subproblem_solvers/MA57/MA57Solver.cpp | // Copyright (c) 2018-2024 <NAME>
// Licensed under the MIT license. See LICENSE file in the project directory for details.
#include <cassert>
#include "MA57Solver.hpp"
#include "ingredients/subproblem/Subproblem.hpp"
#include "linear_algebra/SymmetricMatrix.hpp"
#include "linear_algebra/Vector.hpp"
#include "optimiza... | ALGO | 0.999707 | 6.047621 | {
"github_metadata": {
"branch": "main",
"commit_count": 2164,
"repo_created_at": "2021-09-29T17:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 359,
"forks": 28,
"issues": 12,
"pull_requests": 10
},
"file_meta": {
"content_id": "7aff... |
996c127d-c031-41bb-86a6-0b683a795754 | chr1shr/am225_examples | 5a_fluid_sim/mgs_fem.hh | #ifndef MGS_FEM_HH
#define MGS_FEM_HH
class fluid_2d;
#include "tgmg.hh"
struct mgs_fem {
/** The number of gridpoints in the x direction. */
const int m;
/** The number of gridpoints in the y direction. */
const int n;
/** Total number of gridpoints. */
const int mn;
/** Periodicity in t... | ALGO | 0.98715 | 5.229168 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2018-02-16T18:50:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 26,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aff84e3... |
87d65548-00c0-4576-9eea-cbcc123f5062 | mahinfah/Data_Structure | sorting&searching/quick_sort.cpp | #include <iostream>
using namespace std;
int Partition(int A[], int start, int end)
{
int i = start+1;
int pivot = A[start];
for(int j=start+1; j<=end; j++)
{
if(A[j] < pivot)
{
swap(A[i], A[j]);
i= i+1;
}
}
swap(A[start], A[i-1]);
return (i-... | ALGO | 0.999966 | 5.68841 | {
"github_metadata": {
"branch": "main",
"commit_count": 67,
"repo_created_at": "2024-05-30T10:17: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": "43431cad20d... |
e8fad9ea-445a-40f3-bcbc-8f49d439c4ee | EricJeffrey/myleetcode | leetcode/problems/1004.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
class Solution {
public:
int long... | ALGO | 0.999767 | 5.021644 | {
"github_metadata": {
"branch": "main",
"commit_count": 117,
"repo_created_at": "2020-12-15T07:36: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": "d673aeccd7... |
5dc6f5c6-64cc-4c03-885b-0dc21a947a0e | dwhaynes/leetcode-solutions | 257-binary-tree-paths/2022-03-16 03.33.39 - Accepted - runtime 10ms - memory 14.5MB.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.99999 | 6.238621 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-11-21T22:08: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": "5769fc5b8d... |
78d0d25e-8db5-4d3b-9031-b6b35c7fa9a0 | Porokhnya/DividingHead | DividingHead.ino | //------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/*
Прошивка управления шаговым двигателем для Arduino Mega 2560 и 3.2'' TFT дисплея (контроллер ILI9481).
Автор: <NAME>, <EMAIL>
Прошивка свободн... | TOOL | 0.914451 | 5.988545 | {
"github_metadata": {
"branch": "master",
"commit_count": 54,
"repo_created_at": "2018-09-28T12:20:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1db989765... |
73ceaf5f-e645-4990-b20d-e903d0ed06a6 | KJmistry/Cpp_programming | priority_queue.cpp | #include <iostream>
#include <queue>
using namespace std;
int main()
{
priority_queue<int> myQueue; // known as MAX HEAP
/*--OPERATIONS POSSIBLE ON PRIORITY QUEUE--*/
myQueue.push(2); // myQueue = { 2, }
myQueue.push(3); // myQueue = { 3, 2, }
m... | ALGO | 0.997274 | 4.25968 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2023-03-27T09:44: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": "a3480915b39... |
35406970-0ef9-41e4-bd21-f2b0a6649e03 | Seungcode/Algorithm | 백준/Gold/24042. 횡단보도/횡단보도.cc | #include <iostream>
#include <vector>
#include <queue>
#include <climits>
using namespace std;
int N, M;
vector<pair<int, int>> arr[100001];
void input(){
cin>>N>>M;
for(int i = 0; i<M; i++){
int a, b;
cin>>a>>b;
arr[a].push_back({b, i});
arr[b].push_back({a, i});
}
}
voi... | ALGO | 0.9999 | 3.640583 | {
"github_metadata": {
"branch": "main",
"commit_count": 425,
"repo_created_at": "2024-03-23T04:23: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": "864185b511... |
39458a14-829b-42dd-a61f-3981d4f7e7de | Ivvi-a/Problem-Solving | 프로그래머스/2/150368. 이모티콘 할인행사/이모티콘 할인행사.cpp | #include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int maxMember, maxSell;
vector<int> d_user[5];
vector<int> sum;
vector<int> limit;
void dfs(vector<int>& emoticons, int depth);
vector<int> solution(vector<vector<int>> users, vector<int> emoticons) {
vector<int> a... | ALGO | 0.998978 | 4.142613 | {
"github_metadata": {
"branch": "main",
"commit_count": 244,
"repo_created_at": "2023-11-04T14:59: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": "f2b5845a04... |
1c699788-1a6a-4c22-848f-ff0984f07f3b | neurosim/DNN_NeuroSim_V2.1 | Training_pytorch/NeuroSIM/MultilevelSenseAmp.cpp | /*******************************************************************************
* Copyright (c) 2015-2017
* School of Electrical, Computer and Energy Engineering, Arizona State University
* PI: Prof. <NAME>
* All rights reserved.
*
* This source code is part of NeuroSim - a device-circuit-algorithm framework to bench... | TOOL | 0.978343 | 4.87952 | {
"github_metadata": {
"branch": "master",
"commit_count": 96,
"repo_created_at": "2020-08-07T17:20:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 158,
"forks": 62,
"issues": 16,
"pull_requests": 0
},
"file_meta": {
"content_id": "95bd8... |
053af650-76a9-41d6-b416-5784f88573f5 | qsnake/trilinos | packages/moocho/src/AbstractLinAlgPack/src/serial/implementations/AbstractLinAlgPack_SparseVectorOpDef.hpp | // @HEADER
// ***********************************************************************
//
// Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
// Copyright (2003) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of thi... | TOOL | 0.941687 | 5.480735 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2011-05-28T23:59:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed413be2463... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.