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 |
|---|---|---|---|---|---|---|---|
2a87838e-eacc-487b-8ac0-991faf416208 | bartandrews/DiagHam_Stability | trunk/FQHE/src/Hamiltonian/ParticleOnSphereMultipleGroupNBodyHardCoreHamiltonian.cc | ////////////////////////////////////////////////////////////////////////////////
// //
// //
// DiagHam version 0.01 ... | ALGO | 0.998045 | 3.282029 | {
"github_metadata": {
"branch": "main",
"commit_count": 24,
"repo_created_at": "2022-07-12T10:41:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ea5f73f8c19... |
aac18f30-05c0-43e4-8cd4-9c969a6dd28b | sunjohabdurazck/Tertis | loading.cpp | #include <stdio.h>
#include <conio.h>
#include <graphics.h>
void drawFlower(int x, int y, int radius) {
setcolor(BLUE);
setfillstyle(SOLID_FILL, BLUE);
circle(x, y, radius);
floodfill(x, y, BLUE);
setcolor(WHITE);
setfillstyle(SOLID_FILL, WHITE);
int petalRadius = radius / 2;
for (int ... | ALGO | 0.979831 | 4.062497 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-04-27T15:22: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": "6c122cdfd6d1... |
7aea4210-aba6-4390-8ccc-a380faf2c2b2 | lovebaonvwu/leetcode-cpp | 2025/random_flip_matrix.cc | class Solution
{
unordered_map<int, int> mp;
int nr;
int nc;
int rem;
mt19937 rng{random_device{}()};
int randint(int bound)
{
uniform_int_distribution<int> uni(0, bound);
return uni(rng);
}
public:
Solution(int m, int n) : nr(m), nc(n), rem(nr * nc)
{
}
... | ALGO | 0.999304 | 5.859597 | {
"github_metadata": {
"branch": "master",
"commit_count": 2622,
"repo_created_at": "2019-04-21T11:29:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f0262c3... |
cc8776a5-732c-4b01-99d4-1898e6cafd04 | MohamedAmineYoussef/r-seau-de-routeurs | main.cpp | #include <iostream>
#include <sstream>
#include "Routeur.h"
#include "Graphe.h"
#include "Reseau.h"
using namespace std;
void executerAlgorithmes(Reseau &reseau, const Routeur &r1, const Routeur &r2) {
int tempsTransmission = 0;
vector<Routeur> route;
route = reseau.determinerMinParcours(r1, r2, tempsTran... | ALGO | 0.997667 | 3.678097 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2025-01-10T21:15:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3bffec5706af... |
d2bb2a17-82a3-490e-b913-ef118bae4259 | Shivesh-K/CompetitiveCoding | Interesting_Numbers.cpp | #include <bits/stdc++.h>
using namespace std;
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) (a * b) / gcd(a, b)
#define GOLD ((1 + sqrt(5)) / 2)
#define ll long long
const double PI = 3.141592653589793238462643383279502884197169399375... | ALGO | 0.999711 | 4.353476 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2021-01-06T14:09: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": "7a017dfb0... |
8543344d-afb3-4161-9c56-1d7d88618c62 | Mrwatermolen/XFDTD_CORE | src/network/network.cpp | #include <xfdtd/network/network.h>
#include <xfdtd/parallel/mpi_support.h>
#include <exception>
#include <filesystem>
#include <utility>
#include <xtensor.hpp>
#include <xtensor/xnpy.hpp>
namespace xfdtd {
Network::Network(std::string output_dir) : _output_dir{std::move(output_dir)} {}
Network::Network(std::vector<... | TOOL | 0.936555 | 6.07186 | {
"github_metadata": {
"branch": "main",
"commit_count": 99,
"repo_created_at": "2024-01-27T02:00:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a91f48530d8... |
78643813-4e1a-4916-be19-b77721a9cbee | prs-prabodh/competitiveCoding | New_year_transportation.cpp | /*
* @author <NAME>
* Institute - ASET, New Delhi
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
const int M = 1e9 + 7;
vector<vector<int>> e;
bool *visited;
int n, d;
bool dfs(int node)
{
visited[node] = true;
if (node == d)
return true;
for (int i... | ALGO | 0.999994 | 4.104633 | {
"github_metadata": {
"branch": "master",
"commit_count": 97,
"repo_created_at": "2017-09-02T19:21: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": "de42be0f0... |
a5edc871-223a-4191-9266-01ff9a8855a9 | A1kmm/libzinc | core/source/general/statistics.cpp | /*******************************************************************************
FILE : statistics.c
LAST MODIFIED : 7 May 2001
DESCRIPTION :
Statistical functions, eg. sampling from distributions, used by CMGUI.
==============================================================================*/
/* ***** BEGIN LICENSE B... | ALGO | 0.999484 | 4.30253 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2012-12-05T04:04:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ed9502ee... |
8b385453-071a-4a02-94d3-4561d6018034 | iliyian/CompetitiveProgramming | codeforces.com/1899/G_hjt.cpp | #include <bits/stdc++.h>
#define N 100005
#define lc p << 1
#define rc p << 1 | 1
using namespace std;
struct Solve {
vector<vector<int>> g;
int p[N], maxd[N << 2], mind[N << 2];
int dep[N], rnk[N], dfn[N], son[N], top[N], siz[N], pa[N], cnt = 0;
int n, q;
void dfs1(int u) {
for (int v : g[u]) {
i... | ALGO | 0.999961 | 4.590384 | {
"github_metadata": {
"branch": "main",
"commit_count": 354,
"repo_created_at": "2024-04-21T10:50:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "53486ff905... |
a68938b8-c095-4380-95d3-f7f2002d4af7 | SAYEM5522/CPP-code | Final7b.cpp | // #include <iostream>
// #include <string>
// using namespace std;
// class Graph
// {
// public:
// int eddge[15][15], visited[15], n;
// void DepthFSearch(int v)
// {
// int i;
// visited[v] = 1;
// for (i = 1; i <= n; i++)
// if (eddge[v][i] && !visited[i])
// {
// DepthFSearc... | ALGO | 0.999894 | 5.440409 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2021-08-18T13:01:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "38b50ee379... |
85fa6f18-d015-4522-9dff-9b7976fbe647 | MC-io/competitive_programming | OpenKattis/UnionFind/main.cpp | #include <iostream>
#include <vector>
int main()
{
long long N, Q;
std::vector<std::vector<int>> sets;
while(std::cin >> N)
{
std::cin >> Q;
for (int i = 0; i < N; i++)
{
std::vector<int> v;
v.push_back(i);
sets.push_back(v);
}
... | ALGO | 0.99992 | 4.500519 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-09-19T23:07:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "66dbd6b3219a... |
b4cc5378-8b15-4660-9eb2-ac31e2fdb102 | guduzhe777/Code-cpp | ACM/codeForces/Codeforces Round 883 (Div. 3)/3-1.cpp | //所以写个结构体 做题个数 罚时 然后是 自己的下标 三个一一比较。
#include<bits/stdc++.h>
#define int long long
using namespace std;
typedef long long ll;
struct grade{
int cnt;
ll solveTime;
int index;
};
int t;
int n,m,h;
const int INF = 1e9;
bool cmp(grade &a,grade &b)
{
if(a.cnt>b.cnt) return true;
if(a.cnt == b.cnt &&... | ALGO | 0.999987 | 3.435692 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2022-10-16T15:42: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": "1c452c7a34... |
890adf61-28db-4d68-8d6e-73acd9df1920 | fanfank/leetcode | maximal-square.cpp | class Solution {
struct Point {
int left, up, area, side;
Point() {
this->side = this->area = this->left = this->up = 0;
}
};
public:
int maximalSquare(vector<vector<char>>& matrix) {
// Space: O(m), m = column number, use rolling array
// Time: O(n)
... | ALGO | 0.999978 | 6.472433 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2013-11-02T16:32:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 171,
"forks": 95,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e95613... |
83af24e0-7beb-4847-8212-41de36b43cc7 | chan-hwi/Baekjoon | 백준/Platinum/13339. XOR 수열/XOR 수열.cc | #include <iostream>
#include <cmath>
#include <algorithm>
#define MAX 131072
using namespace std;
typedef long long ll;
int N, M, k;
int nums[MAX + 1], tree[MAX + 1], sorted[MAX + 1];
bool cmp(int i, int j) { return (nums[i] == nums[j] ? i > j : nums[i] < nums[j]); }
void update(int i) {
while (i <= M) {
... | ALGO | 0.999995 | 4.037319 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2021-10-18T11:17:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "975fdfd0fb... |
3526dceb-3433-4728-8e24-25f23c69ef3d | laurila2/CoderByte | FindIntersection/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <sstream>
std::string FindIntersection(std::string strArr[], int arrLength) {
std::stringstream string1(strArr[0]);
std::stringstream string2(strArr[1]);
std::string segment;
std::vector<std::string> seglist;
std::vector<std::string> ... | ALGO | 0.997765 | 5.230874 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2023-09-13T07:55: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": "359e9d2726ab... |
b4a0854f-c6fc-4021-9aa5-8167d373d051 | MathProgrammer/CodeForces | 2021/Div 2/711 CodeCraft 2021/Programs/Two Houses.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int no_of_vertices;
cin >> no_of_vertices;
vector <int> indegree(no_of_vertices + 1);
for(int i = 1; i <= no_of_vertices; i++)
{
cin >> indegree[i];
}
vector < pair <int, pair <int, int> ... | ALGO | 0.999966 | 3.140711 | {
"github_metadata": {
"branch": "master",
"commit_count": 2511,
"repo_created_at": "2017-03-13T14:02:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 224,
"forks": 90,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "e809... |
647aca5f-8340-4243-97e0-694f9b6444dd | tjgiese/ccdl | src/ccdl/math/SPBLAS.hpp | #ifndef SPBLAS_H
#define SPBLAS_H
#include <cmath>
#include <vector>
#include <algorithm>
// # define MKL
#ifdef __cplusplus
extern "C" {
#endif
void mkl_dcsrmv( char const * transa,
int const * nrowA, int const * ncolA,
double const * alpha, char const * matdescra,
double const * Adata,
i... | TOOL | 0.987082 | 4.248468 | {
"github_metadata": {
"branch": "master",
"commit_count": 114,
"repo_created_at": "2014-03-30T18:29:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "475f236d... |
16b0ad15-3104-4413-b93b-cba89b8f4f9f | zensen6/BOJ_350_solved-completed_code-partII | double_linkedlist_acm.cpp | #include <stdio.h>
enum { ADD_HEAD = 1, ADD_TAIL, ADD_NUM, FIND, REMOVE, PRINT, PRINT_REVERSE, END = 99 };
#define MAX_NODE 10000
static int nodeCnt;
static int s;
struct Node {
int data;
Node* next;
Node* prev;
};
Node node[MAX_NODE];
Node* getNode(int data) {
node[nodeCnt].data = data;
node[nodeCnt].next ... | ALGO | 0.99966 | 4.152627 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2019-06-10T02:29: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": "47ce2b843... |
621882a7-09c1-4e4e-928d-c9d7373a45e2 | SJTU-ECTL/SALODI | DFFinsertion.cpp | #include "structure.h"
void init1(string i_file){
ifstream cd;
cd.open(i_file.c_str());
string tmp;
while(true){
cd >> tmp;
if(tmp.compare(".inputs") == 0 ) break;
}
struct node tmp_node;
while(true){//input nodes
cd>>tmp;
if(tmp.compare(".outputs") == 0) break;
tmp_node.i... | ALGO | 0.999262 | 3.528793 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2018-08-27T00:27:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3665dc44d3b... |
d144afe2-651a-4bfb-b9d1-8ed29f58a99a | Hoshi-No-Ai/CRANE-RACE | MINOR_BOARD/API/ALGORITHM/pid_algorithm.cpp | /**********************************************************************************************************************************************************
版权声明:HITCRT(哈工大竞技机器人协会)
文件名:PID_Algorithm.c
最近修改日期:2022.01.02
版本:1.0
-----------------------------------------------------------------------------------------------... | ALGO | 0.998949 | 4.747619 | {
"github_metadata": {
"branch": "main",
"commit_count": 44,
"repo_created_at": "2023-07-21T10:45:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "570a95856d7... |
3505e415-5a33-4478-b45e-72a94dc1b9a4 | ishandutta2007/codeforces-j | j.t.j.l/normal/1017/D.cpp | #pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int MAXN = 1e6 + 10;
const int MM = 1e9 + 7;
ll pw(ll p, ll q){
ll ret = 1;
for... | ALGO | 0.999632 | 3.802415 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T05:42:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f371702de885... |
8db88230-3a7f-43f3-8e1b-c5f3c1995afd | embreakin/FLattice_KKLT | include/evolution.hpp | #ifndef _EVOULUTION_H_
#define _EVOULUTION_H_
#include "field.hpp"
class LeapFrog
{
private:
double _a,_da, _dda;
const double hubble_init = Hinitial/m;
double sfexponent;
double sfbase;
void evol_fields ( double** f, double** df, double h );
void evol_fiel... | ALGO | 0.959451 | 4.620311 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-01-26T06:44: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": "fe81840571c4... |
c15a9141-a808-4b4e-a577-7f2c6e01e630 | liubang/leetcode | src/4.median-of-two-sorted-arrays.cpp | // Copyright (c) 2024 The Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by app... | TEST | 0.999047 | 7.342583 | {
"github_metadata": {
"branch": "main",
"commit_count": 103,
"repo_created_at": "2022-01-17T06:30:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d27bc09824... |
9e18e0fd-3429-4d31-863c-306867393bf4 | Cube219/PS | CodeForces/1629 - Codeforces Round #767 (Div. 2)/D - Peculiar Movie Preferences.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#define _CRT_DECLARE_NONSTDC_NAMES 0 // for using y1 as variable name
#include <iostream>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long int;
constexpr int INF = 0x3f3f3f3f;
constexpr ll LNF = 0x3f3f3f3f3f3f3f3f;
... | ALGO | 0.999952 | 4.416376 | {
"github_metadata": {
"branch": "main",
"commit_count": 1172,
"repo_created_at": "2021-01-20T03:42:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2da82186f... |
ac070dd3-5a47-4c3c-b549-3f56707135c8 | apache/impala | be/src/runtime/bufferpool/reservation-tracker.cc | // Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... | TOOL | 0.964142 | 7.475617 | {
"github_metadata": {
"branch": "master",
"commit_count": 12124,
"repo_created_at": "2016-04-13T07:00:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1226,
"forks": 533,
"issues": 0,
"pull_requests": 26
},
"file_meta": {
"content_id": "a... |
47769725-d275-4300-9430-941053fad798 | shenweichen/Coursera | Specialization_Data_Structures_Algorithms_UC_San_Diego/Course2_Data_Structures/week2_Priority_Queues_and_Disjoint_Sets/merging_tables/merging_tables.cpp | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::max;
using std::vector;
struct DisjointSetsElement {
int size, parent, rank;
DisjointSetsElement(int size = 0, int parent = -1, int rank = 0)
: size(s... | ALGO | 0.999932 | 4.296686 | {
"github_metadata": {
"branch": "master",
"commit_count": 75,
"repo_created_at": "2016-06-30T04:31:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 900,
"forks": 663,
"issues": 3,
"pull_requests": 5
},
"file_meta": {
"content_id": "e6764... |
7f759129-2f61-4466-bab1-6f5c0fa092dc | Pawlo77/IT-Olympiad | algorytmika/sorting/pigeonholeSort.cpp | void
getMaxMin(int arr[], int n, int *min, int *max) {
*max = *min = arr[0];
for (int i = 1; i < n; i++) {
if (arr[i] > *max) {
*max = arr[i];
}
else if (arr[i] < *min) {
*min = arr[i];
}
}
}
// n - length of array
void
sort(int arr[], int n) {
in... | ALGO | 0.999976 | 5.097733 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2021-08-29T12:37: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": "228a6af276... |
97568e55-9289-49e8-b89d-4c0c982485d6 | seajunk/cp | cf/practice/1793C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve(){
ll n; cin >> n;
ll a[n];
for(int i = 0; i < n; i++) cin >> a[i];
vector<bool> inside(n + 1, true);
ll mn = 1;
ll mx = n;
ll l = 0, r = n - 1;
while(r - l + 1 >= 4){
if((a[l] != mx && a[l] != mn)... | ALGO | 0.999766 | 3.994525 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-02T02:50: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": "1c45f2f03731... |
ee92b4a6-7d17-4697-8da8-3fb973c5b826 | hayaten0415/Competitive-programming | AtCoder/ABC/ABC187/D.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n - 1); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
using namespace std;
using P = pair<ll, ll>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }... | ALGO | 0.99994 | 3.981807 | {
"github_metadata": {
"branch": "master",
"commit_count": 1321,
"repo_created_at": "2019-02-17T01:01:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d6334a... |
713978f1-727e-498d-bc87-c31d17cbed8e | hyf212/algorithm | 动态规划/2.背包问题/01背包.cpp | /*#include<bits/stdc++.h>
using namespace std;
int n, m, dp[1001][1001], v[1001], w[1001];
int main(void) {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
scanf("%d%d", &v[i], &w[i]);
for (int i = 1; i <= n; i++)
for (int j = 0; j <= m; j++)
if (j < v[i])
dp[i][j] = dp[i - 1][j];
else
dp[i][... | ALGO | 0.999998 | 3.950159 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2023-10-12T11:26: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": "f5643c4927c... |
aa85d79e-02d1-4696-b5ce-d1cc3e7e8dd8 | umaidansari12/CP | 1_tree/morris_inorder_traversal.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999989 | 6.328558 | {
"github_metadata": {
"branch": "main",
"commit_count": 62,
"repo_created_at": "2022-04-15T17:10:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "376dffe83c6... |
27df3a47-963c-427e-b285-44cd1915c64b | pinakigupta/BehaviorUtilityTreeBased | BehaviorAgents/BehaviorLaneKeep/BehaviorLaneKeep.cpp | #include "../../PCH/pch.hpp"
#include "../../include/BehaviorTertiary.hpp"
#include "../../include/behaviorHorizon.hpp"
#include "../../include/shared_enums.h"
#include "../../include/BehaviorObject.hpp"
#include "../../include/AgentPool.hpp"
namespace BU=BehaviorUtils;
BehaviorTertiary::Maneuver_Temporal ObjColli... | TOOL | 0.990677 | 5.450307 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2019-11-16T19:31:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "0356459e9e... |
7f67864a-d60f-462b-998f-506ea92a7f50 | ncchen99/Program-Design-Homework | Classmate/yi albert/your_algorithm.h | #ifndef YOUR_ALGORITHM_H
#define YOUR_ALGORITHM_H
#include "LT.h"
#include "graph.h"
using namespace std;
unordered_set<int> seedSelection(DirectedGraph G, unsigned int numberOfSeeds) {
unordered_set<int> seeds;
/* Put selected users into unordered_set seeds */
/* Implement your seed selection algorithm ... | ALGO | 0.999694 | 5.000573 | {
"github_metadata": {
"branch": "master",
"commit_count": 59,
"repo_created_at": "2021-10-09T11:02:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9fa4edba3... |
568c95ad-b4a8-4db0-a44c-5af86bf6231c | achellies/DuiBrowser | Duibrowser/src/EAWebkit/Webkit-owb/JavaScriptCore/kjs/dtoa.cpp | /****************************************************************
*
* The author of this software is <NAME>.
*
* Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
* Copyright (C) 2002, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
*
* Permission to use, copy, modify, and distribute this software fo... | TOOL | 0.978423 | 6.951657 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2014-08-14T14:28:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 51,
"forks": 31,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dccc7eda... |
4e527128-ea9d-4e01-bd20-1da8f362f6e8 | ishandutta2007/codeforces-h | hellkitsune/normal/585/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long LL;
typedef pair<int, int> PII;
const int MOD = 1e9 + 7;
const int CNT = 10000000;
int n;
vector<int> p;
bool pr[CNT], odd[CNT];
int cnt[CNT] = {}, acnt[CNT],... | ALGO | 0.999961 | 4.72831 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T02:01: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": "82b323d29442... |
1219a815-9d53-4c28-a9a2-a18c90ae905b | edisonhello/competitive_programming | Codeforces/AC/101026E_tut.cpp | #include <bits/stdc++.h>
using namespace std;
struct node {
node *l, *r;
long long sum;
node() : l(0), r(0), sum(0) {}
node(node *z) : l(z->l), r(z->r), sum(z->sum) {}
} *root[150005];
#define mid ((l + r) >> 1)
void build(node *now, int l, int r) {
if (l == r) return;
build(now->l = new node(... | ALGO | 0.999996 | 4.636842 | {
"github_metadata": {
"branch": "master",
"commit_count": 843,
"repo_created_at": "2016-03-15T14:58:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48745963... |
41c0a781-ce38-4d48-a952-33138e8adad4 | chmuhammadasim/CPP-Work | stack/stack_array_with_template.cpp | #include <iostream>
#include <cstdlib>
using namespace std;
template <class t>
class Stack
{
t *arr;
int top;
int capacity;
public:
Stack(t size){
arr = new t[size];
capacity = size;
top = -1;
}
~Stack(){
delete[] arr;
}
void push(int x){
if (isFull()){
co... | ALGO | 0.997671 | 4.102589 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2022-07-26T07:43: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": "72d8945a5b3... |
3f8ca3b1-adb5-490c-8b97-25559b9540cb | channotation/chap | include/statistics/gaussian_density_derivative.hpp | // CHAP - The Channel Annotation Package
//
// Copyright (c) 2016 - 2018 <NAME>, <NAME>, <NAME>, and
// <NAME>
//
// 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, in... | ALGO | 0.949988 | 7.313987 | {
"github_metadata": {
"branch": "master",
"commit_count": 833,
"repo_created_at": "2018-02-15T20:52:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 21,
"forks": 10,
"issues": 23,
"pull_requests": 5
},
"file_meta": {
"content_id": "59b28... |
3dcc0542-9b57-4c36-acc2-fb0091d18ab0 | ishandutta2007/codeforces-c | cheetose/normal/1303/E.cpp | #include<cstdio>
#include<cstdlib>
#include<iostream>
#include<vector>
#include<queue>
#include<bitset>
#include<string>
#include<stack>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<complex>
#include<cmath>
#include<iomanip>
#include<numeric>
#include<algorithm>... | ALGO | 0.999955 | 3.916296 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:17:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c85d8d1f7291... |
2196867c-47ae-4665-98bb-d9cd3aa665d1 | MartyMiniac/Complirun | complirun/main.cpp | #include "iostream"
#include "string"
#include "vector"
#include "filesystem"
#include "conio.h"
#include "stdio.h"
#include <chrono>
#include "fstream"
#include "sstream"
#include "windows.h"
#include <direct.h>
#define GetCurrentDir _getcwd
namespace fs = std::experimental::filesystem;
std::vector<std::string> f... | TOOL | 0.914338 | 3.9394 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2020-09-11T17:17:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63427c2d92... |
64a82146-bc17-4718-90c6-69f33668274c | iamaryankr/completeDSA | BinaryTrees/BTfrompre&in.cpp | #include<bits/stdc++.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : va... | ALGO | 0.999999 | 6.112375 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-05-23T19:10:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8f845c725b5d... |
72b64cbe-6f3b-4106-a1c3-26adbdaebd73 | Beast-Alok/gfg-potd | 07 July (2024)/July_26th.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool kPangram(string str, int k) {
// code here
vector<int> arr(26,0);
int n = str.size();
int ch = 0;
for(int i=0; i<n; i++){
if(str[i]!=' '){
... | ALGO | 0.999385 | 5.050122 | {
"github_metadata": {
"branch": "main",
"commit_count": 299,
"repo_created_at": "2024-01-01T11:34:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6fe27766d2... |
7612abdc-b877-48b8-bb3b-29de73e447ec | h2ssh/Vulcan | src/utils/command_line.h | /* Copyright (C) 2010-2019, The Regents of The University of Michigan.
All rights reserved.
This software was developed as part of the The Vulcan project in the Intelligent Robotics Lab
under the direction of <NAME>, <EMAIL>. Use of this code is governed by an
MIT-style License that can be found at "https://github... | TOOL | 0.927692 | 6.490613 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2019-05-04T00:21:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 12,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "39bfb891c... |
46f95b6a-8cf0-433f-9742-3d98dc9d0be0 | yuyuyuyurisuki/CODE_CXX | practice/acm/neuacm-training2021/stringBase/test.cc | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
const double EPS = 1e-8;
const int N = 1e6 + 1;
template <class T>
size_t getHash(T s)
{
return hash<T>{}(s);
}
int main(int argc, char *argv[])
{
std::ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
return 0;
}
struct KM... | ALGO | 0.999928 | 4.585527 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2022-08-26T15:15: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": "6eebe0a98... |
49814f3a-9de2-4a37-867b-0bb3e4ef5ee5 | Tidud/neural-network-for-recommending | matrix.cpp | // Включаеме файлы
#include <iostream>
#include <stdlib.h>
#include "matrix.h"
// Конструктор матрицы
matrix::matrix()
{
rows = 0;
columns = 0;
data = nullptr;
}
// Инициализация матрицы
void matrix::init(int rows, int columns)
{
data = new float* [rows];
for (int i = 0; i < rows; i++)
data[i] = new float[col... | ALGO | 0.968195 | 3.800712 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-11T16:43: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": "b61df03be952... |
e8bd0dc2-ff90-4c88-be49-d5cde5f22b35 | dpgaharwal/Coding-Question | TLE/Weekly Practice Questions/Week-6 Recursion/Regular_Expression_Matching.cpp | // Problem Link: https://leetcode.com/problems/regular-expression-matching/
// Approach: Dynamic Programming
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool isMatch(string s, string p)
{
int m = s.size(), n = p.size();
vector<vector<bool>> dp(m + 1, vector<bool>(n +... | ALGO | 0.999747 | 6.164124 | {
"github_metadata": {
"branch": "main",
"commit_count": 73,
"repo_created_at": "2025-01-03T07:58: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": "7c9ac092a4b... |
3dde5806-f9b9-4533-939b-3e092279c10f | mwy3055/Algorithm-codes | baekjoon/cpp/c++/2352.cpp | #include <bits/stdc++.h>
using namespace std;
int LIS(int &n, int *arr) //길이 n인 배열 arr에서 LIS의 길이를 구하여 반환
{
int len = 0;
int *d = new int[n];
d[0] = arr[0];
for (int i = 1; i < n; i++)
{
if (d[len] < arr[i])
{
d[++len] = arr[i];
}
else
{
... | ALGO | 0.999966 | 4.820372 | {
"github_metadata": {
"branch": "main",
"commit_count": 1073,
"repo_created_at": "2022-01-08T11:18:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c0a1fb86... |
b73fbe8f-92ab-4a9d-a3e1-951fcc84adb7 | iam-salman/GFG-Problem-of-the-Day | Problem of the Day/solve_the_sudoku.cpp | /*
Solve the Sudoku
https://practice.geeksforgeeks.org/problems/solve-the-sudoku-1587115621/1
*/
class Solution
{
public:
bool isSafe(int grid[N][N], int row, int col, int value) {
for (int i = 0; i < N; i++) {
if (grid[row][i] == value || grid[i][col] == value)
retur... | ALGO | 0.999683 | 6.043145 | {
"github_metadata": {
"branch": "master",
"commit_count": 15,
"repo_created_at": "2023-07-26T15:07: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": "972783e6a... |
1349eae3-be4d-4bd6-bae6-347d0af25ec2 | fengdut/dwk- | src/particle_fre.cpp | #include<cmath>
#include<complex>
#include"tokamak.h"
#include"mconf.h"
#include"protos.h"
#include"AllocArray.h"
#include"simpintegral.h"
#include"vector.h"
#include"omp.h"
#include<ctime>
#include"stdlib.h"
#include"outlog.h"
using namespace std;
void Chi(const Grid *grid,const Tokamak *tok, double sigma,double **C... | ALGO | 0.999089 | 3.364721 | {
"github_metadata": {
"branch": "master",
"commit_count": 83,
"repo_created_at": "2015-12-07T21:57:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fc45352d7... |
0536de5b-e5d3-47ca-88c7-fb343b723a8d | orfeotoolbox/OTB | Modules/Core/Descriptors/include/otbFourierMellinDescriptorsImageFunction.h | /*
* Copyright (C) 2005-2024 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* 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 ... | ALGO | 0.974655 | 7.390778 | {
"github_metadata": {
"branch": "develop",
"commit_count": 34510,
"repo_created_at": "2015-07-17T15:56:48.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 370,
"forks": 120,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "8d... |
ba4b442b-a035-4db2-a38c-6e33627bc6eb | AIxiaodi4Ever/leetcode_in_cpp | 01a栈_队列_双端队列/0150_vector_official.cpp | class Solution {
public:
bool isNumber(string& s)
{
return s != "+" && s != "-" && s != "*" && s != "/";
}
int evalRPN(vector<string>& tokens) {
int n = tokens.size();
vector<int> stk((n + 1) / 2);
int top = -1;
for (auto& token : tokens) {
if (isNumb... | ALGO | 0.999924 | 5.500093 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-03-06T06:20:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "51602194a... |
f76049dc-da43-47ce-917b-8c07274cdca8 | roshankshaw/programming-challenges | count_say.cpp | #include<bits/stdc++.h>
#define lli long long int
#define rep(i,a,b) for(long long int i=a;i<b;i+=1)
#define repd(i,a,b) for(long long int i=a;i>=b;i-=1)
#define test() int t; cin>>t; while(t--)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007
using namespace std;
/*
question
The ... | ALGO | 0.999996 | 4.533351 | {
"github_metadata": {
"branch": "master",
"commit_count": 23,
"repo_created_at": "2019-05-14T09:49: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": "e89a51600... |
dbc8a02e-4915-4f8b-89c7-08f9c18bbb97 | munich-quantum-toolkit/core | src/zx/Utils.cpp | /*
* Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
* Copyright (c) 2025 Munich Quantum Software Company GmbH
* All rights reserved.
*
* SPDX-License-Identifier: MIT
*
* Licensed under the MIT License
*/
#include "zx/Utils.hpp"
#include "zx/ZXDefinitions.hpp"
#include <optional>
#include <vector>... | TOOL | 0.971476 | 7.52774 | {
"github_metadata": {
"branch": "main",
"commit_count": 3119,
"repo_created_at": "2020-01-02T08:54:03.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 80,
"forks": 41,
"issues": 33,
"pull_requests": 9
},
"file_meta": {
"content_id": "9a4a0f4... |
9f699aac-457d-4b9d-960b-7f478889d873 | JimmyWang0417/Algorithm-Competitive-Codes | Codeforces/PROBLEMSET/CF1438E Yurii Can Do Everything.cpp | // Problem: E. Yurii Can Do Everything
// Contest: Codeforces - Codeforces Round #682 (Div. 2)
// URL: https://codeforces.com/problemset/problem/1438/E
// Memory Limit: 256 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include <bits/extc++.h>
#include <bits/stdc++.h>
#define int ll
#defi... | ALGO | 0.99992 | 4.577171 | {
"github_metadata": {
"branch": "master",
"commit_count": 106,
"repo_created_at": "2019-08-30T06:36:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4b47158e... |
a6ed717f-3838-4f47-a7da-b361d5697b7b | JayaSurya-lj/leetcode | 2265-count-nodes-equal-to-average-of-subtree/2265-count-nodes-equal-to-average-of-subtree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999834 | 5.999811 | {
"github_metadata": {
"branch": "main",
"commit_count": 519,
"repo_created_at": "2023-08-07T17:34: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": "9cbb35918c... |
267e1137-43f9-43b8-a330-6f8160e81e43 | Fahim199/Problem-Solving | Codeforces/1637B.cpp | //Problem link: https://codeforces.com/contest/1637/problem/B
#include <bits/stdc++.h>
typedef unsigned long long int ll;
using namespace std;
void subsetsUtil(vector<int>& A, vector<vector<int> >& res,vector<int>& subset, int index,vector<int>&rec){
res.push_back(subset);
for (int i = index; i < A.size(); i+... | ALGO | 0.999714 | 4.429895 | {
"github_metadata": {
"branch": "main",
"commit_count": 40,
"repo_created_at": "2021-09-19T00:39:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "570ab0a09da... |
80093674-2283-4d00-9250-3e363cf466a0 | SUBHAJITMONDAL-03/Leetcode_Question_Solving | Palindrome with minimum sum - GFG/palindrome-with-minimum-sum.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
// User function Template for C++
class Solution {
public:
int minimumSum(string s) {
int n=s.size();
for(int i=0;i<n/2;i++){
if... | ALGO | 0.999737 | 5.088476 | {
"github_metadata": {
"branch": "main",
"commit_count": 491,
"repo_created_at": "2022-10-15T08:22:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dafecfb785... |
01c1092a-a7b7-42da-960c-2c099c17ce13 | wuzhiguocarter/Cplusplus | qiuzhao/haoweilai/multiply_thread.cpp | include <pthread.h>
#include <stdlib.h>
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
struct matrixArgs
{
int *pMatrixLineA;
int *pMatrixLineB;
int *pResult;
int matrixLineCount;
};
void *calculate(void *arg)
{
matrixArgs *args = (matrixArgs*) arg;
*(args->pResult) = 0... | ALGO | 0.999907 | 3.328483 | {
"github_metadata": {
"branch": "master",
"commit_count": 21,
"repo_created_at": "2016-08-18T09:36: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": "01ea8c23f... |
b130f3d4-1259-44f9-be81-410874475cb7 | acastellanos95/Concurrent-Matrix-Sort | Matrix Merge Sort/Utils.h | //
// Created by andre on 10/15/21.
//
#ifndef MATRIX_MERGE_SORT_UTILS_H
#define MATRIX_MERGE_SORT_UTILS_H
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <ios>
#include <fstream>
#include <sstream>
#include <thread>
#include <atomic>
#include <mutex>
#include <filesystem>
std... | ALGO | 0.990914 | 5.774573 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2021-10-22T17:05:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "79cbda9419fd... |
baf4dab2-ab8e-46be-8acb-462463432dc5 | mbits-libs/args | src/parser.cpp | // Copyright (c) 2018 midnightBITS
// This code is licensed under MIT license (see LICENSE for details)
#include <args/parser.hpp>
#include <cstring>
#include <fstream>
namespace {
inline std::string s(std::string_view sv) {
return {sv.data(), sv.length()};
}
inline std::string const& s(std::string const& in) ... | TOOL | 0.983921 | 7.599958 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2018-11-11T18:56:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4f34cbd469... |
171fd91c-f944-45af-ba60-fa20da6e5c8c | opencog/moses | moses/moses/moses/partial.h | /** partial.h ---
*
* Copyright (C) 2012 Poulin Holdings
*
* Author: <NAME> <<EMAIL>>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License v3 as
* published by the Free Software Foundation and including the exceptions
* at http:/... | ALGO | 0.999553 | 6.349616 | {
"github_metadata": {
"branch": "master",
"commit_count": 16698,
"repo_created_at": "2015-04-26T19:15:06.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 131,
"forks": 85,
"issues": 13,
"pull_requests": 0
},
"file_meta": {
"content_id": "7a3... |
d0195452-4dd6-4dc9-a061-d69ba048e08d | Alberto-SC/Competitive-Programming-solutions | kattis/chess.cpp | #include <bits/stdc++.h>
using namespace std;
#define f(a) a.first
#define s(a) a.second
int main(){
pair<int,int> X,Y;
int t;
cin>>t;
while(t--){
char a,b;
cin>>a>>b;
X = {a-'A',b-'0'};
cin>>a>>b;
Y = {a-'A',b-'0'};
// cout<<X.first<<" "<<X.second<<" ... | ALGO | 0.999617 | 3.396121 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2020-07-20T03:18:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "58b7a219e910... |
8a1db96d-bc05-40c2-bd01-87d37cd96632 | ashraf1600/Algorithm_Lab-2-2- | Algo_lab_testprep/number_of_inversion.cpp | #include <bits/stdc++.h>
using namespace std;
// Partition function as per the video lectures
int partition(int arr[], int l, int r) {
int pivot = arr[l]; // First element as pivot
int i = l + 1;
for (int j = l + 1; j <= r; j++) {
if (arr[j] < pivot) {
swap(arr[i], arr[j]);
... | ALGO | 0.999572 | 5.398185 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2024-09-29T07:14: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": "780483e6fc58... |
a536fcec-2d08-48b8-9779-751de2d881e6 | mayankmishra0801/leetcode | 2873-maximum-value-of-an-ordered-triplet-i/2873-maximum-value-of-an-ordered-triplet-i.cpp | class Solution {
public:
long long maximumTripletValue(vector<int>& nums) {
// int n = nums.size();
// long long result = 0;
// for(int i = 0;i<n;i++){
// for(int j = i+1;j<n;j++){
// for(int k = j+1;k<n;k++){
// long long value = (1LL*(nums[i]-nums[... | ALGO | 0.99998 | 5.20877 | {
"github_metadata": {
"branch": "main",
"commit_count": 270,
"repo_created_at": "2024-05-25T08:21:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a8da814eed... |
428fe1c3-04d2-49d9-9374-dc49ab8a3f69 | miguelsndc/competitive-programming-lib | Solutions/AtCoder/Dump/abc398_d.cpp | #include <bits/stdc++.h>
using namespace std;
template <typename T>
using vc = vector<T>;
using ll = long long;
const int maxn = 2e5 + 5;
namespace rg = std::ranges;
void solve() {
int n, r, c;
cin >> n >> r >> c;
string s;
cin >> s;
vc<vc<int>> dirs(256);
dirs['N'] = {1, 0};
dirs['S'] = ... | ALGO | 0.999927 | 4.027935 | {
"github_metadata": {
"branch": "main",
"commit_count": 88,
"repo_created_at": "2025-03-19T13:03: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": "e26fea04b74... |
28578a3b-c149-4a21-b5e1-5754171c4b24 | kjh107704/Algorithm | BOJ/1922_prim.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> edge;
// V = 컴퓨터의 수, E = 연결할 수 있는 선의 수
int V, E;
struct cmp
{
bool operator()(edge a, edge b)
{
return a.second > b.second;
}
};
void prim_with_priority_queue(int start_vertex, vector<edge> *graph)... | ALGO | 0.999978 | 4.836948 | {
"github_metadata": {
"branch": "master",
"commit_count": 194,
"repo_created_at": "2018-04-03T17:31: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": "c9138df7... |
4d993ddb-3836-41a5-b72a-bb9ccb5343c3 | Camithilwen/Code-Cloning-Analysis | src/llm-scripts/testing/Project_CodeNet_experimentation_dataset/data/p02714/s359757388.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000
#define MOD 1000000007
void solve() {
string s;
ll n, ans;
cin >> n >> s;
vi r, g;
for (int i = 0; i < n; ++i) {
if (s[i] == ... | ALGO | 0.99808 | 3.807499 | {
"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": "2b3dfba081... |
7941f3fb-a3f3-4f59-9ef1-d6455162a231 | vedantbothikar/prepit | DSA - Practice/code/binary trees/build_tree/basic_tree_implementation/code.cpp | // Online C++ compiler to run C++ program online
#include <iostream>
using namespace std;
// TREEE TRAVERSAL USING RECURSION
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
this->data = d;
this->left = NULL;
this->right = NULL;
}
};
// if data = ... | ALGO | 0.999857 | 5.123556 | {
"github_metadata": {
"branch": "main",
"commit_count": 530,
"repo_created_at": "2022-08-30T19:01: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": "40b690af5b... |
dfa2046d-b459-4742-a4d6-9fe9db0f62b4 | Laxmibharti/studentdatamanagement | studenmanagementproject.cpp | #include <iostream>
using namespace std;
// Structure of a student node
struct Student {
int roll;
string name;
float marks;
Student *left, *right;
};
// Function to create a new student node
Student* createNode(int roll, string name, float marks) {
Student* newNode = new Student();
newNode->r... | ALGO | 0.996886 | 5.617608 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-06-08T18:04: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": "3d814b4260f3... |
ef9a6407-4379-4c89-801d-67e8fcd30a75 | JKWalleiee/PCL_TUTORIALS | Clusters_modificado/cluster_extraction.cpp | #include <pcl/ModelCoefficients.h>
#include <pcl/point_types.h>
#include <pcl/io/pcd_io.h>
#include <pcl/filters/extract_indices.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/features/normal_3d.h>
#include <pcl/kdtree/kdtree.h>
#include <pcl/sample_consensus/method_types.h>
#include <pcl/sample_consensus/model_t... | DATA | 0.951261 | 5.171784 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-05-30T19:40:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9e376d9b99... |
0d05f20e-f03f-4297-b37b-85442972b881 | ziglang/zig | lib/libcxx/include/__numeric/adjacent_difference.h | // -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===------------... | ALGO | 0.987471 | 7.301738 | {
"github_metadata": {
"branch": "master",
"commit_count": 34092,
"repo_created_at": "2015-08-06T00:51:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 40012,
"forks": 2915,
"issues": 3389,
"pull_requests": 267
},
"file_meta": {
"content_i... |
c7b35291-727c-4065-b348-c56ed3c60d6f | mrjmac/competitive-programming | CodeForces/candyHard.cpp | #include <bits/stdc++.h>
using namespace std;
struct fasterset
{
priority_queue<int, vector<int>, greater<int>> pq, trash;
void insert(int x)
{
pq.emplace(x);
}
void remove(int x)
{
trash.emplace(x);
}
int get()
{
while (trash.size() && pq.top() == trash.... | ALGO | 0.999987 | 4.204486 | {
"github_metadata": {
"branch": "main",
"commit_count": 241,
"repo_created_at": "2022-05-03T03:14: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": "0cc85d0985... |
515cbf79-e25b-4aa8-90c7-cf24ead92923 | sywrr/RadarProject_Suny | test2/src/jni/Classify_breath.cpp | #include "Classify_breath.h"
#include <stdio.h>
#include <string.h>
#include <math.h>
//#include "filter.c"
//#include <time.h>
Classify_breath::Classify_breath(void)
{
multi_flag=0;
AD_ELEMENT_SIZE = 8192; //512
SLAVE_SIZE = 2048; /*512*/ //AD_ELEMENT_SIZE/N_rowpoint
HARF_AD_SIZE = 1024; /*256*/
REP_LEN... | ALGO | 0.974627 | 3.722258 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2022-05-06T12:38: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": "058dd9cf0b8c... |
be8db9c0-429a-4af9-9d3d-38017670c670 | petebannister/aoc2021 | day16/main.cpp | #include "utils.h"
using namespace std;
using Bits = vector<bool>;
using Biterator = Bits::const_iterator;
Bits ParseBits(StringView s) {
Bits bits;
bits.reserve(s.size() * 4);
auto bs = s.take(1);
while (!bs.empty()) {
auto b = bs.parseNibbleHex();
bs = s.take(1);
bits.push_ba... | ALGO | 0.998764 | 5.401441 | {
"github_metadata": {
"branch": "main",
"commit_count": 59,
"repo_created_at": "2021-11-30T21:08: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": "005a645d2e1... |
4366e00c-de48-4bd8-938d-0d8448c1d599 | jk2020214154/Data_Structure_Code | 第三章 栈、队列和数组/3.1 栈/3_1_5.cpp | #include<iostream>
using namespace std;
#define MaxSize 50
typedef int ElemType;
//顺序栈(top1初始为-1,top2初始为MaxSize--->指向栈顶元素的当前位置)
//type为1表示第一个栈,反之type为2表示第二个栈
typedef struct{
ElemType data[MaxSize];
int top1;
int top2;
}SqStack;
void InitStack(SqStack &S)//栈的初始化
{
S.top1=-1;
S.top2=MaxSize;
}
b... | ALGO | 0.993127 | 3.7082 | {
"github_metadata": {
"branch": "master",
"commit_count": 241,
"repo_created_at": "2023-07-18T03:38:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 9,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "50ebe72d... |
a4d8d090-612b-4190-89e9-8a0c024e0e4a | GarvitDadheech/cp-algo-questions | DP/digitDp.cpp/RecoverLCS.cpp | #include<bits/stdc++.h>
using namespace std;
vector<vector<int>> dp;
string ans;
int lcsLength(string &A,string &B,int i,int j) {
if(i>=static_cast<int>(A.length()) || j>=static_cast<int>(B.length())) {
return 0;
}
if(dp[i][j]!=-1) {
return dp[i][j];
}
int ans1 = 0;
if(A[i]==B[j... | ALGO | 0.999994 | 4.760845 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2024-07-11T17:58:47.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bec05ec9633b... |
a311ea2e-60bc-43de-9b48-6a9e1bb968fc | vinci-grape/Rectifier | output/CodeGen/avatar/Python/C++_handraft/codeforces_222_A.c++ | #include <iostream>
#include <cstdlib>
using namespace std;
int main ( ) {
int n, k ;
cin >> n >> k ;
int * elems = new int [ n ] ;
for ( int i = 0 ; i < n ; i ++ ) {
cin >> elems [ i ] ;
}
bool all_same = true ;
for ( int i = 0 ; i < k - 1 ; i ++ ) {
if ( elems [ i ]!= elem... | ALGO | 0.999749 | 3.683367 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-09T09:23:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "36cf4ccef5e0... |
7fb49e78-a23a-4673-abe8-ee137b87ca1f | ChenkaiMa/TryOutR | sPCAmPC/src/RcppExports.cpp | // Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 1<PASSWORD>
#include <RcppEigen.h>
#include <Rcpp.h>
using namespace Rcpp;
#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();... | ALGO | 0.999192 | 5.459377 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-01-08T21:36: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": "c0a57ddf4b7c... |
043cade6-c9b1-401b-b983-5818aa1ab42a | Vladi98/Project-GEOMETRY | main.cpp | #include <iostream>
#include <exception>
#include <string>
#include <fstream>
#include <math.h>
#include "Element.h"
using namespace std;
int main()
{
unsigned option;
int vecDirection, nullVector;
string type;
Element element1, element2;
Point point1, point2;
Vector vector1, vector2;
Triangle triangleA, t... | TOOL | 0.947804 | 3.457446 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2018-08-20T11:19:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e221ec367b... |
76827096-4deb-4d5a-b546-fba5a2a5041f | ShinDongHyuk/Algorithm-Test | B5.cpp | #include <iostream>
using namespace std;
int l, m, x[100], y[100], r;
int min(int a, int b) {
if (a >= b) {
return b;
}
else {
return a;
}
}
int max(int a, int b) {
if (a <= b) {
return b;
}
else {
return a;
}
}
int main(void) {
scanf("%*d%d%d", &l, &m);
for (int i = 0; i < m; i++) {
cin >> x[i... | ALGO | 0.999912 | 3.588993 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-10-20T06:25: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": "fade8876f... |
a17954b0-6fa4-4c50-9c16-8d18b7dc21c7 | mirajehossain/life-charger | data-structure/Stack/stack_push.cpp | #include <iostream>
#include<cstdlib>
using namespace std;
typedef struct node Node;
struct node {
int data;
Node *next;
};
Node *head = NULL, *topNode;
int top = -1, counter = 1, size = 6;
void push(int data){
if(counter == size){
cout<<"Stack is overflow";
exit(1);
} else {
Node *newNod... | ALGO | 0.999706 | 4.275799 | {
"github_metadata": {
"branch": "master",
"commit_count": 135,
"repo_created_at": "2017-05-15T17: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": "f7b27459... |
dbfc3698-01ed-4ca0-982c-63a00c680b09 | liuyubobobo/Play-Leetcode | 0001-0500/0198-House-Robber/cpp-0198/main.cpp | /// Source : https://leetcode.com/problems/house-robber/description/
/// Author : liuyubobobo
/// Time : 2017-11-19
#include <iostream>
#include <vector>
using namespace std;
/// Memory Search
/// Time Complexity: O(n)
/// Space Complexity: O(n)
class Solution {
private:
// the max profit for robbing nums[i...... | ALGO | 0.999962 | 5.166304 | {
"github_metadata": {
"branch": "master",
"commit_count": 2592,
"repo_created_at": "2016-12-01T17:08:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2732,
"forks": 718,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "b9... |
058871f0-3b95-4824-95e5-9e5b05960470 | SeaBass917/Blind75 | 12 - RotateImage/main.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <utility>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h> /* log10 */
#include <string>
using namespace std;
class Solution {
public:
void rotate(vector<vector<int>>& matrix) {
... | ALGO | 0.999943 | 5.803429 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2022-11-05T23:13: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": "c8de2d01ab... |
81aa8052-38e4-4ad8-b54c-4b92cdde2d3b | bangalcat/Algorithms | graph/9466.cc | /*
백준 : 텀 프로젝트
싸이클 찾기
scc에 썼던 간선 분류를 이용했는데, degree를 이용한 방법도 있음
*/
#include <iostream>
#include <vector>
#include <functional>
using namespace std;
const int MAX_V = 1e5+1;
int main()
{
int T; cin >> T;
while(T--){
//n <= 1e5
int n; cin >> n;
int adj[MAX_V];
for (in... | ALGO | 0.999845 | 4.807782 | {
"github_metadata": {
"branch": "master",
"commit_count": 103,
"repo_created_at": "2018-10-05T06:21:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "26204680... |
63c0c3f1-c911-4648-b665-a1c9549812ec | trinhminhtriet/leetcode | solutions/2400-2499/2493.divide-nodes-into-the-maximum-number-of-groups/Solution.cpp | class Solution {
public:
int magnificentSets(int n, vector<vector<int>>& edges) {
vector<int> g[n];
for (auto& e : edges) {
int a = e[0] - 1, b = e[1] - 1;
g[a].push_back(b);
g[b].push_back(a);
}
vector<int> d(n);
for (int i = 0; i < n; ++i... | ALGO | 0.999812 | 5.108872 | {
"github_metadata": {
"branch": "master",
"commit_count": 118,
"repo_created_at": "2024-12-09T17:55:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 34,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25b389... |
04deb93b-2918-484b-9526-7877ad576880 | invincible04/Competitive-Programming | A_Directional_Increase.cpp | #include <bits/stdc++.h>
#define int long long
#define f(i,a,b) for(int i=a;i<b;i++)
#define mp make_pair
#define pb push_back
#define rall(a) a.rbegin(),a.rend()
#define all(a) a.begin(),a.end()
#define arraysort(a) sort(a,a+n)
#define endl... | ALGO | 0.999916 | 4.04762 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2023-01-28T22:56:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "856a5e749... |
843edcb1-8c8d-45bf-8a59-d464a9bb008e | Tora416/MultiCodeEmbed | dataset/dataset_raw/gcj_cpp/Shloub/3264486_5633382285312000_Shloub.cpp | #include <iostream>
#include <string>
int main() {
int T;
std::cin >> T;
for (auto t = 1; t <= T; ++t) {
std::string r{""};
std::string s;
std::cin >> s;
// std::cerr << s << '\n';
auto ns = s;
auto i = 0U;
while ((i < s.size() - 1) and (s[i] <= s[i + 1]))
++i;
if (i == s.si... | ALGO | 0.999705 | 6.012482 | {
"github_metadata": {
"branch": "master",
"commit_count": 57,
"repo_created_at": "2025-07-10T08:38:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "1e39bce87... |
767f5785-095b-4117-88af-29b17e5104df | JelluSandro/olympic-code-cpp | inopolis/graphSets5/5.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
vector<int> parent;
vector<int> rnk;
vector<int> answer;
int n;
int find_set(int v) {
if (v == parent[v])
return v;
return parent[v] = find_set(parent[v]);
}
void union_sets(int lista, int listb) {
lista = find_set(lista);
li... | ALGO | 0.999939 | 4.222289 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-08-06T09:41: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": "1d4972d8b06e... |
d1bb0748-dc8b-43f5-98a5-c00ff9562037 | Hunterdii/GeeksforGeeks-POTD | December 2024 GFG SOLUTION/December-23.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//Back-end complete function Template for C++
class Solution {
public:
bool searchRowMatrix(vector<vector<int>>& mat, int x) {
for (auto& row : mat) {
if (binary_search(row.begin(), row.end(), x)) return... | ALGO | 0.99939 | 5.508891 | {
"github_metadata": {
"branch": "main",
"commit_count": 3732,
"repo_created_at": "2024-03-09T09:48:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 202,
"forks": 54,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "25fd55... |
54185406-1688-4a48-944f-f9f81508d945 | ishandutta2007/codeforces-a | andreikkaa/normal/638/C.cpp | #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstdio>
#include<numeric>
#include<cstring>
#include<ctime>
#include<cstdlib>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<list>
#include<cmath>
#include<bitset>
#include<cassert>
#include<queue>
#i... | ALGO | 0.99984 | 4.006963 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-04-11T00:51:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef28d5781e7c... |
b7ae65d7-6311-437c-82a0-c223ac0111a1 | NSchertler/OnlineSurfaceReconstruction | libOSR/src/HierarchyUnstructured.cpp | /*
hierarchy.cpp: Code to generate unstructured multi-resolution hierarchies
from meshes or point clouds
This file is part of the implementation of
Instant Field-Aligned Meshes
<NAME>, <NAME>, <NAME>, and <NAME>
In ACM Transactions on Graphics (Proc. SIGGRAPH Asia 2015)
All rights reserved. Use of this sou... | ALGO | 0.996341 | 3.353262 | {
"github_metadata": {
"branch": "master",
"commit_count": 67,
"repo_created_at": "2017-04-09T15:13:41.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 164,
"forks": 36,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f34799... |
d9dfc342-7d50-4553-9499-436403c8e448 | vishnubhagwan/Programs | gfg/infix_to_postfix.cpp | #include <iostream>
#include <iomanip>
#include <queue>
#include <vector>
#include <algorithm>
#include <map>
#include <stack>
#include <assert.h>
#define pii pair<int, int>
#define vipii vector<int, pair<int, int> >
#define ipii pair<int, pair<int, int> >
using namespace std;
typedef long long int ll;
const int N =... | ALGO | 0.999952 | 4.493307 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2016-04-22T17:33: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": "6c0dde88e... |
5e4122e0-64cc-4952-bcb2-84ebeea79d04 | restereo/glassbead | cpp/go_funcs.cpp | /* Timer and loggin */
void timer_start(struct timeval *st) {
gettimeofday(st, NULL);
}
void timer_log(struct timeval *st, const char *msg, bool show_fps=false) {
struct timeval now;
gettimeofday(&now, NULL);
double tm = double(now.tv_sec - st->tv_sec)+double(now.tv_usec - st->tv_usec)/1000000.0;
if (show_fp... | ALGO | 0.975429 | 3.60582 | {
"github_metadata": {
"branch": "master",
"commit_count": 32,
"repo_created_at": "2015-08-26T18:21:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0cc9bcd5a... |
23e384bf-bcc2-4127-b905-db1179c889b4 | jhu-cisst/cisst | cisstMesh/msh3AlgDirPDTreevonMisesProj.h | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
// ****************************************************************************
//
// Copyright (c) 2014, <NAME>, <NAME>, Johns Hopkins University
// ... | ALGO | 0.997943 | 6.560442 | {
"github_metadata": {
"branch": "main",
"commit_count": 4711,
"repo_created_at": "2014-03-12T21:45:28.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 69,
"forks": 45,
"issues": 22,
"pull_requests": 1
},
"file_meta": {
"content_id": "c704239... |
3b3bc806-df3b-432a-8dd9-af0783e7b736 | luojinlongjjj/android-faiss | app/src/main/cpp/source/faiss/IndexIVFSpectralHash.cpp | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// -*- c++ -*-
#include "IndexIVFSpectralHash.h"
#include <memory>
#include <algorithm>
#include <stdint.h>
#include "hamming.... | ALGO | 0.930524 | 6.2616 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2020-06-22T13:11:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 48,
"forks": 5,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "65931d953... |
b28bf6cd-e103-47a4-9ce6-52568692dca2 | gurwinder-git/cpp | spiralMatrix.cpp | #include <iostream>
#include <vector>
using namespace std;
vector<int> spiralMatrix(vector<vector<int>> &matrix);
int main()
{
vector<vector<int>> mat = {{1, 2, 3},
{4, 5, 6},
{7, 8, 9}};
vector<int> res = spiralMatrix(mat);
for (int num : r... | ALGO | 0.999993 | 5.337156 | {
"github_metadata": {
"branch": "master",
"commit_count": 282,
"repo_created_at": "2021-09-02T11:30: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": "cbde53ef... |
9632d7d6-15e9-48df-a5cf-0302e389883a | prempreetbrar/Directory-Analyzer | analyzeDir.cpp | #include "analyzeDir.h"
// OS-Specific Includes for error-handling
#ifdef __linux__
#include <error.h>
#elif defined(__APPLE__) || defined(__MACH__)
#include <errno.h>
#include <cstdio>
#include <cstdlib>
#elif defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#include <iostream>
#endif
... | ALGO | 0.993002 | 7.64382 | {
"github_metadata": {
"branch": "main",
"commit_count": 17,
"repo_created_at": "2025-02-23T01:19: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": "4a3055dfebd... |
d80fcb04-aba5-48c5-9261-91d2c233716a | TmsC21/MyProjects | C++/Zadanie3/main.cpp | /*
Meno a priezvisko: <NAME>
POKYNY:
(1) Subor premenujte na Priezvisko_Meno_ID_zadanie03.cpp (pouzite vase udaje bez diakritiky).
(2) Implementujte funkcie tak, aby splnali popis pri ich deklaraciach.
(3) Cela implementacia musi byt v tomto jednom subore.
(4) Odovzdajte len tento (spravne premenovany) zdrojovy su... | ALGO | 0.999841 | 4.276233 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2020-11-27T21:45:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "91f782c11a6... |
5ea3ad11-82f2-4b89-bd11-d4be23780b68 | 100495717/PROYECTO-PROCESAMIENTO-DE-IM-GENES-C-ARQUITECTURA-DE-COMPUTADORES | imgaos/image-operations-aos.hpp | // image-operation-aos.hpp
#ifndef IMAGE_OPERATION_AOS_HPP
#define IMAGE_OPERATION_AOS_HPP
#include <vector>
#include <cstdint>
#include <string>
#include <limits>
#include <unordered_map>
#include <iostream>
#include "../common/binaryio.hpp"
struct Pixel {
uint16_t r;
uint16_t g;
uint16_t b;
bool op... | ALGO | 0.921597 | 6.690322 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2024-10-08T11:49: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": "b54f4071707... |
5bd34b7d-fc0f-4392-905a-be2f10eefc96 | akhilkammila/leetcode-screenshotter | editorial_code/2000-2999/2256. Minimum Average Difference/cpp-2.cpp | class Solution {
public:
int minimumAverageDifference(vector<int>& nums) {
int n = int(nums.size());
int ans = -1;
int minAvgDiff = numeric_limits<int>::max();
long long currPrefixSum = 0;
// Get total sum of array.
long long totalSum = 0;
for (int in... | ALGO | 0.999988 | 6.802406 | {
"github_metadata": {
"branch": "main",
"commit_count": 33,
"repo_created_at": "2023-06-02T16:24:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 912,
"forks": 294,
"issues": 7,
"pull_requests": 0
},
"file_meta": {
"content_id": "4ac35a7... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.