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 |
|---|---|---|---|---|---|---|---|
2965f81e-6596-4523-ad03-934efe5e4ab4 | EunJung516/BOJ | 00001~05000/2667_단지번호붙이기.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
int N, curX, curY, nxtX, nxtY;
char ch;
int mp[30][30], visited[30][30];
int dx[] = { 0,0,-1,1 }, dy[] = { 1,-1,0,0 };
queue<pair<int, int>> q;
vector<int> ans;
int main() {
cin >> N;
for (int i = 0; i < N; ++i) {
for... | ALGO | 0.999967 | 4.070928 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2021-06-27T06:41: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": "788dcb958ad... |
db7c9e79-b7b6-4ace-a294-c108c6258fc2 | ColdeZhang/Note_of_IOI | 算法模版/GT/tarjan-lca.cpp | #include <cstdio>
#define re register
#define rep(i, a, b) for(re int i = (a); i <= (b); ++ i)
#define Rep(i, a, b) for(re int i = (a); i < (b); ++ i)
#define fwd(i, u) for(re int i = head[(u)]; i; i = e[i].nxt)
#define qfwd(i, u) for(re int i = qhead[(u)]; i; i = q[i].nxt)
const int N = 1e6 + 5;
const int M = 2e6 +... | ALGO | 0.999984 | 3.452497 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-01-19T05:12:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 19,
"forks": 10,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b297a81c... |
b58dfa3e-efe2-4316-987c-3646add13412 | irvifa/online-judges | tlx/tlx-2017-06-21/penjumlahan-pecahan.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll gcd(ll a, ll b) {
if(b==0) return a;
return gcd(b,a%b);
}
void simpliest(ll &f, ll &e) {
ll com;
com = gcd(e,f);
f = f/com;
e = e/com;
}
void addFraction(ll a, ll b, ll c,
ll d, ll &e, ll &f) {
... | ALGO | 0.999881 | 4.080446 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2020-03-11T13:44:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d041e5563... |
bc52be86-f71e-4ba9-9833-3bcfc9d86e2e | dakshp07/LeetCode | 844-backspace-string-compare/844-backspace-string-compare.cpp | class Solution {
public:
bool backspaceCompare(string s, string t) {
// one way is to use two stacks and run through both strings parallely
// tc: O(n) and sc: O(2*n) at max where n is size of s,t
// other way is to use one stack and empty it everytime after processing one string
// ... | ALGO | 0.999861 | 5.652634 | {
"github_metadata": {
"branch": "main",
"commit_count": 1988,
"repo_created_at": "2021-09-30T13:56:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2cfe97cd... |
8bb46e37-a05c-490d-8e09-00009531c9ea | MrCharlesSG/Algorithmic-Techniques | 7. Digrafos Valorados, Dijkstra/7.4-Mejor Camino/Source.cpp |
/*@ <authors>
*
* Nombre, apellidos y usuario del juez (TAISXX) de los autores de la solución.
*
*@ </authors> */
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <unordered_map>
#include "DigrafoValorado.h"
#include "IndexPQ.h"
using namespace std;
template <typename Valor>
c... | ALGO | 0.999975 | 4.955052 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-03-28T16:55:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "472bf518818d... |
01567700-ecd2-43c7-bc88-18a28283a053 | zerolxf/zero | zhuanti/rand/cc.cpp |
/*
POJ 1739
不增加行。
起点和终点特殊处理
G++ 47ms
*/
#include<iostream>
#include<string.h>
#include<algorithm>
#include<stdio.h>
using namespace std;
#define pr(x) cout << #x << " = " << x << " ";
#define prln(x) cout << #x << " = " << x <<endl;
#define ll long long
const int MAXD=15;
const int HASH=10007;
const int STA... | ALGO | 0.999977 | 3.679221 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2015-12-31T07:38:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4a8792a... |
7922d569-67b4-4ac3-af61-c5ca54256498 | sarker306/LightOJ | lightOJ__1199.cpp | #include <cstdio>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <ctime>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
... | ALGO | 0.999513 | 3.569916 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2013-12-27T08:24:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8ba9a7bc6f... |
45e837be-da8d-49cc-a560-77cc222e2a28 | t3nsor/SPOJ | roman.cpp | // 2023-10-15
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
string o(string s) {
string r;
for(int i=0;i<s.size();i++) {
r.push_back(s[i]-64);
}
return r;
}
string R[10][10] = {
{"", "m", "mm", "mmm", o("iv")},
{"", "c", "cc", "ccc", "cd", "d", "dc", "dcc", "dccc"... | ALGO | 0.999816 | 3.989692 | {
"github_metadata": {
"branch": "master",
"commit_count": 392,
"repo_created_at": "2014-10-08T22:07:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 248,
"forks": 102,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "3b1d... |
0bc0c6be-3912-4b87-9287-1100c882f12a | VictorDubois/goal_strategy | include/krabilib/strategie/etape.h | #pragma once
#include "krabilib/position.h"
#include <vector>
#define ETAPE_INVALID_IDX -1
class ActionGoTo;
class MediumLevelAction;
class Etape
{
public:
/** @brief Enum des types d'étape possible (un feu, un point de passage...) */
enum EtapeType
{
DEPART = 0x01,
//#ifdef GOLDO2018
... | ALGO | 0.905326 | 5.744967 | {
"github_metadata": {
"branch": "feature/strat-2024",
"commit_count": 377,
"repo_created_at": "2020-11-06T22:17:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id... |
b7c9ee1e-46d2-4658-a5f1-afd46f9a498e | Wan-YunPeng/leetcode | 4Sum_9_25/4Sum_9_25/main.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std;
vector<vector<int>> solution1(vector<int>& num, int target);
// 利用map存储两个数之和
vector<vector<int>> solution2(vector<int>& num, int target);
// 同上,不过使用multimap
vector<vector<int>> solution3(vector<int>& num, int targ... | ALGO | 0.999949 | 4.283954 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-10-17T05:21: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": "1289756dd4... |
6bb6ee05-2f46-4cca-ac75-132b95c9e787 | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p03142/s584585327.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
void... | ALGO | 0.999991 | 3.828389 | {
"github_metadata": {
"branch": "main",
"commit_count": 243,
"repo_created_at": "2025-06-06T16:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 3,
"pull_requests": 0
},
"file_meta": {
"content_id": "a3ff512b44... |
c948ec53-2dce-44d2-8753-afb76c7fabaa | AiratZa/Proxy_SQL_Logger | Config.cpp | //
// Created by airat on 04.04.2021.
//
#include "Config.hpp"
Config::Config(char *argv[])
{
for (int i = 1; i < 4; i++)
{
parseParam(std::string(argv[i*2-1]), std::string(argv[i*2]));
}
}
void Config::parseParam(const std::string& param_name, const std::string& value)
{
if (param_name == U... | CONFIG | 0.966301 | 5.031662 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-04-04T18:23: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": "c053f5fac8... |
b753f471-f01c-4641-ab27-d054e93d1ea5 | dralves/sp1-sp2-galois | lonestar/experimental/meshsingularities/tests/BlasTest.cpp | /*
* This file belongs to the Galois project, a C++ library for exploiting parallelism.
* The code is being released under the terms of the 3-Clause BSD License (a
* copy is located in LICENSE.txt at the top-level directory).
*
* Copyright (C) 2018, The University of Texas at Austin. All rights reserved.
* UNIVER... | TEST | 0.988655 | 6.363093 | {
"github_metadata": {
"branch": "master",
"commit_count": 7804,
"repo_created_at": "2018-09-11T20:57:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "45f3e49... |
9f9cf2d5-3a17-4a3b-86f9-22d0540446aa | hailingu/leet_lint_code | leet_lint_code/lint_code/merge_two_sorted_arrays.cpp | // Copyright © 2018 <NAME>. All rights reserved.
// License(GPL)
// Author: <NAME>
// This is a answer of lint code problem 6.
#ifndef LEETLINTCODE_LINTCODE_MERGETWOSORTEDARRAYS_CPP
#define LEETLINTCODE_LINTCODE_MERGETWOSORTEDARRAYS_CPP
#include <vector>
class MergeTwoSortedArrays {
public:
std::vector<int> merg... | ALGO | 0.999971 | 6.373173 | {
"github_metadata": {
"branch": "master",
"commit_count": 485,
"repo_created_at": "2020-04-24T10:10: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": "fbfa0805... |
3e9ded28-5cdc-44c6-91f1-db4e28dee6a6 | calgagi/adventofcode | 2020/10/B.cpp | /*
* generated by github.com/calgagi/cp_gen
* file: A.cpp
* time: Wed Dec 9 21:01:28 2020
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
void solve() {
int x;
vector<int> in;
while (cin >> x) {
in.push_back(x);
}
int n = in.size();
... | ALGO | 0.999487 | 3.969848 | {
"github_metadata": {
"branch": "main",
"commit_count": 58,
"repo_created_at": "2020-12-02T05:25:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "32beb0bdfd8... |
ff7b84cc-8359-467c-b83c-77bc0c094f34 | anupam-kumar-krishnan/Competitive_Programming | All Algorithms/01_0-1_kanpshak.cpp | #include<bits/stdc++.h>
using namespace std;
int dp[1000][1000];
int knapSack(int W, int wt[], int val[], int n)
{
if(n == 0 || W <= 0){
return 0;
}
if(dp[n][W] != -1) return dp[n][W];
if(wt[n - 1] <= W){
return dp[n][W] = max(val[n-1] + knapSack(W-wt[n-1], wt, val, n-1), knapSack(W,... | ALGO | 0.999999 | 4.368103 | {
"github_metadata": {
"branch": "main",
"commit_count": 1879,
"repo_created_at": "2021-01-01T13:15:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 219,
"forks": 410,
"issues": 0,
"pull_requests": 3
},
"file_meta": {
"content_id": "b8653... |
c951eaef-c6a1-41cc-a87a-0d626fdc8c34 | T-R0D/Past-Courses | CS302/PA05/search.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#include "Timer.h"
const int numSearches = 100000;
// ABC that gives an interface for the various search implementations
// This allows each class to act like a function by defining
// operator() which takes a search value and sorted li... | ALGO | 0.999369 | 5.859083 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-07-17T02:17:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 16,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "053c7919f... |
230d1000-bd45-4698-969c-74042599e054 | BHUVI-SHIP-IT/its-me | 2610-closest-prime-numbers-in-range/closest-prime-numbers-in-range.cpp | class Solution {
public:
vector<int> closestPrimes(int left, int right) {
vector<bool> isPrime(right + 1, true);
sieve(isPrime, right); // Mark primes using Sieve of Eratosthenes
vector<int> primesInRange;
for (int i = max(2, left); i <= right; i++) {
if (isPrime[i]) {
... | ALGO | 0.99999 | 5.585963 | {
"github_metadata": {
"branch": "main",
"commit_count": 338,
"repo_created_at": "2024-09-22T06:46: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": "c22da63305... |
7dea1dae-c39c-4a5c-b828-7757baa14a23 | luoshunchong/Cplusplus-Leetcode | LeetCode_ccagml/141.linked-list-cycle.cpp | // @lcpr-before-debug-begin
// @lcpr-before-debug-end
/*
* @lc app=leetcode.cn id=141 lang=cpp
* @lcpr version=21913
*
* [141] 环形链表
*/
// @lc code=start
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
... | ALGO | 0.999986 | 5.775526 | {
"github_metadata": {
"branch": "main",
"commit_count": 152,
"repo_created_at": "2021-06-17T02:48: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": "e60a77394e... |
1c8f9094-76ba-42ea-b151-27ad049785e2 | YashhhCodesHere/Cpp-DSA-Questions-Practice | Class & Lab Practics/LAB 4/test.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int val){
data = val;
next = nullptr;
}
};
class LinkedList{
public:
Node* head;
LinkedList(){
head = nullptr;
}
void insertAtHead(int val){
Node* newNo... | ALGO | 0.999831 | 5.612657 | {
"github_metadata": {
"branch": "main",
"commit_count": 350,
"repo_created_at": "2024-09-01T07: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": "d02769a4ba... |
84b6e41c-3982-4fd5-871f-586cebf360d8 | Maaz-14/DSA | Arrays/Swap_Max_Min_Elements.cpp | #include <iostream>
using namespace std;
void swapMax_Min(int* array, int size) {
int max = array[0];
int min = array[0];
int indexMax = 0, indexMin = 0;
for (int* ptr = array+1; ptr < array + size; ptr++) {
if (*ptr > max) {
max = *ptr;
// cout<<"ptr: "<<ptr<<endl;
... | ALGO | 0.999948 | 5.178422 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2025-01-18T21:01: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": "5da4a3edba9... |
8104938a-7b99-4eda-85e1-840f3ee5da39 | hcmlab/ssi | libs/build/openSMILE-2.2rc1/src/include/functionals/functionalExtremes.hpp | /*F***************************************************************************
* openSMILE - the open-Source Multimedia Interpretation by Large-scale
* feature Extraction toolkit
*
* (c) 2008-2011, <NAME>, <NAME>, <NAME>: TUM-MMK
*
* (c) 2012-2013, <NAME>, <NAME>, <NAME>: TUM-MMK
*
* (c) 2013-2014 audEERING ... | TOOL | 0.910836 | 6.339489 | {
"github_metadata": {
"branch": "master",
"commit_count": 342,
"repo_created_at": "2017-02-22T10:17:18.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 62,
"forks": 26,
"issues": 7,
"pull_requests": 1
},
"file_meta": {
"content_id": "0e4b6c7... |
879bd09b-e303-40b4-9b7a-20bb4bb7f995 | Rishi-11-2/CP | E_Romantic_Glasses.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using namespace chrono;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define debug(x...) { cout << "(" << #x << ")" << " = ( "; PRINT(x); }
tem... | ALGO | 0.999938 | 4.479069 | {
"github_metadata": {
"branch": "main",
"commit_count": 82,
"repo_created_at": "2023-10-19T06:20:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "188cdc11227... |
9a6dd8b9-e6b1-4af0-89ea-163a7995650c | GANGE666/xVMP | src/tools/llvm-exegesis/lib/Clustering.cpp | //===-- Clustering.cpp ------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | ALGO | 0.993966 | 7.238499 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2022-12-23T13:59:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 503,
"forks": 109,
"issues": 8,
"pull_requests": 0
},
"file_meta": {
"content_id": "b0aea... |
e886cfc1-266d-4372-80dc-0bb4187567ac | cannor147/itmo-dm | lab05-automata/src/b.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
struct Transition {
int destination;
char symbol;
Transition(int destination, char symbol) {
this->destination = destination;
this->symbol = symbol;
}
};
vector<bool> final_states;
vector<int> last_pos;
vecto... | ALGO | 0.999972 | 5.129374 | {
"github_metadata": {
"branch": "master",
"commit_count": 20,
"repo_created_at": "2019-09-22T08:31:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 2,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "532225b67... |
dda2fb77-78bf-4053-90d5-46cc67fb8140 | abhay121kumar/Ninja | l3 recurssion 1/Lecture Question/xTothePowerN.cpp | /*
@csalgo
Coding Problem
Problem Statement: x to the power n
Problem Level: EASY
Problem Description:
Write a program to find x to the power n (i.e. x^n). Take x and n from the user. You need to return the answer.
Do this recursively.
Input format :
Two integers x and n (separated by space)
Output Format :
x^n (i.e.... | ALGO | 0.999883 | 5.509968 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2023-09-06T07:07:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a1939d906... |
57d47280-7d99-4e51-82e9-75bab4993b89 | cctbx/cctbx_project | cctbx/miller/math.h | #ifndef CCTBX_MILLER_MATH_H
#define CCTBX_MILLER_MATH_H
#include <cctbx/sgtbx/space_group.h>
namespace cctbx { namespace miller {
/*! sum((w/epsilon)*data) / sum(w)
anomalous_flag = true: w = 1
anomalous_flag = false: w = 1 for centric reflections
w = 2 for acentric reflec... | ALGO | 0.994703 | 5.914682 | {
"github_metadata": {
"branch": "master",
"commit_count": 38660,
"repo_created_at": "2015-07-22T13:36:27.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 256,
"forks": 121,
"issues": 120,
"pull_requests": 31
},
"file_meta": {
"content_id": "... |
cb929b4f-357d-45f6-9a13-77dcd0ec26e3 | Langtienh/DSA | QHĐ - Với đệ quy có nhớ/DPRCTRT.cpp | #include <iostream>
#include <algorithm>
#define llong long long
using namespace std;
llong dp[106][106][3];
bool avail[106][106][3];
int n, a[106];
void init() {
for(int i=1; i<=n; ++i)
for(int j=1; j<=n; ++j) avail[i][j][1] = avail[i][j][2] = false, dp[i][j][1] = -1e18, dp[i][j][2] = 1e18;
}
llong get_res... | ALGO | 0.998666 | 3.487552 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-17T06:20:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "62b0c02c534b... |
a5974c7b-b9ca-45de-90c7-29b2c45ea4c2 | apajon/WPG_spline_-_DE | Simulation_3D/utility/GaussSeidel.h | /*
* GaussSeidel.h
*/
#include <Eigen/Dense>
#include <Eigen/StdVector>
// #ifndef _GAUSS_SEIDEL_H_
// #define _GAUSS_SEIDEL_H_
//#include "mex.h"
using namespace std;
using namespace Eigen;
class GaussSeidel {
public:
typedef std::vector<Matrix3d,aligned_allocator<Matrix3d> > MatrixArray;
typedef Matrix... | ALGO | 0.994609 | 5.252637 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2017-10-02T12:49: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": "23c2f63ef0... |
721f9141-809e-4819-b0f9-26a7e08a0d6e | josh-mc/terminaldigits | src/tests.cpp |
#include <Rcpp.h>
#include "terminaldigits.h"
using namespace Rcpp;
//[[Rcpp::export]]
DataFrame perm_basic(int distribution,
int duplicates,
int set_n,
double set_mean,
double set_sd,
int decimals,
... | TEST | 0.917294 | 6.244201 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2022-05-01T10:41: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": "4188641b685... |
62126e7d-f062-4f24-8264-0e949c49ea60 | phamdinhanhtuan/data-structures-and-algorithms | pr22.c++ | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct integerSequence {
int data ;
struct integerSequence *next ;
} node ;
void clearBuffer () {
while (getchar () != '\n') ;
}
void lexit () {
exit (EXIT_FAILURE) ;
}
node *makeNode (int value) {
node *newNode = (node*)malloc(sizeof (node)) ... | ALGO | 0.999163 | 3.884357 | {
"github_metadata": {
"branch": "main",
"commit_count": 75,
"repo_created_at": "2025-02-20T00:44: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": "7757678b607... |
f097fdc9-b384-4ffd-930b-bc03d712eb8d | Abir1373/XPSC-2 | W16/Extra/B_250_Thousand_Tons_of_TNT.cpp | // <NAME>
// author : <NAME>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std ;
#define f first
#define s second
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define ll long... | ALGO | 0.999897 | 4.104517 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2025-01-05T13:57:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "551e088d628... |
f4823770-4e73-4cfb-ac0c-89aaba03a3a7 | IshwariK117/C_plusplus_Basics | find_duplicate_in_array.cpp | #include <iostream>
using namespace std;
int main()
{
bool foundDuplicate = false;
const int MAX_SIZE = 100; // Maximum size of the array
int array[MAX_SIZE] = {1, 2, 3, 4, 2, 3, 5}; // Example array
int size = 7; // Number of elements in the array
... | ALGO | 0.998073 | 4.629289 | {
"github_metadata": {
"branch": "main",
"commit_count": 31,
"repo_created_at": "2024-07-29T18: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": "46952b78949... |
d0777ce0-87ac-44b5-9906-6c8e2a0db0b5 | phUR99/TEST | 백준/Platinum/18138. 리유나는 세일러복을 좋아해/리유나는 세일러복을 좋아해.cc | #include <bits/stdc++.h>
using namespace std;
#define fastio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
#define ll long long
int n, m;
int aMatch[205], bMatch[205];
int A[205], B[205];
bool adj[205][205];
bool visited[205];
bool dfs(int a)
{
if (visited[a])
return fa... | ALGO | 0.999969 | 3.999812 | {
"github_metadata": {
"branch": "main",
"commit_count": 1693,
"repo_created_at": "2023-08-27T13:55:38.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9dfd1b789... |
42167d36-c728-4046-b990-7c5df84e04f2 | harshgandhi-1999/my-cpp-files | A_Sasha_and_His_Trip.cpp | // codeforces round #539 div2 A
#include <bits/stdc++.h>
using namespace std;
#define endl ("\n")
#define pi (3.141592653589)
#define mod 1e9 + 7
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) cc.begin(), c.end()
#define rrep(i, n) for (int i = n - 1; i ... | ALGO | 0.999958 | 3.434957 | {
"github_metadata": {
"branch": "main",
"commit_count": 19,
"repo_created_at": "2020-12-27T14:29:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bbe0d729d44... |
e4fe42e9-f710-4333-b948-633326dc36eb | tejas249/Data-Structure-And-Algorithms | Binary_Search_Tree/LCA_BST_LC235.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
if(root ==... | ALGO | 0.999991 | 6.351589 | {
"github_metadata": {
"branch": "main",
"commit_count": 77,
"repo_created_at": "2023-11-19T06:28:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "03a834e64b3... |
e936f743-8b10-42c0-bb4a-8eec21859b18 | abhinavgpt1/DSA-cpp | DSA-self/Graphs (Striver-TUF)/MaximumConnectedGroup(gfg_hard).cpp | /**
* Maximum Connected Group
* -----------------------
* You are given an n x n binary grid. A grid is said to be binary if every value in grid is either 1 or 0.
* You can change at most one cell in grid from 0 to 1.
* You need to find the largest group of connected 1's.
* Two cells are said to be connected if ... | ALGO | 0.999951 | 5.988961 | {
"github_metadata": {
"branch": "master",
"commit_count": 24,
"repo_created_at": "2023-03-11T17:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3f2a91d2e... |
fbe0146a-d134-4637-bf8f-ba54364185c3 | vishal-ayyappan/dsa_cpp | Leetcode/Difficulty/Hard/lc4.cpp | #include<bits/stdc++.h>
using namespace std;
/*
Median of 2 sorted arrays
*/
//Brute
/*
0/ Use extra space to sort and then find the median
*/
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int m = nums1.size();
int n = nums2.size();
int i = 0;
int j = 0;
vector<int> sor... | ALGO | 0.999993 | 5.597445 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2025-06-24T17:43: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": "8cb874b847e... |
3fb8fe17-3b19-4db7-b761-50d3bcefd3d3 | abhiabhishek19/dsapractice | 0206-reverse-linked-list/0206-reverse-linked-list.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 {
private:
// void Solve(ListNo... | ALGO | 0.999955 | 5.757843 | {
"github_metadata": {
"branch": "main",
"commit_count": 163,
"repo_created_at": "2024-02-24T18:47: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": "b953dfab09... |
add954c7-bd71-48e6-b16c-d5f4e588ab6c | harrisonzhy/mean-mst | kruskal.hh | #pragma once
#include "setup.hh"
template<size_t S>
class KruskalSOA {
public :
static auto findset (GraphSOA<S> &G, int i) -> int {
if (G.vertices.parent[i] != i) {
G.vertices.parent[i] = findset(G,G.vertices.parent[i]);
}
return G.vertices.parent[i];
... | ALGO | 0.999711 | 5.043973 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-06-30T03:58: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": "dd6a98e7bf88... |
2cc4af6b-a496-4e15-a591-58ce64b4fa26 | ishandutta2007/codeforces-x | xellos/normal/547/A.cpp | // iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_T... | ALGO | 0.999912 | 3.251255 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:38: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": "0923638a0658... |
27f0fc21-9ba7-4317-b98e-1f357c2aa7b5 | lxiao217/study428 | 深度学习/源码/OpenCV/opencv_contrib/modules/ximgproc/samples/fld_lines.cpp | #include <iostream>
#include "opencv2/imgproc.hpp"
#include "opencv2/ximgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
using namespace std;
using namespace cv;
using namespace cv::ximgproc;
int main(int argc, char** argv)
{
std::string in;
cv::CommandLineParser parser(argc, argv, ... | TOOL | 0.986143 | 6.067929 | {
"github_metadata": {
"branch": "main",
"commit_count": 46,
"repo_created_at": "2023-05-29T01:51:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 141,
"forks": 28,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "44d75e81... |
09c80cf6-2542-4479-bd94-4b1552f0ae57 | Pipi24/OJ | first_time/leetcode/c++/647. Palindromic Substrings.cpp | /*
枚举回文中心,每扩展一次,回文数量加1
一共2n-1个中心,奇数和偶数两种回文情况
时间:O(N^2)
空间:O(1)
*/
class Solution {
public:
int countSubstrings(string s) {
int n = s.size(), ans = 0;
for (int i = 0; i < 2 * n - 1; ++i) {
int l = i / 2, r = i / 2 + i % 2;
while (l >= 0 && r < n && s[l] == s[r]) {
... | ALGO | 0.999987 | 5.894934 | {
"github_metadata": {
"branch": "master",
"commit_count": 272,
"repo_created_at": "2018-02-01T08:52: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": "8e2c7e65... |
1928520e-fb3c-4e8c-9935-0ff843a9c7ab | bayashi-cl/procon-submission | atcoder/abc222/abc222_e/26460720.cpp | #include <atcoder/math>
#include <atcoder/modint>
#include <boost/range/irange.hpp>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <valarray>
#include <vector>
na... | ALGO | 0.999983 | 4.802394 | {
"github_metadata": {
"branch": "main",
"commit_count": 3734,
"repo_created_at": "2022-01-03T06:42: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": "c4cab70f3... |
bdab4a02-b084-4738-b4fc-f205f717e928 | BandhiyaHardik/GeeksForGeeks_Solutions | POTD_2024/01January/20Jan_Distribute_candies_in_a_binary_tree.cpp | class Solution
{
public:
int distributeCandy(Node* root)
{
map<Node *, int> subtree, candies;
int ans = 0;
function<void(Node *)> dfs1 = [&](Node * node) {
if(!node)
return;
subtree[node] = 1;
candies[node]... | ALGO | 0.999975 | 5.20536 | {
"github_metadata": {
"branch": "master",
"commit_count": 951,
"repo_created_at": "2023-02-05T05:04:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89c85ab8... |
2c996922-d506-4cc3-bf7e-ba036d16ae41 | myoung-jin-na/mil10 | work/src/MIL-32/Examples/General/Mblob/C++/mblob.cpp | /*******************************************************************************/
/*
* File name: MBlob.cpp
*
* Synopsis: This program loads an image of some nuts, bolts and washers,
* determines the number of each of these, finds and marks
* their center of gravity using the Blob analysis ... | ALGO | 0.94378 | 5.453462 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-11-09T12:18:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e8b8666d84... |
ad4c47f7-e0e4-406f-86bd-ac0713ee3c4a | ljshou/workspace | algorithm/simple-algos/knapsack.cc | /* 0-1 knapsack */
/* implemented by L.J. in Oct.30, 2013 */
#include <iostream>
#include <algorithm>
using namespace std;
const int kN=10; //k means const
const int kV=10;
struct node
{
int volume;
int value;
}g_item[kN]; //global variable starting with g_
int g_s[kV+1] = {0};
void ZeroOnePack(int cost, int ... | ALGO | 0.999022 | 3.663657 | {
"github_metadata": {
"branch": "master",
"commit_count": 78,
"repo_created_at": "2014-11-02T07:42: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": "ae74d7793... |
5b82059b-ac21-495d-af42-9d4a0a2e1f5b | Ayush29Ayush/leetcode-gfg-problems | 503-next-greater-element-ii/503-next-greater-element-ii.cpp | //!Brute Force Approach:
// class Solution {
// public:
// vector<int> nextGreaterElements(vector<int> &nums){
// int n = nums.size();
// vector<int> ans(n);
// for (int i = 0; i < n; i++){
// ans[i] = -1;
// for (int j = 1; j < n; j++){
// if (nums[i]... | ALGO | 0.999986 | 5.557536 | {
"github_metadata": {
"branch": "main",
"commit_count": 3511,
"repo_created_at": "2021-11-28T15:53:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1d2d7b0fa... |
0e1d6b5a-d216-41f5-91fc-440a12c1994b | lballabio/quantlib-old | QuantLibAddin/qlo/getcovariance.hpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2006 <NAME>
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it and/or modify... | ALGO | 0.949442 | 6.973433 | {
"github_metadata": {
"branch": "master",
"commit_count": 18714,
"repo_created_at": "2013-06-06T07:47:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 473,
"forks": 399,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50... |
9d314959-8c89-4e01-acce-a8bca8436aeb | RonaldSun/VI-Stereo-DSO | src/FullSystem/CoarseTracker.h | /**
* This file is part of DSO.
*
* Copyright 2016 Technical University of Munich and Intel.
* Developed by <NAME> <engelj at in dot tum dot de>,
* for more information see <http://vision.in.tum.de/dso>.
* If you use this code, please cite the respective publications as
* listed on the above website.
*
* DSO is free s... | ALGO | 0.960284 | 5.826487 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2019-03-06T02:59:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 396,
"forks": 128,
"issues": 30,
"pull_requests": 0
},
"file_meta": {
"content_id": "3cb4... |
9d63be42-ece0-4384-b5d3-dcfb24aa5b48 | capt-farvez/Codeforces_Solutions | Contests/Codeforces Round 871 (Div. 4)/C.cpp | // <NAME> //
#include <bits/stdc++.h>
#include <iomanip>
#include <cmath>
#define readFirst() (ios_base::sync_with_stdio(false), cin.tie(NULL));
#define ll long long int
#define vll vector<long long int>
#define mll map<long long int, long long int>
#define pb push_back
#define pp pop_back
#define gcd(x, y) __gcd(x, y... | ALGO | 0.999947 | 3.941884 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2023-03-31T20:25: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": "f313acc4780... |
4fe99e8b-6d6e-416d-97da-70d66ea8a080 | sxs-collaboration/spectre | src/NumericalAlgorithms/Interpolation/BarycentricRationalSpanInterpolator.hpp | // Distributed under the MIT License.
// See LICENSE.txt for details.
#pragma once
#include <complex>
#include <cstddef>
#include "NumericalAlgorithms/Interpolation/SpanInterpolator.hpp"
#include "Options/String.hpp"
#include "Utilities/Gsl.hpp"
#include "Utilities/Serialization/CharmPupable.hpp"
namespace intrp {
... | ALGO | 0.98198 | 7.483048 | {
"github_metadata": {
"branch": "develop",
"commit_count": 17103,
"repo_created_at": "2017-04-07T17:28:20.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 168,
"forks": 202,
"issues": 530,
"pull_requests": 57
},
"file_meta": {
"content_id": ... |
dde9f6f9-e1d7-437f-abac-f085eb863d11 | cogniteam/intel-pengo | docker/openvino/open_model_zoo/demos/pedestrian_tracker_demo/src/distance.cpp | /*
// Copyright (c) 2018 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... | ALGO | 0.960458 | 6.336695 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2020-10-04T12:40:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "929c276a... |
31e68bb4-6125-4ed5-96f0-b0399c8045a2 | marbjorn/Operation-System-Labs | OS_lab2/main.cpp | #include <iostream>
#include <windows.h>
#include "ArrData.h"
#include <math.h>
int minValue;
int maxValue;
double averageValue;
bool createThread(DWORD WINAPI func(LPVOID v), ArrData *array, DWORD &dword)
{
HANDLE hThread = CreateThread( // create thread
NULL, // define if ... | ALGO | 0.999782 | 4.260387 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2023-03-22T10:44: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": "e9efba90268... |
5bb42167-d121-469b-81cd-d2dede78c4fe | gaurav12gk/LeetCode-Solution | 733-flood-fill/733-flood-fill.cpp | class Solution {
public:
int dx[4]={-1,0,1,0};
int dy[4]={0,1,0,-1};
bool isvalid(int x,int y, int n , int m )
{
if(x<0 or y<0 or x> n-1 or y>m-1)return false;
return true;
}
void bfs(int newc ,int sr, int sc, vector<vector<int>> &image)
{
int co = image[sr][sc];
q... | ALGO | 0.999655 | 6.258738 | {
"github_metadata": {
"branch": "main",
"commit_count": 986,
"repo_created_at": "2021-12-24T07: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": "bee30b43f6... |
2d728668-c5c6-4e98-865e-e0a6909e9f02 | IsaacAsante/HackerRank | Problem Solving/Algorithms/Sorting/Running Time of Algorithms/running time of algorithms.cpp | /* Author: <NAME>
* HackerRank URL for this exercise: https://www.hackerrank.com/challenges/runningtime/problem
* Original video explanation: https://www.youtube.com/watch?v=mi7J_97y1yk
* Last verified on: 14 February, 2021
*/
/* IMPORTANT:
* This code is meant to be used as a solution on HackerRank (link above... | ALGO | 0.999966 | 5.367299 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2021-02-16T14:57:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 193,
"forks": 44,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a0f03e43... |
ab2654f9-a0ac-4427-981d-7aea124575cd | sidd412/learning-languages | cpp files/sid24.cpp | // #include<iostream>
// using namespace std ;
// int main(){
// int n ;
// cin>>n ;
// sid[n] ;
// for (int i = 0; i <n; i++)
// {
// cin>>sid[i] ;
// }
// for (int i = 0; i < n; i++)
// {
// }
// return 0 ;
// }
// #include<iostream>
// using namespace std ;
// int main(){
// int n ;
// cin>>n ;
// int sid[n] ;
... | ALGO | 0.999968 | 4.66835 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-03-03T18:23:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c21dd4592a... |
5034a7d1-72c1-49aa-b094-59748059d14f | kateBea/FIB-EDA-Estructura-de-Datos-y-Algoritmos | Problemas de Jutge/Divide and Conquer/P84219.cc | //FIRST OCURRENCE P84219
#include <iostream>
#include <vector>
using namespace std;
/*returns the first position of x in the vector v*/
int i_first_ocurrence(double x, const vector<double>& v, int e, int d)
{
if (e > d) return -1;
int m = (e+d)/2;
if (x < v[m]) return i_first_ocurrence(x, v, e, m-1);
... | ALGO | 0.999643 | 4.876504 | {
"github_metadata": {
"branch": "main",
"commit_count": 11,
"repo_created_at": "2022-08-10T10:48:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b2a17c3438c... |
cc6f2d66-5eda-426c-b1c4-28e27dbec12c | hassanelsherif90/Project | circle.cpp | #include <iostream>
#include <cmath>
using namespace std;
float FunCircle(float r){
const float d = 3.14;
float AreaCircle = d * pow(r, 2);
return AreaCircle;
}
float FunCircle2(float r){
const float d = 3.14;
float AreaCircle = (d * pow(r , 2)) / 4;
return AreaCircle;
}
float FunCircle3(floa... | ALGO | 0.999334 | 3.933936 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2023-03-11T21:01: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": "a4c326e660c6... |
708add63-270e-47da-a0da-cb2616d64a22 | ryandev421/algorithm | LeetCode/568.Maximum_Vacation_Days.cpp | class Solution {
public:
int maxVacationDays(vector<vector<int>>& flights, vector<vector<int>>& days) {
int n = days.size();
int m = days[0].size();
int dy[m][n];
int ans=0;
for(int i = 0; i<m; i++) {
for(int j=0;j<n;j++) {
dy[i][j] = std:... | ALGO | 0.99991 | 5.743042 | {
"github_metadata": {
"branch": "master",
"commit_count": 111,
"repo_created_at": "2018-04-08T10:23:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e289ad78... |
5df5d7a3-eb8e-49a4-9141-d19bc22d2c4d | Abdullah-Builds/Data_Structures_And_Algorithms_Practice_Set_1 | LAB#8/Q1.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int val;
Node *left;
Node *right;
Node(int value)
{
val = value;
left = nullptr;
right = nullptr;
}
Node()
{
left = nullptr;
right = nullptr;
}
};
Node *Built_Tree(Node *&root, in... | ALGO | 0.999992 | 5.31174 | {
"github_metadata": {
"branch": "main",
"commit_count": 42,
"repo_created_at": "2024-09-13T15:04:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "db02ab87ef0... |
e804740d-eb88-442e-abad-0cdce1adc97c | nb9960/DSA | Data Structures/LinkedList/nthfromend.cpp | #include <bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* next;
};
void push(Node **head, int new_data){
Node* new_node = new Node();
new_node->data =new_data;
new_node->next = *head;
*head = new_node;
}
void printNthFromLast(Node *head, int n){
Node *main_ptr = head;
No... | ALGO | 0.99976 | 3.927915 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2020-07-25T11:10:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f5c079fc... |
6d8a1947-1e60-49d9-a447-8c59d04e8ac7 | tamim-18/Graphics-lab | Lab 2/midpoint_circle_sector.cpp | #include <GL/glut.h>
#include <cmath>
#include <iostream>
using namespace std;
float xc = 7, yc = 8; // Circle center
float r = 43; // Circle radius
float startAngle = 30 * M_PI / 180.0; // Start angle in radians
float endAngle = 300 * M_PI / 180.0; // End angle in radians
bool drawSector = true; // Set to ... | ALGO | 0.999732 | 6.772737 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2025-01-29T16:17:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7d0b58b467c... |
2bd78831-cb7f-46a2-b20f-4717d9904c7d | yongxin-xu/Learning | cpp/lru/lru.hpp | #include <iostream>
#include <unordered_map>
#include <list>
using std::pair;
using std::unordered_map;
using std::list;
class LRUCache {
public:
LRUCache(int capacity): _cap(capacity) {}
int get(int key) {
auto mit = _map.find(key);
if (mit == _map.end()) { // key not exists
retu... | ALGO | 0.999014 | 5.883101 | {
"github_metadata": {
"branch": "main",
"commit_count": 22,
"repo_created_at": "2021-08-01T09:04:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba62df04976... |
136a1c9b-0150-40e4-aba8-163121b79020 | lcchen008/graph | tools/dag_profiler.cpp | // This util generates a histgram according to out-degree.
// The input is 0-based.
#include <algorithm>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <sstream>
#include <stdlib.h>
#include "graph.h"
using namespace std;
template <class VertexValue, class EdgeValue>
graph<VertexValue, EdgeValu... | ALGO | 0.983392 | 4.245318 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2014-10-10T05:02:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "52a85307d9... |
56fb859b-1572-4069-a4b1-475c236b15b3 | PRACHURYAPRANSRAMA/Codeforces-contest | 20 JUNE 2021/20JUNE2021.cpp | //
// main.cpp
// 20 JUNE 2021
//
// Created by <NAME> on 20/06/21.
//
#include<iomanip>
#include<iostream>
#include<vector>
#include<algorithm>
#include<tuple>
#include<string>
#include <iterator>
#include <map>
#include<math.h>
using namespace std;
#define pb push_back
#define nn endl
#define pll pai... | ALGO | 0.999974 | 4.783744 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2021-07-13T13:11: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": "5b6adab70e3f... |
cad81a23-a57e-466b-9ed9-0af8d0bf694b | miskcoo/oicode | bzoj/2169.cpp | /* BZOJ-2169: 连边
* 组合计数 */
#include <cstdio>
const int MaxN = 1010, mod_v = 10007;
int f[MaxN][MaxN], deg[MaxN];
void inc(int& x, int v) { x += v % mod_v; if(x >= mod_v) x -= mod_v; }
void dec(int& x, int v) { x -= v % mod_v; if(x < 0) x += mod_v; }
int pow(int x, int p)
{
int v = 1;
for(; p; p >>= 1, x = x * x... | ALGO | 0.999989 | 4.206121 | {
"github_metadata": {
"branch": "master",
"commit_count": 217,
"repo_created_at": "2014-05-25T12:26:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "a10d443e... |
c5d2f7c5-030d-4d9b-a080-d1c27ed4f7d6 | nibrary/nibrary | src/dMRI/tractography/algorithms/tractographyAlgorithm.h | #pragma once
#include "base/nibr.h"
#include "../tracker/trackerThread.h"
namespace NIBR {
typedef enum {
PROP_CONTINUE,
PROP_STOP,
PROP_FAIL
} Propagation_Decision;
typedef enum {
ALGORITHM_NOTSET = -1,
PTT,
LOCAL_PROBABILISTIC
} Algorithm_Type;
class TractographyAlgorithm {
public:
TractographyAlgorithm(... | TOOL | 0.996322 | 5.337994 | {
"github_metadata": {
"branch": "main",
"commit_count": 346,
"repo_created_at": "2024-05-13T12:18:43.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "872dd180ca1... |
d2d21617-314c-4d59-b78f-7dacee41c071 | AnimeshSinha1309/coding-contests | CodeForces/R652/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef pair<long long, long long> pll;
typedef vector<vector<long long>> mll;
typedef vector<pair<long long, long long>> vpl;
typedef long double ld;
typedef vector<long double> vld;
typedef vector<vector<long double>> ... | ALGO | 0.999987 | 3.494214 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2020-02-26T05:58:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3c5beafbe8... |
536dac22-d02d-4bf5-9abf-06671245b519 | tjd1234/cmpt135spring2023 | lectures/week12/swap.cpp | // swap.cpp
#include <iostream>
#include <vector>
#include <string>
using namespace std;
// void swap_values(int &a, int &b)
// {
// int temp = a;
// a = b;
// b = temp;
// }
// void swap_values(string &a, string &b)
// {
// string temp = a;
// a = b;
// b = temp;
// }
template <typename T>... | ALGO | 0.998136 | 6.555169 | {
"github_metadata": {
"branch": "main",
"commit_count": 90,
"repo_created_at": "2022-12-30T00:05:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "be59c55d2db... |
071d0d86-f8f6-493c-bfeb-7c53588775bb | ivarlon/fys3150 | prosjekt 2/problem2.cpp | // FYS4150 project 2
// problem 2
// setting up NxN tridiagonal matrix A for N = 6, solves
// eigenval. eq. and checks agreement w/ anal. result
//
#include <iostream>
#include <armadillo>
using namespace std;
using namespace arma;
mat create_tridiagonal(int N, double a, double d, double e){
// creates tridiag. mat... | ALGO | 0.999882 | 5.169998 | {
"github_metadata": {
"branch": "main",
"commit_count": 54,
"repo_created_at": "2022-09-08T14:48: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": "c9f7877c069... |
9d939937-629e-4c47-8c8e-8a81720a40a6 | AveryMunny/CompSci2 | AveryMunn-Assignment9.cpp | /*
COPYRIGHT (C) 2017 Student Name (UANET ID ) All rights reserved.
CSII assignment 9
Author. Student Name
<EMAIL>
Version. 1.01 09.09.2017
Purpose: This program is the test cases for the assignment
*/
#include <iostream>
#include <iomanip>
//using
using namespace std;
// prototypes
void ... | TOOL | 0.94889 | 3.401069 | {
"github_metadata": {
"branch": "main",
"commit_count": 16,
"repo_created_at": "2023-04-24T20:59: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": "821ea9ffe58... |
721328b8-7040-42e5-bb4f-715a8bb8dcce | liuzhangjie1713/bustub | src/optimizer/nlj_as_hash_join.cpp | #include <algorithm>
#include <memory>
#include "catalog/column.h"
#include "catalog/schema.h"
#include "common/exception.h"
#include "common/macros.h"
#include "execution/expressions/column_value_expression.h"
#include "execution/expressions/comparison_expression.h"
#include "execution/expressions/constant_value_expre... | ALGO | 0.997017 | 7.283728 | {
"github_metadata": {
"branch": "sping2023",
"commit_count": 365,
"repo_created_at": "2023-12-17T06:26:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4160f... |
6af87276-6ba1-4dd2-b275-9788b432bc01 | ankiiitraj/questionsSolved | 1366-B.cpp | #include <bits/stdc++.h>
#define int long long int
#define pb push_back
#define all(a) a.begin(), a.end()
#define scnarr(a, n) for (int i = 0; i < n; ++i) cin >> a[i]
#define vi vector<int>
#define pii pair <int, int>
#define mii map <int, int>
#define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NU... | ALGO | 0.999961 | 5.048924 | {
"github_metadata": {
"branch": "master",
"commit_count": 46,
"repo_created_at": "2020-02-19T18:09:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea204aa45... |
d8c5787a-451d-4c84-8d50-ea7b463fcda6 | ASSERT-KTH/Supersonic | predictions/submissions-aizu-coop-gpt4/Codenet/p02272/445515990/response_8.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <stack>
using namespace std;
const int INF = 1000000001;
const int MAX = 500000;
int cnt;
int S[MAX] = {0};
void merge(int *A, int left, int mid, int right) {
int i = left, j = mid, k = left;
while (i < mid && j < right) {
i... | ALGO | 0.999969 | 3.862767 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2022-02-03T10:33:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5f57f4a6baad5... |
932c45d0-e199-43dd-857a-872ff2e6c708 | jk-jung/problem-solving | codeforces/Codeforces Round 76x/R768_div2_A.cpp | #include <string.h>
#include <stdio.h>
#include <math.h>
#include <cassert>
#include <set>
#include <map>
#include <array>
#include <stack>
#include <queue>
#include <vector>
#include <numeric>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef vecto... | ALGO | 0.999984 | 3.856581 | {
"github_metadata": {
"branch": "main",
"commit_count": 1582,
"repo_created_at": "2021-06-24T13:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d82021f4... |
e37f0355-2c8e-4a1e-acf7-8d3b9d87c7f7 | mrunaltarwatkar018/Coding_Ninjas_Introduction_To-C-and_Data_Structures_and_Algorithm | Milestone 2/A - Lecture 8 - Arrays/2. Assignments/1_Find_Unique.cpp | /*
Question : Find Uniqe
Problem statement
You have been given an integer array/list(ARR) of size N. Where N is equal
to [2M + 1].
Now, in the given array/list, 'M' numbers are present twice and one number
is present only once.
You need to... | ALGO | 0.999725 | 5.866786 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-06-18T14:56:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6312f6784a... |
4370d7c0-5926-4489-b862-718013b4a338 | SynclonSec/Xsol-TraderAI | src/models/multi_agent_system_model.cpp |
#include "multi_agent_system_model.h"
#include <random>
#include <algorithm>
#include <cmath>
namespace xsol {
struct MultiAgentSystemModel::Impl {
std::vector<Agent> agents;
std::mt19937 rng;
std::vector<std::vector<double>> predictionHistory;
size_t inputDimension;
double systemPerformance;
... | ALGO | 0.999955 | 6.81358 | {
"github_metadata": {
"branch": "main",
"commit_count": 188,
"repo_created_at": "2024-12-18T15:27: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": "734424e36d... |
38c1960a-abdb-44d8-b187-326000da973b | ystanev/Fundamentals-of-Programming | C++ Practice/Week 4/Q3.cpp | //#include "stdafx.h" // Header File used VS.
#include <iostream>
//#include <iomanip> // Used to format the output.
#include <cstdlib> // Used for system().
#include <math.h> // Used for sqrt().
//#include <stdio.h> /* printf, NULL */
//#include <time.h> /* time */
using namespace std;// ?
//#include <string> // Use... | ALGO | 0.999707 | 3.566673 | {
"github_metadata": {
"branch": "master",
"commit_count": 66,
"repo_created_at": "2017-01-25T16:09:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 31,
"forks": 9,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "920fcea9... |
171d2773-d3da-44d1-8587-9de959a3ef31 | 4324MAYUR/cpp | 6-2/class.cpp | #include <iostream>
using namespace std;
int getint()
{
int n;
cin >>n;
return n;
}
double getDouble()
{
double n;
cin >>n;
return n;
}
class A1
{
protected:
int choice;
double a,b,c;
public:
virtual void calculate() = 0;
};
class A2 : public A1
{
public:
void calculate()
{
cout << "Pre... | ALGO | 0.982406 | 3.128941 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-01-23T17:38: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": "c68f33aa788... |
a174061e-86fa-449b-9a09-abee3ec9d406 | ForgotDream/Problemset | Luogu/P1016 旅行家的预算.cpp | /**
* @file P1016 旅行家的预算.cpp
* @author ForgotDream
* @brief DFS
* @date 2023-05-13
*/
#include <bits/stdc++.h>
using i64 = long long;
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout << std::fixed << std::setprecision(2);
double d1, c, d2, p1;
int n;
std::c... | ALGO | 0.999959 | 4.437865 | {
"github_metadata": {
"branch": "main",
"commit_count": 286,
"repo_created_at": "2023-04-20T07:00: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": "424cdead6b... |
eabbd34b-f8e9-423d-b3a9-d17e8a57fe21 | Ayush7614/Daily-Coding-DS-ALGO-Practice | Algorithms/Searching and Sorting/C++/sorting.cpp | #include<iostream>
#include<cmath>
using namespace std;
void bubble_sort(int arr[],int n){
for(int i =0;i<n-1;i++){
if(arr[i]>arr[i+1]){
int temp=arr[i];
arr[i]=arr[i+1];
arr[i+1]=temp;
}
}
}
void insertion_sort(int arr[],int n){
for(int i=1;i<n;i... | ALGO | 0.999937 | 4.458609 | {
"github_metadata": {
"branch": "main",
"commit_count": 2968,
"repo_created_at": "2020-12-28T05:34:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 322,
"forks": 474,
"issues": 335,
"pull_requests": 20
},
"file_meta": {
"content_id": "c6... |
f4fddddd-4bd2-42be-9242-c0d4b11f9f6c | WesternDundrey/CodeForces | IQ_text.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> numbers(n);
for (int i = 0; i < n; i++) {
cin >> numbers[i];
}
// Check the parity of the first three numbers to determine the majority parity.
int evenCount = 0;
for (... | ALGO | 0.999988 | 4.977878 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2025-04-01T03:09: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": "681bcd4d4c8... |
93d352aa-dff8-43f3-ba05-76f659000296 | Yusha47/Competitive-Programming | New folder (2)/xx.cpp | #include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define MAX 10000
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0; i<n; i++)
#define rep1(i,n) for(int i=1; i<=n; i++)
#define repSe(i,st,end) for(int i=st;i<end;i++)
#define repS0(i,st,end) for(int i=st;i>0;i--)
#defi... | ALGO | 0.999755 | 3.246605 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2022-10-31T15:56: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": "81d0e2bf32... |
0e204464-2029-494f-b013-8c14f1560e3a | kartikkukreja/blog-codes | src/Segmented Least Squares Problem.cpp | #include <cstdio>
#include <algorithm>
#include <stack>
#include <limits>
#define MAXN 1000
#define INF numeric_limits<double>::infinity()
using namespace std;
struct Point {
int x, y;
bool operator < (const Point& that) const {
return x < that.x;
}
} points[MAXN + 1];
// Used for computing E[i][j] which is the ... | ALGO | 0.9998 | 3.956473 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2014-07-14T18:27:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 177,
"forks": 117,
"issues": 3,
"pull_requests": 1
},
"file_meta": {
"content_id": "8dd17... |
be7e67b3-8697-478e-8881-1910afe0110f | fanjingfang/clique | clique.cpp | #include <iostream>
#include <sstream>
#include <fstream>
#include <queue>
#include "clique.h"
//#include "mpi.h"
mt19937 rand_num;
Net net;
Net clusterindex;
Net clusternodes;
Edge Edge_LIST;
Edge Edge_LIST1;
deque <int> node_pdf_set;
deque <int> PDF_M;
int N_eff=0;
int NN_cut=0;
double N_eff_T = 0;
double powe... | ALGO | 0.999649 | 3.740086 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2016-04-17T19:25:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b2d4e950d... |
900d5646-d6df-4df5-ae54-a84002ceb374 | ZixuanWang1210/acm_ws | template/ST.cpp | template<typename T> struct ST{
ST(T a[], int n){
siz = n;
maxv.resize(n+1); minv.resize(n+1);
int t = __lg(n) + 1;
for(int i= 0;i<=n;i++) maxv[i].resize(t), minv[i].resize(t);
for(int i = 0; i <= n; i++) maxv[i][0] = minv[i][0] = a[i];
for(int j = 1; j < t; j++)
... | ALGO | 0.99998 | 4.445313 | {
"github_metadata": {
"branch": "main",
"commit_count": 108,
"repo_created_at": "2022-01-15T09:52: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": "bf58a746ee... |
c5bc7521-d77f-4cd3-bec3-c4dd2e719e86 | MilanoBicocca-pix/cmssw | RecoLocalMuon/CSCSegment/src/CSCSegAlgoRU.cc | /**
* \file CSCSegAlgRU.cc
*
* \authors V.Palichik & N.Voytishin
* \some functions and structure taken from SK algo by M.Sani and SegFit class by T.Cox
*/
#include "CSCSegAlgoRU.h"
#include "CSCSegFit.h"
#include "Geometry/CSCGeometry/interface/CSCLayer.h"
#include "DataFormats/GeometryVector/interface/GlobalPoin... | ALGO | 0.995629 | 4.504246 | {
"github_metadata": {
"branch": "master",
"commit_count": 178510,
"repo_created_at": "2015-02-06T10:41:42.000Z",
"is_fork": true,
"is_org_owned": true,
"forked_from": "cms-sw/cmssw",
"stars": 3,
"forks": 0,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id"... |
9c50ff83-7049-435b-a977-a7935e2f19de | Santospirito007/CS161 | chap_3_prb_4.cpp | // chap_3_prb_4.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "../../std_lib_facilities.h"
int _tmain(int argc, _TCHAR* argv[])
{
double val1 = 0;
double val2 = 0;
double sum = 0;
double difference = 0;
double ration = 0;
double product = 0;
cout << "Input value o... | ALGO | 0.992242 | 3.957435 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-03-20T10:45: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": "d1ea647215... |
88a44d9e-a20d-48e7-8b3e-6c01ecda37b7 | ishandutta2007/codeforces-v | vercingetorix/normal/1493/C.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <queue>
#include <cstring>
#include <set>
#include <bitset>
#include <map>
#include <chrono>
#include <random>
#include <unordered_map>
#include <stdio.h>
using namespace std;
typedef long long ll;
typedef long do... | ALGO | 0.999671 | 3.166075 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-10-30T16:31: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": "48a274a661ed... |
c77c99b6-0080-4c7b-80c7-0fd877c0be39 | sachin-sanil/Neumann-BC | Solver.cpp | #include "Solver.h"
#include "Grid.h"
#include "Grid_int.h"
#include "Stencil.h"
#include <fstream>
Solver::Solver(int l_level, int n_Vcycle,char c)
{
level= l_level;
Vcycle = n_Vcycle;
n_d= c;
ngp_= pow(2,level)+1;
}
Solver::Solver(int l_level, int n_Vcycle, std::vector<double> &u)
{
level= l_level... | ALGO | 0.999849 | 3.233409 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-05-09T18:07: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": "0371e5d2d2... |
dff24709-d9ee-4d1a-965f-0394bf40b0b8 | zwkcoding/data_structure | c++/tree/bst_iterator/main.cpp | /*
* Filename: /home/zwk/code/data_structrue/c++/tree/bst_iterator/main.cpp
* Path: /home/zwk/code/data_structrue/c++/tree/bst_iterator
* Created Date: Thursday, May 9th 2019, 8:22:58 pm
* Author: zwk
*
* Copyright (c) 2019 Your Company
*/
#include "../../include/base.h"
class BSTIterator {
private:
s... | ALGO | 0.99995 | 4.784425 | {
"github_metadata": {
"branch": "master",
"commit_count": 87,
"repo_created_at": "2019-04-24T14:36: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": "4e7cdc6d6... |
67bcc0f2-0223-4084-a73b-7699ea1282ac | Super-long/Leetcode | Leetcode/春招/哈希表/LRU.cpp | #include <bits/stdc++.h>
using namespace std;
class LRUCache {
private:
struct ListNode{
int val;
int key;
ListNode* next;
ListNode* prev;
ListNode(int val, int key) : val(val), key(key), next(nullptr), prev(nullptr){}
};
unordered_map<int, ListNode*> cache;
Lis... | ALGO | 0.999494 | 5.314095 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2019-12-08T07:31:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7cb88c4b... |
2f08dd13-880c-4dad-a176-9f593e4e7471 | jetyingjia/LeetCode | LeetCode/Merge k Sorted Lists.cpp | #include "utils.h"
#ifdef MergekSortedLists
#include <iostream>
#include <vector>
#include <list>
#include <time.h>
#include <queue>
struct ListNode
{
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
struct comp
{
//优先队列中默认是less(<),top为最大的元素
//此处为greater(>),top为最小元素
bool operator() (ListNod... | ALGO | 0.999549 | 5.159421 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2014-05-11T14:13:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f6a59a79a0... |
36b5c266-666c-40a6-a1a2-70f0d4da25c5 | anirudhgupta03/GFG | Must Do Coding Questions for Product Based Companies/Linked List/Clone a linked list with next and random pointer.cpp | //Ref1: https://www.youtube.com/watch?v=VNf6VynfpdM&t=8s
//Ref2: https://github.com/striver79/SDESheet/blob/main/cloneLinkedListCPP
/* the node structure is as follows
struct Node {
int data;
Node *next;
Node *arb;
Node(int x) {
data = x;
next = NULL;
arb = NULL;
}
};
*/
... | ALGO | 0.999137 | 4.164153 | {
"github_metadata": {
"branch": "main",
"commit_count": 539,
"repo_created_at": "2021-01-04T04:31:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "33e79b79be... |
ba735ebe-7a48-4fba-87e6-8a09007110d9 | hanil12/DX2023_02 | WIN_API/WIN_API_202302/Algorithm/DP_1.cpp | #include <iostream>
#include <string>
#include <vector>
#include <windows.h>
using namespace std;
// ENCHANT
// 강화를 하는데
// + 1
// + 2
// + 3
// 0강 f(0)
// 1
// 1강 f(1)
// 1
// 2강 f(2)
// 2
// 3강 f(3) = 4
// 1 1 1
// 1 2
// 2 1
// 3
// 4강 f(4) =
// 1 1 1 1
// 1 2 1
// 2 2
// 3 1
// 1 3
// 2 1 1
// 1 1 2
// N강을... | ALGO | 0.999808 | 4.158145 | {
"github_metadata": {
"branch": "main",
"commit_count": 72,
"repo_created_at": "2023-03-30T08:05:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "976db20581d... |
3e33ed8e-955e-4914-b607-07c9660e5a84 | ankeshbanerjee/cpp-and-dsa | 08 Arrays/08_05_Max_Min_element_of_an_array.cpp | #include <iostream>
using namespace std;
int getMax (int arr[], int n){
int maximum = INT_MIN;
for ( int i = 0; i< n; i++){
// if ( maximum < arr [i] ){
// maximumimum = arr [i];
// }
int maximum = max ( maximum, arr[i] );
}
return maximum;
}
int getMin (int arr [],... | ALGO | 0.999367 | 4.375758 | {
"github_metadata": {
"branch": "main",
"commit_count": 135,
"repo_created_at": "2022-06-21T12:04: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": "1b4842c581... |
a77bb737-1e55-4522-bea8-89f6a80ec697 | hossam-hani/1st-Electrical-Project | main-v1.cpp |
#include <iostream>
#include <string>
#include <vector>
#include <ctype.h>
#include <algorithm>
#include<sstream>
#include<math.h>
using namespace std;
double det(int n, double mat[10][10])
{
double d = 0;
int c, subi, i, j, subj;
double submat[10][10];
if (n == 2)
{
return( (mat[0][0... | ALGO | 0.999643 | 3.508369 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-08-07T00:51: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": "1e900f7096... |
66323405-5350-439d-9aac-f6cbf97ed73f | ericniebler/range-v3 | include/range/v3/algorithm/search_n.hpp | /// \file
// Range v3 library
//
// Copyright <NAME> 2014-present
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range... | ALGO | 0.999817 | 6.959131 | {
"github_metadata": {
"branch": "master",
"commit_count": 2541,
"repo_created_at": "2013-11-11T16:05:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4273,
"forks": 457,
"issues": 262,
"pull_requests": 24
},
"file_meta": {
"content_id": ... |
26d46478-dc82-4518-a42c-0b47acefda8d | yexinyu95/Code | PTAbasic/1014STR.cpp | #include <iostream>
#include <vector>
using namespace std;
void printVec (std::vector<char> VEC)
{
for (size_t i = 0; i != VEC.size(); i++)
{
std::cout << VEC[i];
if (i != VEC.size() - 1)
{putchar(' ');}
}
std::cout << std::endl;
}
/*compare same index's char in given string A and B... | ALGO | 0.999854 | 3.687743 | {
"github_metadata": {
"branch": "master",
"commit_count": 28,
"repo_created_at": "2023-08-04T04:11: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": "41c4747b2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.