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 |
|---|---|---|---|---|---|---|---|
0ea6409d-d2ae-4476-8804-391797aff1a7 | aloehr/adventofcode | aoc2021/solutions/day15.cpp | #include <iostream>
#include <string>
#include <vector>
#include <array>
#include <limits>
#include <queue>
#include "aoch/AOCSolutionTypes.hpp"
// resizes aoch::Input according to p2 requirements
aoch::Input resize(const aoch::Input& in) {
size_t h = in.size();
size_t w = in[0].size();
aoch::Input ret(... | ALGO | 0.999696 | 5.342099 | {
"github_metadata": {
"branch": "master",
"commit_count": 189,
"repo_created_at": "2021-01-06T06:44: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": "308e2b89... |
139dcdfc-46f7-4614-8a46-bbbe223f25d8 | Jiahui17/legacy-dynamatic | Regression_test/examples/covariance_float/src/covariance_float.cpp | /**
* covariance.c: This file is part of the PolyBench/C 3.2 test suite.
*
*
* Contact: <NAME> <<EMAIL>>
* Web address: http://polybench.sourceforge.net
*/
#include "covariance_float.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define AMOUNT_OF_TEST 1
void covariance_float(inout_float_t data[30... | ALGO | 0.995183 | 4.750993 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2023-08-24T17:12:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "487f699fb... |
4ec6e2f6-29e2-48c2-be5c-143cb286dc1c | PraveenMhapsekar/DataStructures | EDUCATIVE_IO/Arrays/Array_12_find_missing_number.cc | /*
We are given an array containing n distinct numbers taken from the range 0 to n.
Since the array has only n numbers out of the total n+1 numbers, find the missing number.
*/
#include <stdio.h>
#include <iostream>
#include <limits.h>
#include <vector>
using namespace std;
class MissingNumber {
public:
static i... | ALGO | 0.999887 | 5.138565 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2016-10-22T20:28:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d01da426... |
f4f22f5b-67f0-44d7-8f3d-744b4fc53f8c | Vivekrathore2002/DSA-Coding | Kadane's Algorithm - GFG/kadanes-algorithm.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// arr: input array
// n: size of array
//Function to find the sum of contiguous subarray with maximum sum.
long long maxSubarraySum(int arr[], int n) {
long long currentMax = arr[0... | ALGO | 0.999649 | 5.848166 | {
"github_metadata": {
"branch": "main",
"commit_count": 1805,
"repo_created_at": "2023-03-22T13:58:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0dc6a06c9... |
188978c1-3ed6-44ac-a493-012d1833b64e | DKrakhmalyovPrev/2 | segs.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
using namespace std;
class Point
{
friend class Segment;
friend class ALotOfSegm;
private:
double x,y;
public:
Point(){};
Point(double j,double k): x(j), y(k){};
void ScanPoint()
{
cin>>x>>y;
}
... | ALGO | 0.999294 | 3.834635 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2015-04-12T16:39:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1acbf8ab1... |
54781c67-8846-45ee-8109-b7d38ed2ef09 | ltf0501/NoName | Contest/NEERC/2009-2010 Southern/pK.cpp | #include <bits/stdc++.h>
using namespace std;
string str[1001];
void dfs(int l, int r, int d) {
int prev = l;
for (int i = l + 1; i <= r; i++) {
if (str[i][d] != str[prev][d] || (str[prev][d] != '#' && str[prev][d] != '*')) {
if (d) cout << "<li>\n";
if (i - 1 == prev) {
for (int j = d; str[prev][j]; j+... | ALGO | 0.999306 | 4.073414 | {
"github_metadata": {
"branch": "master",
"commit_count": 136,
"repo_created_at": "2019-05-19T15:55:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9730a3dc... |
71cb604c-92a5-410d-91bb-722116c7f156 | kylefjl/leetcode | editor/cn/P480_SlidingWindowMedian.cpp | //中位数是有序序列最中间的那个数。如果序列的长度是偶数,则没有最中间的数;此时中位数是最中间的两个数的平均数。
//
// 例如:
//
//
// [2,3,4],中位数是 3
// [2,3],中位数是 (2 + 3) / 2 = 2.5
//
//
// 给你一个数组 nums,有一个长度为 k 的窗口从最左端滑动到最右端。窗口中有 k 个数,每次窗口向右移动 1 位。你的任务是找出每次窗口移动后得到的新窗
//口中元素的中位数,并输出由它们组成的数组。
//
//
//
// 示例:
//
// 给出 nums = [1,3,-1,-3,5,3,6,7],以及 k = 3。
//
//
//窗口位置 ... | ALGO | 0.999993 | 6.645562 | {
"github_metadata": {
"branch": "main",
"commit_count": 84,
"repo_created_at": "2022-01-30T13:12: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": "ef6d6f52865... |
b8994230-1c4c-4fb5-9276-403eeb226849 | juhik24/DSA-Sheet | 0155-min-stack/0155-min-stack.cpp | class MinStack {
public:
// Time = O(1), Space = O(N) or O(2N)
// Here we are creating a stack of pairs and pair will contain the current value and min. element till now.
vector<pair<int, int>>v;
MinStack() {
}
void push(int val) {
int size = v.size();
if... | ALGO | 0.999879 | 6.501168 | {
"github_metadata": {
"branch": "master",
"commit_count": 1459,
"repo_created_at": "2022-05-06T18:32:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "389d3bd... |
e5d9497b-739c-4044-842c-73f4cedc6f09 | WojciechIgnaczak/s3 | OOP/w2/zk2.cpp | #include <iostream>
using namespace std;
class Complex{
public:
Complex(double _re,double _im): re(_re), im(_im){};
Complex(double _re):re(_re),im(0){};
double real()const{return re;};
double imag()const{return im;};
Complex operator+(const Complex &c);
Complex operator-(const Comp... | ALGO | 0.981307 | 5.318565 | {
"github_metadata": {
"branch": "main",
"commit_count": 132,
"repo_created_at": "2024-10-01T12:08:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "697c491a8c... |
0162dda5-226e-40e4-ac1d-69586ed953fc | fishman/virtualdub | VirtualDub/h/f_base.h | // VDShader - Custom shader video filter for VirtualDub
// Copyright (C) 2007 <NAME>
//
// This program 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; either version 2 of the License, or
// (at your option)... | TOOL | 0.92706 | 5.944564 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2009-04-27T08:42:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4c7c6c3aa... |
2031e50a-891f-4c5b-9a8e-507aab960fa3 | matthelb/tsp | src/solve/parallel_concorde_solver.h | #ifndef TSP_SOLVE_PARALLEL_CONCORDE_SOLVER_
#define TSP_SOLVE_PARALLEL_CONCORDE_SOLVER_
#include <string>
#include <vector>
#include "solve/concorde_solver.h"
#define PROCESSORS_PER_NODE 8
class ParallelConcordeSolver : public ConcordeSolver {
public:
ParallelConcordeSolver();
virtual ~ParallelConcordeSolver();
... | ALGO | 0.998348 | 5.601767 | {
"github_metadata": {
"branch": "master",
"commit_count": 113,
"repo_created_at": "2014-08-08T23:20:11.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 10,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "5708bb... |
75807329-895a-4f61-a70e-5dc98894f69c | Sanjay091/CSES_SOLUTION | KFSTB - Help the Commander in Chief.cpp | #include<bits/stdc++.h>
using namespace std;
#define fori(x,y) for(ll i=x;i<y;i++)
#define forj(x,y) for(ll j=x;j<y;j++)
#define rfori(a,b) for(int i=a;i>=b;i--)
#define for_it(a) for(auto it: a)
#define pb push_back
#define pf push_front
#define ff first
#define ss second
... | ALGO | 0.999984 | 4.277667 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-09-18T09:22: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": "5bb50aa421... |
cf2ca228-9eb7-48bc-82c9-3f6d2ee6aa03 | isha-sarode/technohack | temperatureconverter.cpp | #include <iostream>
using namespace std ;
float c_to_ff(float temperature) {
return (temperature * 9.0) / 5.0 + 32;
}
float f_to_c(float temperature) {
return (temperature - 32) * 5 / 9;
}
int main()
{
int choice;
float temperature;
float converted_temperature;
cout<<"How you gonna to cover... | TOOL | 0.942976 | 4.172726 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-08-29T08:06: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": "212675ac874b... |
5eec5a78-93fd-4227-88f2-ed45306f5ad4 | tensorflow/runtime | include/tfrt/host_context/parallel_for.h | /*
* Copyright 2020 The TensorFlow Runtime Authors
*
* 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 applicab... | ALGO | 0.999677 | 7.865915 | {
"github_metadata": {
"branch": "master",
"commit_count": 4153,
"repo_created_at": "2020-04-24T19:25:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 758,
"forks": 122,
"issues": 40,
"pull_requests": 4
},
"file_meta": {
"content_id": "067... |
955a7c9c-e42b-4d24-95fa-5f49b2e2b51e | EasonTong/DataStruct | 树/二叉树基本操作提交/二叉树基本操作提交.cpp | #include <iostream>
using namespace std;
template <class T>
struct BiNode
{
T data;
BiNode<T> *lchild;
BiNode<T> *rchild;
bool ltag;
bool rtag;
};
template <class T>
struct Node
{
T Data;
Node *next;
};
template <class T>
class LinkQueue
{
public:
LinkQueue();
virtual ~LinkQueue();
void EnQueue(T x);
Nod... | ALGO | 0.999924 | 3.824848 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2017-10-03T06:37: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": "0a4bb5f7f... |
1b2d0798-b683-4185-bad2-f03785d87b8d | zuevval/source | cpp/aux_discrete/2graphs/6maxDepth.cpp | #include<cstdio>
#include<climits>
#include<iostream>
#include<vector>
#include<cctype>
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
TreeNode() : val(INT_MIN), left(NULL), right(NULL) {}
};
void print1(TreeNode * t, int depth, int ifLeftSon) {
... | ALGO | 0.999837 | 3.868637 | {
"github_metadata": {
"branch": "master",
"commit_count": 569,
"repo_created_at": "2019-02-10T15:36:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a67aacd... |
08f1bf24-96ca-47e3-a995-28e483063846 | arangodb/arangodb | 3rdParty/boost/1.78.0/boost/hana/detail/has_duplicates.hpp | /*!
@file
Defines `boost::hana::detail::has_duplicates`.
@copyright <NAME> 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_DETAIL_HAS_DUPLICATES_HPP
#define BOOST_HANA_DETAIL_HAS_DUPLICATES_HPP
... | ALGO | 0.920578 | 6.901874 | {
"github_metadata": {
"branch": "devel",
"commit_count": 51986,
"repo_created_at": "2011-10-26T06:42:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 13878,
"forks": 857,
"issues": 743,
"pull_requests": 38
},
"file_meta": {
"content_id": ... |
aab6a885-573e-439b-8a9a-a0d87abd669c | seahorn/crab | include/crab/domains/combined_congruences.hpp | #pragma once
/**
* Reduced product of a numerical domain and the congruence domain.
**/
#include <crab/domains/abstract_domain.hpp>
#include <crab/domains/abstract_domain_specialized_traits.hpp>
#include <crab/domains/combined_domains.hpp>
#include <crab/domains/congruences.hpp>
#include <crab/domains/interval_cong... | TOOL | 0.940365 | 7.519031 | {
"github_metadata": {
"branch": "master",
"commit_count": 1832,
"repo_created_at": "2017-06-30T22:21:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 245,
"forks": 32,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "9508f... |
8f088937-ec51-4db1-99ca-2582502852e9 | hotaosa/AtCoder | ARC/ARC151/C/main.cc | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
int main() {
long long n;
int m;
cin >> n >> m;
vector<long long> x(m);
vector<int> y(m);
for (int i = 0; i < m; ++i) cin >> x[i] >> y[i];
if (m == 0) {
cout << (n & 1LL ? "Takahashi" : "Aoki") << endl;
return 0;
}
long ... | ALGO | 0.999991 | 4.261311 | {
"github_metadata": {
"branch": "master",
"commit_count": 523,
"repo_created_at": "2021-04-06T09:44:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e33697e1... |
e64ed0ee-292f-47b3-80c6-3c1dd240409c | jackmelcher/CollegeProgramming | Year4_2016_2017/Quarter2_Winter_2017/EECS117 - Parallel Computer Systems/hw4/mm.cc | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
#include <x86intrin.h> // Add x86 intrinsics
#include "timer.c"
#define N_ 4096
#define K_ 4096
#define M_ 4096
#define B_ 2 //added default blocksize value
typedef float dtype; //changed data type to float to accommodate SIMD
void verify(... | ALGO | 0.999398 | 4.835082 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-05-09T06:00: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": "7dafe47075... |
c2803072-a60e-49e9-aac3-6bb806d51ed1 | mmp/pbrt-v3 | src/shapes/loopsubdiv.cpp |
/*
pbrt source code is Copyright(c) 1998-2016
<NAME>, <NAME>, and <NAME>.
This file is part of pbrt.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of sou... | ALGO | 0.996695 | 4.855072 | {
"github_metadata": {
"branch": "master",
"commit_count": 737,
"repo_created_at": "2015-06-15T18:13:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5017,
"forks": 1212,
"issues": 53,
"pull_requests": 4
},
"file_meta": {
"content_id": "4... |
7dc6c735-f48d-45a7-ba46-61bf9571d42a | ishandutta2007/codeforces-s | sfiction/normal/901/D.cpp | #include <bits/stdc++.h>
#define st first
#define nd second
#define all(x) (x).begin(), (x).end()
using namespace std;
using namespace placeholders;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template <class T> void mini(T &l, T r){l = min(l, r);}
tem... | ALGO | 0.999953 | 3.798246 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "64b4610e8468... |
1dc37ed1-e141-4298-b7e8-cb572737ca62 | HIM7707/DSA_101 | DP_sandeepSir/Lcs(2)tabulation.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
const int mod=1e9+7;
using namespace std;
// } Driver Code Ends
// function to find longest common subsequence
class Solution
{
public:
//Function to find the length of longest common subsequence in two strings.
//vector<vector<int>> dp (n,vector<int>(m,-1));... | ALGO | 0.999992 | 5.940805 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2022-04-21T17:21: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": "204ae1b2d... |
a46d4996-5ef3-419d-989e-a844f2b314fb | andresdanielmtz/TC2038P | hw/act1.3/A00227463_Act1.3/methods/a_star.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <cmath>
#include <algorithm>
using namespace std;
typedef pair<int, int> Point;
struct PointHash {
size_t operator()(const Point& p) const {
return hash<int>()(p.first) ^ hash<int>()(p.second);
}
};
vector<Point... | ALGO | 0.999798 | 5.463927 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2024-08-06T03:30:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea55a07108d... |
c7c21025-675a-4b42-b84e-1ca29282e49c | FuyukiVila/FOR-ICPC | codeforces/contest1825/C.cpp | #define GKD std::cin.tie(nullptr)->std::ios::sync_with_stdio(false);
#define clr(a, b) memset(a, b, sizeof(a))
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const double pi = acos(-1);
const int INF = 0x3f3f3f3f;
template<typename T>
inline T qpow(T a, T n) {
... | ALGO | 0.999961 | 3.969327 | {
"github_metadata": {
"branch": "main",
"commit_count": 212,
"repo_created_at": "2023-04-18T14:06:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "34119a32ba... |
f72a8a37-4e19-4d6f-a893-87768d7fa89a | franv314/competitive | IOI/2008_printer/printer.cpp | #include <bits/stdc++.h>
using namespace std;
class Trie {
struct Node {
bool is_word;
int depth;
Node *children[26];
Node() : is_word(false), depth(0) {
fill(children, children + 26, (Node*)NULL);
}
} *root;
vector<char> op;
void insert(const char ... | ALGO | 0.999947 | 3.975874 | {
"github_metadata": {
"branch": "soluzioni",
"commit_count": 263,
"repo_created_at": "2023-06-30T15:30:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79a02... |
5efacbf4-28b3-4dd5-afb8-7593ece36986 | TheRakibJoy/Algorithms | Graph Theory/Dijkstra/CF - 59E - Shortest Path with dijkstra.cpp | #include<bits/stdc++.h>
#define Input freopen("in.txt","r",stdin)
#define Output freopen("out.txt","w",stdout)
#define ll long long int
#define ull unsigned long long int
#define pii pair<int,int>
#define pll ... | ALGO | 0.999983 | 3.949329 | {
"github_metadata": {
"branch": "master",
"commit_count": 880,
"repo_created_at": "2021-12-21T07:08:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c96f454... |
0a5be1ff-ca12-42ab-8b3d-f93d8f8f750e | phantomwolf/leetcode-problems | Algorithm/Array/LongestSubarrayWithContinuousElements/naive.cpp | #include <iostream>
#include <vector>
using namespace std;
int longest_subarray_continuous (const vector<int> &nums, vector<int> &subarr)
{
// subarray start position
int size = nums.size();
int longest = 1;
int m = 0, n = 0;
for (int i = 0; i < size - 1; ++i) {
int min = nums[i], max = n... | ALGO | 0.999585 | 5.107235 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2015-10-27T13:53:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b38978f... |
39285b4e-e955-4279-83e8-1286121c8e33 | Biplob68/Programming | GeeksforGeeks/Anagram of String.cpp | /*
Given two strings S1 and S2 in lowercase, the task is to make them anagram.
The only allowed operation is to remove a character from any string.
Find the minimum number of characters to be deleted to make both the strings anagram.
Input: S1 = bcadeh
S2 = hea
Output: 3
Explanation: We need to remove b, c and... | ALGO | 0.999893 | 5.137172 | {
"github_metadata": {
"branch": "main",
"commit_count": 549,
"repo_created_at": "2021-03-11T05:21: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": "dfa8ff80a1... |
3a272193-5a0f-4044-9b1c-95bd57bcd630 | BOBIERJOHNELMER/IT-104A---Data-Structure-and-Algorithms | Activity: Design Your Heap Challenge/Heaps Basic Code/Galactic Cargo Management text.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// Function to display the heap as a vector
void displayHeap(const vector<int>& heap) {
cout << "[ ";
for (int val : heap) cout << val << " ";
cout << "]\n";
}
// Function to heapify up
void heapifyUp(vector<int>& heap, int in... | ALGO | 0.999602 | 7.259125 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2024-11-23T19:03:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "37c779a3523... |
f377dc7c-78c3-4f36-beb6-da89ff2d2508 | GRMaverick/University | Year3/FYP/FYP_Mathematics/MathematicsLib/Intersections.cpp | #include "stdafx.h"
#include <math.h>
#include "Intersections.h"
namespace Mathematics
{
using namespace Structures;
namespace Intersections
{
//
// Finds scalar projection of vector u in the direction of v
//
float ScalarProjection(const Vector3& u, const Vector3& v)
{
if (v.IsNormalised())
{
... | ALGO | 0.987327 | 4.810623 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-03-31T19:35:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0359d5f10... |
2c19df3b-deb5-45c7-8f26-c39954cc00be | Exr0nProjects/learn_cpp | problems/contests/standard-xjoi/1259/1.cpp | /*
clumsy dancers
after-contest solution
if a, c are male and b, d are female, and a>c && b>d, then ac, bd is better than ad, bc
*/
#include <bits/stdc++.h>
#define cn const int
using namespace std;
cn MAXSZ = 1010;
int male[MAXSZ];
int female[MAXSZ];
int n;
int main()
{
scanf("%d", &n);
for (int i = 0; i <... | ALGO | 0.999928 | 3.736176 | {
"github_metadata": {
"branch": "master",
"commit_count": 2744,
"repo_created_at": "2019-04-07T20:47:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a947a6c0... |
84065ed9-51bf-48f5-99ee-0c7cd97ce424 | Fmancino/ODEsolver | ODEsolver/include/ODEsolver.hpp | /*
* ODESolver.hpp
* Created on: Dic, 2015
* Author: <NAME>
*Description: This header groups toghether all the needed header files to use this ODE library,
* it's the only header the user needs to include to access all the functionalities.
* Underneath there is also a description of th... | ALGO | 0.931843 | 4.786117 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2017-07-28T17:15: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": "261442607... |
b2e26602-05a2-4cbb-954d-044c69ef9239 | alexandraback/datacollection | solutions_5639104758808576_0/C++/sdcr/A.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <stack>
#include <queue>
#include <set>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstdlib>
using namespace std;
typedef pair<int,int> pii;
typedef ... | ALGO | 0.999787 | 3.651126 | {
"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": "2fae10dfc... |
7fbf74c7-e7af-4e82-8db4-fbc43d27e094 | byam/algorithms | vc/13/c.cpp | #include <bits/stdc++.h>
//#include <atcoder/all>
// using namespace atcoder;
using namespace std;
// debug
#define printv(v) \
for (auto x : v) { \
cerr << x << " "; \
} \
cerr << endl;
#define print2d(v, n, m) \
for (int i = 0; i < (n); i++) { ... | ALGO | 0.999897 | 4.059977 | {
"github_metadata": {
"branch": "master",
"commit_count": 309,
"repo_created_at": "2016-09-21T15:27:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9b92c1dd... |
418af4b5-b916-4427-a569-4f42ec85d8c6 | JanuszBedkowski/observation_equations | codes/c++Examples/src/simple_optimization_problem_func_xy_with_constraints.cpp | #include <GL/freeglut.h>
#include <vector>
#include <Eigen/Eigen>
#include <iostream>
#include <iomanip>
#include "example_func_xy_jacobian.h"
#include "constraints_jacobian.h"
#include <transformations.h>
#define RENDER_PSI 0
#define RENDER_OBJECTIVE_FUNC 1
#define RENDER_OBJECTIVE_FUNC_WITH_CONTRAINT 2
int render_... | ALGO | 0.976884 | 5.139549 | {
"github_metadata": {
"branch": "main",
"commit_count": 207,
"repo_created_at": "2021-04-19T14:13:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 29,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25c886c9... |
9c4b7bc9-0e79-4fb1-81c5-14e313b7c820 | Val-de-mar/pascal | Expression/main.cpp | #include <iostream>
#include <Expression.h>
using Ex = Expression;
using ff = std::vector<std::unique_ptr<Expression>>;
int main() {
using std::unique_ptr;
VariableManager manager;
auto A = new ValueExpression(getId<int>, std::make_shared<VariableT>(9));
auto B = new ValueExpression(getId<int>, std::... | TOOL | 0.969577 | 5.752471 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2021-12-12T22:38: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": "e9f15a3ec... |
f184a864-71e1-4d98-b702-fd7ced9f81a5 | HCPS42/TRD | code/number_theory/CRT.h | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// https://codeforces.com/gym/102155/problem/F
template <class T>
T mod_inv(T r, T a) {
T g = a, z = 0, y = 1;
while (r != 0) {
T q = g / r; g %= r;
swap(g, r); z -= q * y; swap(z, y);
}
return z < 0 ? z + a : z;
}
te... | ALGO | 0.999926 | 4.342329 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2024-08-14T16:18: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": "1d61785dd... |
55a64fcb-1bc6-4248-ab53-8035c7a6de98 | Mura-Tomo/ProgrammingContest | abc269/abc269_B.cpp | #include <bits/stdc++.h>
using namespace std;
int main (void) {
vector<string> S(10);
for (int i=0; i<10; i++) {
cin >> S[i];
}
int A = 0, B = 0, C = 0, D = 0;
int count = 0;
for (int i=0; i<10; i++) {
for (int j=0; j<10; j++) {
if (S[i][j] == '#' && count == 0) {
... | ALGO | 0.999722 | 3.177592 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-22T09:32: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": "564a3ead6905... |
73a9d3cd-850c-44c8-81ed-54035b18bd87 | Leeterate/3DViewer_v2.0 | src/model/parser.cc | #include "parser.h"
namespace proj {
void Parser::Clean() {
matrix_points.clear();
polygons.clear();
vert_cnt = 0;
pol_cnt = 0;
min_max.x_min = 0;
min_max.x_max = 0;
min_max.y_min = 0;
min_max.y_max = 0;
min_max.z_min = 0;
min_max.z_max = 0;
}
void Parser::OpenFile(const std::string& filename) ... | TOOL | 0.9168 | 4.839588 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-22T21:09: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": "cfd31387bd80... |
5f373fcd-2d8f-455f-9108-6ef2d0325cbb | tobusoo/algo | 7-contest/e.cpp | #include <iostream>
#include <map>
int main()
{
std::string a, b;
std::cin >> a >> b;
int a_len = a.length();
int b_len = b.length();
std::map<std::pair<int, int>, int> m;
for (int i = -1; i < a_len + 1; i++) {
m[{i, -1}] = i + 1;
}
for (int i = -1; i < b_len + 1; i++) {
... | ALGO | 0.999976 | 4.388086 | {
"github_metadata": {
"branch": "master",
"commit_count": 76,
"repo_created_at": "2024-02-21T12:41:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d014e675f... |
dc33910a-fdb0-4871-9d75-386d735eab7f | lshtar13/PS | boj.2580.cc | #include <bits/stdc++.h>
using namespace std;
u_int8_t board[9][9];
void sudoku(int x, int y)
{
if (x == 9 && y == 9)
{
for (int i = 0; i < 9; ++i)
{
for (int l = 0; l < 9; ++l)
printf("%d ", board[i][l]);
printf("\n");
}
exit(0);
}
... | ALGO | 0.999821 | 4.374891 | {
"github_metadata": {
"branch": "main",
"commit_count": 330,
"repo_created_at": "2023-12-19T12:47:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "641a9b16cd... |
57eb0311-90d2-41db-8d34-a6f8e8d7d41e | PiCiU1221/University | Semestr 1/Programowanie C++/Lista--16-01-2023.cpp | #include <iostream>
#include <algorithm>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <vector>
using namespace std;
/*
Ogólne założenia:
- Brak wycieków pamięci.
- Przejrzysty kod - podział na funkcje, struktury, wcięcia, minimalizacja
redundancji kodu.
- Brak zmiennych globalnych.
-------------... | TOOL | 0.920236 | 3.578238 | {
"github_metadata": {
"branch": "main",
"commit_count": 102,
"repo_created_at": "2022-11-15T15:57:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ba0535511... |
98f47e2d-fd1a-4eba-ad3e-ccf438c8e67c | Acovea/libevocosm | examples/function_optimization/fopt.cpp | /*
Evocosm is a C++ framework for implementing evolutionary algorithms.
Copyright 2011 <NAME>. All rights reserved.
Evocosm is user-supported open source software. Its continued development is dependent
on financial support from the community. You can provide funding by visiting the Evocosm
websit... | ALGO | 0.991239 | 5.667633 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-09-26T02:56:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f06253db642... |
c057346f-9d4b-4efd-ab6f-3cfb30a32f28 | Leooo918/MyBaekjoon | 백준/Gold/2357. 최솟값과 최댓값/최솟값과 최댓값.cc | #include <iostream>
#include <algorithm>
#include <stack>
#include <string.h>
using namespace std;
int n, m;
long long a, b;
long long arr[100001];
long long minTree[400001];
long long maxTree[400001];
void build(int start, int end, int node)
{
if (start == end)
{
minTree[node] = arr[start];
maxTree[node] = a... | ALGO | 0.99999 | 4.629066 | {
"github_metadata": {
"branch": "main",
"commit_count": 213,
"repo_created_at": "2023-05-21T14:55: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": "1ba380f73b... |
04f8651d-bc5f-4f29-8238-d3055d66a21d | ShubhamPhapale/competitive-programming | templates/Advanced/hld.cpp | // ----- Heavy-Light Decomposition (HLD) Skeleton -----
// (Assumes a tree with 0-indexed nodes; further functions such as query/update are built atop a segment tree.)
struct HLD {
int n;
vector<vector<int>> adj;
vector<int> parent, depth, heavy, head, pos;
int curPos;
HLD(int n): n(n), adj(n),... | ALGO | 0.999466 | 4.38258 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2023-07-06T15:04:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1a2c3556067c... |
4089225a-5f6e-441f-8466-d5842189724e | KainingYing/introduction-to-algorithm | code/第十五章 动态规划/第十五章 动态规划/LCScpp.cpp | #include <iostream>
using namespace std;
int LCS_crude(int a, int b,int *x,int *y)
{
//a与b为数组的长度,0表示数组为长度0,表示第一个元素,其实还是有元素的
//4表示数组长度为4,但是表示第五个元素。
if(a == -1 || b == -1)//为了兼容,用-1表示数组长度为0
return 0;
else if (x[a] == y[b])
{
return LCS_crude(a - 1, b - 1, x, y)+1;
}
else
{
int c = LCS_crude(a, b - 1, x, y);... | ALGO | 0.999979 | 3.471904 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2019-07-21T08:30:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c926e26e9... |
0f524a17-9e70-46ae-ae96-675ffe7fbc26 | Min364/Algorithm | 종만북/06~12-알고리즘 설계 패러다임/12장-최적화 문제 결정 문제로 바꿔 풀기/캐나다 여행(CANADATRIP).cpp | #include<iostream>
#include<algorithm>
using namespace std;
int n, k;
struct dd {
int a, b, c;
};
dd arr[5010];
bool decision(int x) {
int ret = 0;
for (int i = 1; i <= n; i++) {
if (x >= arr[i].a) {
ret += (min(x, arr[i].b) - arr[i].a) / arr[i].c + 1;
}
}
return ret >= k;
}
int solve() {
int l = -1, r = ... | ALGO | 0.999978 | 4.582864 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2022-09-15T16:55: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": "917db6ceae3e... |
3d68833f-eff7-4ebc-989b-9628a0553a7a | szellmann/visionaray | src/common/inifile.cpp | // This file is distributed under the MIT license.
// See the LICENSE file for details.
#include <algorithm>
#include <cctype>
#include <cstddef>
#include <sstream>
#include <vector>
#include "inifile.h"
namespace visionaray
{
//---------------------------------------------------------------------------------------... | TOOL | 0.944171 | 6.742635 | {
"github_metadata": {
"branch": "master",
"commit_count": 4445,
"repo_created_at": "2015-01-27T21:24:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 438,
"forks": 37,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "d37e... |
1831b3e5-3dcc-4490-8ee9-b00b0df6ea2b | sandip-menariya/cpp | graph.cpp | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
struct edge
{
int source;
int destination;
int weight;
edge(int s, int d, int w) : source(s), destination(d), weight(w) {};
};
unordered_map<int, vector<edge *>> create()
{
unordered_map<int, vector<edge *>> graph;... | ALGO | 0.999947 | 5.407727 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-01-12T17:33: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": "d0f6b840b268... |
dfc73d95-70a9-430e-8841-d5f9a37f4fae | cheerayhuang/leetcode | nth-digits/nth-digits.cc | /**************************************************************************
*
* Copyright (c) 2015 <NAME>. All Rights Reserved
*
* @file: nth-digits.cc
* @author: <NAME>
* @email: <EMAIL>
* @date: 05-17-2017 11:06:27
* @version $Revision$
*
*********************************************************************... | ALGO | 0.999255 | 5.250828 | {
"github_metadata": {
"branch": "master",
"commit_count": 146,
"repo_created_at": "2014-10-25T15:02: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": "352a374b... |
b68c8091-ce07-4316-a23d-25abfe8e20e7 | hpc-maths/samurai | demos/LBM/boundary_conditions.hpp | // Copyright 2018-2025 the samurai's authors
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
#include <xtensor/xfixed.hpp>
#include <samurai/operators_base.hpp>
#include <samurai/subset/node.hpp>
template <std::size_t dim, class TInterval>
class update_boundary_D2Q4_flat_op : public samurai::field_operator_b... | ALGO | 0.98193 | 7.001962 | {
"github_metadata": {
"branch": "master",
"commit_count": 839,
"repo_created_at": "2020-11-26T13:10:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 46,
"forks": 17,
"issues": 19,
"pull_requests": 22
},
"file_meta": {
"content_id": "75a78... |
cff9049b-2c42-497f-9971-435af4a107b5 | wdzeng/cp-solutions | kattis/a4p8nf/i.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define ms(v) memset(v, 0, sizeof(v))
#define mss(v) memset(v, -1, sizeof(v))
#define len(v) int(v.size())
#ifdef hy
#define fastio()
#define debug(a) cerr <... | ALGO | 0.99984 | 3.777803 | {
"github_metadata": {
"branch": "master",
"commit_count": 170,
"repo_created_at": "2019-03-26T03:15:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "02719f42... |
5d13df21-0019-4faf-b7b7-bebd2d6307dd | SXZZ5/ParserT | e.cpp | //go: build ignore
// +build ignore
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#ifndef ONLINE_JUDGE
#include "cptemp.h"
#define println(x) cout << x << endl
#define print(x) cout << x
#define ln endl
#else
#include <bits/stdc++.h>
#define print(x)
#define println(x)
#define d... | ALGO | 0.999132 | 4.707926 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2024-03-23T19:21: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": "9b91add03a... |
b38a2120-5879-447d-a05f-52ed90998f56 | wym6912/ACM-ICPC_wym6912 | XDU/1283.cpp | //#define NOSTDCPP
//#define Cpp11
//#define Linux_System
#ifndef NOSTDCPP
#include <bits/stdc++.h>
#else
#include <algorithm>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstring>
#include <cstdio>
#include <deque>
#include <exception>
#include <functional>
#include <iomanip>
#include <iostream... | ALGO | 0.999971 | 3.160596 | {
"github_metadata": {
"branch": "master",
"commit_count": 363,
"repo_created_at": "2017-08-09T05:04:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "06614f8c... |
57b18ce4-0a70-4cbd-863c-68045b9cb3e4 | npinto/opencv | modules/core/include/opencv2/core/operations.hpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | TOOL | 0.90836 | 5.827475 | {
"github_metadata": {
"branch": "master",
"commit_count": 5256,
"repo_created_at": "2012-09-09T01:58:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 60,
"forks": 107,
"issues": 1,
"pull_requests": 2
},
"file_meta": {
"content_id": "99d0... |
eb12e1b1-d344-441a-b250-b68e61f9d39d | simonengstrm/aoc23 | d2/main.cxx | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
using namespace std;
std::string trimStart(const std::string& s) {
auto start = s.begin();
while (start != s.end() && std::isspace(*start)) {
++start;
}
return std::string(start, s.end());
}
// Function ... | ALGO | 0.989227 | 5.972497 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-12-01T19:17: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": "f7ef6c680e71... |
a2940c95-b288-4f11-8e63-b51a9580d9f7 | marlinism/Gale-Shapley-Algorithm | Gale_Shapley.cpp | //---------------------------------------------------------------------------
// GALE_SHAPLEY.CPP
// Member function definition for class Gale_Shapley
// Authors: <NAME>
//---------------------------------------------------------------------------
// Name class: a class that contains all the list of the human and the... | ALGO | 0.993302 | 3.800784 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-04-04T06:18: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": "6271f81b003d... |
0129a72c-be87-4b72-bed5-7c88372d15d1 | KhoiHuynh2212/OSprojects | CS3113_Project1.cpp | #include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
struct Instruction {
int type{}; // Instruction type : 1 (Compute), 2 (Print), 3 (Store), 4 (Load)
vector<int> parameters; // parameters for the instruction
};
struct PCB {
// Process identificat... | ALGO | 0.997546 | 5.269473 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2025-01-19T21:50: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": "fdfcec188... |
f3e86a86-cf41-4501-b327-1c76225475df | Yu0727Harada/pro_con | tenkei90/063.cpp | //
// Created by 原田 on 2022/05/10.
//
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cs... | ALGO | 0.999981 | 4.759594 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2020-08-09T08:23: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": "c80bb3a9... |
bf751fd0-6216-41cc-81e4-710fa5cf5896 | amerinoo/OpenGL-Pang_game | particleContact.cpp | /*
* Project name: Pang Game
* Version 1
* Student : <NAME>
*/
#include "particleContact.h"
ParticleContact::ParticleContact(Particle * particle1, Particle * particle2, Vector3 contactNormal,
double interpenetration) : particle1(particle1), particle2(particle2), contactNormal(contactNormal),
interpenetration... | ALGO | 0.96999 | 5.674518 | {
"github_metadata": {
"branch": "master",
"commit_count": 51,
"repo_created_at": "2017-02-07T17:26: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": "25c179a9b... |
d63085c3-8377-4704-a3d5-1402e3e7509e | KentoNishi/USACO-Solutions | 2018-2019/mootube/graph.cpp | #include <chrono>
#include <array>
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <fstream>
#include <iostream>
#include <unordered_map>
using namespace std;
vector<string> split(string str, string character){
vector<string> result;
long long s=0;
lon... | ALGO | 0.999968 | 4.204245 | {
"github_metadata": {
"branch": "master",
"commit_count": 311,
"repo_created_at": "2019-01-11T00:45:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6a41ec6f... |
7e876db1-fc61-42f1-b75a-25732483297b | ahmedfahad04/IIT-LAB | 3rd Semester Labs/CSE301_ CO Course/DP 2/LIS_Time_Efficient_DP.cpp | /*
### LIS using Time Efficient DP ###
input format:
size of array
array elements....
output format:
Length of LIS:
LIS:
*/
#include <bits/stdc++.h>
#define N 1000
#define mINF -100005
using namespace std;
int L[N], L2[N], pre[N], a[N];
int LIS_FAST_DP(int n){
L[0] = mINF;
L2[0] = 0;
pre[0] = -1;
... | ALGO | 0.999993 | 4.251648 | {
"github_metadata": {
"branch": "main",
"commit_count": 216,
"repo_created_at": "2022-01-08T05:39:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "65ab6ff5c4... |
e7e670f4-7e11-43b2-b724-c8198a2920ae | stenlik26/Coding-problems | LeetCode/225. Implement Stack using Queues/solution.cpp | #include <iostream>
#include <queue>
using namespace std;
void print_queue(queue<int> q)
{
while (!q.empty())
{
cout << q.front() << " ";
q.pop();
}
cout << endl;
}
class MyStack {
private:
queue<int> q1;
queue<int> q2;
bool q1_active;
public:
MyStack() {
q1_a... | ALGO | 0.998476 | 4.931997 | {
"github_metadata": {
"branch": "main",
"commit_count": 107,
"repo_created_at": "2021-12-30T20:57: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": "56fb8a6ad8... |
32998dec-0acf-4267-8e39-022ed510dd31 | klemense1/lexmamcts | mvmcts/mvmcts.h | // Copyright (c) 2019 <NAME>
//
// Extended by: <NAME>, <NAME>
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.
// ========================================================
#ifndef MVMCTS_MVMCTS_H_
#define MVMCTS_MVMCTS_H_
#define PLAN_DEBUG_INFO... | ALGO | 0.992956 | 7.233768 | {
"github_metadata": {
"branch": "master",
"commit_count": 331,
"repo_created_at": "2020-10-03T14:01:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "205188c6... |
362e5640-42e8-45b9-b8d7-1f60b60ee373 | marcokvendramin/Simulador_Colisoes | main.cpp | #define SDL_MAIN_HANDLED
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include <iostream>
#include <vector>
#include <cmath>
#include <random>
#include <chrono>
#include <string>
#include <sstream>
#include <iomanip>
// Estrutura de vetor 3D com operações básicas de álgebra vetorial
struct Vec3 {
float x, y, z;... | ALGO | 0.999634 | 6.088053 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-07-05T02:59: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": "9c61a3a6660... |
fe26ebb7-b880-4fe8-8d43-8edc47b6fc9a | rushioda/PIXELVALID_athena | athena/Trigger/TrigTools/TrigVertexFitter/src/TrigL2VertexFitter.cxx | /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
////////////////////////////////////////////////////////////////////////////////
// TrigL2VertexFitter tool
// -------------------------------
// ATLAS Collaboration
//
// 04.07.2006 Package created
//
// a new version of LVL2 vertex fitte... | ALGO | 0.985394 | 5.791164 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-01-19T03:53:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "67608bd570... |
6a66111a-78d2-4502-adff-491b90745720 | scrottty/CarND-Path-Planning-Project | src/helperFunctions.h | #ifndef __HELPERFUNCTIONS_H__
#define __HELPERFUNCTIONS_H__
#include <vector>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include "providedFunctions.h"
#include "constants.h"
#include "spline.h"
#include "costFunctions.h"
#include "Vehicle.h"
#include "Ego.h"
using namespace std;
bo... | ALGO | 0.999417 | 4.966839 | {
"github_metadata": {
"branch": "master",
"commit_count": 13,
"repo_created_at": "2017-10-31T07:48: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": "fd67390ec... |
32cb2f53-409f-4088-a9bc-532db9dd0b5e | k1101jh/CodingTest | baekjoon/11660.cpp | #include <iostream>
using namespace std;
int N, M;
int board[1025][1025];
int dp[1025][1025];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int x1, y1, x2, y2;
cin >> N >> M;
for(int i=1; i <= N; i++) {
for(int j=1; j <= N; j++) {
cin >> b... | ALGO | 0.999907 | 4.853919 | {
"github_metadata": {
"branch": "main",
"commit_count": 115,
"repo_created_at": "2021-10-05T08:27: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": "66a38cf582... |
3ed37ebf-1739-406d-ae2f-75f1ca80b1cd | nic-cs151-master/sp21-lecture | 09-trees/BinarySearchTree102/bst.cpp | /**@file bst.cpp
* @author CS151 North Idaho College
* @date 2020/10/12
*/
#include "bst.h"
BinarySearchTree::BinarySearchTree()
{
// initializing
mRoot = nullptr; // empty tree
}
BinarySearchTree::~BinarySearchTree()
{
}
void BinarySearchTree::insert(int newData)
{
// case 1: tree empty
if ... | ALGO | 0.996386 | 3.796522 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2021-01-11T17:05:32.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "846bbda116b8... |
e191566a-a03a-44f9-b250-6e1b2abb9a18 | tec-csf/TC2017-T2-Otono-2019-danielroa98 | Primer Parcial/BucketSort.cpp | /*
*
* <NAME>
* A01021960
* Fecha de entrega 06/09/2019
*
*/
#include <bits/stdc++.h>
#include <chrono>
#include <stdio.h>
#include <ctime>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
using namespace std::chrono;
static void BucketSort(int* data, int count) {
int minValue = d... | ALGO | 0.996595 | 4.916948 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-09-03T12:15:23.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef80b48d9ae... |
d0efa3b9-203a-4b65-88d4-17813aa7d928 | luster1031/Algorithm_Study | Backjoon/13305_주유소/첫번째 시도_실패.cpp | #include<iostream>
#include<vector>
using namespace std;
int main() {
long long testcase;
long long min = 100001;
long long min_col = 0;
vector<long long> cost;
vector<long long> Village;
cin >> testcase;
for (int i = 0,num; i < testcase-1; i++) {
cin >> num;
cost.push_back(num);
}
for (int i = 0,num; i <... | ALGO | 0.999966 | 3.32821 | {
"github_metadata": {
"branch": "main",
"commit_count": 373,
"repo_created_at": "2021-12-08T16:10:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8c1409a582... |
646c2ce7-06e3-44a7-9fef-680d463d60c2 | RathoreSPaarth/cpp | sorting/quickSort.cpp | #include<bits/stdc++.h>
using namespace std;
void swap(int arr[], int i, int j){
if(i == j) return;
int temp = arr[j];
arr[j] = arr[i];
arr[i] = temp;
}
int getPivot(int arr[], int left, int right){
int pivot = arr[right];
int i = left - 1;
for(int j = left; j<right; j++){
if(ar... | ALGO | 0.999984 | 5.117267 | {
"github_metadata": {
"branch": "master",
"commit_count": 19,
"repo_created_at": "2020-06-19T21:33: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": "96683fbf8... |
c248b4af-4583-4c45-9684-8189dd2efc70 | dedprod/LAB1-SUVOROV--Artyushin- | dz7.cpp | #include <iostream>
#include <cmath>
double a = 0;
double b = 0;
double c = 0;
double D = 0;
double x1 = 0;
double x2 = 0;
void uravn(){
D = pow(b,2) - 4*a*c;
if (D >= 0) {
x1 = ((-b + sqrt(D))/2*a);
x2 = ((-b - sqrt(D))/2*a);
if ((a != 0) & (b != 0)) {
if (D == 0... | ALGO | 0.998654 | 3.681606 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2022-11-09T14:53: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": "bc2dfdacae3... |
e731f271-9284-4973-b896-fe8fa64b8ec4 | osman-goni-cse/Competitive-Programming | Algorithms/Number-Theory/EulerTotient.cpp | #include <bits/stdc++.h>
using namespace std;
// Euler Totient function count the number of
// integers which is co-prime to n(given number)
// O(sqrt(n)) complexity per n
int solve(int n)
{
int ans = n;
for(int i=2; i*i <= n; i++){
if(n%i == 0) {
while(n%i == 0) n/=i;
ans = ans-ans/i;
}
}
if(n > 1) ... | ALGO | 0.999838 | 3.912491 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2020-08-27T16:51:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3615f8ad5... |
13120cbc-0ad1-450e-a0c7-f81c32bb0853 | alinasagaydak/Proga_C_2023 | matrix_3x3_3.0.cpp | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
typedef struct
{
float data[3][3];
int xSize;
int ySize;
} Matrix;
void printMatrix(Matrix* M, const char* nameOperation)
{
printf("%s\n", nameOperation);
for (int row_num = 0; row_num < M->ySize; row_num++)
{
for (int col_num = 0; col_num < M->xSize; c... | ALGO | 0.997645 | 3.903859 | {
"github_metadata": {
"branch": "main",
"commit_count": 66,
"repo_created_at": "2023-02-10T06:39:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 2
},
"file_meta": {
"content_id": "87efc5b6865... |
1f63c406-7204-49a5-9f54-9bdebe4293ca | Kumar-laxmi/Algorithms | C++/Image Processing/Canny Edge Detection Algorithm/cannyEdgeDetection.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <opencv2/opencv.hpp>
using namespace cv;
void toGrayScale(Mat& image);
void applyGaussianFilter(Mat& image);
void applySobelOperator(Mat& image, Mat& gradientImage);
void performNonMaxSuppression(Mat& gradientImage, Mat& suppressedImage);
void applyDoubl... | ALGO | 0.997201 | 6.083662 | {
"github_metadata": {
"branch": "main",
"commit_count": 2265,
"repo_created_at": "2022-10-23T02:05:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 338,
"forks": 364,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4475... |
c60a1e42-7eca-4e02-a1bd-47f7137402da | ManamritSingh/DSA | Data structures/Sorts/MergeSort.cpp | #include <iostream>
using namespace std;
void merge(int A[], int l, int mid, int h) {
int i = l;
int j = mid + 1;
int k = l;
int B[h + 1];
while (i <= mid && j <= h) {
if (A[i] < A[j]) {
B[k++] = A[i++];
} else {
B[k++] = A[j++];
}
}
while (... | ALGO | 0.999999 | 5.615605 | {
"github_metadata": {
"branch": "main",
"commit_count": 203,
"repo_created_at": "2023-06-16T14:15: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": "833ecd2fee... |
ca0c28ed-965e-4bf4-8b25-6a482a7a5003 | MasteringOpenCV/code | Chapter2_iPhoneAR/Example_MarkerBasedAR/opencv2.framework/Versions/A/Headers/stitching/detail/matchers.hpp | /*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... | ALGO | 0.92556 | 6.888128 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2012-12-09T02:48:52.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2756,
"forks": 1643,
"issues": 45,
"pull_requests": 4
},
"file_meta": {
"content_id": "24a... |
569c1dba-5bd0-4ada-b788-8f4f898bf3e5 | kevinwgy/m2c | MeshMatcher.cpp | /************************************************************************
* Copyright © 2020 The Multiphysics Modeling and Computation (M2C) Lab
* <<EMAIL>> <<EMAIL>>
************************************************************************/
#include<MeshMatcher.h>
#include<SpaceVariable.h>
#include<Utils.h>
#includ... | ALGO | 0.934066 | 5.359944 | {
"github_metadata": {
"branch": "main",
"commit_count": 698,
"repo_created_at": "2020-12-12T01:18:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "57e166377a... |
3e907a84-315f-4997-80c6-e042b8b06ff2 | hgstp/copstruc | src/asymp_var_tau.cpp | #include <Rcpp.h>
using namespace Rcpp;
// The function computes an estimate of the asymptotic covariance matrix
// of the copula correlation estimator based on Kendall's tau - see (4.1) in
// Klueppelber, Kuhn (2009). The entries of the asymptotic covariance matrix
// Gamma are given in (4.2)
//
//
// [[Rcpp::export... | ALGO | 0.999594 | 7.182752 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2015-07-21T10: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": "6c0e72934a... |
76eb4534-e492-4567-ab26-033e620e597d | JoHnKiking/github | 24年-10月20日--695. 岛屿的最大面积/24年-10月20日--695. 岛屿的最大面积/源.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <queue>
#include <utility>
using namespace std;
class Solution {
bool vis[51][51] = {false};
int m, n;
int kx[4] = { 0, 0, -1, 1 };
int ky[4] = { -1, 1, 0, 0 };
public:
int bfs(vector<vector<int>>& grid, int i, int j... | ALGO | 0.999947 | 5.814916 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2024-05-07T09:53: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": "bb8e25940e0... |
8fd98073-5f9e-4eac-ad40-f0c8770a09bc | alexandraback/datacollection | solutions_5738606668808192_1/C++/nonreviad/coinjam_big.cc | #include <iostream>
#include <cstdlib>
#include <vector>
uint64_t firstDivisor(uint64_t x, uint64_t base_to_16, const std::vector<uint64_t>& primes)
{
for (const auto& prime : primes)
{
if (prime >= x)
return 1;
const auto mod1 = x % prime;
const auto mod2 = base_to_16 % prime;
if (((mod1 * mod2) % prime ... | ALGO | 0.999531 | 4.707627 | {
"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": "ac6568c4b... |
d71a8174-f722-4ad8-b9bc-07bc3a4ad438 | Matbubble/Heaven-Knows-Im-Miserable-Now | cses/Graph Algorithms/RoundTrip.cpp | #include <iostream>
#include <iomanip>
#include <string>
#include <math.h>
#include <algorithm>
#include <cstring>
#include <numeric>
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
using namespace st... | ALGO | 0.999845 | 4.9726 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-10-08T01:33: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": "328bb0ff8a6... |
d98cd7f6-41eb-45c3-b447-b7a18391f0e6 | JeffersonLab/chroma | lib/util/gauge/expsu3.cc | /*# $Id: expsu3.cc,v 3.1 2006-08-25 23:46:37 edwards Exp $ ($Date: 2006-08-25 23:46:37 $) */
/*# EXPSU3: */
/*# In place a = 1 + a + (1/2)*a^2 + ...+ (1/n!)*(a)^n n = 12 */
/*# a must be a lattice_complex32_colour_colour primitive */
/*# If it does not satisfy the unitary condition, we eesu3 () to invoke */
/*... | ALGO | 0.993998 | 3.723805 | {
"github_metadata": {
"branch": "master",
"commit_count": 12973,
"repo_created_at": "2013-08-13T18:20:39.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 65,
"forks": 55,
"issues": 1,
"pull_requests": 12
},
"file_meta": {
"content_id": "939c... |
96124d2f-fdfe-4ce6-a032-b51a70a8fb0e | ou3slati/competitive-programming | Implementations/IOI 2022 Prep/Training/[prep][#3]/D.cpp | //Never stop trying
#include "bits/stdc++.h"
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
typedef string str;
typedef long double ld;
typedef pair<int, int> pi;
#define fi first
#define se second
typedef vector<int> vi;
typedef vector<pi> vpi;
#defi... | ALGO | 0.999857 | 4.111776 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2025-06-30T20:23: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": "4c9126bd2e9... |
81324f19-6b61-478b-9eb5-09f4cd870537 | 503133214/men | code/C++/teach.cpp | #include <iostream>
#include <string>
using namespace std;
const int MAX_CONTACTS = 100;
void addContact(string names[], string phones[], string emails[], int &count) {
if (count >= MAX_CONTACTS)
{
cout << "Contact list is full!\n";
return;
}
string name, phone, email;
// Input val... | TOOL | 0.953205 | 5.211881 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2022-10-31T16:23:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5ecf0024c95... |
e335778d-1850-4216-954f-1de67abd5a12 | frandibar/acm-valladolid | accepted/p486_english_number_translator/acm.cpp |
/* @JUDGE_ID: 40922FK 486 C++ */
/******************************************************************************
Solution to Problem 486 - English-Number Translator
by: <NAME>
date: May-19-2004
******************************************************************************/
#include <iostream>
#include <qu... | ALGO | 0.999579 | 4.436172 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2012-05-17T03:00:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b5c51037ae... |
467b621c-690a-4cd4-bd5e-4217111f6873 | n-inja/kyoupro | src/abc/131/E.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n, k;
cin >> n >> k;
vector<pair<int, int>> ps;
for (int i =... | ALGO | 0.999807 | 4.141107 | {
"github_metadata": {
"branch": "master",
"commit_count": 468,
"repo_created_at": "2017-07-18T01:13: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": "4bb13c2b... |
b89bfa4f-5b8a-4a76-8ec1-238e2eeb53b2 | adityaanantjadhav/DataStructure-Algorithm-sppu | Djikstra'sAlgorithm.cpp | #include <iostream>
#include <string>
using namespace std;
class dj
{
int arr[10][10];
public:
dj()
{
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
if (i == j)
{
arr[i][j] = 0;
}
... | ALGO | 0.999915 | 4.408434 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2023-10-11T16:13: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": "712044e8c00c... |
d2abd49d-6531-47ec-ae77-ed77e8935bab | Joqsan/Leetcode | 841. Keys and Rooms.cp | #include <vector>
#include <stack>
#include <iostream>
using namespace std;
/*
Asking whether we can enter all rooms starting from zero
is the same as asking whether we can reach every room
starting from zero.
Do a DFS from 0 and count all the rooms that are reachable from
it, if all the rooms reachables from... | ALGO | 0.998989 | 5.8888 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-05-13T21:34:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7b13bcecd2... |
d165f378-10d4-401d-9e25-178caae05769 | siddharth25pandey/CPP-Programming | Greedy Algorithms/Arduino_workingcode.cpp | #include <Keypad.h>
#include <Wire.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
long n1 = 0;
long n2 = 0;
double total = 0;
char key;
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
{'1','2','3','+'},
{'4','5','6','-'},
{'7','8','9','*'},
{'C','0','=','/'}
};
byte rowPins[ROW... | TOOL | 0.903971 | 3.967083 | {
"github_metadata": {
"branch": "master",
"commit_count": 1586,
"repo_created_at": "2020-09-30T19:06:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 60,
"forks": 227,
"issues": 11,
"pull_requests": 31
},
"file_meta": {
"content_id": "8b... |
da7ff775-d1a6-4694-93a7-5e8618248d00 | eshaanized/SeaFox | layout/painting/nsCSSRenderingBorders.cpp | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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://mozilla.org/MPL/2.0... | TOOL | 0.962817 | 7.315755 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2024-06-03T17:41: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": "06a8cba0f... |
0a3f6d53-88a0-40b4-94a0-bd8bbdf292ee | frank-cywong/CodingContests | usaco/2022-Jan/usaco51.cpp | #include <iostream>
using namespace std;
int N;
const int mod = 1000000007;
int dp[101][1001];
int h[100];
int doDP() {
for (int i = 1; i < N; i++) {
for (int j = 0; j <= h[i]; j++) {
if (i == 1) {
if (j <= h[0]) {
dp[i][j] = j + 1;
}
else {
dp[i][j] = h[0] + 1;
}
continue;
... | ALGO | 0.999989 | 3.906308 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-05-30T22:14: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": "9a1b2a99cc5... |
8811d538-e658-4449-99b0-5463c74a80d4 | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/1_6671_151.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, k, a[maxn];
vector<int> ans;
long long sum;
int main() {
ios::sync_with_stdio(false);
cin >> n >> k;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
sum += a[i];
}
int partsum = sum / k;
int tmp = 0, lastpos = 0;
bool flag ... | ALGO | 0.999996 | 3.938997 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59: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": "f3b0db9a433... |
2c320f63-a0d8-4bbf-85dd-b16d9442ced6 | nqdat2002/Data-Structures-and-Algorithms | Giai Thuat Tham Lam/DSA03027 - GIÁ TRỊ LỚN NHẤT.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> p;
typedef vector<vector<int> > vt;
typedef vector<pair<int, int> > vp;
const ll mod = 1e9 + 7;
const int oo = 1e6 + 7;
#define f first
#define s second
#define pb push_... | ALGO | 0.999916 | 4.422041 | {
"github_metadata": {
"branch": "main",
"commit_count": 459,
"repo_created_at": "2022-02-20T06:21:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79aa6c3da7... |
b6a2e0ad-3332-45dd-89e8-12988c05de0e | RubenAshughyan/Programming-olympiads | PzWinter2016Day6/main.cpp | #include<bits/stdc++.h>
//#include "rubo.h"
#define MP make_pair
#define PB push_back
#define in int
#define ll long long
#define ull unsigned long long
#define vc vector
#define SQ(j) (j)*(j)
//#define i first
//#define j second
//#define ld long double
#define dbl double
#define pll pair<long long,long long>
#defi... | ALGO | 0.999973 | 3.746317 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2016-11-12T16:53:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba37b4b33... |
cb2dfa3e-c0c9-4611-9e49-88da7b5783ee | jojelen/Codility | 8_Leader/EquiLeader.cpp | int solution(vector<int> &A) {
int candidate = A[0];
int count = 0;
int N = A.size();
for (auto &a : A) {
if (count == 0) {
candidate = a;
count++;
} else {
if (a == candidate)
count++;
else
count--;
... | ALGO | 0.999875 | 5.10984 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-01-14T08:04: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": "09f220e1c1... |
ac2f0788-1706-4376-b82f-bd4fc86c2bbc | ishandutta2007/codeforces-s | sortoite/normal/1246/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define pb push_back
typedef double DO;
typedef long long INT;
typedef vector<int> VI;
typedef pair<int, int> pii;
using VP = vector<pii>;
const int NN = 1e5+1;
int flag[NN];
int a[NN];
VP b[NN];
map<VP, int> mp;
int main() {
#ifndef ONLI... | ALGO | 0.999841 | 3.607336 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:07:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0f1cde31b215... |
e370d8b0-e38e-4d59-8da6-b668587e09c5 | Ak1som4qqe/Zoo-simulator | Source.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <locale>
#include <limits>
#include <ios>
#include <map>
#include <memory>
#include <io.h>
#include <fcntl.h>
using namespace std;
// Перечисление типов животных
enum AnimalType { HERBIVORE, CARNI... | TOOL | 0.902226 | 4.495307 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2025-05-28T09:06: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": "3eeb0bb36fa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.