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 |
|---|---|---|---|---|---|---|---|
86398beb-c23c-4a0c-bafd-30424ce259ff | amir5200fx/Tonb | Common/Foam/include/base/PatchToolsEdgeOwnerI.hxx | #pragma once
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class FaceList, class PointField>
tnbLib::labelList tnbLib::PatchTools::edgeOwner
(
const PrimitivePatch<FaceList, PointField>& p
)
{
typedef typename PrimitivePatch<FaceList, PointField>::FaceType FaceType;
const... | ALGO | 0.954493 | 6.31861 | {
"github_metadata": {
"branch": "master",
"commit_count": 2430,
"repo_created_at": "2019-12-25T02:29:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 3,
"issues": 29,
"pull_requests": 1
},
"file_meta": {
"content_id": "1d7205... |
356bc9e2-bf6d-4eec-a7fb-18119b93ef09 | facebookarchive/BOLT | libclc/generic/lib/math/fract.inc | /*
* Copyright (c) 2015 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modif... | ALGO | 0.991279 | 6.262134 | {
"github_metadata": {
"branch": "main",
"commit_count": 410387,
"repo_created_at": "2018-04-24T23:40:08.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2530,
"forks": 183,
"issues": 66,
"pull_requests": 2
},
"file_meta": {
"content_id": "ed... |
e2bcf306-db06-4af0-8090-72920bf7905d | afsanamim04/Codeforces_Solution | AccurateLee.cpp | #include <bits/stdc++.h>
#define PI acos(-1.0)
#define all(x) x.begin(), x.end()
#define nl '\n'
#define pb push_back
typedef long long int ll;
typedef unsigned long long int llu;
using namespace std;
void sol() {
int n;
cin >> n;
string s,t,a,b, ans;
cin >> s;
for ( int i = 0; i < n; ++i ){
if(s[i]=='0')... | ALGO | 0.999969 | 4.213466 | {
"github_metadata": {
"branch": "main",
"commit_count": 34,
"repo_created_at": "2024-03-14T15:50:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "41c7736c20d... |
65b40110-f960-4481-9406-1ad186e2d408 | crackersamdjam/DMOJ-Solutions | CCO/cco03p2.cpp | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define gc getchar()
#define pc(x) putchar(x)
template<typename T> void scan(T &x){x = 0;bool _=0;T c=gc;_=c==45;c=_?gc:c;while(c<48||c>57)c=gc;for(;c<48||c>57;c=gc);for(;c>47&&c<58;c=gc)x=(x<<3)+(x<<1)+(c&15);x=_?-x:x;}
template<typename T> void printn(T n... | ALGO | 0.999918 | 3.634438 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2021-08-08T18:36:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "09f1659a0... |
680253a9-024c-47a3-9637-6e443bfa118c | Pointcept/Pointcept | libs/pointops2/src/attention/attention_cuda.cpp | #include <vector>
#include <torch/serialize/tensor.h>
#include <ATen/cuda/CUDAContext.h>
#include "attention_cuda_kernel.h"
void attention_step1_forward_cuda(int N, int M, int h, int C, at::Tensor q_tensor, at::Tensor k_tensor,
at::Tensor index0_tensor, at::Tensor index1_tensor, at::Tensor attn_tensor)
{
cons... | DATA | 0.985265 | 4.594845 | {
"github_metadata": {
"branch": "main",
"commit_count": 113,
"repo_created_at": "2023-03-21T17:28:09.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 2318,
"forks": 274,
"issues": 275,
"pull_requests": 5
},
"file_meta": {
"content_id": "ac89... |
a92cf4bb-49fa-42b7-9afa-b9a5c821f127 | vasubansal1033/DSA_dups | Datastructures/010 Graphs/test.cpp | #include<bits/stdc++.h>
using namespace std;
class graph{
int v; // number of vertices
int e; // number of edges
vector<int>* adj; // array of vectors
public:
graph(int v){
this->v = v;
adj = new vector<int>[v];
e = 0;
}
// return number of edges
int getEdges(){
... | ALGO | 0.998915 | 4.713046 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2021-05-15T12:26:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 24,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "825d4b09f8... |
d72e7f50-f624-49f9-a6cc-13989b2d852c | KailasMahavarkar/interview-prep | DP Question/frog_jump_leetcode_403.cpp | #include <algorithm>
#include <climits>
#include <cstring>
#include <iostream>
#include <iterator>
#include <unordered_map>
#include <vector>
#pragma GCC optimize("O3,unroll-loops")
using namespace std;
/*
Problem Link : https://leetcode.com/problems/frog-jump/description/
Company Tags : None
Youtube L... | ALGO | 0.999842 | 5.679734 | {
"github_metadata": {
"branch": "master",
"commit_count": 219,
"repo_created_at": "2023-02-21T13:25: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": "88ef5999... |
9655b049-4aa1-4512-a047-cdeee7fbf272 | abdallahmontaser/my-code | Prim Algorithm.cpp | #include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
struct Edge
{
int from, to, w;
bool operator<(const Edge& e)const
{
return w > e.w;
}
};
int N, M, u, v, c, mstcost = 0;
vector<vector<Edge>> adj;
vector< Edge>edges;
void prim()
{
vi vis(N, 0);
priority_queue< Edge>qe... | ALGO | 0.999997 | 4.203199 | {
"github_metadata": {
"branch": "main",
"commit_count": 55,
"repo_created_at": "2021-01-19T23:54: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": "5696490eee6... |
1ce84c7f-602b-43eb-9472-1a649ce137cc | xlgames-inc/XLE | Foreign/cml-1_0_2/cml/mathlib/projection.h | /* -*- C++ -*- ------------------------------------------------------------
Copyright (c) 2007 <NAME> and <NAME> http://cmldev.net/
The Configurable Math Library (CML) is distributed under the terms of the
Boost Software License, v1.0 (see cml/LICENSE for details).
*------------------------------------------------... | ALGO | 0.977095 | 6.364898 | {
"github_metadata": {
"branch": "master",
"commit_count": 6572,
"repo_created_at": "2015-01-15T05:07:55.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 339,
"forks": 73,
"issues": 5,
"pull_requests": 0
},
"file_meta": {
"content_id": "87c87... |
93bc8c3d-cc1b-4ae3-bfa0-b72a56b3abb2 | mahir-hs/LeetCode | 97.interleaving-string.cpp | /*
* @lc app=leetcode id=97 lang=cpp
*
* [97] Interleaving String
*/
// @lc code=start
class Solution {
public:
bool isInterleave(string s1, string s2, string s3) {
int n1 = s1.size(), n2 = s2.size(), n3 = s3.size();
if (n1 + n2 != n3) return false;
bool dp[n1+1][n2+1];
memset(... | ALGO | 0.998465 | 6.410416 | {
"github_metadata": {
"branch": "main",
"commit_count": 198,
"repo_created_at": "2023-12-04T09:19: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": "4b878ad388... |
21aebbbe-78a3-4da6-8903-7c2030574bef | ishandutta2007/codeforces-v | vepifanov/normal/294/A.cpp | #include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>
using namespace std;
#define mp make_pair
#define ... | ALGO | 0.999912 | 3.337169 | {
"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": "c0d0ab1f8d89... |
00637bbd-9afe-4e26-a473-03218b0ce3cc | fazlerahmanejazi/Competitive-Programming | HackerRank/CodeAgon/B.cpp | #include <bits/stdc++.h>
using namespace std ;
#define inf 0x3f3f3f3f
#define INF 1000111000111000111LL
#define mod 1000000007
#define endl '\n'
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define fi first
#define se second
#define all(cc) (cc).begin(),(cc).end()
using lli = long long int ;
using p... | ALGO | 0.999994 | 3.632142 | {
"github_metadata": {
"branch": "master",
"commit_count": 102,
"repo_created_at": "2018-01-12T00:39:16.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 1,
"issues": 0,
"pull_requests": 6
},
"file_meta": {
"content_id": "98a1511d... |
06d6ae33-1bd8-4d2f-94fc-fd7b0ed284f9 | NexusOnePlus/template | listas/listas.h | #include <iostream>
#include <string.h>
using namespace std;
struct nodo
{
char nomb[20]; // Cadena de caracteres correspondientes al nombre dentro del nodo
nodo *sig; // puntero nodo que apunta al siguiente nodo
};
// Funciones
void crea_i(nodo *&p); // crea una lista desde el inicio
void... | ALGO | 0.994128 | 3.956672 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2024-05-02T12:21: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": "8e21942b5ae... |
9e98f477-cdb8-4495-b85d-7742a0b06274 | abuzar990/PF-Assignment-3 | Task-3.cpp | //#include<iostream>
//using namespace std;
//
//const int patient = 2;
//const int days = 7;
//char arr[patient][days];
//
//void input()
//{
// for (int i = 0; i < patient; i++)
// {
// for (int j = 0; j < days; j++)
// {
// cout << "Enter Status of Patient " << i + 1 << " for Day " << j + 1 << ": ";
// cin >> ... | ALGO | 0.991809 | 3.947195 | {
"github_metadata": {
"branch": "main",
"commit_count": 10,
"repo_created_at": "2025-05-28T08:34: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": "729d13889cb... |
705a3f03-ee8b-47a9-a55b-8c3d89da5a71 | thotabhargav123/codes | coll.cpp | #include<bits/stdc++.h>
using namespace std;
class Sinhasing{
private:
int lota;
list<int> *dabha;
public:
Sinhasing(int v);
void nimpu(int val);
void kalechey(int loc);
void chupeybey();
int secretmasala(int x) {
return (x % lota);
}
};
Sinhasing::Sinhasing(int v){
... | ALGO | 0.999496 | 3.515119 | {
"github_metadata": {
"branch": "main",
"commit_count": 5,
"repo_created_at": "2023-10-20T09:49:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "699246f06890... |
82e069bb-7c30-4150-b933-9f57f6f2312e | DollarAkshay/Competitive-Coding | CodeChef/CodeChef_Three_Integers.cpp | /*~~~~~~~~~~~~~~~~~~*
* *
* $DollarAkshay$ *
* *
*~~~~~~~~~~~~~~~~~~*/
//https://www.codechef.com/LTIME58A/problems/AFK
#include <algorithm>
#include <assert.h>
#include <ctype.h>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <s... | ALGO | 0.999861 | 4.400163 | {
"github_metadata": {
"branch": "master",
"commit_count": 570,
"repo_created_at": "2018-01-31T16:03:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fb753ec6... |
42b7cb4f-6872-4599-bccd-29ff1d22c8f3 | tasneem27/TripPlanner | RAPTOR(bestplan)/Raptor.cpp | #include<bits/stdc++.h>
#include<algorithm>
#include<limits.h>
#include"Functions.h"
using namespace std;
vector<string> MarkedStops;
unordered_map<string,string> RoutestoScan;
//current_trip starts from 0 to num_trips-1
long long EarliestTrip(string route, string stop, int current_trip, time_t current_time){
/... | ALGO | 0.999415 | 3.713804 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2020-07-03T08:28:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0c4e3063f... |
ea6edab0-0c41-4553-b276-b26cc1c8cdb9 | PaddlePaddle/Paddle-Lite | lite/backends/arm/math/split_merge_lod_tenosr.cc | // Copyright (c) 2019 PaddlePaddle 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required... | TOOL | 0.900121 | 6.470195 | {
"github_metadata": {
"branch": "develop",
"commit_count": 7526,
"repo_created_at": "2017-09-20T11:41:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 7124,
"forks": 1620,
"issues": 68,
"pull_requests": 17
},
"file_meta": {
"content_id": ... |
32536464-03d1-4293-b05e-5d5a929a55c8 | Waqar-107/Codeforces | D-set/937D.Sleepy Game.cpp | /***from dust i have come, dust i will be***/
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define dbg printf("in\n")
#define nl printf("\n");
#define N 200100
#define sf(n) scanf("%d", &n)
#define sff(n,m) scanf("%d%d",&n,&m)
#define sfl(n) scanf("%I64d", &n)
#define sffl(n... | ALGO | 0.999946 | 3.222833 | {
"github_metadata": {
"branch": "master",
"commit_count": 1441,
"repo_created_at": "2017-02-23T10:29:34.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 208,
"forks": 91,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "1424... |
b8843e32-d3ab-4d5e-b463-40c8993df07b | mpadge/distdecay | src/Matrix-fns.cpp | #include "Matrix-fns.h"
/************************************************************************
************************************************************************
** **
** CALC_COV *... | ALGO | 0.998636 | 5.884332 | {
"github_metadata": {
"branch": "master",
"commit_count": 65,
"repo_created_at": "2016-02-26T10:43:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "c1f616605... |
a831f93b-a693-4cbc-a3ea-48e4cd260d35 | channyHuang/leetcodeOJ | 676.cpp | class MagicDictionary {
public:
class Node {
public:
char c;
Node *child[26];
bool isend;
Node(char _c = ' ') {
c = _c;
for (int i = 0; i < 26; i++) {
child[i] = NULL;
}
isend = false;
}
};
Node *r... | ALGO | 0.999657 | 5.496592 | {
"github_metadata": {
"branch": "master",
"commit_count": 241,
"repo_created_at": "2019-11-14T13:27: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": "3ac09c57... |
20468488-0a80-4d27-9111-79c6f900d6c9 | abhiXsliet/Solved-DSA-Problems | GFG POTD/002-February-2024/012-recursive-sequence.cpp | // https://www.geeksforgeeks.org/problems/recursive-sequence1611/1
//{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution{
private:
typedef long long ll;
int MOD = 1e9 + 7;
// TC : O(N *... | ALGO | 0.999926 | 5.592439 | {
"github_metadata": {
"branch": "main",
"commit_count": 2156,
"repo_created_at": "2023-07-29T13:17:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e7e297bf1... |
a7cfe4ca-c4af-4d09-b586-c24452b10569 | kpgaffney/policing | Controller.cpp | //
// Created by <NAME> on 4/12/18.
//
#include <iostream>
#include <cmath>
#include <random>
#include <bitset>
#include "Controller.h"
using namespace std;
Controller::Controller() {
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<unsigned int> dist(0, 255);
for (int i = 0; i < 33; i+... | TOOL | 0.96022 | 3.597978 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2018-03-02T22:56: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": "b9fd14be6... |
d6977526-a890-4bcf-8d8f-cda7a949d26d | Seneca-244200/Fardad-s-Notes-Archive | 2231/NAA/15-Mar28/b-funcTemplateAndReferences.cpp | #include <iostream>
#include "Utils.h"
using namespace std;
using namespace sdds;
class Container {
int m_data;
public:
Container( int data = 0 ) :m_data( data ) {
}
Container operator+( const Container& Ro ) {
return Container( m_data + Ro.m_data );
}
ostream& display( ostream& os )const {
... | TOOL | 0.959652 | 4.173922 | {
"github_metadata": {
"branch": "master",
"commit_count": 40,
"repo_created_at": "2015-07-06T18:12:10.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 19,
"forks": 18,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0fd90f7e... |
8c4f96ee-bf1d-4eca-8820-be1c8bd4591b | tafjwr/cplib | dijkstra.lib.cpp | /**
* Dijkstra
*/
template <typename T>
struct dijkstra_graph
{
public:
using Vertex = std::pair<T, long long>;
using Edge = std::pair<T, long long>;
long long N;
std::vector<std::vector<Edge>> G;
std::vector<T> d;
std::vector<long long> p;
const long long _inf ... | ALGO | 0.999962 | 5.212977 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2021-02-24T08:48: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": "d66b2f119065... |
a1f43d40-3e18-47c4-aa88-9ee187ba2275 | kaisereagle/cint | demo/stl/list2.cxx | #include <stdio.h>
#include <iostream.h>
#include <_list.h> // problem in precompiled list class and cint
#include <algo.h>
#include <assert.h>
list<char> vec(char* s)
{
list<char> x;
while(*s != '\0') {
x.push_back(*s++);
}
return x;
}
ostream& operator<<(ostream& os,list<char>& x) {
list<char>::itera... | ALGO | 0.976549 | 3.854746 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-12-27T11:42:56.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 25,
"forks": 10,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "448d4fab... |
b74b881a-a994-4c45-82b1-0c2726306099 | TheNinza/dsa-visualizer | public/codes/bblsort/bblsort.cpp | // C++ program for Bubble Sort
#include <iostream>
using namespace std;
// Function to sort an array using bubble sort
void bubbleSort(int arr[], int n)
{
int i, j;
for (i = 0; i < n-1; i++)
// Last i elements are already in place
for (j = 0; j < n-i-1; j++)
//Swap if the element fou... | ALGO | 0.999994 | 5.460862 | {
"github_metadata": {
"branch": "main",
"commit_count": 53,
"repo_created_at": "2021-06-08T05:57:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 11,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "7ef462ac0c... |
260cb85b-67fb-4137-acc6-7a8876c53f50 | Minerest/DiazEric_48102-master | HomeWork/Assignment7/GADCH8_P9/main.cpp | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: main.cpp
* Author: ericd
*
* Created on December 2, 2016, 1:59 AM
*/
#include <iostream>
#include <ctime>
#include... | ALGO | 0.997439 | 4.510528 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2016-12-02T11:35: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": "73fd9745b7... |
f3b2d80a-ede2-40eb-8c2d-4ee86b4fd6b2 | tclarke/opticks | Code/application/PlugIns/src/DataFusion/Poly2D.h | /*
* The information in this file is
* Copyright(c) 2007 Ball Aerospace & Technologies Corporation
* and is subject to the terms and conditions of the
* GNU Lesser General Public License Version 2.1
* The license text is available from
* http://www.gnu.org/licenses/lgpl.html
*/
#ifndef POLY2D_H
#define POLY2... | TOOL | 0.961533 | 6.273778 | {
"github_metadata": {
"branch": "master",
"commit_count": 1144,
"repo_created_at": "2009-09-12T13:50:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 16,
"forks": 10,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "765e5... |
25edcca3-05f7-4f9f-98fd-4ee9388d6c57 | booneng/competitive_programming | atcoder/gc23c.cpp | #include <iostream>
#define ll long long int
using namespace std;
ll mod = 1000000007;
ll factorials[1000005];
ll inv[1000005];
ll mod_pow(ll k, ll pow) {
ll ans = 1;
while (pow > 0) {
if (pow & 1) ans = ans * k % mod;
k = k * k % mod;
pow >>= 1;
}
return ans;
}
int main() {
ll n;
cin >> n;... | ALGO | 0.99998 | 3.994972 | {
"github_metadata": {
"branch": "master",
"commit_count": 133,
"repo_created_at": "2018-03-26T11:11: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": "bd1dca3d... |
61bfa9c2-ded4-4231-96e4-962d780ff2d5 | sophgo/sophon-demo | sample/SSD/cpp/ssd_bmcv/ssd.hpp | //===----------------------------------------------------------------------===//
//
// Copyright (C) 2022 Sophgo Technologies Inc. All rights reserved.
//
// SOPHON-DEMO is licensed under the 2-Clause BSD License except for the
// third-party components.
//
//===--------------------------------------------------------... | TOOL | 0.909533 | 4.875222 | {
"github_metadata": {
"branch": "release",
"commit_count": 1205,
"repo_created_at": "2022-11-04T00:33:13.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 396,
"forks": 82,
"issues": 35,
"pull_requests": 1
},
"file_meta": {
"content_id": "116... |
b8410129-0e54-46e8-a24c-6124cfb4fb02 | IljaSir/CopilotSolverForLeetCode | C++/Medium/CompileError/divide-two-integers_2.cpp | class Solution {
public:
int divide(int dividend, int divisor) {
if (dividend == INT_MIN && divisor == -1
if (divisor == 1) return dividend;
if (divisor == -1) {
if (dividend == INT_MIN) return INT_MAX;
return -dividend;
}
int sign = 1;
... | ALGO | 0.999943 | 5.84032 | {
"github_metadata": {
"branch": "main",
"commit_count": 8,
"repo_created_at": "2023-07-28T08:23: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": "68bfa80a703c... |
a145ed4b-7c85-4ce3-94af-15badf73f14f | BCAPATHSHALA/DSA-SUPREME-2-0-NOTES | DSA SUPREME 2.0 CODES/30. CLASS CODE/PROBLEM2.CPP | // 📂 Program 2: Middle of the Linked List (Leetcode-876)
// Approach 1: getLength and getMid
/**
* 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, ListN... | ALGO | 0.99979 | 6.150119 | {
"github_metadata": {
"branch": "master",
"commit_count": 322,
"repo_created_at": "2023-08-28T06:24:20.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 235,
"forks": 86,
"issues": 1,
"pull_requests": 1
},
"file_meta": {
"content_id": "476cd... |
917016cb-36ac-4a56-9897-2e181cb2e57c | dipu-bd/OJ-Codes | LightOJ/1018 - Brush (IV).cpp | /*============================
/\u7h0r : 5ud!p70 ch@ndr@ d@5
=============================*/
//C headers
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <ctype.h>
#include <assert.h>
//cpp headers
#include <iostream>
#include <iomanip>
#include <sstream>
#incl... | ALGO | 0.999761 | 3.92774 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2015-02-18T17:34:28.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "578467f595... |
05ed6d6e-4700-4635-b61c-b04d41136809 | salmahmed6/Leet-code- | Maximum-Depth-of-Binary-Tree.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.999953 | 6.231397 | {
"github_metadata": {
"branch": "master",
"commit_count": 42,
"repo_created_at": "2025-01-08T21:42: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": "f02af8902... |
74b434b8-8a83-4966-8e01-eeb7ba26ebae | Drew-Childs/CS-201-Lab-5 | Lab05/Lab05/Main.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int new_row() { //creates new row and returns it
int num_rows;
cout << "Enter the number of rows in this matrix --> ";
cin >> num_rows;
cout << endl;
return num_rows;
}
int new_column() { //creates new column and returns it
int num_c... | ALGO | 0.96585 | 3.909593 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2021-10-25T02:48: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": "e1e4864631... |
34aedfd9-e2d1-4a83-82e4-707b1596b609 | networkit/networkit | include/networkit/distance/IncompleteDijkstra.hpp | /*
* IncompleteDijkstra.hpp
*
* Created on: 15.07.2014
* Author: dhoske
*/
#ifndef NETWORKIT_DISTANCE_INCOMPLETE_DIJKSTRA_HPP_
#define NETWORKIT_DISTANCE_INCOMPLETE_DIJKSTRA_HPP_
#include <unordered_set>
#include <vector>
#include <tlx/container/d_ary_addressable_int_heap.hpp>
#include <networkit/auxilia... | ALGO | 0.986293 | 7.424798 | {
"github_metadata": {
"branch": "master",
"commit_count": 9146,
"repo_created_at": "2017-02-04T13:04:42.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 811,
"forks": 235,
"issues": 23,
"pull_requests": 24
},
"file_meta": {
"content_id": "59... |
61b639b0-0cc8-4de0-9360-6fd12959a11e | Seannnnnnnnnnn/Quadratic-Assignment-Problem | C++/SimulatedAnnealing.cpp | #include <iostream>
#include <vector>
#include <random>
using namespace std;
// class def
class SimulatedAnnealing {
private:
int rate;
int Tmin;
int T0;
vector<vector<int>> W;
vector<vector<int>> D;
int n;
int cost(vector<int> cost);
ve... | ALGO | 0.99999 | 5.596347 | {
"github_metadata": {
"branch": "main",
"commit_count": 63,
"repo_created_at": "2023-08-26T05:00: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": "e25125dd537... |
07fade79-154c-4ee5-aff6-d9b5f055900f | google/or-tools | ortools/math_opt/samples/cpp/integer_programming.cc | // Copyright 2010-2025 Google LLC
// 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 agreed to in... | ALGO | 0.996604 | 7.444343 | {
"github_metadata": {
"branch": "stable",
"commit_count": 15256,
"repo_created_at": "2015-02-21T01:25:35.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12243,
"forks": 2248,
"issues": 60,
"pull_requests": 12
},
"file_meta": {
"content_id":... |
b5814f26-e84a-4c2b-881f-f9373eca8f6f | reckless-meherun/Data-Structures-and-Algorithms | DSA/Algorithms/Shortest Path/bellman_ford.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> iPair;
enum COLORS
{
white = 0, // not visited (not explored)
grey = 1, // visited but their neighbours are not visited (partially explored)
black = 2 // visited along with all the neighbours (fully explored)
};
... | ALGO | 0.999967 | 4.10399 | {
"github_metadata": {
"branch": "main",
"commit_count": 165,
"repo_created_at": "2023-02-08T14:20: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": "83c5238fb5... |
0ac8b2a2-ae20-4e2d-9530-c7eaa86bb8c7 | Dsxv/competitveProgramming | cses/1672.cpp | #include <bits/stdc++.h>
using namespace std ;
#define int long long
const int N = 505 ;
int dp[N][N] ;
const int INF = 1e15 ;
int32_t main(){
ios :: sync_with_stdio(0) ;
cin.tie(0) ;
int n , m , q;
cin >> n >> m >> q ;
for(int i = 0 ; i < n ; i++){
for(int j = 0 ; j < n ; j++){
if(i == j) continue ;
dp[i... | ALGO | 0.999755 | 4.26222 | {
"github_metadata": {
"branch": "master",
"commit_count": 44,
"repo_created_at": "2019-06-23T19:26: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": "fa0aab9d9... |
da6107e7-147b-4d86-a121-28f1e1e36915 | ProgramCaiCai/THU_DS_Code | DS/1_2_Zuma.cpp |
#include <cstdio>
#include <cstring>
struct Node{
char c;
Node *next;
Node *prev;
};
const int N = 10010;
Node *head=NULL;
Node pool[N<<1];
Node *poolptr=pool;
char s[N];
void prepend(char c){
Node *tmp = poolptr++;
tmp->c = c;
tmp->next = head;
tmp->prev = NULL;
if(head) head->pr... | ALGO | 0.999849 | 3.345061 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2014-10-10T04:36:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c485ad633a... |
b659f9e8-6d14-4b90-96dc-e73d52bf3413 | kyejin0412/algorithm | boj/2480_주사위 세개.cpp | #include <iostream>
using namespace std;
int main() {
int arr[3] = {};
int biggest = 0;
int same = 0;
for (int i = 0; i < 3; i++) {
cin >> arr[i];
if (arr[i] > biggest)
biggest = arr[i];
}
if (arr[0] == arr[1] && arr[0] == arr[2] && arr[1] == arr[2]) {
cout... | ALGO | 0.9993 | 3.421011 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2021-07-10T12:32: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": "3287f1be150... |
7333027e-d8bf-4c23-8b33-cd2ec99b0013 | mbeza/Graphs | funkcje.cpp | #include "funkcje.h"
struct compareEdge
{
bool operator ()( EdgM & e1, EdgM & e2 )
{
//kolejność - rosnąco
if( e1.weight > e2.weight ) return true;
if( e1.weight < e2.weight ) return false;
return false;
}
};
void PrimsL(GraphL & graf)
{
Heap priority; //... | ALGO | 0.999635 | 4.444009 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-05-15T13:59: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": "8e1991ca2e... |
75492eb4-3468-4017-aacc-f68e8bffe1ab | kaba2/pastel | pastel/geometry/maximum_clique_alignedbox.h | // Description: Maximum clique of an aligned box graph
#ifndef PASTELGEOMETRY_MAXIMUM_CLIQUE_ALIGNEDBOX_H
#define PASTELGEOMETRY_MAXIMUM_CLIQUE_ALIGNEDBOX_H
#include "pastel/sys/output/output_concept.h"
#include "pastel/sys/range.h"
#include "pastel/sys/redblacktree.h"
#include "pastel/sys/output/null_output.h"
#incl... | ALGO | 0.999902 | 6.934606 | {
"github_metadata": {
"branch": "master",
"commit_count": 2386,
"repo_created_at": "2020-01-03T03:49:00.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 3,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2e05915... |
6131b8bf-59b0-45f1-9e3c-03cdf803392e | wisdompeak/LeetCode | Dynamic_Programming/1723.Find-Minimum-Time-to-Finish-All-Jobs/1723.Find-Minimum-Time-to-Finish-All-Jobs_v2.cpp | class Solution {
int stateTime[4100];
int visited[4100][13];
int k;
public:
int minimumTimeRequired(vector<int>& jobs, int k)
{
int n = jobs.size();
this->k = k;
for (int state=0; state<(1<<n); state++)
{
int sum = 0;
for (int i=0; i<n... | ALGO | 0.999945 | 5.549061 | {
"github_metadata": {
"branch": "master",
"commit_count": 8912,
"repo_created_at": "2017-03-01T10:30:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6018,
"forks": 1314,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "0... |
84cb334a-fe5d-4c2d-afc3-a0b624cf0cc3 | ajutscaria/CS224U | NLPCodeBase/lib/posinduction/src/perplexity.cpp | // $Id: perplexity.cpp,v 1.2 2002/08/14 13:46:18 clark Exp $
// Evaluate the perplexity of some test data
// with respect to a class-based bigram model
#include <iostream>
#include <stdio.h>
#include "simplecorpus.h"
#include "clusters.h"
#include "matrix.h"
#include <math.h>
int main(int argc, char* argv[])
{
... | ALGO | 0.972483 | 5.147405 | {
"github_metadata": {
"branch": "master",
"commit_count": 536,
"repo_created_at": "2013-02-17T00:27: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": "6a1f1555... |
aebf54af-6f11-4d18-bb1c-dfc2f893e471 | Rufian55/Cplusplus | Conway's GOL (Cellular Automatons)/Glider.cpp | /****************************************************************************************
** Program Filename: Glider.cpp
** Author: <NAME>
** Date: 1/17/2016
** Description: Contains the glider() function.
** Input: array "collector"
** Output: Used by Main.cpp to generate Glider animation.
***************************... | ALGO | 0.927793 | 3.587751 | {
"github_metadata": {
"branch": "master",
"commit_count": 173,
"repo_created_at": "2016-08-22T12:18: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": "24ce53fc... |
9a64269d-3018-444e-bb75-42cc450cb34b | pibuxd/competitive-programming | CFORC/GCD_Problem.cpp | // author: Piotr "pibuxd" Bublik (https://github.com/pibuxd)
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
bool IsPrime(int number)
{
if (number == 2 || number == 3)
return true;
if (number % 2 == 0 || number % 3 == 0)
retur... | ALGO | 0.999649 | 4.027727 | {
"github_metadata": {
"branch": "master",
"commit_count": 409,
"repo_created_at": "2021-01-06T21:36:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bc9a30da... |
4f2a9131-acd5-4eb3-bd79-b65ab0c16999 | niteshydv01/Data-Structure-Algorithm | 0120-triangle/0120-triangle.cpp | class Solution {
public:
// Function to find the minimum path sum recursively with memoization
int minimumPathSumUtil(int i, int j, vector<vector<int>>& triangle, int n,
vector<vector<int>>& dp) {
// If the result for this cell is already calculated, return it
if (dp[i... | ALGO | 0.999984 | 6.703092 | {
"github_metadata": {
"branch": "main",
"commit_count": 1227,
"repo_created_at": "2024-02-26T20:47: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": "e033b469e... |
17a739be-6334-4769-982f-3c3d5a4e24aa | KratosMultiphysics/Kratos | applications/FluidDynamicsApplication/custom_constitutive/newtonian_3d_law.cpp | // | / |
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: <NAME>
//
// System includes
... | ALGO | 0.994132 | 6.099908 | {
"github_metadata": {
"branch": "master",
"commit_count": 106408,
"repo_created_at": "2017-02-13T10:58:24.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1141,
"forks": 265,
"issues": 381,
"pull_requests": 258
},
"file_meta": {
"content_id"... |
0d7eb307-2955-493e-ae2a-03f7fe538788 | walkccc/LeetCode | solutions/2741. Special Permutations/2741.cpp | class Solution {
public:
int specialPerm(vector<int>& nums) {
const int n = nums.size();
const int maxMask = 1 << n;
int ans = 0;
vector<vector<int>> mem(n, vector<int>(maxMask));
for (int i = 0; i < n; ++i) {
ans += specialPerm(nums, i, 1 << i, maxMask, mem);
ans %= kMod;
}
... | ALGO | 0.999969 | 5.972118 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2019-02-23T15:46:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1254,
"forks": 437,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "bf30bfc... |
c3685fcb-7f15-4519-854b-577dabd055d6 | uufree/Data-Structure-And-Algorithm | data/7/RBTree.h | /*************************************************************************
> File Name: RBTree.h
> Author: uuchen
> Mail: <EMAIL>
> Created Time: 2018年03月21日 星期三 17时02分00秒
************************************************************************/
#ifndef _RBTREE_H
#define _RBTREE_H
#include"binarySearchTree.h"
t... | ALGO | 0.987918 | 4.659297 | {
"github_metadata": {
"branch": "master",
"commit_count": 108,
"repo_created_at": "2017-07-20T01:50: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": "66fbc835... |
1028a08d-8036-4f61-9132-bbc4900fbf86 | Neel-max-cpu/DSA-practice- | 0268-missing-number/0268-missing-number.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
int n = nums.size();
/*
sort(nums.begin(), nums.end());
for(int i=0; i<n; i++){
if(nums[i]!=i) return i;
}
return n;
*/
/*
vector<int>v(n+1,-1);
for(int i=0; ... | ALGO | 0.999978 | 5.449976 | {
"github_metadata": {
"branch": "main",
"commit_count": 438,
"repo_created_at": "2024-08-13T08:29: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": "7d199739bd... |
61534cb6-8f9d-4176-b235-37f8a1ff42c0 | robert-vetter/School-Projects | Olympiads/2024/IOI/Vorquali/USACO/Aufgabe_13/main.cpp | #include <bits/stdc++.h>
using namespace std;
struct Entry {
int day;
string name;
int change;
};
bool compareByDay(const Entry &a, const Entry &b) {
return a.day < b.day;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
vector<Entry> entries;
int n;
cin >> n;
unord... | ALGO | 0.999835 | 4.196504 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-03-05T14:30: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": "61ffc85f67cd... |
5b472222-46ec-4bed-bcfa-a1c81bdff4b4 | Obj1144/CP_Code | CF/CF1749/CF1749E.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
int n,m;
cin>>n>>m;
vector<vector<int>> s(n+2,vector<int>(m+2,0));
vector<vector<int>> dp(n+2,vector<int>(m+2,-1));
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++){
char c;
cin>>c;
... | ALGO | 0.999985 | 4.823404 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2023-09-09T09:11:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7f2a863e7d... |
e4a8ea39-bdd3-4506-8dc9-85088e1c5d61 | MottoX/CP-STL | string/trie.cpp | const int CHARSET = 10, BASE = '0', MAX_NODE = 100000;
struct Trie {
int tot, root, child[MAX_NODE][CHARSET];
int flag[MAX_NODE];
Trie() {
init();
}
void init() {
root = newNode();
}
int newNode() {
++tot;
memset(child[tot], 0, sizeof(child[tot]));
... | ALGO | 0.999612 | 4.367225 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2018-11-13T16:57: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": "d802710eb3... |
87fa11d2-e1fb-4c44-ab32-708f29ddd722 | DuanYaQi/leetcode | DS_Linked_list/234+isPalindrome_FastSlow.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
bool isPalindrome(Lis... | ALGO | 0.999777 | 6.192712 | {
"github_metadata": {
"branch": "master",
"commit_count": 309,
"repo_created_at": "2021-03-15T10:04:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 8,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "88b7e7dd... |
bc72de3b-1963-471a-a354-ec5c9a99a965 | DenisDesimon/LeetCode | Check_If_a_String_Is_a_Valid_Sequence_from_Root_to_Leaves_Path_in_a_Binary_Tree.cpp | //#Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree - https://leetcode.com/explore/featured/card/30-day-leetcoding-challenge/532/week-5/3315/
#include <iostream>
#include <vector>
#include <queue>
#include <cassert>
using namespace std;
// Definition for a binary tree node.
struct Tr... | ALGO | 0.999979 | 6.004205 | {
"github_metadata": {
"branch": "master",
"commit_count": 646,
"repo_created_at": "2019-02-05T17:04: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": "2dc5d7a3... |
6eabc8b8-b89e-4efc-a83b-18d0424f1594 | SweetRomeo/Encryption_Decryption_Algorithms | main.cpp | #include <iostream>
#include <string>
#include <random>
#include <unordered_set>
void randomFill(std::string& text, int size) {
using namespace std;
string alphaBeth = "abcdefghijklmnqprstuvwxyz";
std::cout << alphaBeth.size() << '\n';
random_device rd;
mt19937 mt(rd());
uniform_int_distributio... | TOOL | 0.979988 | 3.518152 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2024-05-28T18:47:01.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "e69eb15e0ca4... |
9d6cf52e-3909-4b02-87f9-aec668981e68 | allysson-assuncao/Exercicios-Maratona | Semana4/allysson/chuva.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
string matrizCompleta;
for (int i = 0; i < N; i++) {
for (int j = 0; j < M; j++) {
char c;
cin >> c;
matrizCompleta += c;
}
matrizCompleta += '\n... | ALGO | 0.99985 | 4.102896 | {
"github_metadata": {
"branch": "main",
"commit_count": 56,
"repo_created_at": "2024-03-20T00:26: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": "4f0400a4912... |
4a327ffe-181e-44c5-87fb-d9e42cfb1501 | arthurvtrr/AA-Problems-Solved | New/Treino Segunda Fase/Lista 4/D.cpp | #include <bits/stdc++.h>
using namespace std;
int n, x, cnt[2][15], pow3[15], dp[1600000];
int solve(int mask) {
if (dp[mask] != -1) return dp[mask];
int ret = 0, quant[15], aux = mask;
memset(quant, 0, sizeof quant);
for (int i = 0; i < 13; i++) {
quant[i+1] = aux % 3;
aux /= 3;
... | ALGO | 0.999956 | 3.576805 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2015-09-18T11:53:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ed7eaf1e0... |
60724cd9-8347-4d9d-bdc8-0d1343feb642 | Yu0727Harada/pro_con | codeforces/608div2/c.cpp | //
// Created on 2019/12/15.
//
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
const long long LINF =1e18;
const int INF = 1e9;
using gragh = vector<vector<int>>;
int main() {
int n;
ll sx,sy;
cin>>n>>sx>>sy;
vector<vector <int> > location (1e3... | ALGO | 0.999829 | 4.505833 | {
"github_metadata": {
"branch": "master",
"commit_count": 142,
"repo_created_at": "2020-08-09T08:23:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "acb42cf0... |
520a00c4-9ebf-4f52-994f-0a7178d1c771 | Andreachen0707/3D_reconstruction_object_detection | code/Detect/fconv3d.cc | #include "mex.h"
#include <math.h>
#include <string.h>
/*
* This code is used for computing filter responses. It computes the
* response of a set of filters with a feature map.
*
* Basic version, relatively slow but very compatible.
*/
struct thread_data {
double *A;
double *B;
double *C;
mxArray *mxC;
c... | ALGO | 0.994697 | 6.320648 | {
"github_metadata": {
"branch": "master",
"commit_count": 11,
"repo_created_at": "2018-04-07T07:39:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "598c073c1... |
abdbbf71-5d50-4688-b245-e1ec1846ccb1 | finyle/rank-cf | div1_2/2023/6_ton_round_5.cpp | #include <bits/stdc++.h>
#define ru_(i,l,r) for(int i=(l);i<=(r);i++)
#define ru(i,l,r) for(int i=(l);i<(r);i++)
#define rd_(i,r,l) for(int i=(r);i>=(l);i--)
#define rd(i,r,l) for(int i=(r);i>(l);i--)
#define ll long long
#define pli pair<ll,int>
#define s1 first
#define s2 second
using namespace std;
#ifdef LOCAL
#in... | ALGO | 0.999956 | 4.466858 | {
"github_metadata": {
"branch": "main",
"commit_count": 13,
"repo_created_at": "2024-12-06T09:56:03.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2b593cbafb8... |
5da56ea6-227c-414d-8d4f-91badc5f8a5e | noa/bayesner | src/nn/pgibbs.hpp | /*
* Copyright 2015-2016 <NAME>
*
* 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 agreed to ... | ALGO | 0.979264 | 7.423945 | {
"github_metadata": {
"branch": "master",
"commit_count": 36,
"repo_created_at": "2016-11-20T03:40:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c30230104... |
b2c997e8-dcfa-472f-b748-d73dea8ae7e7 | vaughn-k/Algorithm | graph/bfs/bj2178.cpp | /*
44m
너비우선탐색(bfs)
이전에 풀었던 토마토(7576)문제와 매우 비슷하다. 오히려 토마토보다 쉬운문제였다.
다만 변수를 중복해서 사용해서 시간을 잡아먹었다.
예를 들어 for문에서 i,j를 사용했는데, 다른 변수로 i를 다시 사용해서 i값이 계속 변화하여 의도치않은 결과가 나왔다.
각 기본변수(i,j x,y a,b ...) 등등은 항상 사용하던 용도로만 가급적 사용하고, 의미있는 변수이름을 사용하도록하자.
*/
#include <iostream>
#include <queue>
#include <utility>
#include <string>
u... | ALGO | 0.999974 | 3.269584 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2021-02-20T16:06: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": "20718c368... |
fb5e2cc7-bdb9-44df-b662-2f1feefcf15d | hadjitejuco/CS0007TN29NEW | 1_decreasebyaconstant.cpp | #include <iostream>
using namespace std;
int linearSearch(int arr[], int n, int x) {
for (int i = 0; i < n; i++) {
cout << "Iteration " << i << ": Checking element " << arr[i] << endl;
if (arr[i] == x) return i; // Element found
}
return -1; // Element not found
}
int main() {
int arr[... | ALGO | 0.999232 | 5.75176 | {
"github_metadata": {
"branch": "main",
"commit_count": 21,
"repo_created_at": "2024-01-03T03:22:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4fa20255a5d... |
ab94ea5a-93c9-4207-baf5-6490a3050668 | the-reverend/Win32xx | samples/CommonDialogs/src/ContextHelp.cpp | /* (15-Sep-2015) [Tab/Indent: 8/8][Line/Box: 80/74] (ContextHelp.cpp) *
********************************************************************************
| |
| Copyright (c) 2016, <NAME> |
| ... | TOOL | 0.912331 | 7.250414 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2016-04-17T03:20: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": "34a9c3df79... |
1fd051ba-7ae4-4bdf-a4cb-eba19e21d319 | JayjeetAtGithub/Algorithms | binary-tree-problems/zig-zag-traversal-of-tree.cpp | //C++ program to traverse a tree in zig zag manner
#include <bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node *left , *right;
Node(int data){
this->data = data;
}
};
void traverse_zigzag(Node *root) {
deque<Node *> q;
q.push_back(root);
int level = 0;
... | ALGO | 0.999997 | 5.389791 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2018-07-31T04:41:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 3,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "52829b5fe... |
bcbdc7e2-e45e-4b24-b36a-03bcd771960a | Sowmik23/CompetitiveProgramming | DSA_Implementation/1000. Randomized Algorithms/Rejection Sampling.cpp | // The rand7() API is already defined for you.
// int rand7();
// @return a random integer in the range 1 to 7
class Solution {
public:
int rand10() {
// Rejection Sampling
// Time Complexity: O(1)O(1)O(1) average, but O(∞)O(\infty)O(∞) worst case.
/*
int row, col, idx;
... | ALGO | 0.990988 | 3.750471 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2018-11-10T16:55:49.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "95740cf73... |
d0633536-6fc4-48c9-b988-81297079b5d2 | MyCuteGuineaPig/Leetcode | Sort/147. Insertion Sort List.cpp | /*
147. Insertion Sort List
Sort a linked list using insertion sort.
A graphical example of insertion sort. The partial sorted list (black) initially contains only the first element in the list.
With each iteration one element (red) is removed from the input data and inserted in-place into the sorted list
Algorit... | ALGO | 0.999993 | 5.803242 | {
"github_metadata": {
"branch": "master",
"commit_count": 1842,
"repo_created_at": "2018-01-29T23:45:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 116,
"forks": 24,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "48ae... |
4583552b-40cb-4f65-a0ea-9c900d2d0d31 | akhikolla/testpackages | fuzzedpackages/Rborist/src/defmap.h | // This file is part of ArboristCore.
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/**
@file defmap.h
@brief Definitions for the classes managing the ... | TOOL | 0.975673 | 6.246181 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-01-15T17:42:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 7,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ba82dc490c... |
fe911ae0-1acc-453e-bb38-7e6b90e7c7cb | Hira02/DSA | climbStairs.cpp | /*
Problem Description : (LC 70)
---------------------------------------------------------------------
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Example 1:
Input: 2
Output: 2
Explanation: There... | ALGO | 0.999986 | 5.721581 | {
"github_metadata": {
"branch": "master",
"commit_count": 456,
"repo_created_at": "2020-05-04T17:09:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7d51716... |
7d613dc7-5fe8-4ca7-b6d2-63db070d84a9 | AbdelrahmanHamdyy/Problem-Solving | CodeForces/Summer 2022/Bear and Raspberry.cpp | #include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define cin(v) for (int i = 0; i < sz(v); i++) cin >> v[i];
#define cout(v) for (auto i : v) cout << i << endl;
constexpr double pi = 3.141592653589... | ALGO | 0.999964 | 3.272739 | {
"github_metadata": {
"branch": "main",
"commit_count": 172,
"repo_created_at": "2022-02-11T19:37: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": "6b674c21fd... |
2d908498-0fa6-4eb6-9d5f-f958e03359d3 | trieck/BG3ModMaker | Utility/FibTree.h | #pragma once
/*
* FibTree<K, V> - A Binary Search Tree with Fibonacci-Based Balancing
*
* This is a self-balancing binary search tree that maintains balance using
* Fibonacci-based constraints rather than traditional rotations (as seen in
* AVL or Red-Black Trees). The goal is to achieve logarithmic search and
*... | ALGO | 0.999486 | 7.626586 | {
"github_metadata": {
"branch": "master",
"commit_count": 91,
"repo_created_at": "2025-02-09T06:00:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad7ab8ace... |
414820ea-0e7c-499e-bc83-7316bc95fd59 | adityasinghhh/coding | topcoder/557/FoxAndMountainEasy.cpp | #include<algorithm>
#include<assert.h>
#include<bitset>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<deque>
#include<iostream>
#include<map>
#include<memory.h>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#include<utility>
#include<v... | ALGO | 0.999097 | 3.810888 | {
"github_metadata": {
"branch": "master",
"commit_count": 5,
"repo_created_at": "2013-05-26T14:49: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": "5f6542f479... |
301b8433-23d0-4112-94f4-a499ddcd24c1 | sajid43677/Competitive-Programming | D_The_Clock.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//double pi = acos(-1.0);
#define allZero(a) memset(a,0,sizeof(a));
#define allnegOne(a) memset(a,-1,sizeof(a));
#define endl "\n"
#define Boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define reverseS string(curr.rbegin(),cu... | ALGO | 0.998847 | 4.038079 | {
"github_metadata": {
"branch": "master",
"commit_count": 45,
"repo_created_at": "2022-04-07T15:20:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0935415f4... |
2c9e4263-12b9-457e-ad67-a5fbcdda4724 | piyush168713/DSA-CPP | 21-1-Trie/3-Implement-Phone-Directory.cpp | // Problem Statement
// Implement a phone Directory - CodeStudio
// Link - https://www.codingninjas.com/codestudio/problems/implement-a-phone-directory_1062666
class TrieNode{
public:
char data;
TrieNode* children[26];
bool isTerminal;
TrieNode(char ch){
data = ch;
for (int i = 0... | ALGO | 0.999647 | 5.905802 | {
"github_metadata": {
"branch": "main",
"commit_count": 244,
"repo_created_at": "2022-05-02T15:16:45.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 5,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "47e06bae0c... |
39d3e454-6587-4fe0-81e7-084a5f89803e | ad-freiburg/qlever | src/parser/PathQuery.cpp | // Copyright 2024, University of Freiburg
// Chair of Algorithms and Data Structures
// Authors: <NAME> <<EMAIL>(at)gmail.com>
// <NAME> <<EMAIL>>
#include "parser/PathQuery.h"
#include <string_view>
#include "parser/MagicServiceIriConstants.h"
namespace parsedQuery {
// __________________________________... | CONFIG | 0.920968 | 6.781223 | {
"github_metadata": {
"branch": "master",
"commit_count": 2479,
"repo_created_at": "2014-12-05T14:09:19.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 600,
"forks": 83,
"issues": 133,
"pull_requests": 57
},
"file_meta": {
"content_id": "4e... |
1e23b92f-8389-4b7e-a856-2a5129889485 | OpenSees/OpenSees | SRC/system_of_eqn/linearSOE/sparseGEN/DistributedSparseGenColLinSOE.cpp | /* ****************************************************************** **
** OpenSees - Open System for Earthquake Engineering Simulation **
** Pacific Earthquake Engineering Research Center **
** **
** ... | ALGO | 0.983173 | 3.832375 | {
"github_metadata": {
"branch": "master",
"commit_count": 8721,
"repo_created_at": "2018-09-12T00:49:34.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 667,
"forks": 719,
"issues": 42,
"pull_requests": 23
},
"file_meta": {
"content_id": "e0... |
8db472b0-7024-4eb3-99bf-7d33379a0408 | 2694048168/LeetCodeAlgorithm | C++/findLongestChain.cpp | /**
* @File : findLongestChain.cpp
* @Brief : 最长数对链 动态规划
* @Link : https://leetcode-cn.com/problems/maximum-length-of-pair-chain/
* @Author : <NAME>
* @Date : 2021-07-16
*/
#include <iostream>
#include <vector>
#include <algorithm>
class Solution
{
public:
// 动态规划 + 二分法,时间复杂度 big-O(nlogn),空间复杂度 O... | ALGO | 0.999954 | 5.291583 | {
"github_metadata": {
"branch": "master",
"commit_count": 109,
"repo_created_at": "2020-09-16T14:39:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 17,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b479402... |
eecd85b0-b0e1-4ddd-934c-ab50493c762a | google/xls | xls/data_structures/leaf_type_tree.cc | // Copyright 2024 The XLS Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | TOOL | 0.912973 | 6.658845 | {
"github_metadata": {
"branch": "main",
"commit_count": 8189,
"repo_created_at": "2020-05-07T21:38:30.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1322,
"forks": 207,
"issues": 876,
"pull_requests": 40
},
"file_meta": {
"content_id": "25... |
1c0d27bf-aba3-4a30-b576-cc329cc76420 | alihusnain88/DSA-Course | Assignments/Home Work 1/Singly Linked List 2/main.cpp | #include <iostream>
#include "BCSF22M039_SLL2.h"
#include "BCSF22M039_SLL2.cpp"
using namespace std;
int main(){
BCSF22M039_SLL2 List1;
cout <<"\nEnter elements to initialize list (-1 to stop): \n";
int input;
while (input != -1){
cin>>input;
if(input != -1){//Don't insert -1
... | TOOL | 0.994135 | 3.879474 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-10-05T15:52: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": "792128730fc6... |
5fac1cc1-cfb2-4c69-9bd3-4f9ff8ec5d79 | pm306/procon | ABC/207/A.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<long long, long long>;
constexpr char ln = '\n';
constexpr long long MOD = 1000000007;
constexpr long long INF = 1<<30;
constexpr long long LINF = 1LL<<60;
constexpr double EPS = 1e-9;
#define all(v) v.begin(), v.end()
#define rep(i, ... | ALGO | 0.999827 | 4.07531 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2022-02-28T10:20:36.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "846aed903b... |
c95f7701-566f-4b05-b469-5ac837e7e460 | MikhailMaximenko/error_correcting_codes | src/linalg.cpp | #include "linalg.h"
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <set>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
namespace linalg {
lin_vector::lin_vector(size_t src, size_t dim) : std::vector<bool>(dim) {
for (size_t i = 0; i < dim; ++i) {
(*this)[i]... | ALGO | 0.989 | 4.681055 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2025-04-08T10:43: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": "b2949cb4fe1c... |
c2576af2-1b95-40dd-a00d-37b290bfd673 | Koyingtw/CP | CSES/Introductory/Number Spiral.cpp | // Problem: Number Spiral
// Contest: CSES - CSES Problem Set
// URL: https://cses.fi/problemset/task/1071
// Memory Limit: 512 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#pragma region
#pragma optimize("O3")
#include <bits/stdc++.h>
#define Weakoying ios::sync_with_stdio(0), cin.tie(... | ALGO | 0.999859 | 5.035486 | {
"github_metadata": {
"branch": "main",
"commit_count": 79,
"repo_created_at": "2021-07-10T12:46:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6836bca99c6... |
211244df-3de0-4e30-8756-8c310c747f35 | IshaanGaba97/LeetCode-Solutions | 987-vertical-order-traversal-of-a-binary-tree/987-vertical-order-traversal-of-a-binary-tree.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.999995 | 6.05243 | {
"github_metadata": {
"branch": "main",
"commit_count": 1061,
"repo_created_at": "2022-02-23T07:15:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7d3c12947... |
b27bebc1-791b-4948-b2aa-13cbae79d3fc | blockx7a/labcpp2 | program5lab2variant1.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float mark;
cin >> mark;
if (mark >= 0 && mark <= 9)
{
if (mark <= 4.4)
{
cout << "не получилось не фартануло == 2.0" << endl;
}
else if (mark <= 5.2)
{
cout << "сре... | ALGO | 0.989997 | 3.379707 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-12-05T11:00:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "30f4c82ac42e... |
82f6879b-cce0-49f7-b48e-51e92035b19c | danielabarrett/RayTracerCpp | src/Shape.cpp | #include <iostream>
#include <cassert>
#include <memory>
#include "Shape.h"
#include "MatrixStack.h"
#include "tiny_obj_loader.h"
#define EPSILON3 1e-3
#define EPSILON6 1e-6
#define CROSS(dest,v1,v2) \
dest[0]=v1[1]*v2[2]-v1[2]*v2[1]; \
dest[1]=v1[2]*v2[0]-v1[0]*v2[2]; \
dest[2]=v1[0]*v2[1]-v1[1]*v2[0];
#define DOT(v... | ALGO | 0.91024 | 6.443403 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-01-30T17:43:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a96f3b1cc292... |
257cfa1e-b5de-449b-aa56-a482ad6eaef7 | KimMean/Algorithm | 프로그래머스/3/42627. 디스크 컨트롤러/디스크 컨트롤러.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
int solution(vector<vector<int>> jobs) {
int answer = 0;
int time = 0; // 현재 시간
int index = 0; // jobs 벡터의 인덱스
int n = jobs.size();
// 요청 시간이 빠른 순서대로 정렬
sort(jobs.begin(), jobs.end());
... | ALGO | 0.999887 | 5.31897 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2023-10-19T15:17:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6035248bf6... |
ebb33e16-29b7-4461-8444-91efc39dfedb | farzeenshahid/DSA-Cpp | DataStructures/expressionparser.cpp | #include <iostream>
using namespace std;
int precedence(char op)
{
switch(op){
case '+':return 1;
case '-':return 1;
case '*':return 2;
case '%':return 2;
case '/':return 2;
case '(':return 4;
case ')':return 4;
case '^':return 3;
default:retu... | ALGO | 0.999763 | 4.251206 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-05-15T10:50:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 2,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59563181d12e... |
d1c33cbf-8d71-4895-aab2-ebd7a404ad18 | madsdev404/CSE-Course-Phitron | Semester 2/Data-Structure/Module 8 Assignment 02/diff_min_max.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
void insert_tail(Node *&head, Node *&tail, int val)
{
Node *newNode = new Node(val);
if (head == NULL)
{
head = newNo... | ALGO | 0.999764 | 4.080167 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-04-21T05:38: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": "1392376ca42... |
741fc210-0287-4f2f-be35-bed0783be395 | UmBender/comp | contest/55/d/main.cpp | // clang-format off
//#include <atcoder/all>
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define endl '\n'
void __dbg() { cerr << endl; }
template <typename T> void __dbg(T t) { cerr << t << endl; }
template <typename T, typename... TRest> void __dbg(T first, TRest... rest) {
cerr << first << ",... | ALGO | 0.999932 | 4.266507 | {
"github_metadata": {
"branch": "main",
"commit_count": 278,
"repo_created_at": "2024-01-07T13:26:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab0b5f1a5f... |
8d309291-4dbd-4386-93b9-2e16ad0fe672 | swraj28/DSA_Revision | C++/13. Sliding Window/014.Leetcode_992. Subarrays with K Different Integers.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define ms(arr, v) memset(arr, v, sizeof(arr))
#define bct(x) __builtin_popcountll(x)
#define all(v) (v).begin(),(v).end()
... | ALGO | 0.999924 | 5.495631 | {
"github_metadata": {
"branch": "master",
"commit_count": 81,
"repo_created_at": "2022-03-21T03:54: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": "576056a1d... |
fa13e772-14c5-47a3-8c3f-c6fed89c2e31 | wcysai/Calabash | XVIII Open Cup named after E.V. Pankratiev. Grand Prix of Khamovniki/C.cpp | #pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define Rep(i, n) for (int i = 1; i <=n; i++)
#define range(x) begin(x), end(x)
#ifdef __LOCAL_DEBUG__
#define _debug(fmt, ...) fprintf(stderr, "[%s] " fmt "\n", __func__, ##__VA_ARGS__)
#else
#define _d... | ALGO | 0.999986 | 3.940634 | {
"github_metadata": {
"branch": "master",
"commit_count": 601,
"repo_created_at": "2018-09-13T09:53:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 63,
"forks": 14,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aa7dc7... |
e0097525-3c67-4783-bd85-61cf51ddcb5a | fang50253/NJFU_CS_Training | 24-25-1操作系统实习/3.存储管理/03提交带注释.cpp | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
#include<iostream>
#define MAXSIZE 400
namespace fzy//创建命名空间fzy,用于写一些数据结构
{
template<typename T>
struct queuenode //创建队列结点
{
T v = T();//提供队列结点的默认构造方法
queuenode<T>* next = nullptr;//指向下一个位置,并提供默认构造方法
};
template <... | ALGO | 0.999486 | 4.068226 | {
"github_metadata": {
"branch": "main",
"commit_count": 69,
"repo_created_at": "2024-12-19T01:33:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c4b702a1eae... |
e19c233b-a6e7-4f5a-bda1-9887e6984bd6 | Patistar/ReactiveEulerSolver | driver/source/fub/hpx/single_stage.2d.cpp | // Copyright (c) 2018 <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, including without limitation the rights
// to use, copy, modify, merge, publish, distri... | ALGO | 0.998893 | 6.528853 | {
"github_metadata": {
"branch": "master",
"commit_count": 48,
"repo_created_at": "2018-10-26T08:29: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": "189ab767d... |
1690c979-2569-40ab-bbc9-a2a4937da0e8 | liaorongfan/GoCpp | general/03_template/func_template/template.cpp | //
// Created by rongfan on 2022/5/7.
//
#include <iostream>
// declare a template
//template <typename T>
//void func(T);
// define a template
template <typename T> // T template formal para --> compile time variable
void func(T input) { // input function formal para --> run time varable
std::cout << input <... | TOOL | 0.959932 | 4.557152 | {
"github_metadata": {
"branch": "main",
"commit_count": 43,
"repo_created_at": "2021-10-07T13:48:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b175ec1825a... |
b9319218-53fe-4ca4-b13f-c39ffc888f37 | mjx-project/mjx | include/mjx/internal/yaku_evaluator.h | #ifndef MAHJONG_YAKU_EVALUATOR_H
#define MAHJONG_YAKU_EVALUATOR_H
#include <optional>
#include <tuple>
#include <unordered_set>
#include <vector>
#include "mjx/internal/types.h"
#include "mjx/internal/win_cache.h"
#include "mjx/internal/win_info.h"
#include "mjx/internal/win_score.h"
namespace mjx::internal {
class ... | ALGO | 0.940444 | 6.99601 | {
"github_metadata": {
"branch": "master",
"commit_count": 749,
"repo_created_at": "2020-04-28T09:13:16.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 187,
"forks": 21,
"issues": 105,
"pull_requests": 4
},
"file_meta": {
"content_id": "f6dd... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.