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 |
|---|---|---|---|---|---|---|---|
2dbf5a45-6d0a-4103-802b-cf4a0c0a8bf8 | fstqwq/Nemesis | SCL_others/Other/SJTU_ACM_Platelet/Template/Source-25/GraphTheory/kth_minimum_path.cpp | const int MAXNODE=MN+MAXM*2;
int n,m,cnt,S,T,Kth,N,TT,used[MN];
int rt[MN],seq[MN],adj[MN],from[MN],dep[MN];
LL dist[MN],w[MAXM],ans[MAXK];
struct GivenEdge{
int u,v,w;GivenEdge(){};
GivenEdge(int _u,int _v,int _w): u(_u),v(_v),
w(_w){};
}edge[MAXM];
struct Edge {
int v,nxt,w;Ed... | ALGO | 0.9999 | 3.494864 | {
"github_metadata": {
"branch": "master",
"commit_count": 248,
"repo_created_at": "2019-09-08T16:45:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 43,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "309f75d... |
8a173955-08b6-41d1-aad1-3530679de30c | bosen-you/code- | toi/e841.cpp | #include <iostream>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n , m;
cin >> n >> m;
int map[n] = {0} , temp[n];
for (int i = 0; i < n; i++) temp[i] = 1;
for (int i = 0; i < m; i++){
int p , q , r , s;
cin >> p >> q >> r >> s;
if (r ==... | ALGO | 0.999984 | 3.539907 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2024-08-31T12:25:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c09274b861... |
a03df130-0a84-4677-8227-3c142d46dac5 | atrimuhammad/Lossless-Compression-Huffman-Coding-Algorithm | HuffmanTree.cpp | #include <iostream>
#include <fstream>
#include "HuffmanTree.h"
#include "OrderedQueue.h"
using namespace std;
HuffmanTree::HuffmanTree()
{
root = NULL;
}
HuffmanTree::~HuffmanTree()
{
}
T_Node* HuffmanTree::Make_BT_Node(char Char, int Freq)
{
T_Node* new_node = new T_Node;
new_node->left = NULL;
new_node->right... | ALGO | 0.999735 | 3.630105 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-12-31T02:09:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "017849df77... |
3293e193-e54d-4d94-9639-18950988eaae | ShiftyBlock/USACO-Problems-AssortedC- | Codeforces/339-D2-C.cpp | /*
ID: davidzh8
PROG: subset
LANG: C++
*/
#include <bits/stdc++.h>
using namespace std;
#define pii pair<long,long>
#define endl "\n"
#define long long long
#define v vector
long MOD = 1e9+7;
void setIO(string name, int submit) {
if (submit) {
ios_base::sync_with_stdio(0);
cin.tie(0);
fre... | ALGO | 0.999951 | 3.314819 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2020-10-29T03:16: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": "b1b124f0f2... |
ec0f0d2b-1d78-4b34-a857-01359918b3c4 | safo6m/HMO | src/greedy.cc | #include <cstdio>
#include <cmath>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <queue>
#include <algorithm>
using namespace std;
const int POPULATION = 10;
const int ITERATION = 1000;
inline int Rand(int lo, int hi) {
return (rand() % (hi - lo + 1)) + lo;
}
class user_t {
public:
in... | ALGO | 0.999429 | 4.009616 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2014-12-08T19:39:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "045619b1a... |
0053c52a-395e-4e43-a179-a6e03a71e075 | D-BookeR/Synthese-d-images-avec-OpenGL | common_simple/C++/gl-matrix.cpp | /* Copyright (c) 2013, <NAME>, <NAME>. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following ... | TOOL | 0.97754 | 6.284677 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2017-06-22T14:15:26.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 6,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cbe390cde72... |
e33ca5a0-96f5-4555-914b-26b82362e61b | ishefalichopra/CPP | 322_RemoveDuplicatesLL2.cpp | #include <bits/stdc++.h>
using namespace std;
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) {}
};
ListNode *deleteDuplicates(ListNode *head)
{
ListNode *dummy = ne... | ALGO | 0.999956 | 5.539014 | {
"github_metadata": {
"branch": "master",
"commit_count": 652,
"repo_created_at": "2022-11-22T13:16:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b04a40d... |
8d4cbe9c-262b-4b0f-aeda-50ca843eaf1f | cemagg/SUN-EM-CMOM | src/solvers/mom/parallel_mom/mpi_fill_ilhs.cpp | #include "mpi_fill_ilhs.h"
void mpiFillIlhs(std::complex<double> *zmn,
std::complex<double> *vrhs,
int &num_zmn_rows,
int &num_vrhs_rows,
int &matrix_size,
int &block_size,
int &context)
{
int zero = 0;
int one = 1;
int info = 0;
int zmn_lda = std::max(1, num_zmn_rows);
int zmn_desc... | ALGO | 0.994098 | 4.084376 | {
"github_metadata": {
"branch": "master",
"commit_count": 527,
"repo_created_at": "2019-02-26T11:26:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 37,
"forks": 12,
"issues": 12,
"pull_requests": 0
},
"file_meta": {
"content_id": "f928f5... |
aa459df8-01ee-4173-9b66-2012b3a6f858 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/04/0408/personal_submission/cf226b_md.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using pii = std::pair<int, int>;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
std::cin >> n;
vector<i64> stones(n);
copy_n(istream_iterator<i64>(cin), n, begin(stones));
sort(begin(stones... | ALGO | 0.999624 | 4.350763 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "9bd9... |
1416477b-e17f-4a54-8419-d46bef430b5b | RyanShaw3/MyScripts | LintCode/US_Giants/112.Remove_Duplicates_from_Sorted_List.cpp | /**
* Definition of singly-linked-list:
* class ListNode {
* public:
* int val;
* ListNode *next;
* ListNode(int val) {
* this->val = val;
* this->next = NULL;
* }
* }
*/
#include <iostream>
using namespace std;
class ListNode
{
public:
int val;
ListNode *next;
List... | ALGO | 0.999992 | 5.342069 | {
"github_metadata": {
"branch": "main",
"commit_count": 187,
"repo_created_at": "2021-12-05T12:11:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b26e177247... |
6933ccb5-bbd5-4348-8bad-5ef7c456bc82 | berenger-eu/tbfmm | examples/testUnifKernel.cpp | #include "spacial/tbfmortonspaceindex.hpp"
#include "spacial/tbfspacialconfiguration.hpp"
#include "utils/tbfrandom.hpp"
#include "core/tbfcellscontainer.hpp"
#include "core/tbfparticlescontainer.hpp"
#include "core/tbfparticlesorter.hpp"
#include "core/tbftree.hpp"
#include "algorithms/tbfalgorithmselecter.hpp"
#inclu... | ALGO | 0.990511 | 5.566352 | {
"github_metadata": {
"branch": "master",
"commit_count": 406,
"repo_created_at": "2020-04-23T16:52:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 4,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "40bb07c... |
afe0a3f6-8262-425f-ad81-13c14aa640fd | roytam1/palemoon27 | intl/locale/nsUConvPropertySearch.cpp | /* 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/. */
#include "nsUConvPropertySearch.h"
#include "nsCRT.h"
#include "nsString.h"
#include "mozilla/BinarySearch.h"
nam... | TOOL | 0.909244 | 6.794627 | {
"github_metadata": {
"branch": "master",
"commit_count": 4110,
"repo_created_at": "2018-07-25T02:10:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 68,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "24395... |
cc59fb8e-ceb3-4bc5-b19b-8c601c87ed51 | Yobretaw/AlgorithmProblems | Leetcode/DP/scrambleString.cpp | #include <iostream>
#include <vector>
#include <string>
#include <string.h>
#include <sstream>
#include <stack>
#include <queue>
#include <utility>
#include <unordered_map>
using namespace std;
/*
* Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
*... | ALGO | 0.999971 | 5.869012 | {
"github_metadata": {
"branch": "master",
"commit_count": 456,
"repo_created_at": "2014-06-30T21:08:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cb303c00... |
1345f8f9-d601-4867-85f4-f5dc0dc3e2bd | hugoassisj/movingRobots | movingRobots/Source/source.cpp | #include <stdlib.h>
#include "source.h"
#define NEW_POS_RANGE 20
using namespace std;
/**
* @brief Constructs a Source object with the given ID.
*
* @param _id The ID of the source.
*/
Source::Source(int _id)
{
mutexLock = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_lock(&mutexLock);
id = _id;
time... | TOOL | 0.915063 | 5.406704 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2018-11-21T18:53: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": "bfd109389... |
9ce18335-8cbb-4962-8de3-5b85d02f0f01 | garimasinghgryffindor/DAA | ALL PAIR SHORTEST PATH/floydwarshall.cpp | //DYNAMIC PROGRAMMING APPROACH TO FIND ALL PAIR SHORTEST PATH
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
class floyd{
int V;
vector <vector <int> > graph , res;
public:
floyd(vector <vector <int> > &graph , int V)
{
this->graph=graph... | ALGO | 0.99994 | 5.534697 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2022-06-19T10:37: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": "194b32493d... |
d054ec2d-e26c-4ea9-b9f5-b0826f4d0fca | intel/hyperscan | src/fdr/flood_runtime.h | /*
* Copyright (c) 2015-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the f... | ALGO | 0.953878 | 3.047252 | {
"github_metadata": {
"branch": "master",
"commit_count": 1317,
"repo_created_at": "2015-09-21T21:58:00.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5051,
"forks": 748,
"issues": 163,
"pull_requests": 29
},
"file_meta": {
"content_id": "... |
cecb236e-3f5d-4e53-afaa-5e00eaedb625 | CS303-0001/Assignment_2 | single_linked_list.h | #ifndef SINGLE_LINKED_LIST_H
#define SINGLE_LINKED_LIST_H
#include <iostream>
#include <cstddef>
namespace std
{
/**
* @class Single_Linked_List
* @brief A template class for a singly linked list.
*/
template <typename T>
/**
* @class Single_Linked_List
* @brief A class represen... | ALGO | 0.996842 | 6.564602 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-06-17T22:35:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "15941044421af... |
1c99aaa8-52a1-494f-a16e-889162d8e3ea | davidgjordan/ProyectosCpp | PracticasCPPCasa/pilas.cpp | #include <iostream>
#include <string>
#include <cstring>
using namespace std;
class node{
char * data;
node * siguiente;
node(char * sdata, node *snode =nullptr):data{sdata}, siguiente{snode}{
}
public:
~node(){
}
friend class pila;
};
class pila{
node * ultimo = nullptr;
publi... | ALGO | 0.990631 | 3.802229 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2017-11-10T16:22: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": "9241f5902... |
97c665cc-2a3b-4d68-bffd-bab6c9cd087e | itsaj958/Anuj-c- | stacks 4/infixwithbrackets.cpp | #include<iostream>
#include<string>
#include<stack>
using namespace std;
int priority(char ch){
if(ch=='+' ||ch=='-') return 1;
// else if(ch=='(' ) return 0;
// else if(ch==')' ) return 3;
else return 2;
}
int solve(int v1,int v2,char ch){
if(ch=='+') return v1+v2;
else if(ch=='-') return v1-v2;
else if(ch=='*') ret... | ALGO | 0.999968 | 4.048659 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-07-13T08:18: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": "85e259a42aee... |
9ee5248f-74c2-4daf-9215-253287cc0ab7 | ishandutta2007/codeforces-i | -imc-/normal/1704/F.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
using li = long long;
using ld = long double;
const int MOD = 998244353;
unordered_map<string, bool> wins;
bool get_wins(string s, char cur) {
auto p = s + cur;
if (!wins.count(p)) {
wins[p] = false;
for (int i = 0; i... | ALGO | 0.999905 | 3.997112 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:39:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8eb67654a46b... |
5a637a05-ea03-44c2-9dc6-aaac5b10f7eb | jaketurelli/advent_of_code_2021 | src/c++/day_011.cpp | ///////////////////////////////////////////////
/// @file day_011.cpp
/// @author <NAME> (<EMAIL>)
/// @brief https://adventofcode.com/2021/day/11
/// @version 0.1
/// @date 2021-12-26
///
/// @copyright Copyright (c) 2021
///
///////////////////////////////////////////////
#include "day_011.h"
#include <fstream>
#inc... | ALGO | 0.994895 | 5.714432 | {
"github_metadata": {
"branch": "main",
"commit_count": 29,
"repo_created_at": "2021-12-16T08:05: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": "2117f3872b7... |
8f022e21-470c-400c-b6ff-467275d4017b | sharc-lab/FlowGNN | DGN/src/linear.cc | #include "linear.h"
#include "hls_math.h"
using std::array;
template<
int DIM_IN,
int DIM_OUT,
int PARALLEL,
bool RELU
>
void linear(
FM_TYPE input[DIM_IN],
WT_TYPE weight[DIM_OUT][DIM_IN],
WT_TYPE bias[DIM_OUT],
FM_TYPE output[DIM_OUT]
)
{
#pragma HLS INLINE off
#pragma HLS ARRAY_PART... | ALGO | 0.978344 | 6.460251 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-04-27T20:52:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 74,
"forks": 9,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "11b4a0784246... |
b9e89831-695e-40cd-840b-898fe0b15016 | nizi24/AtCoder | ABCPastQuestions/abc169/b/main.cpp | #include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
#define MOD 1000000007
#define INF INT32_MAX / 2
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
template <class T>
inline bool chmin(T &... | ALGO | 0.999995 | 4.0421 | {
"github_metadata": {
"branch": "master",
"commit_count": 1059,
"repo_created_at": "2021-01-10T08:43: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": "384c080... |
5e5da0e5-c22e-45b3-9c8c-22b3c341af7b | gabriel-tandil/SENSITIVE_COUTURE | DelFEM/src/femeqn/eqnsys_shell.cpp | /*
DelFEM (Finite Element Analysis)
Copyright (C) 2009 <NAME> <EMAIL>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later versi... | ALGO | 0.995953 | 3.180683 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-12-03T19:00:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 50,
"forks": 18,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c123b1a5... |
7ee97c5e-c4df-4b89-87be-252393e9433c | DentistGus/Algoritmi | Backtracking/intercorso2023.cpp | /*Sia data una tripla di interi S, N e P. S indica una somma. P indica un numero primo. Si trovino tutti
gli N numeri primi strettamente maggiori di P tali che la loro somma è uguale ad S. Possono esistere
più sequenze che soddisfano tale condizione.*/
#include <iostream>
#include <vector>
using namespace std;
bool ... | ALGO | 0.999769 | 4.158692 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-11-10T15:29:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "304c2f5e27d0... |
8ff0f935-b40a-43a1-b72e-00c5ae7dd328 | WhiZTiM/coliru | Archive2/87/9f9fcf926f1ab5/main.cpp | #include <iostream>
#include <vector>
#include <queue>
struct symbol {
explicit symbol(char av = 0, int ac = 0) : value(av), count(ac) { }
char value; // actual symbol, by default 0 (empty)
int count; // count of the symbol, by default 0
}; // symbol
// compare two symbols
// symbol with a lower count is... | ALGO | 0.999811 | 4.014056 | {
"github_metadata": {
"branch": "master",
"commit_count": 42630,
"repo_created_at": "2016-04-21T16:34:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f516b... |
b6f61a0f-7c32-4101-a8d0-945014dda736 | ishandutta2007/codeforces-l | linkct/normal/438/D.cpp | #include <cstdio>
#include <iostream>
using namespace std;
typedef long long int ll;
const int MAXN = 100005;
struct segTree{
int maxv[MAXN << 2], ql, qr, qv, qp;
ll sum[MAXN << 2];
void maintain(int x){
maxv[x] = max(maxv[x << 1], maxv[x << 1 | 1]);
sum[x] = sum[x << 1] + sum[x << 1 | 1];
}
void singleUpdate... | ALGO | 0.999444 | 3.84054 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "85e214681a78... |
cffd1026-d306-4bdb-9cb3-b9a9f08df16f | about-anuj/Leetcode-Solutions | 403-frog-jump/403-frog-jump.cpp | class Solution {
public:
int dp[2001][2001];
bool calc(vector<int>&stones,unordered_map<int,int>&mp,int curind,int jump,int n)
{
if(curind==n-1) return true;
if(curind>=n) return 0;
if(dp[curind][jump]!=-1) return dp[curind][jump];
bool ans=false;
for(int i=-... | ALGO | 0.999963 | 5.665175 | {
"github_metadata": {
"branch": "main",
"commit_count": 2272,
"repo_created_at": "2022-01-02T08:50: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": "8f42d08e5... |
b39c4d5e-7685-4ca3-8122-84696678e2a7 | Pritz69/GFG_POTD | Medium/Detect Cycle using DSU/detect-cycle-using-dsu.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to detect cycle using DSU in an undirected graph.
int find(int i,int parent[]){
if(parent[i]==i){
return i;
}
parent[i]=find(parent[i],parent);
... | ALGO | 0.999956 | 6.253896 | {
"github_metadata": {
"branch": "main",
"commit_count": 1722,
"repo_created_at": "2022-10-12T08:40:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "288874f75... |
00def40d-599c-461e-8e3d-8a500a84ee05 | DurkoMatko/LFU_AdvancedCPP_Taks7a | Homework7b/lambda.cpp | #include <iostream>
#include <algorithm>
#include <typeinfo>
#include <functional>
void PerformOperation(std::function<void ()> f){
f();
}
int main(){
std::vector<int> vector = {1,2,3,4,5,6,7,8,9};
int v = 5;
//passing all variables by reference
auto iterator = std::find_if(vector.begin(),vector.end(),[&](int e... | ALGO | 0.991116 | 5.881139 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-11-30T23:15: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": "4255c952f7... |
f9536862-3367-4425-b3df-5f06ce67fe41 | imamrb/cp-programming | 3_codeforces/D String Game Binary Search.cpp | #include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb push_back
#define mkp make_pair
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define maximum(a) *max_element(all(a))
#define minimum(a) ... | ALGO | 0.999963 | 3.984944 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-09-18T15:39: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": "0087044134... |
b26a9846-7d8f-491b-a124-06035854e327 | ezequiel-lazarte/Facultad | Programacion Orientada a Objetos/Unidad 5/Ejercicios de practica/Ejercicio adicional 1/Ejercicio adicional 1.cpp | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
using namespace std;
int CuentaFrase(vector<string> v1);
int main() {
/**Escriba un programa que abra un archivo con el texto de <NAME> de <NAME>
Cervantes (puede obtener el archivo desde la dirección:
http://www.gutenberg.org/files/2000/o... | ALGO | 0.99747 | 4.114423 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-09-03T17:36: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": "9fa15272a9b5... |
35615417-0a01-4c58-afe0-abd706580554 | stevenmsl/cpp_fkswnrc_1100 | main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <unordered_map>
#include "solution.h"
#include "util.h"
using namespace std;
using namespace sol1086;
/*
Input: S = "havefunonleetcode", K = 5
Output: 6
Explanation:
There are 6 substrings they are : 'havef','avefu','vefun','efuno','etc... | ALGO | 0.999899 | 5.005888 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-04-12T21:22: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": "feb96a487d... |
26db15de-b11d-4dd4-9f34-17eced919e57 | ishandutta2007/codeforces-e | endagorion/normal/364/C.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <cassert>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
#define mp make_pair
#define pb push_back
#defin... | ALGO | 0.999701 | 3.255265 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:34: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": "2750afa6d4fa... |
898e0c79-37b5-493d-9cfd-a325d91d914e | Syhawk/LeetCode | unique_paths_ii.cpp | //uri: https://leetcode.com/problems/unique-paths-ii/
/*
* 计算从矩阵左上角到右下角的所有唯一路径数目,其中矩阵存在障碍物,障碍物用数字1
* 来表示,那么可以用负数来表示路径可达,最后再把负数求正即可。
* 空间复杂度:O(1).
* 时间复杂度:O(m*n).
* */
class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
vector<vector<int>> &p = obstacleGrid;
... | ALGO | 0.999972 | 4.926088 | {
"github_metadata": {
"branch": "master",
"commit_count": 292,
"repo_created_at": "2015-12-12T13:48:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9ce6a0f1... |
af179944-e443-45b4-959c-192a22a00609 | GeorgePsom/RTFramework | Framework/Plane.cpp | #include "stdafx.h"
Plane::Plane(XMVECTOR& U, XMVECTOR& V, XMVECTOR& Pos, bool reverseNormal, Material& m, bool light, int lightIndex) : position(Pos), Intersectable(m, light, lightIndex)
{
isLight = light;
mat = m;
u = U;
v = V;
normal = XMVector3Normalize(XMVector3Cross(u, v));
reverse = reve... | ALGO | 0.978497 | 5.350072 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-11-20T16:43: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": "4bd56b45e5b... |
dc59c47d-c765-41ab-befc-a9a9181fa5e2 | kristianmeyerr/suneigen | app/main.cpp | #include <iostream>
#include <Eigen/SparseCore>
#include "model_robertson.h"
#include "suneigen.h"
using namespace suneigen;
int main() {
std::cout<<"********************************"<<std::endl;
std::cout<<"** Running forward simulation **"<<std::endl;
std::cout<<"********************************"<<std:... | ALGO | 0.999725 | 5.787528 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2021-10-25T12:57:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "1725d3db71f... |
c38ee299-1e04-446d-b913-f934f95d85cb | BlackRa1nFR/source-2003 | src_main/vphysics/trace.cpp | #include <string.h>
#include "convert.h"
#include "vector.h"
#include "mathlib.h"
#include "cmodel.h"
#include "physics_trace.h"
#include "ivp_physics.hxx"
//#include "ivp_core.hxx"
#include "ivp_surman_polygon.hxx"
//#include "ivp_templates.hxx"
#include "ivp_compact_ledge.hxx"
//#include "ivp_compact_ledge_solver.hxx... | ALGO | 0.999054 | 5.418211 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-04-23T22:17:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 32,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c51a8fe6... |
7df3164d-2d67-47a6-a6b9-224f660c6690 | Uintah/Uintah | src/CCA/Components/Models/Radiation/RMCRT/RayKokkos.h | /*
* The MIT License
*
* Copyright (c) 1997-2025 The University of Utah
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* right... | ALGO | 0.994952 | 6.044452 | {
"github_metadata": {
"branch": "master",
"commit_count": 55375,
"repo_created_at": "2019-09-03T20:22:50.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 63,
"forks": 23,
"issues": 12,
"pull_requests": 1
},
"file_meta": {
"content_id": "39fa... |
63a3dc0e-62e1-4347-96d3-f1ee922bb0a7 | z-ding/Leetcode | Leetcode/recursion_DP/2572_SquareFreeSubseq/recursion.cpp | class Solution {
public:
unordered_set<int> sq;
unordered_set<int> cur;
vector<vector<long long>> c_memo;
inline long long combination(int ttl, int target, int cur) {
//cout << cur << "," << ttl << "," << target << endl;
if (c_memo[cur][target] != -1) {
return c_memo[cur][tar... | ALGO | 0.999824 | 4.755673 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2023-02-01T12:13: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": "45c775937... |
1df86ee4-3835-4db3-8369-7f39322d47f8 | MAA1117/DSA | codeforces/012224_cf1520a.cpp | #include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
bool is_in(char c, std::vector<char>& s)
{
bool ret;
std::find(s.begin(), s.end(), c) != std::end(s)
? ret=true : ret=false;
return ret;
}
int main()
{
/* std::string INPUT = */
/* "5\n" ... | ALGO | 0.999946 | 4.12607 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-01-02T18:31: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": "a3cb56ce863... |
90ede85d-b23c-4466-9cf5-5633e1d54084 | eyvazliruf/PaNaRuf | PaNaRuf/PaNaRuf/ComputeFeatures.cpp | #include "ComputeFeatures.h"
#include <opencv2/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
using namespace detail;
using namespace xfeatures2d;
using namespace samples;
int ComputeFeatures::imageFeatureComputer(Mat image1, Mat image2, vector<Point2d>& obj, vector<Point2d... | ALGO | 0.988078 | 5.032946 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2023-06-18T18:11:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9d6364257e1... |
f3d4d330-46f8-4051-b3d8-54bbe082bbc1 | akash-mankar/EPI | Graphs/16.1.cpp | // Traverse through a 2D maze to find a path from entrance to exit
// in this solution we assume graph consists of all vertices
// I think its assumed that the
/*
DFS or BFS
crucial part
Keep track of visited and unvisited nodes.
else it ll loop forever if a cycle exists in the path.
BFs only gives us shortest path
b... | ALGO | 0.999904 | 5.921286 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2015-07-01T03:36: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": "81a29f8a6... |
2676f655-5c8d-4b67-9248-d3b5da51dbfa | lavishmlk/My-leetcode-and-gfg-solutions-in-Cpp | 78-subsets/78-subsets.cpp | class Solution {
public:
//ITERATIVE SOLUTION, RECURSIVE ISKA PEHLE SUBMIT <NAME>, SAW VIDEO OF <NAME>
vector<vector<int>> subsets(vector<int>& nums) {
vector<vector<int>> ans;
int n = nums.size();
ans.push_back({});
cout<<ans.size();
for(int i=0; i<n; i++)
... | ALGO | 0.999936 | 6.106884 | {
"github_metadata": {
"branch": "main",
"commit_count": 1393,
"repo_created_at": "2021-12-24T12:03: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": "94010647e... |
e914e864-d505-4af2-85e7-9d18bec911af | ishandutta2007/codeforces-s | spy20051623/normal/1611/D.cpp | #include <bits/stdc++.h>
using namespace std;
int a[200005];
int b[200005];
int d[200005];
int p[200005];
vector<int> g[200005];
void solve() {
int n;
scanf("%d", &n);
for (int i = 0; i <= n; ++i) g[i].clear(), a[i] = b[i] = d[i] = p[i] = 0;
int root = -1;
for (int i = 1; i <= n; ++i) {
scanf("%d", &b[i]);
... | ALGO | 0.999496 | 4.192655 | {
"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": "a0c3719a9b03... |
51fb016c-b2ea-44c2-ad3d-8a3350cab2fb | heiseish/Competitive-Programming | cf/contest/485/B.cpp | /**
It takes a great deal of bravery to stand up to our enemies, but just as much to stand up to our friends.
*/
#include <bits/stdc++.h>
#define forn(i, l, r) for(int i=l;i<=r;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
#define nd second
#define st first
#define sz(x) (int)x.size()
#define UNIQ... | ALGO | 0.999976 | 3.904336 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-03-16T06:47:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7abb0293b... |
4fe73dd6-2e8d-433e-89d5-fdd1eb7084f9 | NedalAdham/PROBLEM-SOLVING | 768A.cpp | //A. Oath of the Night's Watch
//https://codeforces.com/contest/768/problem/A // 32
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <deque>
#include <string>
#include <bitset>
int arr [10000007];
using namespace std;
int main() {
int n;
cin >> n;
int mx = 0, mn = 100000000... | ALGO | 0.999996 | 3.941393 | {
"github_metadata": {
"branch": "main",
"commit_count": 68,
"repo_created_at": "2021-04-27T03:46: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": "4c6902234e6... |
d04bba3b-5081-49a9-a9ac-8a1e8026955d | original-work/statistic_linux | src/main.cpp | /*
* =========================================================
*
* Filename: main.cpp
*
* Description:
*
* Version: 1.0
* Created: 2017.07.27
* Revision: none
* Compiler: gcc
*
* Author: wangxx
* Contact: <EMAIL>
*
* =============================================... | ALGO | 0.947961 | 4.082867 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2018-02-09T05:36:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bfef753dae... |
f1ceaecd-316f-4589-95cd-40ed58c207e4 | junhyeoksin/algorithm | 순열/permutation.cpp | #include <bits/stdc++.h>
using namespace std;
// vector 사용한 순열
// void printV(vector<int> &v){
// for(int i = 0; i < v.size(); i++){
// cout << v[i] << " ";
// }
// cout << "\n";
// }
// int main(){
// int a[3] = {1,2,3};
// vector<int> v;
// for(int i = 0; i < 3; i ++ ) v.push_back(... | ALGO | 0.999924 | 4.953914 | {
"github_metadata": {
"branch": "main",
"commit_count": 37,
"repo_created_at": "2024-03-29T16:11: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": "3dc27db6c67... |
b806a4f3-8888-40fb-bb01-62c80ba320a2 | dennischa/CodeSignal-Algorithm_Study | CodeSignal/interview-practice/combinationSum.cpp | //
// mostFrequentSum.cpp
// CodeSignal
//
// Created by 차경준 on 06/08/2019.
// Copyright © 2019 KyungJunCha. All rights reserved.
//
// Problem URL : https://app.codesignal.com/interview-practice/task/JAhrxhDQDLDDA3NXe
// Difficulty : Hard
// Note : BackTracking
#include "interview-practice.h"
namespace combina... | ALGO | 0.999897 | 5.909059 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-06-03T04:08: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": "116c6c0ee... |
f83c1051-6405-431a-80d2-811d16e18732 | tiago-sb/ap1 | ap1_unidade01/lista2AP1/src/questao04.cpp | /*
Experimente fazer um algoritmo que peca que seja digitado um valor inteiro positivo. Caso o valor digitado
seja negativo, deve aparecer na tela a mensagem: "ERRO! VOCE DIGITOU UM VALOR NEGATIVO."
*/
#include <iostream>
using namespace std;
void pedido(int n1);
int main(){
int n;
pedido(n);
return 0;
}... | ALGO | 0.965679 | 3.912061 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2023-07-23T16:45:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8479d5a0d94... |
4964cbd6-1cfd-4ec6-b4e8-de8edeab5c61 | SavkovAndrey/Hard_17 | Hard_17/Main.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int** create_matrix(int row, int col); // Создание матрицы
void input_matrix(int** matrix, int row, int col); // Заполнение и вывод стартовой матрицы
void calc_char(int** matrix, int row, int col, int* sum)... | ALGO | 0.999835 | 4.275302 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2023-11-21T18:19:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72d74670ef... |
e37c24e2-c73a-4f55-80e0-cba4a0844db3 | engus525/BaekJoon | 프로그래머스/3/42861. 섬 연결하기/섬 연결하기.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
struct KS
{
int s, e, v;
};
vector<KS> graph;
int parent[101];
int Find(int x)
{
if (parent[x] == x) return x;
else return parent[x] = Find(parent[x]);
}
bool Union(int x, int y)
{
x = Find(x);
y = ... | ALGO | 0.99976 | 4.631892 | {
"github_metadata": {
"branch": "main",
"commit_count": 1282,
"repo_created_at": "2023-01-18T09:35: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": "e5c1d9205... |
c3b7732d-7a0a-4854-96fe-b7e0c6c8b58e | supercmmetry/diffie-hellman-protocol | src/diffie_hellman.cpp | #include <diffie_hellman.h>
#include <random>
#include <iostream>
uint64_t DiffieHellman::fast_powmod(uint64_t x, uint64_t n, uint64_t m) {
if (n == 0) {
return 1;
}
if (n == 1) {
return x % m;
}
uint64_t half_result = fast_powmod(x, n >> 1, m);
if ((n & 1) == 0) {
re... | ALGO | 0.995901 | 5.823683 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2021-03-30T11:20: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": "2007fd861f... |
52d23ec6-2568-46f1-a2b0-5d78fd101866 | HariAakash646/CompetitiveProgramming | Contests/CF1882/probB.cpp | #include <bits/stdc++.h>
using namespace std;
#define scd(t) scanf("%d", &t)
#define scld(t) scanf("%ld", &t)
#define sclld(t) scanf("%lld", &t)
#define scc(t) scanf("%c", &t)
#define scs(t) scanf("%s", t)
#define scf(t) scanf("%f", &t)
#define sclf(t) scanf("%lf", &t)
#define forr(i, j, k) for (int i = j; i < k; i++... | ALGO | 0.999703 | 4.266739 | {
"github_metadata": {
"branch": "main",
"commit_count": 123,
"repo_created_at": "2022-09-08T07:58:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5124639912... |
119b5c8e-21d1-4632-b13d-bce676301a9c | lclpsoz/competitive-programming | ARCHIVE/summer-camp-2019/summer-camp-2019-02-01/F.cpp | #include "bits/stdc++.h"
using namespace std;
////////////// Prewritten code follows. Look down for solution. ////////////////
#define x first
#define y second
#define len(x) ((int)(x).size())
using pii = pair<int, int>;
using ll = long long;
using llu = long long unsigned;
using ld = long double;
const ld EPS = 1e-9... | ALGO | 0.999933 | 3.977297 | {
"github_metadata": {
"branch": "master",
"commit_count": 274,
"repo_created_at": "2020-07-09T09:09:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4a663ee2... |
f37aa9b4-5207-43d2-b1fc-2945a0fc851d | AOSiP/platform_frameworks_av | media/libeffects/lvm/lib/Common/src/LVC_Core_MixSoft_1St_2i_D16C31_WRA.cpp | /*
* Copyright (C) 2004-2010 NXP Software
* Copyright (C) 2010 The Android Open Source Project
*
* 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/... | ALGO | 0.999416 | 5.245107 | {
"github_metadata": {
"branch": "eleven",
"commit_count": 57190,
"repo_created_at": "2017-08-20T04:14:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d4d614... |
8d3a2124-495f-46de-8adf-fbb01a8f4c98 | Ismail-Upal/CP-Campaign | Codeforces/I_I.cpp | #include<bits/stdc++.h>
using namespace std;
#define opt() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define tc int t; cin >> t; for (int _ = 1; _ <= t; _++)
using ll = long long;
#define endl '\n'
#define sz(x) (ll)(x).size()
//-------------------------------------------
int32_t main()
{
opt();
... | ALGO | 0.999975 | 3.685657 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2024-07-07T19:32: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": "1705ffc0c81... |
6d824e2e-5e0a-4a50-baa0-5c4eeb808e18 | ravi688/CrackingTheCodingInterview | permutation.cpp | #include <iostream>
#include <vector> // for std::vector
#include <concepts> // for std::integral
#include <utility> // for std::declval
#include <functional> // for std::functional
template<typename T, typename... U>
concept same_as_any = (std::same_as<T, U> || ...);
template<typename T>
concept ReadOnlyVector = req... | ALGO | 0.999403 | 7.197323 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2023-06-05T18:51:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3625e8983... |
0db5235f-233f-4af5-a36e-5374a1435ce2 | equation9/BOJ | 2316.cpp | /*2316번 도시 왕복하기(C++11)*/
/*네트워크 플로우*/
/*1번과 2번의 최대 유량*/
#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
int N, P;
int map[802][802];
queue<int> Q;
int pr[802];
int main()
{
int i;
scanf("%d %d", &N, &P);
for(i = 1; i <= N; i++)
map[i][N+i] = 1;
map[1][N+1] = map[2][N+2] = 87654321;
... | ALGO | 0.999859 | 3.370751 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2017-03-28T09:45: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": "232177181... |
04afa9ba-49df-499c-8f48-cd749c8e5e05 | SimvolOrg/FlyLegacy | source/src/Include/GeoMath.h | //=================================================================================
// Copyright 2007 <NAME>
// Mathematical utility for Geo position
//=================================================================================
// Earth coordinates in latitude and longitude requets specific math
// frame to acc... | TOOL | 0.937618 | 3.947009 | {
"github_metadata": {
"branch": "master",
"commit_count": 252,
"repo_created_at": "2011-07-08T18:59:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 10,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "962ba6d... |
1aee5eb5-1be3-4035-a34a-c3ee8c77432b | yassin64b/competitive-programming | CodeForces/555/1157F.cc | #include <bits/stdc++.h>
using namespace std;
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
constexpr int MXV = 200'001;
vector<int> cnt(MXV, 0);
vector<int> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
++cnt[a[i]];
}
... | ALGO | 0.999989 | 3.971812 | {
"github_metadata": {
"branch": "master",
"commit_count": 786,
"repo_created_at": "2016-03-07T18:10: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": "6c2003f2... |
d3568778-febc-42c9-acc8-10d383ab72fc | maballeza/Graph | Vertices.hpp | #pragma once
#include "Node.hpp"
#include <unordered_map>
#include <vector>
#include <string>
#include <type_traits>
#include <iostream>
#include <sstream>
#include <iomanip>
template <typename I>
struct Vertex : BaseNode<I> {
enum Status { nf, f, d }; // Not found, found, discovered.
Vertex(I&& i)
... | ALGO | 0.995561 | 6.803347 | {
"github_metadata": {
"branch": "master",
"commit_count": 49,
"repo_created_at": "2021-09-06T00:29: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": "c66a297d2... |
6388a72d-c3c9-42e3-999f-93501f8a14e3 | elrinor/cmc-cg | 2006 - Task4 {12 of 24} [k]/src/Mebius.cpp | #include <gl\glut.h>
#include <windows.h>
#include <math.h>
#include "loadbmp.h"
#define PI 3.1415926
#define sqr(x) ((x)*(x))
#define eps 0.0001
class Vector
{
public:
union{
struct{
float x,y,z;
};
float a[3];
};
Vector() {}
Vector(float X,float Y,float Z) {x=X;y=Y;z=Z;}
Vector(const Vect... | ALGO | 0.987539 | 3.956351 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2015-03-30T14:17: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": "a5d210f5d... |
c00c0f02-73a5-4552-8c4d-353f7863f138 | davdleet/algorithms-practice | BOJ/2638/A.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
int N, M;
vector<vector<int>> arr;
vector<vector<int>> visited;
deque<pair<int, int>> cheese_tiles;
vector<pair<int, int>> dir = {
{1, 0},
{-1, 0},
{0, 1},
{0, -1}};
void outside(int x, int y)
{
visited[x][y] = 1;
arr[x... | ALGO | 0.999898 | 3.635937 | {
"github_metadata": {
"branch": "main",
"commit_count": 322,
"repo_created_at": "2021-09-01T15:31:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9dbd8ea79c... |
21a86271-6e0c-4463-902e-80aa367d320b | chen-jy/competitive-programming | dmoj/rgpc/rgpc18p5 - Wormhole.cpp | // An accepted solution to P6 - Wormhole
// O(X*Y^2*Z^2*W^2) - complete (RuAr)
#include <bits/stdc++.h>
#define XX (X<<1)
#define YY (Y<<1)
#define ZZ (Z<<1)
#define WW (W<<1)
#define LIM XX*YY*ZZ*WW
using namespace std;
int numPeople, X, Y, Z, W;
// Stores tax estimates
// Dimensions are doubled in order to simulate ... | ALGO | 0.999926 | 3.483318 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-03-24T21:55: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": "e64851d41e... |
f3f95fd7-d7bc-4a5a-a6a6-0cb4cc1dba29 | Silvoid/GenshinProbCalc | calcpulls_ssrpair.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <mpir.h>
#include "calcpulls.h"
void GNSN_WProbCalc::CalcSSRPair()
{
// Make sure dependencies are there.
if((initialized & 1) != 1)
{
this->CalcSSRCharacter();
}
if((initialized & 2) != 2)
{
this->CalcSSRWeapo... | ALGO | 0.976589 | 4.214056 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-04-25T00:45:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7428b2689a74... |
4be4156c-4245-42ab-9530-32f8104b8456 | alexandraback/datacollection | solutions_5686313294495744_1/C++/znirzej/C3.cpp | #include<bits/stdc++.h>
#define PII pair<int,int>
#define f first
#define s second
#define VI vector<int>
#define LL long long
#define MP make_pair
#define LD long double
#define PB push_back
#define ALL(V) V.begin(),V.end()
#define abs(x) max((x),-(x))
#define PDD pair<LD,LD>
#define VPII vector< PII >
#define siz(V... | ALGO | 0.999746 | 3.728338 | {
"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": "c7af902b2... |
d1724459-58c4-46c5-8500-ddb39b1f6335 | donge/donge | 2006/[C++]Topcoder/SRM376/GameOnAGraph.cpp | #pragma warning(disable: 4786)
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;
class GameOnAGraph
{
public:
vector <int> getMarks(vector <string> adj, string colors, string marks, int N) {
vector <int> res;
// My ... | ALGO | 0.999862 | 4.436865 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2012-09-12T14:37:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f920ab6e5... |
e1674dcf-95fb-4e58-b46e-614478673993 | jiyapalrecha35/Google.github.io | codes/bloomfilters.cpp | #include <iostream>
#include <string>
#include <vector>
#include <bitset>
#include <functional>
using namespace std;
// Hash functions
size_t h1(const string& s, int arrSize) {
size_t hash = 0;
for (char c : s) {
hash = (hash + static_cast<size_t>(c)) % arrSize;
}
return hash;
}
size_t h2(con... | ALGO | 0.998929 | 5.57303 | {
"github_metadata": {
"branch": "main",
"commit_count": 240,
"repo_created_at": "2024-04-06T05:10:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "04f187a858... |
87b100dc-1039-458b-a25e-c634cd137651 | joonas-yoon/PS | BOJ/14628.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int n, k;
int mp[101], hp[101];
int dp[101][101];
// x번째 스킬을 사용했고, 남은 체력이 h일 때 사용되는 최소 마나 포인트
int solve(int x, int h) {
if (x >= n) return h == 0 ? 0 : INF;
int& ans = dp[x][h];
if (ans != -1) return ans;
ans = solve(x + 1, h);
int cnt ... | ALGO | 0.99993 | 3.301257 | {
"github_metadata": {
"branch": "master",
"commit_count": 169,
"repo_created_at": "2017-07-03T12:24:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "a8f6df97... |
346354e7-ce07-48cb-9c28-b12c0e94880e | maz9n/csci2341 | Assignment 9/Polynomial.cpp | /**
@file Polynomial.cpp
@author Almozaini:Mazen:A00323488:csc34118
@version 1.0
@date 2014-06-09
* Assignment #9
* due 2014-06-10
@brief
Polynomial calculator using linked lists
*/
/*
program is finished
*/
// includes
#include <iostream>
#include <sstream>
#include <math.h>
#include <string>
#include <i... | ALGO | 0.975732 | 3.920048 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2014-06-21T14:33: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": "92588e83c... |
f6903d17-399b-4f68-8f07-840266626611 | zarafayya/leetcode | problems/c++/2-add-two-numbers.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
void sumNode(ListNode... | ALGO | 0.999953 | 6.312716 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-07-01T10:18: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": "9dcf5f768ac... |
44483098-2dce-4126-9972-2b4558725ae7 | Scrubpai/Competitive-Programming | DMOJ/CDC/Canada Day Contest 2021 - CCC Bad Haha.cpp | #include <bits/stdc++.h>
using namespace std;
#define nl '\n'
string n; int k;
void solve(int tc) {
cin >> n >> k;
if (!k) { cout << n << nl; return; }
vector<char> vec; deque<int> idx[10];
int sz = (int)n.size();
for (int i=0; i<sz; i++) idx[n[i]-'0'].push_back(i);
for (int i=0; i<sz; i++) {
... | ALGO | 0.999988 | 4.916567 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2021-12-29T02:05: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": "f96707aa784... |
2dc49eb8-5045-4a5f-9d01-1da44043b2f7 | leonjia0112/EC602_2017_FALL | Assignment2/earth_electrons.cpp | // Copyright 2017 <NAME> <EMAIL>
#include <iostream>
#include <math.h>
using namespace std;
// The estimation is base on the number of atoms on earth and the mass of earth
// average case is tha the whole earth is made of carbon, which has a 1/2 of electron
// compare to proton. The worst case is hydrogen, with is 1 ... | DATA | 0.986933 | 3.362905 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2017-09-15T21:19: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": "2ac660157f... |
4e7127f9-7760-4153-8a06-7b16337b6930 | GabrieleBocchi/unitn-prog1 | esami_esercitazioni/Esame 12-01-2021/soluzioni studenti/222603/1/Attempt1_esercizio1.cc | #include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char * argv [])
{
if(argc != 3){
cout << "Usage ./a.out <file.txt> <file1.txt>" << endl;
exit(1);
}
fstream input, output;
char parola[101];
char ** parole = new char * [1000];
int i=0;
input.open(argv[1], ios::in);
... | TOOL | 0.975566 | 3.454054 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-01-03T17:06: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": "323d8ca8a4... |
71480e36-23d8-4f4b-8d3c-9e0012739093 | ShanmukhChalla97/CS325 | HW3/coinchange.cpp | /* Author: <NAME>
* Date: Winter 2018
* Description: This program will take a hard-coded list of coins, and efficiently use the least number of coins to
* reach the amount A.
* References used:
* https://www.youtube.com/watch?annotation_id=annotation_2195265949&feature=iv&src_vid=Y0ZqKpToTic&v=NJuKJ8sasG... | ALGO | 0.999359 | 4.572737 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2018-02-19T08:07: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": "4e13f7c717... |
14fd9fa0-c08b-4272-bff3-a811d02de5aa | basarunalan/Flight-Management-System | Route.cpp | #include <iostream>
#include "Route.h"
#include <limits.h>
using namespace std;
int Route::minDistance(int distance[],bool checkVisit[],int lastNode){
int minimum = INT_MAX;
int Node;
for(int k=0;k<lastNode;k++)
{
if(!checkVisit[k] && distance[k]<=minimum)
{
minimum=d... | ALGO | 0.999597 | 3.415129 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-08-27T17:19: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": "10aa844a67de... |
f484f3ec-908f-492a-be54-6a4d3bdd76c7 | atmtools/arts | src/m_spectral_radiance_field.cc | #include <arts_omp.h>
#include <workspace.h>
#include "math_funcs.h"
namespace {
auto ray_path_propagation_matrixProfile(
const Workspace& ws,
const Agenda& propagation_matrix_agenda,
const AscendingGrid& frequency_grid,
const ArrayOfAtmPoint& ray_path_atmospheric_point) {
struct ray_path_propagatio... | ALGO | 0.999222 | 6.205971 | {
"github_metadata": {
"branch": "main",
"commit_count": 10626,
"repo_created_at": "2012-10-29T12:51:17.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 78,
"forks": 32,
"issues": 19,
"pull_requests": 2
},
"file_meta": {
"content_id": "f82513... |
f08f6e24-bb8b-4279-bb57-9a4d8e89b502 | Effet/acm | zoj/3631/Sov_07_30_2012.cpp | #include <algorithm>
#include <iostream>
using namespace std;
typedef long long ll;
const int MAX_N = 30 + 10;
int n, m;
ll a[MAX_N];
ll sum[MAX_N];
ll lleft;
void dfs(int u, int r) {
if (u > n) {
if (r < lleft)
lleft = r;
return ;
}
// ll ff = r*100 + u;
// if (s.fi... | ALGO | 0.999941 | 3.332719 | {
"github_metadata": {
"branch": "master",
"commit_count": 43,
"repo_created_at": "2012-05-04T01:44:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1b2ebd7bf... |
444a90c3-d673-4fe9-8342-a3147ed5b20d | vinayak-7/DSA | Geek hates too many 1s - GFG/geek-hates-too-many-1s.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int noConseBits(int n) {
// code here
int lastOcc = -1;
for(int i = 32; i >= 0 ; i--)
{
... | ALGO | 0.998672 | 5.463497 | {
"github_metadata": {
"branch": "main",
"commit_count": 1878,
"repo_created_at": "2023-01-12T15:35: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": "ebc64040c... |
c329d9d4-b4e1-422d-a186-b24f2dc8ae37 | K-LeeL/cs372.Kaylee.Lewis | apps/Programs/CS 372MidTermPQ/Q3/MidtermQ3.cpp | // CS 372 Mid-term Exam: Programming Questions - Question 3
// Due: Tue Sep 19, 2023 10:00pm
//
// File: MidtermQ3.cpp
// Author: <NAME>
// Question 3: People like to be lazy. To the point at times where we try to write our code to be lazy as well.
// For example, there is the concept of doing a "lazy deletion"... | ALGO | 0.900488 | 7.179847 | {
"github_metadata": {
"branch": "main",
"commit_count": 25,
"repo_created_at": "2023-08-16T01:23:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "65b7c0f1005... |
f60ba176-48d7-46e7-84bd-ed4ea4741696 | qwer-zcc/OI | codeforces/448/B.cpp | //+-------------------------------------+
//| By qwer_zcc |
//| Date 05/07/2014 |
//+-------------------------------------+
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
#incl... | ALGO | 0.999912 | 3.120792 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2015-04-27T12:16: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": "75964a3682... |
4014c291-7a05-4340-9b4c-55cf2efbd9a8 | ariloc/CompetitiveProgrammingCodes | UVa/572.cpp | #include <bits/stdc++.h>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#define forn(i,n) for(int i = 0; i < int(n); i++)
#define forsn(i,s,n) for(int i = int(s); i < int(n); i++)
#define dforn(i,n) for (int i = int(n)-1; i >= 0; i--)
#define dforsn(i,s,n) for(int i = int(n)-1; i >= int(s); i--)... | ALGO | 0.999533 | 3.944094 | {
"github_metadata": {
"branch": "master",
"commit_count": 183,
"repo_created_at": "2020-08-19T01:48:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e63f895f... |
62e3ad11-5055-417c-9963-eb3bce6ddcf3 | SantinoAggosti/level1Eda | WarmUpStarterCode/orbitalSim.cpp | /*
******************************************************
* Orbital Simulation *
* *
* 25.03 EDA *
* Copyrigth (C) 2023 <NAME> *
* ... | ALGO | 0.999512 | 4.485078 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-03-17T14:42:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bb7ee08e42d... |
22cb87d2-31d8-4a2b-b1ac-1157a0a49809 | SibgatullinAP/HomeWork | 6sem/ibm/hw2/solver.h | #ifndef SOLVER_H
#define SOLVER_H
class arguments;
int solve_mpi (arguments args, double *matrix, double *x, double *rhs, double *block_column, double *block_1, double *block_2);
void gaussian_elimination_mpi (arguments args, double *matrix, double *rhs,
double *x, double *block_1, doub... | ALGO | 0.999529 | 4.95468 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2020-09-26T21:05: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": "c65b3d859... |
2144864c-371b-4c8f-bd69-03eb35d79a7c | Valentino-R/CPP | Exercices/ticTacToeV3.cpp | #include <iostream>
#include <stdlib.h>
#include <ctime>
void drawBoard(char* spaces);
void palyerMove(char* spaces, char player);
void computerMove(char* spaces, char computer, char player);
bool checkWin(char* spaces, char player, char computer);
bool checkTie(char* spaces);
int main ()
{
char spaces[9] = {' ',... | ALGO | 0.998847 | 4.17806 | {
"github_metadata": {
"branch": "main",
"commit_count": 15,
"repo_created_at": "2025-03-14T12:56: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": "a30e184c63b... |
181db863-dbb7-4d35-a738-5e4bd73434bb | mrnorman/miniWeather | cpp/miniWeather_mpi_parallelfor.cpp |
//////////////////////////////////////////////////////////////////////////////////////////
// miniWeather
// Author: <NAME> <<EMAIL>> , Oak Ridge National Laboratory
// This code simulates dry, stratified, compressible, non-hydrostatic fluid flows
// For documentation, please see the attached documentation in the "do... | ALGO | 0.998218 | 5.699883 | {
"github_metadata": {
"branch": "main",
"commit_count": 361,
"repo_created_at": "2018-07-24T02:29:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 163,
"forks": 74,
"issues": 3,
"pull_requests": 3
},
"file_meta": {
"content_id": "9f01f52... |
9d0d66c6-59f0-41ef-93e2-7856cb35af40 | asdf57/ray-tracing | src/main.cpp | #include <iostream>
#include <algorithm>
#include "constants.h"
#include "color.h"
#include "hittable.h"
#include "hittable_list.h"
#include "sphere.h"
constexpr double ASPECT_RATIO = 16.0 / 9.0;
constexpr int IMAGE_WIDTH = 400;
//Floor at 1 to prevent integer casting from providing height of 0
constexpr int IMAGE_HEI... | ALGO | 0.963433 | 5.561582 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2023-12-16T00:52: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": "895b30cf33a... |
ce277b7b-7c93-4d3e-a5e7-711c10bad365 | ishandutta2007/codeforces-f | fastmath/normal/1388/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
#define debug(x) st... | ALGO | 0.999741 | 4.014177 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43: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": "7578d813bf05... |
cf159033-9559-4af9-9d67-5a19cb1065f6 | GiovA07/Automata-y-Lenguajes | automatas/DFA/DFA.h | #ifndef DFA_H
#define DFA_H
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <utility> // Para std::pair
#include "../InterfaceFiniteAutomata.h"
#include <string>
using namespace std;
class DFA : public InterfaceFiniteAutomata {
private:
set<int> k; /... | ALGO | 0.977995 | 4.94228 | {
"github_metadata": {
"branch": "main",
"commit_count": 38,
"repo_created_at": "2024-04-01T16:24: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": "d76a56dfd8e... |
0b1bb94d-98a2-4a30-a930-a94d5c8a10e7 | ezhou2008/algorithm-basic | cpp2/540-Zigzag-Iterator.cpp | /*Zigzag Iterator
Description
Given two 1d vectors, implement an iterator to return their elements alternately.
Have you met this question in a real interview? Yes
Example
Given two 1d vectors:
v1 = [1, 2]
v2 = [3, 4, 5, 6]
By calling next repeatedly until hasNext returns false,
the order of elements returne... | ALGO | 0.999967 | 6.062856 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2017-03-15T16:33: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": "badca4be33... |
f5974965-d633-4cde-b71f-3a6153de9735 | LunchOn13/PbSolve | week1/Week1_2_12161638_JongWonLee.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin >> t;
for (int i = 0; i < t; i++)
{
int n;
cin >> n;
vector<int> stack;
int q;
... | ALGO | 0.999513 | 3.795595 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-12-16T15:23: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": "8e3995da84... |
5373fc86-cdf8-4d55-bede-876250be7933 | HirenJoshi16/Self_dsa | 170-listProduct.cpp | #include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
struct node{
int data;
struct node *next;
};
void createList(struct node *head){
struct node *p = head;
int i=1, limitSize=3, data;
while(i <= limitSize){
struct node *node = (struct node*)malloc(sizeof(struct ... | ALGO | 0.999707 | 3.760283 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-04-05T17:28: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": "eaa7d288fc5c... |
c652c714-52af-4ccd-b95a-61c94804bd8c | hwliu11/Mobius | src/geom/occ/Standard_Real.cxx | // Copyright (c) 1998-1999 <NAME>
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the ... | TOOL | 0.944244 | 5.686724 | {
"github_metadata": {
"branch": "master",
"commit_count": 266,
"repo_created_at": "2024-04-12T14:44: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": "9ffddfdb... |
48eece9c-e8f0-4cb3-bdbf-18c9fa55f5bd | ItaiiCadena/poo_1 | exercises/Apuntadores/e_puntero_02.cpp | /*
Comprobar si un numero es par o impar, y mostrar
la posicion de memoria donde se esta guardando el numero.
CON PUNTEROS
*/
#include <iostream>
using namespace std;
int main(){
int numero, *dir_num;
//Pedimos numero al usuario
cout << "Digite un numero: "; cin >> numero;
dir_num = № ... | ALGO | 0.993908 | 3.679452 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-06-28T03:48:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "394dc5db816b... |
e85ae621-bbbb-4e84-9c12-2ade126dc7be | Marius-Juston/Autonomous-Vehicule | C++/HistogramFilterOptimization/blur.cpp | #include "headers/blur.h"
#include "headers/zeros.h"
using namespace std;
vector<vector<float> > blur(vector<vector<float> > &grid, float blurring) {
float corner = blurring / 12.0f, adjacent = blurring / 6.0f;
vector<vector<float> > window = {{corner, adjacent, corner},
... | ALGO | 0.997115 | 5.415446 | {
"github_metadata": {
"branch": "master",
"commit_count": 94,
"repo_created_at": "2020-03-21T20:17: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": "f1a9b50f8... |
f0bece51-2a87-4a22-85f0-8690910be55d | heyyytamvo/AlgorithmAndDataStructure | Lec05-BreadthFirstSearch/KefaAndPark.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cstring>
using namespace std;
int numberOfVertices;
int maxCat;
vector<int> adj[100001];
int Cat[100001];
int path[100001];
bool visited[100001];
vector<int> leaveList;
//consecutive
bool canGo(int end){
int start = 1;
int... | ALGO | 0.998715 | 4.145525 | {
"github_metadata": {
"branch": "main",
"commit_count": 61,
"repo_created_at": "2022-12-30T09:14:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c0a4788ac27... |
e21c22d3-ad6b-4d54-a442-a8288d2fd100 | cms-sw/cmssw | HeterogeneousCore/CUDAUtilities/interface/cudastdAlgorithm.h | #ifndef HeterogeneousCore_CUDAUtilities_cudastdAlgorithm_h
#define HeterogeneousCore_CUDAUtilities_cudastdAlgorithm_h
#include <utility>
#include <cuda_runtime.h>
// reimplementation of std algorithms able to compile with CUDA and run on GPUs,
// mostly by declaringthem constexpr
namespace cuda_std {
template <t... | ALGO | 0.999524 | 6.929338 | {
"github_metadata": {
"branch": "master",
"commit_count": 251237,
"repo_created_at": "2013-06-26T14:09:07.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1144,
"forks": 4480,
"issues": 947,
"pull_requests": 108
},
"file_meta": {
"content_id... |
07af8b61-6b42-4906-afec-3f1a3eeba1da | Mamim57/Data-Structure-Algorithm | Graph/Prims.cpp | #include <bits/stdc++.h>
using namespace std;
const int INF = 1e9; // Represents infinity
void prim(int V, int G[5][5])
{
int parent[V]; // Stores MST
int key[V]; // Minimum weights to add vertices
bool mstSet[V]; // Tracks vertices in MST
for (int i = 0; i < V; i++)
{
key[i] = IN... | ALGO | 0.999996 | 5.02647 | {
"github_metadata": {
"branch": "main",
"commit_count": 45,
"repo_created_at": "2024-12-08T11:24: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": "f2ea1a07d3c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.